[jboss-svn-commits] JBL Code SVN: r36289 - in labs/jbossrules/trunk: drools-guvnor/src/main/resources and 13 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Dec 9 00:21:10 EST 2010
Author: kurt.stam at jboss.com
Date: 2010-12-09 00:21:08 -0500 (Thu, 09 Dec 2010)
New Revision: 36289
Added:
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/configuration.xml
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/roles.properties
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/users.properties
labs/jbossrules/trunk/drools-repo/drools-repository/src/test/resources/drools_repository.properties
labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util/
labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java
labs/jbossrules/trunk/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfiguratorWithJAAS.java
Removed:
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/configuration.xml
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/roles.properties
labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/users.properties
labs/jbossrules/trunk/drools-repo/drools-repository/src/main/resources/drools_repository.properties
labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java
Modified:
labs/jbossrules/trunk/drools-guvnor/pom.xml
labs/jbossrules/trunk/drools-guvnor/src/main/resources/drools_repository.properties
labs/jbossrules/trunk/drools-repo/drools-repository/pom.xml
labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml
labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java
labs/jbossrules/trunk/drools-repo/jcr-jr-impl/pom.xml
labs/jbossrules/trunk/drools-repo/jcr-jr-impl/src/main/java/org/drools/repository/jackrabbit/JackrabbitRepositoryConfigurator.java
labs/jbossrules/trunk/drools-repo/jcr-ms-impl/
labs/jbossrules/trunk/drools-repo/jcr-ms-impl/pom.xml
labs/jbossrules/trunk/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java
labs/jbossrules/trunk/drools-repo/pom.xml
Log:
GUVNORSOA-47, merging ModeShape Integration up and including r35773
Modified: labs/jbossrules/trunk/drools-guvnor/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/pom.xml 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-guvnor/pom.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -149,6 +149,30 @@
<artifactId>drools-repository</artifactId>
</dependency>
<dependency>
+ <artifactId>drools-repository-jcr-ms-impl</artifactId>
+ <groupId>org.drools</groupId>
+ <version>5.1.0.BRMS</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.modeshape</groupId>
+ <artifactId>modeshape-jcr</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-idtrust</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi-bare</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx-bare</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
</dependency>
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/resources/drools_repository.properties
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/resources/drools_repository.properties 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/resources/drools_repository.properties 2010-12-09 05:21:08 UTC (rev 36289)
@@ -4,13 +4,13 @@
# JACKRABBIT
org.drools.repository.configurator = org.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator
#
-org.drools.repository.jcr.impl = org.apache.jackrabbit.core.RepositoryFactoryImpl
-#
# MODESHAPE
-# Currently, these properties will be used to load ModeShape from the specified configuration file.
-#
+# In deployed configuration, to use ModeShape Service use:
#org.drools.repository.configurator = org.drools.repository.modeshape.ModeShapeRepositoryConfigurator
-#
-#org.modeshape.jcr.URL = file:src/test/resources/modeshape/configuration.xml
\ No newline at end of file
+#org.modeshape.jcr.URL = jndi:jcr/local?repositoryName=brms
+
+# To use ModeShape when running the unittests use:
+#org.drools.repository.configurator = org.drools.repository.modeshape.ModeShapeRepositoryConfiguratorWithJAAS
+#org.modeshape.jcr.URL = file:src/test/resources/modeshape/configuration.xml
Copied: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape (from rev 35627, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape)
Deleted: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/configuration.xml
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape/configuration.xml 2010-10-21 03:55:06 UTC (rev 35627)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/configuration.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ModeShape (http://www.modeshape.org)
- ~
- ~ See the COPYRIGHT.txt file distributed with this work for information
- ~ regarding copyright ownership. Some portions may be licensed
- ~ to Red Hat, Inc. under one or more contributor license agreements.
- ~ See the AUTHORS.txt file in the distribution for a full listing of
- ~ individual contributors.
- ~
- ~ ModeShape is free software. Unless otherwise indicated, all code in ModeShape
- ~ is licensed to you under the terms of the GNU Lesser General Public License as
- ~ published by the Free Software Foundation; either version 2.1 of
- ~ the License, or (at your option) any later version.
- ~
- ~ ModeShape is distributed in the hope that it will be useful,
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- ~ for more details.
- ~
- ~ You should have received a copy of the GNU Lesser General Public License
- ~ along with this distribution; if not, write to:
- ~ Free Software Foundation, Inc.
- ~ 51 Franklin Street, Fifth Floor
- ~ Boston, MA 02110-1301 USA
- -->
-<configuration xmlns:mode="http://www.modeshape.org/1.0"
- xmlns:jcr="http://www.jcp.org/jcr/1.0"
- xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
- <!-- Define the sources from which content is made available. -->
- <mode:sources jcr:primaryType="nt:unstructured">
- <mode:source jcr:name="TransientSource" mode:classname="org.modeshape.graph.connector.inmemory.InMemoryRepositorySource"/>
- </mode:sources>
- <!-- JCR Repositories. This is required, with a separate repository for each JCR repository instance. -->
- <mode:repositories>
- <mode:repository jcr:name="Guvnor JCR Repository" mode:source="TransientSource">
- <mode:options>
- <mode:option jcr:name="queryIndexesUpdatedSynchronously" mode:value="true"/>
- </mode:options>
- </mode:repository>
- </mode:repositories>
-</configuration>
Copied: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/configuration.xml (from rev 35627, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape/configuration.xml)
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/configuration.xml (rev 0)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/configuration.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ ModeShape (http://www.modeshape.org)
+ ~
+ ~ See the COPYRIGHT.txt file distributed with this work for information
+ ~ regarding copyright ownership. Some portions may be licensed
+ ~ to Red Hat, Inc. under one or more contributor license agreements.
+ ~ See the AUTHORS.txt file in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ ModeShape is free software. Unless otherwise indicated, all code in ModeShape
+ ~ is licensed to you under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ ModeShape is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ -->
+<configuration xmlns:mode="http://www.modeshape.org/1.0"
+ xmlns:jcr="http://www.jcp.org/jcr/1.0"
+ xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
+ <!-- Define the sources from which content is made available. -->
+ <mode:sources jcr:primaryType="nt:unstructured">
+ <mode:source jcr:name="TransientSource" mode:classname="org.modeshape.graph.connector.inmemory.InMemoryRepositorySource"/>
+ </mode:sources>
+ <!-- JCR Repositories. This is required, with a separate repository for each JCR repository instance. -->
+ <mode:repositories>
+ <mode:repository jcr:name="Guvnor JCR Repository" mode:source="TransientSource">
+ <mode:options>
+ <mode:option jcr:name="queryIndexesUpdatedSynchronously" mode:value="true"/>
+ </mode:options>
+ </mode:repository>
+ </mode:repositories>
+</configuration>
Deleted: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml 2010-10-21 03:55:06 UTC (rev 35627)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -1,18 +0,0 @@
-<?xml version='1.0'?>
-
-<policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:security-config:5.0" xmlns="urn:jboss:security-config:5.0"
- xmlns:jbxb="urn:jboss:security-config:5.0">
- <application-policy name="modeshape-jcr">
- <authentication>
- <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
- <module-option name="usersProperties">modeshape/users.properties</module-option>
- <module-option name="rolesProperties">modeshape/roles.properties</module-option>
- <module-option name="name">1.1</module-option>
- <module-option name="succeed">true</module-option>
- <module-option name="throwEx">false</module-option>
- </login-module>
- </authentication>
- </application-policy>
-</policy>
-
\ No newline at end of file
Copied: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml (from rev 35627, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml)
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml (rev 0)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/jaas.conf.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -0,0 +1,18 @@
+<?xml version='1.0'?>
+
+<policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:security-config:5.0" xmlns="urn:jboss:security-config:5.0"
+ xmlns:jbxb="urn:jboss:security-config:5.0">
+ <application-policy name="modeshape-jcr">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
+ <module-option name="usersProperties">modeshape/users.properties</module-option>
+ <module-option name="rolesProperties">modeshape/roles.properties</module-option>
+ <module-option name="name">1.1</module-option>
+ <module-option name="succeed">true</module-option>
+ <module-option name="throwEx">false</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+</policy>
+
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/roles.properties
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape/roles.properties 2010-10-21 03:55:06 UTC (rev 35627)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/roles.properties 2010-12-09 05:21:08 UTC (rev 36289)
@@ -1,4 +0,0 @@
-alan_parsons=admin
-ADMINISTRATOR=admin
-fdd=readwrite
-thirdpartyuser=readwrite
Copied: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/roles.properties (from rev 35627, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape/roles.properties)
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/roles.properties (rev 0)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/roles.properties 2010-12-09 05:21:08 UTC (rev 36289)
@@ -0,0 +1,4 @@
+alan_parsons=admin
+ADMINISTRATOR=admin
+fdd=readwrite
+thirdpartyuser=readwrite
Deleted: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/users.properties
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape/users.properties 2010-10-21 03:55:06 UTC (rev 35627)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/users.properties 2010-12-09 05:21:08 UTC (rev 36289)
@@ -1,4 +0,0 @@
-alan_parsons=password
-ADMINISTRATOR=password
-fdd=password
-thirdpartyuser=password
Copied: labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/users.properties (from rev 35627, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-guvnor/src/test/resources/modeshape/users.properties)
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/users.properties (rev 0)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/resources/modeshape/users.properties 2010-12-09 05:21:08 UTC (rev 36289)
@@ -0,0 +1,4 @@
+alan_parsons=password
+ADMINISTRATOR=password
+fdd=password
+thirdpartyuser=password
Modified: labs/jbossrules/trunk/drools-repo/drools-repository/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-repo/drools-repository/pom.xml 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/drools-repository/pom.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -50,7 +50,7 @@
<dependency>
<artifactId>drools-repository-jcr-ms-impl</artifactId>
<groupId>org.drools</groupId>
- <version>5.1.0.BRMS</version>
+ <version>5.2.0-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
-->
Deleted: labs/jbossrules/trunk/drools-repo/drools-repository/src/main/resources/drools_repository.properties
===================================================================
--- labs/jbossrules/trunk/drools-repo/drools-repository/src/main/resources/drools_repository.properties 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/drools-repository/src/main/resources/drools_repository.properties 2010-12-09 05:21:08 UTC (rev 36289)
@@ -1,16 +0,0 @@
-# This file is used to load the properties passed to the JCR 2.0 RepositoryFactory.
-#
-#
-# JACKRABBIT
-org.drools.repository.configurator = org.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator
-#
-org.drools.repository.jcr.impl = org.apache.jackrabbit.core.RepositoryFactoryImpl
-#
-
-# MODESHAPE
-
-# Currently, these properties will be used to load ModeShape from the specified configuration file.
-#
-#org.drools.repository.configurator = org.drools.repository.modeshape.ModeShapeRepositoryConfigurator
-#
-#org.modeshape.jcr.URL = file:src/test/resources/modeshape/configuration.xml
\ No newline at end of file
Copied: labs/jbossrules/trunk/drools-repo/drools-repository/src/test/resources/drools_repository.properties (from rev 35682, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/drools_repository.properties)
===================================================================
--- labs/jbossrules/trunk/drools-repo/drools-repository/src/test/resources/drools_repository.properties (rev 0)
+++ labs/jbossrules/trunk/drools-repo/drools-repository/src/test/resources/drools_repository.properties 2010-12-09 05:21:08 UTC (rev 36289)
@@ -0,0 +1,14 @@
+# This file is used to load the properties passed to the JCR 2.0 RepositoryFactory.
+#
+#
+# JACKRABBIT
+org.drools.repository.configurator = org.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator
+#
+
+# MODESHAPE
+
+# Currently, these properties will be used to load ModeShape from the specified configuration file.
+#
+#org.drools.repository.configurator = org.drools.repository.modeshape.ModeShapeRepositoryConfiguratorWithJAAS
+#
+#org.modeshape.jcr.URL = file:src/test/resources/modeshape/configuration.xml
\ No newline at end of file
Modified: labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -15,13 +15,10 @@
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
</dependency>
- <!--
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.8</version>
- </dependency>
- -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
</dependencies>
</project>
Modified: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java 2010-12-09 05:21:08 UTC (rev 36289)
@@ -17,7 +17,6 @@
package org.drools.repository;
import java.util.Properties;
-import java.util.ServiceLoader;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
@@ -25,10 +24,13 @@
import javax.jcr.Session;
import javax.jcr.Workspace;
+import org.drools.repository.util.ClassUtil;
+
+
/**
* This abstract class is required so different JCR implementations can provide their own configuration mechanism.
*
- * * This contains code to initialise the repository using the {@link javax.jcr.RepositoryFactory} interface defined by the JCR 2.0
+ * This contains code to initialise the repository using the {@link javax.jcr.RepositoryFactory} interface defined by the JCR 2.0
* specification. This configurator loads the properties from the {@link PROPERTIES_FILE "/drools_repository.properties"}
* resource, and passes these to the {@link javax.jcr.RepositoryFactory#getRepository(java.util.Map)}.
*
@@ -39,6 +41,7 @@
protected RepositoryFactory factory;
public static final String JCR_IMPL_CLASS = "org.drools.repository.jcr.impl";
+ protected static String defaultJCRImplClass = null;
public static final String REPOSITORY_ROOT_DIRECTORY = "repository.root.directory";
/**
@@ -55,21 +58,31 @@
//Instantiate real repo.
if (jcrImplementationClass==null) {
+ jcrImplementationClass = defaultJCRImplClass;
+ }
+
// Use the JCR 2.0 RepositoryFactory to get a repository using the properties as input ...
- for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) {
- Repository repo = factory.getRepository(properties);
- if (repo != null) {
- this.factory = factory;
- return repo;
- }
- }
- }
- } catch (RepositoryException re) {
+// We're not yet supporting JSE 1.6, so until then this needs to stay commented out
+// for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) {
+// Repository repo = factory.getRepository(properties);
+// if (repo != null) {
+// this.factory = factory;
+// return repo;
+// }
+// }
+
+ Class jcrFactory = ClassUtil.forName(jcrImplementationClass, this.getClass());
+ RepositoryFactory factory = (RepositoryFactory) jcrFactory.newInstance();
+ Repository repo = factory.getRepository(properties);
+ this.factory = factory;
+ return repo;
+
+ } catch (Exception re) {
throw new RepositoryException(re);
}
// If here, then we couldn't find a repository factory ...
- String msg = "Unable to find an appropriate JCR 2.0 RepositoryFactory; check the 'drools_repository.properties' configuration file.";
- throw new RepositoryException(msg);
+// String msg = "Unable to find an appropriate JCR 2.0 RepositoryFactory; check the 'drools_repository.properties' configuration file.";
+// throw new RepositoryException(msg);
}
public abstract void registerNodeTypesFromCndFile(String cndFileName, Session session, Workspace workspace) throws RepositoryException;
Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util (from rev 35769, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/org/drools/repository/util)
Deleted: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java 2010-10-27 14:47:15 UTC (rev 35769)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java 2010-12-09 05:21:08 UTC (rev 36289)
@@ -1,363 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.drools.repository.util;
-
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Proxy;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility methods to aid in class/resource loading.
- *
- * @author kevin
- */
-public class ClassUtil
-{
- private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ClassUtil.class);
-
- /**
- * Load the specified class.
- * @param className The name of the class to load.
- * @param caller The class of the caller.
- * @return The specified class.
- * @throws ClassNotFoundException If the class cannot be found.
- */
- public static Class forName(final String className, final Class caller)
- throws ClassNotFoundException
- {
- final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
- if (threadClassLoader != null)
- {
- try
- {
- return Class.forName(className, true, threadClassLoader) ;
- }
- catch (final ClassNotFoundException cnfe)
- {
- if (cnfe.getException() != null)
- {
- throw cnfe ;
- }
- }
- }
-
-
- final ClassLoader classLoader = caller.getClassLoader() ;
- if (classLoader != null)
- {
- try
- {
- return Class.forName(className, true, classLoader) ;
- }
- catch (final ClassNotFoundException cnfe)
- {
- if (cnfe.getException() != null)
- {
- throw cnfe ;
- }
- }
- }
-
- return Class.forName(className, true, ClassLoader.getSystemClassLoader()) ;
- }
-
- /**
- * Resolve a proxy for the specified interfaces.
- * @param interfaces The interfaces associated with the proxy.
- * @param caller The class of the caller.
- * @return The specified proxy class.
- * @throws ClassNotFoundException If the class cannot be found.
- */
- public static Class resolveProxy(final String[] interfaces, final Class caller)
- throws ClassNotFoundException
- {
- final int numInterfaces = (interfaces == null ? 0 : interfaces.length) ;
- if (numInterfaces == 0)
- {
- throw new ClassNotFoundException("Cannot generate proxy with no interfaces") ;
- }
-
- final Class[] interfaceClasses = new Class[numInterfaces] ;
- for(int count = 0 ; count < numInterfaces ; count++)
- {
- interfaceClasses[count] = forName(interfaces[count], caller) ;
- }
-
- final ClassLoader proxyClassLoader ;
- final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
- if (threadClassLoader != null)
- {
- proxyClassLoader = threadClassLoader ;
- }
- else
- {
- final ClassLoader classLoader = caller.getClassLoader() ;
- if (classLoader != null)
- {
- proxyClassLoader = classLoader ;
- }
- else
- {
- proxyClassLoader = ClassLoader.getSystemClassLoader() ;
- }
- }
-
- return Proxy.getProxyClass(proxyClassLoader, interfaceClasses) ;
- }
-
- /**
- * Get the specified resource as a stream.
- * @param resourceName The name of the class to load.
- * @param caller The class of the caller.
- * @return The input stream for the resource or null if not found.
- */
- public static InputStream getResourceAsStream(final String resourceName, final Class caller)
- {
- final String resource ;
- if (resourceName.startsWith("/"))
- {
- resource = resourceName.substring(1) ;
- }
- else
- {
- final Package callerPackage = caller.getPackage() ;
- if (callerPackage != null)
- {
- resource = callerPackage.getName().replace('.', '/') + '/' + resourceName ;
- }
- else
- {
- resource = resourceName ;
- }
- }
- final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
- if (threadClassLoader != null)
- {
- final InputStream is = threadClassLoader.getResourceAsStream(resource) ;
- if (is != null)
- {
- return is ;
- }
- }
-
- final ClassLoader classLoader = caller.getClassLoader() ;
- if (classLoader != null)
- {
- final InputStream is = classLoader.getResourceAsStream(resource) ;
- if (is != null)
- {
- return is ;
- }
- }
-
- return ClassLoader.getSystemResourceAsStream(resource) ;
- }
-
- public static URL getResource(final String resourceName, final Class<?> caller)
- {
- final String resource ;
- if (resourceName.startsWith("/"))
- {
- resource = resourceName.substring(1) ;
- }
- else
- {
- final Package callerPackage = caller.getPackage() ;
- if (callerPackage != null)
- {
- resource = callerPackage.getName().replace('.', '/') + '/' + resourceName ;
- }
- else
- {
- resource = resourceName ;
- }
- }
- final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
- if (threadClassLoader != null)
- {
- final URL url = threadClassLoader.getResource(resource) ;
- if (url != null)
- {
- return url ;
- }
- }
-
- final ClassLoader classLoader = caller.getClassLoader() ;
- if (classLoader != null)
- {
- final URL url = classLoader.getResource(resource) ;
- if (url != null)
- {
- return url ;
- }
- }
-
- return ClassLoader.getSystemResource(resource) ;
- }
-
-
- public static List<URL> getResources(String resourcePath, Class<?> caller) throws IOException {
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-
- if(resourcePath.startsWith("/")) {
- resourcePath = resourcePath.substring(1);
- }
-
- if (classLoader != null) {
- return toList(classLoader.getResources(resourcePath));
- }
-
- classLoader = caller.getClassLoader();
- if (classLoader != null) {
- return toList(classLoader.getResources(resourcePath));
- }
-
- return new ArrayList<URL>();
- }
-
- private static <T> List<T> toList(Enumeration<T> objects) {
- List<T> theList = new ArrayList<T>();
- while(objects.hasMoreElements()) {
- theList.add(objects.nextElement());
- }
- return theList;
- }
-
- /**
- * Get a package name and convert it to a path value, so it can be used
- * in calls to methods like {@link #getResourceAsStream}.
- * <p/>
- * Adds a '/' prefix and converts all '." characters to '/'. Doesn't add a
- * trailing slash.
- *
- * @param packageObj The package.
- * @return The package path.
- */
- public static String getPath(Package packageObj) {
- return "/" + packageObj.getName().replace('.', '/');
- }
-
- public static List<String> getResourceList(String regex, Class caller) {
- ClasspathResourceFilter filter = new ClasspathResourceFilter(regex);
- ClassLoader classLoader;
-
- classLoader = Thread.currentThread().getContextClassLoader();
- if(classLoader instanceof URLClassLoader) {
- filter.filter((URLClassLoader) classLoader);
- }
- classLoader = caller.getClassLoader();
- if(classLoader instanceof URLClassLoader) {
- filter.filter((URLClassLoader) classLoader);
- }
-
- return filter.getResourceList();
- }
-
- private static class ClasspathResourceFilter {
-
- private List<String> resourceList = new ArrayList<String>();
- private Pattern pattern;
-
- private ClasspathResourceFilter(String regex) {
- pattern = Pattern.compile(regex);
- }
-
- private void filter(URLClassLoader classLoader) {
- URL[] cpUrls = classLoader.getURLs();
-
- for (int i = 0; i < cpUrls.length; i++) {
- try {
- File file = new File(cpUrls[i].toURI());
- if(file.isDirectory()) {
- searchClasspathDirTree(file, "");
- } else {
- searchArchive(file);
- }
- } catch (URISyntaxException e) {
- logger.warn("Error searching classpath resource URL '" + cpUrls[i] + "' for resource '" + pattern.pattern() + "': " + e.getMessage());
- } catch (IOException e) {
- logger.warn("Error searching classpath resource URL '" + cpUrls[i] + "' for resource '" + pattern.pattern() + "': " + e.getMessage());
- }
- }
- }
-
- private void searchClasspathDirTree(File rootDir, String subDir) {
- File currentDir = new File(rootDir, subDir);
- File[] contents = currentDir.listFiles();
-
- for(File file: contents) {
- if(file.isDirectory()) {
- String subSubDir = subDir + "/" + file.getName();
- searchClasspathDirTree(rootDir, subSubDir);
- } else {
- String resClasspathPath = file.toURI().toString().substring(rootDir.toURI().toString().length() - 1);
- if(isToBeAdded(resClasspathPath)) {
- resourceList.add(resClasspathPath);
- }
- }
- }
- }
-
- private void searchArchive(File archiveFile) throws IOException {
- ZipFile zip = new ZipFile(archiveFile);
- Enumeration<? extends ZipEntry> entries = zip.entries();
-
- while (entries.hasMoreElements()) {
- ZipEntry entry = entries.nextElement();
- String resClasspathPath = "/" + entry.getName();
- if(isToBeAdded(resClasspathPath)) {
- resourceList.add(resClasspathPath);
- }
- }
- }
-
- private boolean isToBeAdded(String resClasspathPath) {
- if(resourceList.contains(resClasspathPath)) {
- // Already in the list e.g. same resource in different archives...
- return false;
- }
-
- Matcher matcher = pattern.matcher(resClasspathPath);
- return matcher.matches();
- }
-
- private List<String> getResourceList() {
- return resourceList;
- }
- }
-}
-
Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java (from rev 35769, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java)
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java (rev 0)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/util/ClassUtil.java 2010-12-09 05:21:08 UTC (rev 36289)
@@ -0,0 +1,363 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.drools.repository.util;
+
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Proxy;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.slf4j.LoggerFactory;
+
+/**
+ * Utility methods to aid in class/resource loading.
+ *
+ * @author kevin
+ */
+public class ClassUtil
+{
+ private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ClassUtil.class);
+
+ /**
+ * Load the specified class.
+ * @param className The name of the class to load.
+ * @param caller The class of the caller.
+ * @return The specified class.
+ * @throws ClassNotFoundException If the class cannot be found.
+ */
+ public static Class forName(final String className, final Class caller)
+ throws ClassNotFoundException
+ {
+ final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+ if (threadClassLoader != null)
+ {
+ try
+ {
+ return Class.forName(className, true, threadClassLoader) ;
+ }
+ catch (final ClassNotFoundException cnfe)
+ {
+ if (cnfe.getException() != null)
+ {
+ throw cnfe ;
+ }
+ }
+ }
+
+
+ final ClassLoader classLoader = caller.getClassLoader() ;
+ if (classLoader != null)
+ {
+ try
+ {
+ return Class.forName(className, true, classLoader) ;
+ }
+ catch (final ClassNotFoundException cnfe)
+ {
+ if (cnfe.getException() != null)
+ {
+ throw cnfe ;
+ }
+ }
+ }
+
+ return Class.forName(className, true, ClassLoader.getSystemClassLoader()) ;
+ }
+
+ /**
+ * Resolve a proxy for the specified interfaces.
+ * @param interfaces The interfaces associated with the proxy.
+ * @param caller The class of the caller.
+ * @return The specified proxy class.
+ * @throws ClassNotFoundException If the class cannot be found.
+ */
+ public static Class resolveProxy(final String[] interfaces, final Class caller)
+ throws ClassNotFoundException
+ {
+ final int numInterfaces = (interfaces == null ? 0 : interfaces.length) ;
+ if (numInterfaces == 0)
+ {
+ throw new ClassNotFoundException("Cannot generate proxy with no interfaces") ;
+ }
+
+ final Class[] interfaceClasses = new Class[numInterfaces] ;
+ for(int count = 0 ; count < numInterfaces ; count++)
+ {
+ interfaceClasses[count] = forName(interfaces[count], caller) ;
+ }
+
+ final ClassLoader proxyClassLoader ;
+ final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+ if (threadClassLoader != null)
+ {
+ proxyClassLoader = threadClassLoader ;
+ }
+ else
+ {
+ final ClassLoader classLoader = caller.getClassLoader() ;
+ if (classLoader != null)
+ {
+ proxyClassLoader = classLoader ;
+ }
+ else
+ {
+ proxyClassLoader = ClassLoader.getSystemClassLoader() ;
+ }
+ }
+
+ return Proxy.getProxyClass(proxyClassLoader, interfaceClasses) ;
+ }
+
+ /**
+ * Get the specified resource as a stream.
+ * @param resourceName The name of the class to load.
+ * @param caller The class of the caller.
+ * @return The input stream for the resource or null if not found.
+ */
+ public static InputStream getResourceAsStream(final String resourceName, final Class caller)
+ {
+ final String resource ;
+ if (resourceName.startsWith("/"))
+ {
+ resource = resourceName.substring(1) ;
+ }
+ else
+ {
+ final Package callerPackage = caller.getPackage() ;
+ if (callerPackage != null)
+ {
+ resource = callerPackage.getName().replace('.', '/') + '/' + resourceName ;
+ }
+ else
+ {
+ resource = resourceName ;
+ }
+ }
+ final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+ if (threadClassLoader != null)
+ {
+ final InputStream is = threadClassLoader.getResourceAsStream(resource) ;
+ if (is != null)
+ {
+ return is ;
+ }
+ }
+
+ final ClassLoader classLoader = caller.getClassLoader() ;
+ if (classLoader != null)
+ {
+ final InputStream is = classLoader.getResourceAsStream(resource) ;
+ if (is != null)
+ {
+ return is ;
+ }
+ }
+
+ return ClassLoader.getSystemResourceAsStream(resource) ;
+ }
+
+ public static URL getResource(final String resourceName, final Class<?> caller)
+ {
+ final String resource ;
+ if (resourceName.startsWith("/"))
+ {
+ resource = resourceName.substring(1) ;
+ }
+ else
+ {
+ final Package callerPackage = caller.getPackage() ;
+ if (callerPackage != null)
+ {
+ resource = callerPackage.getName().replace('.', '/') + '/' + resourceName ;
+ }
+ else
+ {
+ resource = resourceName ;
+ }
+ }
+ final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+ if (threadClassLoader != null)
+ {
+ final URL url = threadClassLoader.getResource(resource) ;
+ if (url != null)
+ {
+ return url ;
+ }
+ }
+
+ final ClassLoader classLoader = caller.getClassLoader() ;
+ if (classLoader != null)
+ {
+ final URL url = classLoader.getResource(resource) ;
+ if (url != null)
+ {
+ return url ;
+ }
+ }
+
+ return ClassLoader.getSystemResource(resource) ;
+ }
+
+
+ public static List<URL> getResources(String resourcePath, Class<?> caller) throws IOException {
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+
+ if(resourcePath.startsWith("/")) {
+ resourcePath = resourcePath.substring(1);
+ }
+
+ if (classLoader != null) {
+ return toList(classLoader.getResources(resourcePath));
+ }
+
+ classLoader = caller.getClassLoader();
+ if (classLoader != null) {
+ return toList(classLoader.getResources(resourcePath));
+ }
+
+ return new ArrayList<URL>();
+ }
+
+ private static <T> List<T> toList(Enumeration<T> objects) {
+ List<T> theList = new ArrayList<T>();
+ while(objects.hasMoreElements()) {
+ theList.add(objects.nextElement());
+ }
+ return theList;
+ }
+
+ /**
+ * Get a package name and convert it to a path value, so it can be used
+ * in calls to methods like {@link #getResourceAsStream}.
+ * <p/>
+ * Adds a '/' prefix and converts all '." characters to '/'. Doesn't add a
+ * trailing slash.
+ *
+ * @param packageObj The package.
+ * @return The package path.
+ */
+ public static String getPath(Package packageObj) {
+ return "/" + packageObj.getName().replace('.', '/');
+ }
+
+ public static List<String> getResourceList(String regex, Class caller) {
+ ClasspathResourceFilter filter = new ClasspathResourceFilter(regex);
+ ClassLoader classLoader;
+
+ classLoader = Thread.currentThread().getContextClassLoader();
+ if(classLoader instanceof URLClassLoader) {
+ filter.filter((URLClassLoader) classLoader);
+ }
+ classLoader = caller.getClassLoader();
+ if(classLoader instanceof URLClassLoader) {
+ filter.filter((URLClassLoader) classLoader);
+ }
+
+ return filter.getResourceList();
+ }
+
+ private static class ClasspathResourceFilter {
+
+ private List<String> resourceList = new ArrayList<String>();
+ private Pattern pattern;
+
+ private ClasspathResourceFilter(String regex) {
+ pattern = Pattern.compile(regex);
+ }
+
+ private void filter(URLClassLoader classLoader) {
+ URL[] cpUrls = classLoader.getURLs();
+
+ for (int i = 0; i < cpUrls.length; i++) {
+ try {
+ File file = new File(cpUrls[i].toURI());
+ if(file.isDirectory()) {
+ searchClasspathDirTree(file, "");
+ } else {
+ searchArchive(file);
+ }
+ } catch (URISyntaxException e) {
+ logger.warn("Error searching classpath resource URL '" + cpUrls[i] + "' for resource '" + pattern.pattern() + "': " + e.getMessage());
+ } catch (IOException e) {
+ logger.warn("Error searching classpath resource URL '" + cpUrls[i] + "' for resource '" + pattern.pattern() + "': " + e.getMessage());
+ }
+ }
+ }
+
+ private void searchClasspathDirTree(File rootDir, String subDir) {
+ File currentDir = new File(rootDir, subDir);
+ File[] contents = currentDir.listFiles();
+
+ for(File file: contents) {
+ if(file.isDirectory()) {
+ String subSubDir = subDir + "/" + file.getName();
+ searchClasspathDirTree(rootDir, subSubDir);
+ } else {
+ String resClasspathPath = file.toURI().toString().substring(rootDir.toURI().toString().length() - 1);
+ if(isToBeAdded(resClasspathPath)) {
+ resourceList.add(resClasspathPath);
+ }
+ }
+ }
+ }
+
+ private void searchArchive(File archiveFile) throws IOException {
+ ZipFile zip = new ZipFile(archiveFile);
+ Enumeration<? extends ZipEntry> entries = zip.entries();
+
+ while (entries.hasMoreElements()) {
+ ZipEntry entry = entries.nextElement();
+ String resClasspathPath = "/" + entry.getName();
+ if(isToBeAdded(resClasspathPath)) {
+ resourceList.add(resClasspathPath);
+ }
+ }
+ }
+
+ private boolean isToBeAdded(String resClasspathPath) {
+ if(resourceList.contains(resClasspathPath)) {
+ // Already in the list e.g. same resource in different archives...
+ return false;
+ }
+
+ Matcher matcher = pattern.matcher(resClasspathPath);
+ return matcher.matches();
+ }
+
+ private List<String> getResourceList() {
+ return resourceList;
+ }
+ }
+}
+
Modified: labs/jbossrules/trunk/drools-repo/jcr-jr-impl/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-jr-impl/pom.xml 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/jcr-jr-impl/pom.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -9,7 +9,7 @@
</parent>
<artifactId>drools-repository-jcr-jr-impl</artifactId>
<packaging>jar</packaging>
- <name>Drools :: Repository :: JR</name>
+ <name>Drools :: Repository :: JRC JackRabbit</name>
<dependencies>
@@ -22,6 +22,5 @@
<groupId>org.drools</groupId>
<version>5.2.0-SNAPSHOT</version>
</dependency>
-
</dependencies>
</project>
Modified: labs/jbossrules/trunk/drools-repo/jcr-jr-impl/src/main/java/org/drools/repository/jackrabbit/JackrabbitRepositoryConfigurator.java
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-jr-impl/src/main/java/org/drools/repository/jackrabbit/JackrabbitRepositoryConfigurator.java 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/jcr-jr-impl/src/main/java/org/drools/repository/jackrabbit/JackrabbitRepositoryConfigurator.java 2010-12-09 05:21:08 UTC (rev 36289)
@@ -38,13 +38,16 @@
*/
public class JackrabbitRepositoryConfigurator extends JCRRepositoryConfigurator {
+
private static final Logger log = LoggerFactory.getLogger(JackrabbitRepositoryConfigurator.class);
private static TransientRepository transientRepository = null;
- /* (non-Javadoc)
- * @see org.drools.repository.RepositoryConfigurator#getJCRRepository()
- */
- @Override
+ public JackrabbitRepositoryConfigurator() {
+ super();
+ defaultJCRImplClass = "org.apache.jackrabbit.core.RepositoryFactoryImpl";
+ }
+
+ @Override
public Repository getJCRRepository(Properties properties) throws RepositoryException {
String repoRootDir = properties.getProperty(REPOSITORY_ROOT_DIRECTORY);
Property changes on: labs/jbossrules/trunk/drools-repo/jcr-ms-impl
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
.classpath
.project
Modified: labs/jbossrules/trunk/drools-repo/jcr-ms-impl/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-ms-impl/pom.xml 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/jcr-ms-impl/pom.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -7,9 +7,9 @@
<groupId>org.drools</groupId>
<version>5.2.0-SNAPSHOT</version>
</parent>
- <artifactId>drools-repository-jcr-ms</artifactId>
+ <artifactId>drools-repository-jcr-ms-impl</artifactId>
<packaging>jar</packaging>
- <name>Drools :: Repository :: ModeShape</name>
+ <name>Drools :: Repository :: JCR ModeShape</name>
<dependencies>
@@ -28,32 +28,17 @@
<artifactId>jboss-idtrust</artifactId>
<version>2.0.2.CR1</version>
</dependency>
- <dependency>
- <groupId>com.google.collections</groupId>
- <artifactId>google-collections</artifactId>
- <version>1.0</version>
- </dependency>
<dependency>
<groupId>org.jboss.security</groupId>
<artifactId>jboss-security-spi-bare</artifactId>
<version>2.0.2.SP6</version>
- <!-- <scope>test</scope> -->
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.security</groupId>
<artifactId>jbosssx-bare</artifactId>
<version>2.0.2.SP6</version>
- <!-- <scope>test</scope> -->
- <exclusions>
- <exclusion>
- <groupId>apache-xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-xalan</groupId>
- <artifactId>serializer</artifactId>
- </exclusion>
- </exclusions>
+ <scope>runtime</scope>
</dependency>
</dependencies>
Modified: labs/jbossrules/trunk/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java 2010-12-09 05:21:08 UTC (rev 36289)
@@ -5,27 +5,16 @@
import javax.jcr.Workspace;
import org.drools.repository.JCRRepositoryConfigurator;
-import org.jboss.security.config.IDTrustConfiguration;
import org.modeshape.jcr.CndNodeTypeReader;
/**
- * This specialized {@link JCRRepositoryConfigurator} simply initializes the IDTrust JAAS implementation optionally used by
- * ModeShape for authentication and authorization.
+ * This specialized {@link JCRRepositoryConfigurator}
*/
public class ModeShapeRepositoryConfigurator extends JCRRepositoryConfigurator {
- static {
- // Initialize IDTrust
- String configFile = "modeshape/jaas.conf.xml";
- IDTrustConfiguration idtrustConfig = new IDTrustConfiguration();
- try {
- idtrustConfig.config(configFile);
- } catch (Exception ex) {
- throw new IllegalStateException(ex);
- }
- }
-
+
public ModeShapeRepositoryConfigurator() {
+ defaultJCRImplClass = "org.modeshape.jcr.JcrRepositoryFactory";
}
public void registerNodeTypesFromCndFile(String cndFileName, Session session, Workspace workspace)
Copied: labs/jbossrules/trunk/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfiguratorWithJAAS.java (from rev 35680, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfiguratorWithJAAS.java)
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfiguratorWithJAAS.java (rev 0)
+++ labs/jbossrules/trunk/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfiguratorWithJAAS.java 2010-12-09 05:21:08 UTC (rev 36289)
@@ -0,0 +1,22 @@
+package org.drools.repository.modeshape;
+
+import org.drools.repository.JCRRepositoryConfigurator;
+import org.jboss.security.config.IDTrustConfiguration;
+
+/**
+ * This specialized {@link JCRRepositoryConfigurator} simply initializes the IDTrust JAAS implementation optionally used by
+ * ModeShape for authentication and authorization.
+ */
+public class ModeShapeRepositoryConfiguratorWithJAAS extends ModeShapeRepositoryConfigurator {
+
+ static {
+ // Initialize IDTrust
+ String configFile = "modeshape/jaas.conf.xml";
+ IDTrustConfiguration idtrustConfig = new IDTrustConfiguration();
+ try {
+ idtrustConfig.config(configFile);
+ } catch (Exception ex) {
+ throw new IllegalStateException(ex);
+ }
+ }
+}
Modified: labs/jbossrules/trunk/drools-repo/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-repo/pom.xml 2010-12-09 04:41:35 UTC (rev 36288)
+++ labs/jbossrules/trunk/drools-repo/pom.xml 2010-12-09 05:21:08 UTC (rev 36289)
@@ -14,8 +14,6 @@
<module>drools-repository</module>
<module>jcr-api</module>
<module>jcr-jr-impl</module>
- <!-- this can be uncommented once we have a modeshape 2.3 release
<module>jcr-ms-impl</module>
- -->
</modules>
</project>
More information about the jboss-svn-commits
mailing list