[jboss-svn-commits] JBL Code SVN: r34962 - labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-api/src/main/java/org/drools/repository.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Sep 1 16:04:59 EDT 2010


Author: kurt.stam at jboss.com
Date: 2010-09-01 16:04:59 -0400 (Wed, 01 Sep 2010)
New Revision: 34962

Modified:
   labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java
Log:
adding WorkSpace as argument

Modified: labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java	2010-09-01 15:58:02 UTC (rev 34961)
+++ labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-api/src/main/java/org/drools/repository/JCRRepositoryConfigurator.java	2010-09-01 20:04:59 UTC (rev 34962)
@@ -23,6 +23,7 @@
 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.
@@ -39,42 +40,42 @@
 
 	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);
-    }
+	 * @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 {
 
-    public abstract void registerNodeTypesFromCndFile(String cndFileName, Session session) throws RepositoryException;
+			String jcrImplementationClass = properties.getProperty(JCR_IMPL_CLASS);
+			//Instantiate real repo.
 
-    /**
-     * Method called when the JCR implementation is no longer needed.
-     */
-    public abstract void shutdown();
+			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();
 }



More information about the jboss-svn-commits mailing list