mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
use only on jaxbcontext to reduce memory consumption
This commit is contained in:
@@ -111,7 +111,7 @@ public class AbstractHgHandler
|
|||||||
LoggerFactory.getLogger(AbstractHgHandler.class);
|
LoggerFactory.getLogger(AbstractHgHandler.class);
|
||||||
|
|
||||||
//~--- constructors ---------------------------------------------------------
|
//~--- constructors ---------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs ...
|
* Constructs ...
|
||||||
*
|
*
|
||||||
@@ -322,29 +322,6 @@ public class AbstractHgHandler
|
|||||||
protected <T> T getResultFromScript(Class<T> resultType,
|
protected <T> T getResultFromScript(Class<T> resultType,
|
||||||
HgPythonScript script, Map<String, String> extraEnv)
|
HgPythonScript script, Map<String, String> extraEnv)
|
||||||
throws IOException, RepositoryException
|
throws IOException, RepositoryException
|
||||||
{
|
|
||||||
return getResultFromScript(resultType, script, jaxbContext, extraEnv);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method description
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param resultType
|
|
||||||
* @param script
|
|
||||||
* @param jaxbContext
|
|
||||||
* @param extraEnv
|
|
||||||
* @param <T>
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
* @throws RepositoryException
|
|
||||||
*/
|
|
||||||
protected <T> T getResultFromScript(Class<T> resultType,
|
|
||||||
HgPythonScript script, JAXBContext jaxbContext,
|
|
||||||
Map<String, String> extraEnv)
|
|
||||||
throws IOException, RepositoryException
|
|
||||||
{
|
{
|
||||||
Process p = createScriptProcess(script, extraEnv);
|
Process p = createScriptProcess(script, extraEnv);
|
||||||
T result = null;
|
T result = null;
|
||||||
|
|||||||
@@ -70,18 +70,15 @@ public class HgChangesetViewer extends AbstractHgHandler
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param handler
|
* @param handler
|
||||||
* @param changesetPagingResultContext
|
* @param jaxbContext
|
||||||
* @param changesetContext
|
|
||||||
* @param context
|
* @param context
|
||||||
* @param repositoryDirectory
|
* @param repositoryDirectory
|
||||||
*/
|
*/
|
||||||
public HgChangesetViewer(HgRepositoryHandler handler,
|
public HgChangesetViewer(HgRepositoryHandler handler,
|
||||||
JAXBContext changesetPagingResultContext,
|
JAXBContext jaxbContext, HgContext context,
|
||||||
JAXBContext changesetContext, HgContext context,
|
|
||||||
File repositoryDirectory)
|
File repositoryDirectory)
|
||||||
{
|
{
|
||||||
super(handler, changesetPagingResultContext, context, repositoryDirectory);
|
super(handler, jaxbContext, context, repositoryDirectory);
|
||||||
this.changesetContext = changesetContext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,18 +87,15 @@ public class HgChangesetViewer extends AbstractHgHandler
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param handler
|
* @param handler
|
||||||
* @param changesetContext
|
* @param jaxbContext
|
||||||
* @param context
|
* @param context
|
||||||
* @param changesetPagingResultContext
|
|
||||||
* @param repository
|
* @param repository
|
||||||
*/
|
*/
|
||||||
public HgChangesetViewer(HgRepositoryHandler handler,
|
public HgChangesetViewer(HgRepositoryHandler handler,
|
||||||
JAXBContext changesetPagingResultContext,
|
JAXBContext jaxbContext, HgContext context,
|
||||||
JAXBContext changesetContext, HgContext context,
|
|
||||||
Repository repository)
|
Repository repository)
|
||||||
{
|
{
|
||||||
super(handler, changesetPagingResultContext, context, repository);
|
super(handler, jaxbContext, context, repository);
|
||||||
this.changesetContext = changesetContext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
@@ -130,8 +124,7 @@ public class HgChangesetViewer extends AbstractHgHandler
|
|||||||
env.put(ENV_REVISION_START, Util.EMPTY_STRING);
|
env.put(ENV_REVISION_START, Util.EMPTY_STRING);
|
||||||
env.put(ENV_REVISION_END, Util.EMPTY_STRING);
|
env.put(ENV_REVISION_END, Util.EMPTY_STRING);
|
||||||
|
|
||||||
return getResultFromScript(Changeset.class, HgPythonScript.CHANGELOG,
|
return getResultFromScript(Changeset.class, HgPythonScript.CHANGELOG, env);
|
||||||
changesetContext, env);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -249,9 +242,4 @@ public class HgChangesetViewer extends AbstractHgHandler
|
|||||||
|
|
||||||
return getChangesets(null, null, null, null, startNode, endNode);
|
return getChangesets(null, null, null, null, startNode, endNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private JAXBContext changesetContext;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,11 +126,8 @@ public class HgRepositoryHandler
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.browserResultContext = JAXBContext.newInstance(BrowserResult.class);
|
this.jaxbContext = JAXBContext.newInstance(BrowserResult.class,
|
||||||
this.blameResultContext = JAXBContext.newInstance(BlameResult.class);
|
BlameResult.class, Changeset.class, ChangesetPagingResult.class);
|
||||||
this.changesetContext = JAXBContext.newInstance(Changeset.class);
|
|
||||||
this.changesetPagingResultContext =
|
|
||||||
JAXBContext.newInstance(ChangesetPagingResult.class);
|
|
||||||
}
|
}
|
||||||
catch (JAXBException ex)
|
catch (JAXBException ex)
|
||||||
{
|
{
|
||||||
@@ -225,7 +222,7 @@ public class HgRepositoryHandler
|
|||||||
|
|
||||||
if (TYPE_NAME.equals(type))
|
if (TYPE_NAME.equals(type))
|
||||||
{
|
{
|
||||||
blameViewer = new HgBlameViewer(this, blameResultContext,
|
blameViewer = new HgBlameViewer(this, jaxbContext,
|
||||||
hgContextProvider.get(), repository);
|
hgContextProvider.get(), repository);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -257,8 +254,7 @@ public class HgRepositoryHandler
|
|||||||
|
|
||||||
if (TYPE_NAME.equals(type))
|
if (TYPE_NAME.equals(type))
|
||||||
{
|
{
|
||||||
changesetViewer = new HgChangesetViewer(this,
|
changesetViewer = new HgChangesetViewer(this, jaxbContext,
|
||||||
changesetPagingResultContext, changesetContext,
|
|
||||||
hgContextProvider.get(), repository);
|
hgContextProvider.get(), repository);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -326,8 +322,8 @@ public class HgRepositoryHandler
|
|||||||
@Override
|
@Override
|
||||||
public RepositoryBrowser getRepositoryBrowser(Repository repository)
|
public RepositoryBrowser getRepositoryBrowser(Repository repository)
|
||||||
{
|
{
|
||||||
return new HgRepositoryBrowser(this, browserResultContext,
|
return new HgRepositoryBrowser(this, jaxbContext, hgContextProvider.get(),
|
||||||
hgContextProvider.get(), repository);
|
repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -474,8 +470,7 @@ public class HgRepositoryHandler
|
|||||||
throw new IllegalStateException("directory not found");
|
throw new IllegalStateException("directory not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HgChangesetViewer(this, changesetPagingResultContext,
|
return new HgChangesetViewer(this, jaxbContext, context,
|
||||||
changesetContext, context,
|
|
||||||
repositoryDirectory);
|
repositoryDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,18 +761,9 @@ public class HgRepositoryHandler
|
|||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private JAXBContext blameResultContext;
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private JAXBContext browserResultContext;
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private JAXBContext changesetContext;
|
|
||||||
|
|
||||||
/** Field description */
|
|
||||||
private JAXBContext changesetPagingResultContext;
|
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private Provider<HgContext> hgContextProvider;
|
private Provider<HgContext> hgContextProvider;
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
private JAXBContext jaxbContext;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user