mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 22:15:45 +01:00
do not read stored objects on every get method call
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user