do not read stored objects on every get method call

This commit is contained in:
Sebastian Sdorra
2012-05-19 11:02:50 +02:00
parent caa0206202
commit a8d5e677de
3 changed files with 75 additions and 23 deletions

View File

@@ -84,6 +84,19 @@ public class JAXBStore<T> extends AbstractListenableStore<T>
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
public Class<T> getType()
{
return type;
}
//~--- methods --------------------------------------------------------------
/**
* Method description
*
@@ -91,7 +104,7 @@ public class JAXBStore<T> extends AbstractListenableStore<T>
* @return
*/
@Override
public T get()
protected T readObject()
{
if (logger.isDebugEnabled())
{
@@ -115,19 +128,6 @@ public class JAXBStore<T> extends AbstractListenableStore<T>
return result;
}
/**
* Method description
*
*
* @return
*/
public Class<T> getType()
{
return type;
}
//~--- set methods ----------------------------------------------------------
/**
* Method description
*
@@ -135,7 +135,7 @@ public class JAXBStore<T> extends AbstractListenableStore<T>
* @param object
*/
@Override
public void set(T object)
protected void writeObject(T object)
{
if (logger.isDebugEnabled())
{
@@ -149,7 +149,6 @@ public class JAXBStore<T> extends AbstractListenableStore<T>
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(object, configFile);
fireEvent(object);
}
catch (JAXBException ex)