You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by sa...@apache.org on 2012/08/07 11:18:51 UTC
svn commit: r1370152 - in /ofbiz/branches/jackrabbit20120501/framework:
component-load.xml jcr/ofbiz-component.xml
jcr/src/org/ofbiz/jcr/loader/JCRContainer.java
jcr/src/org/ofbiz/jcr/loader/OFBizLoginModule.java
Author: sascharodekamp
Date: Tue Aug 7 09:18:50 2012
New Revision: 1370152
URL: http://svn.apache.org/viewvc?rev=1370152&view=rev
Log:
Update jcr container startup process
Modified:
ofbiz/branches/jackrabbit20120501/framework/component-load.xml
ofbiz/branches/jackrabbit20120501/framework/jcr/ofbiz-component.xml
ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/JCRContainer.java
ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/OFBizLoginModule.java
Modified: ofbiz/branches/jackrabbit20120501/framework/component-load.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/component-load.xml?rev=1370152&r1=1370151&r2=1370152&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20120501/framework/component-load.xml (original)
+++ ofbiz/branches/jackrabbit20120501/framework/component-load.xml Tue Aug 7 09:18:50 2012
@@ -29,6 +29,7 @@ under the License.
<load-component component-location="minilang"/>
<load-component component-location="common"/>
<load-component component-location="service"/>
+ <load-component component-location="jcr"/>
<!-- <load-component component-location="jetty"/> -->
<load-component component-location="catalina"/>
<load-component component-location="entityext"/>
@@ -39,5 +40,4 @@ under the License.
<load-component component-location="testtools"/>
<load-component component-location="webtools"/>
<load-component component-location="images"/>
- <load-component component-location="jcr"/>
</component-loader>
Modified: ofbiz/branches/jackrabbit20120501/framework/jcr/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/jcr/ofbiz-component.xml?rev=1370152&r1=1370151&r2=1370152&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20120501/framework/jcr/ofbiz-component.xml (original)
+++ ofbiz/branches/jackrabbit20120501/framework/jcr/ofbiz-component.xml Tue Aug 7 09:18:50 2012
@@ -18,17 +18,30 @@ specific language governing permissions
under the License.
-->
-<ofbiz-component name="jcr"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
- <resource-loader name="main" type="component"/>
- <classpath type="dir" location="config"/>
- <classpath type="jar" location="build/lib/*"/>
- <classpath type="jar" location="lib/*"/>
+<ofbiz-component name="jcr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+ <resource-loader name="main" type="component" />
+ <classpath type="dir" location="config" />
+ <classpath type="jar" location="build/lib/*" />
+ <classpath type="jar" location="lib/*" />
+
+ <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml" />
+
+ <service-resource type="model" loader="main" location="servicedef/services.xml" />
+ <test-suite loader="main" location="testdef/jcrtests.xml" />
+
+ <!-- Load embedded Jackrabbit content repository. Since this container depends upon JNDI, it must be started after the naming-container
+ container. -->
+ <container name="jcr-container" class="org.ofbiz.jcr.loader.JCRContainer" loaders="test">
+ <property name="configFilePath" value="framework/jcr/config/jcr-test-config.xml"/>
+ <property name="removeRepositoryOnShutdown" value="true"/>
+ </container>
+
+ <container name="jcr-container" class="org.ofbiz.jcr.loader.JCRContainer" loaders="main" >
+ <property name="configFilePath" value="framework/jcr/config/jcr-config.xml" />
+ <property name="removeOnShutdown" value="false" />
+ </container>
- <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
- <service-resource type="model" loader="main" location="servicedef/services.xml"/>
- <test-suite loader="main" location="testdef/jcrtests.xml" />
</ofbiz-component>
Modified: ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/JCRContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/JCRContainer.java?rev=1370152&r1=1370151&r2=1370152&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/JCRContainer.java (original)
+++ ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/JCRContainer.java Tue Aug 7 09:18:50 2012
@@ -59,11 +59,7 @@ public class JCRContainer implements Con
initializeJcrFactory(configRootElement, factoryImplDefinition);
}
- /*
- * (non-Javadoc)
- *
- * @see org.ofbiz.base.container.Container#start()
- */
+ @Override
public boolean start() throws ContainerException {
JCRFactory jcrFactory = getJCRFactory();
@@ -76,11 +72,7 @@ public class JCRContainer implements Con
return true;
}
- /*
- * (non-Javadoc)
- *
- * @see org.ofbiz.base.container.Container#stop()
- */
+ @Override
public void stop() throws ContainerException {
JCRFactory jcrFactory = getJCRFactory();
@@ -111,7 +103,7 @@ public class JCRContainer implements Con
private Element getConfigFileRootElement() throws ContainerException {
Element configRootElement = null;
try {
- configRootElement = ResourceLoader.getXmlRootElement(configFilePath);
+ configRootElement = ResourceLoader.getXmlRootElement(configFilePath);
} catch (GenericConfigException e) {
throw new ContainerException("Could not load the jcr configuration in file " + configFilePath, e);
}
Modified: ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/OFBizLoginModule.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/OFBizLoginModule.java?rev=1370152&r1=1370151&r2=1370152&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/OFBizLoginModule.java (original)
+++ ofbiz/branches/jackrabbit20120501/framework/jcr/src/org/ofbiz/jcr/loader/OFBizLoginModule.java Tue Aug 7 09:18:50 2012
@@ -38,7 +38,7 @@ import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.DelegatorFactory;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
-import org.ofbiz.service.GenericDispatcher;
+import org.ofbiz.service.GenericDispatcherFactory;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ServiceUtil;
@@ -76,7 +76,8 @@ public class OFBizLoginModule implements
delegator = DelegatorFactory.getDelegator("default");
// get the dispatcher
- dispatcher = GenericDispatcher.getLocalDispatcher("auth-dispatcher", delegator);
+ GenericDispatcherFactory factory = new GenericDispatcherFactory();
+ dispatcher = factory.createLocalDispatcher("auth-dispatcher", delegator);
this.subject = subject;
this.callbackHandler = callbackHandler;