01: package org.drools.repository;
02:
03: import javax.jcr.Repository;
04: import javax.jcr.Session;
05:
06: /**
07: * This interface is required so different JCR implementations can provide their own configuration mechanism.
08: *
09: * @author Michael Neale
10: *
11: */
12: public interface JCRRepositoryConfigurator {
13:
14: /**
15: * @return a new Repository instance.
16: * There should only be one instance of this in an application.
17: * Generally, one repository (which may be bineded to JNDI) can spawn multiple sessions
18: * for each user as needed.
19: * Typically this would be created on application startup.
20: * @param repositoryRootDirectory The directory where the data is stored. If empty, the repository will be generated
21: * there the first time it is used. If it is null, then a default location will be used (it won't fail).
22: */
23: public abstract Repository getJCRRepository(
24: String repositoryRootDirectory);
25:
26: /**
27: * Attempts to setup the repository. If the work that it tries to do has already been done, it
28: * will return without modifying the repository.
29: * This will register any node types, and setup bootstrap nodes as needed.
30: * This will not erase any data.
31: *
32: * @throws RulesRepositoryException
33: */
34: public abstract void setupRulesRepository(Session session)
35: throws RulesRepositoryException;
36:
37: }
|