[jboss-svn-commits] JBL Code SVN: r36264 - in labs/jbossrules/trunk/drools-repo: jcr-api and 7 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Dec 8 12:26:55 EST 2010


Author: kurt.stam at jboss.com
Date: 2010-12-08 12:26:54 -0500 (Wed, 08 Dec 2010)
New Revision: 36264

Added:
   labs/jbossrules/trunk/drools-repo/jcr-api/
   labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml
   labs/jbossrules/trunk/drools-repo/jcr-api/src/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java
Removed:
   labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml
   labs/jbossrules/trunk/drools-repo/jcr-api/src/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/
   labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java
Modified:
   labs/jbossrules/trunk/drools-repo/pom.xml
Log:
GUVNORSOA-47, merging ModeShape Integration r35614, add jcr-api module

Copied: labs/jbossrules/trunk/drools-repo/jcr-api (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api)

Deleted: labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/pom.xml	2010-10-20 22:37:38 UTC (rev 35614)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml	2010-12-08 17:26:54 UTC (rev 36264)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-   <modelVersion>4.0.0</modelVersion>
-   <parent>
-      <artifactId>drools</artifactId>
-      <groupId>org.drools</groupId>
-      <version>5.1.0.BRMS</version>
-   </parent>
-   <artifactId>drools-repository-jcr-api</artifactId>
-   <packaging>jar</packaging>
-   <name>Drools :: Repository :: JCR API</name>
-   <dependencies>
-      <dependency>
-         <groupId>javax.jcr</groupId>
-         <artifactId>jcr</artifactId>
-      </dependency>
-      <!--  
-      <dependency>
-        <groupId>log4j</groupId>
-        <artifactId>log4j</artifactId>
-        <version>1.2.8</version>
-      </dependency>
-     -->
-   </dependencies>
- 
-</project>

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/pom.xml)
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/pom.xml	2010-12-08 17:26:54 UTC (rev 36264)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+   <modelVersion>4.0.0</modelVersion>
+   <parent>
+      <artifactId>drools</artifactId>
+      <groupId>org.drools</groupId>
+      <version>5.1.0.BRMS</version>
+   </parent>
+   <artifactId>drools-repository-jcr-api</artifactId>
+   <packaging>jar</packaging>
+   <name>Drools :: Repository :: JCR API</name>
+   <dependencies>
+      <dependency>
+         <groupId>javax.jcr</groupId>
+         <artifactId>jcr</artifactId>
+      </dependency>
+      <!--  
+      <dependency>
+        <groupId>log4j</groupId>
+        <artifactId>log4j</artifactId>
+        <version>1.2.8</version>
+      </dependency>
+     -->
+   </dependencies>
+ 
+</project>

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src)

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main)

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java)

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/META-INF)

Deleted: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF	2010-10-20 22:37:38 UTC (rev 35614)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF	2010-12-08 17:26:54 UTC (rev 36264)
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path: 
-

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF)
===================================================================
--- labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF	                        (rev 0)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/META-INF/MANIFEST.MF	2010-12-08 17:26:54 UTC (rev 36264)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/org)

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/org/drools)

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/org/drools/repository)

Deleted: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java	2010-10-20 22:37:38 UTC (rev 35614)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java	2010-12-08 17:26:54 UTC (rev 36264)
@@ -1,81 +0,0 @@
-/**
- * Copyright 2010 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.drools.repository;
-
-import java.util.Properties;
-import java.util.ServiceLoader;
-
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.RepositoryFactory;
-import javax.jcr.Session;
-import javax.jcr.Workspace;
-
-/**
- * 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
- * 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)}.
- * 
- * @author Michael Neale
- */
-public abstract class JCRRepositoryConfigurator {
-
-	protected RepositoryFactory factory;
-
-	public static final String JCR_IMPL_CLASS            = "org.drools.repository.jcr.impl";
-	public static final String REPOSITORY_ROOT_DIRECTORY = "repository.root.directory";
-
-	/**
-	 * @return a new Repository instance. There should only be one instance of this in an application. Generally, one repository
-	 *         (which may be binded to JNDI) can spawn multiple sessions for each user as needed. Typically this would be created
-	 *         on application startup.
-	 * @param repositoryRootDirectory The directory where the data is stored. If empty, the repository will be generated there the
-	 *        first time it is used. If it is null, then a default location will be used (it won't fail).
-	 */
-	public Repository getJCRRepository( Properties properties ) throws RepositoryException {
-		try {
-
-			String jcrImplementationClass = properties.getProperty(JCR_IMPL_CLASS);
-			//Instantiate real repo.
-
-			if (jcrImplementationClass==null) {
-				// 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) {
-			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);
-	}
-
-	public abstract void registerNodeTypesFromCndFile(String cndFileName, Session session, Workspace workspace) throws RepositoryException;
-
-	/**
-	 * Method called when the JCR implementation is no longer needed.
-	 */
-	public abstract void shutdown();
-}

Copied: labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java (from rev 35614, labs/jbossrules/soa_branches/BRMS-5.1.1/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	                        (rev 0)
+++ labs/jbossrules/trunk/drools-repo/jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java	2010-12-08 17:26:54 UTC (rev 36264)
@@ -0,0 +1,81 @@
+/**
+ * Copyright 2010 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.drools.repository;
+
+import java.util.Properties;
+import java.util.ServiceLoader;
+
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.RepositoryFactory;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+
+/**
+ * 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
+ * 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)}.
+ * 
+ * @author Michael Neale
+ */
+public abstract class JCRRepositoryConfigurator {
+
+	protected RepositoryFactory factory;
+
+	public static final String JCR_IMPL_CLASS            = "org.drools.repository.jcr.impl";
+	public static final String REPOSITORY_ROOT_DIRECTORY = "repository.root.directory";
+
+	/**
+	 * @return a new Repository instance. There should only be one instance of this in an application. Generally, one repository
+	 *         (which may be binded to JNDI) can spawn multiple sessions for each user as needed. Typically this would be created
+	 *         on application startup.
+	 * @param repositoryRootDirectory The directory where the data is stored. If empty, the repository will be generated there the
+	 *        first time it is used. If it is null, then a default location will be used (it won't fail).
+	 */
+	public Repository getJCRRepository( Properties properties ) throws RepositoryException {
+		try {
+
+			String jcrImplementationClass = properties.getProperty(JCR_IMPL_CLASS);
+			//Instantiate real repo.
+
+			if (jcrImplementationClass==null) {
+				// 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) {
+			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);
+	}
+
+	public abstract void registerNodeTypesFromCndFile(String cndFileName, Session session, Workspace workspace) throws RepositoryException;
+
+	/**
+	 * Method called when the JCR implementation is no longer needed.
+	 */
+	public abstract void shutdown();
+}

Modified: labs/jbossrules/trunk/drools-repo/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-repo/pom.xml	2010-12-08 17:21:28 UTC (rev 36263)
+++ labs/jbossrules/trunk/drools-repo/pom.xml	2010-12-08 17:26:54 UTC (rev 36264)
@@ -5,12 +5,13 @@
    <parent>
       <artifactId>drools</artifactId>
       <groupId>org.drools</groupId>
-      <version>5.1.0.BRMS</version>
+      <version>5.2.0-SNAPSHOT</version>
    </parent>
    <artifactId>drools-repository-parent</artifactId>
    <packaging>pom</packaging>
    <name>Drools :: Repository :: Parent</name>
    <modules>
+     <module>jcr-api</module>
      <module>drools-repository</module>
    </modules>
 </project>



More information about the jboss-svn-commits mailing list