X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.server.jackrabbit%2Fsrc%2Forg%2Fargeo%2Fjackrabbit%2FJackrabbitContainer.java;fp=org.argeo.server.jackrabbit%2Fsrc%2Forg%2Fargeo%2Fjackrabbit%2FJackrabbitContainer.java;h=82d58fb31fdc025cd8d78428cd3c36f21f106319;hb=a43673012d2827b0780c03f8a4fe862a6f7dfbf8;hp=9060b585a59bee58a8615b910a11cdfd9934e5cf;hpb=63446804f4954bfedd50d8c692bde0fab13aa1ec;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.server.jackrabbit/src/org/argeo/jackrabbit/JackrabbitContainer.java b/org.argeo.server.jackrabbit/src/org/argeo/jackrabbit/JackrabbitContainer.java index 9060b585a..82d58fb31 100644 --- a/org.argeo.server.jackrabbit/src/org/argeo/jackrabbit/JackrabbitContainer.java +++ b/org.argeo.server.jackrabbit/src/org/argeo/jackrabbit/JackrabbitContainer.java @@ -56,7 +56,9 @@ public class JackrabbitContainer extends JackrabbitWrapper implements // local private Resource configuration; + private Resource variables; + private RepositoryConfig repositoryConfig; private File homeDirectory; private Boolean inMemory = false; @@ -64,6 +66,10 @@ public class JackrabbitContainer extends JackrabbitWrapper implements /** Migrations to execute (if not already done) */ private Set dataModelMigrations = new HashSet(); + /** Straight (non spring) values */ + private Properties configurationProperties; + private InputSource configurationXml; + /** * Empty constructor, {@link #init()} should be called after properties have * been set @@ -107,11 +113,16 @@ public class JackrabbitContainer extends JackrabbitWrapper implements // process configuration file Properties vars = getConfigurationProperties(); - configurationIn = readConfiguration(); vars.put(RepositoryConfigurationParser.REPOSITORY_HOME_VARIABLE, getHomeDirectory().getCanonicalPath()); - repositoryConfig = RepositoryConfig.create(new InputSource( - configurationIn), vars); + InputSource is; + if (configurationXml != null) + is = configurationXml; + else { + configurationIn = readConfiguration(); + is = new InputSource(configurationIn); + } + repositoryConfig = RepositoryConfig.create(is, vars); // // Actual repository creation @@ -288,6 +299,9 @@ public class JackrabbitContainer extends JackrabbitWrapper implements /** Generates the properties to use in the configuration. */ protected Properties getConfigurationProperties() { + if (configurationProperties != null) + return configurationProperties; + InputStream propsIn = null; Properties vars; try { @@ -349,4 +363,12 @@ public class JackrabbitContainer extends JackrabbitWrapper implements this.configuration = configuration; } + public void setConfigurationProperties(Properties configurationProperties) { + this.configurationProperties = configurationProperties; + } + + public void setConfigurationXml(InputSource configurationXml) { + this.configurationXml = configurationXml; + } + }