|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.repository.RepositoryInitializationHandler
public abstract class RepositoryInitializationHandler
A repository initialization handler is responsible for initializing a repository content.
The handler is called each time a repository is opened in a JVM session. This can be used to create a default structure for the repository.
To register a repository initializer MyInitHandler
you should
do:
RepositoryInitializationHandler.setInstance(new MyInitHandler());
If you want to create an initialization chain you can implement to delegate to the parent handle the default initialization and then to do your specific initialization stuff
RepositoryInitializationHandler parentHandler = RepositoryInitializationHandler.getInstance();
MyInitHandler myHandler = new MyInitHandler(parentHandler);
RepositoryInitializationHandler.setInstance(myHandler);
...
class MyHandler extends RepositoryInitializationHandler {
...
public initializeRepository(CoreSession session) {
if (parentHandler != null) parentHandler.initializeRepository(session);
// do my own initialization here
...
}
...
}
Important Note: Use the given session to initialize the repository. Do not create other repository sessions when initializing the repository to avoid dead locks.
Constructor Summary | |
---|---|
RepositoryInitializationHandler()
|
Method Summary | |
---|---|
abstract void |
doInitializeRepository(CoreSession session)
|
static RepositoryInitializationHandler |
getInstance()
|
RepositoryInitializationHandler |
getNext()
|
RepositoryInitializationHandler |
getPrevious()
|
void |
initializeRepository(CoreSession session)
Must be implemented by custom initializers. |
void |
install()
|
void |
uninstall()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RepositoryInitializationHandler()
Method Detail |
---|
public static RepositoryInitializationHandler getInstance()
public abstract void doInitializeRepository(CoreSession session) throws ClientException
ClientException
public void initializeRepository(CoreSession session) throws ClientException
session
- the current session
ClientException
public void install()
public void uninstall()
public RepositoryInitializationHandler getPrevious()
public RepositoryInitializationHandler getNext()
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |