public class RepositoryService extends DefaultComponent
Modifier and Type | Field and Description |
---|---|
static ComponentName |
NAME |
static String |
XP_REPOSITORY |
lastModified
Constructor and Description |
---|
RepositoryService() |
Modifier and Type | Method and Description |
---|---|
protected Repository |
doGetRepository(String repositoryName)
Calls to that method should be synchronized on repositories
|
protected void |
doInitRepositories()
Initializes all repositories.
|
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class associated with this object.
|
int |
getApplicationStartedOrder()
The component notification order for
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext) . |
protected RepositoryFactory |
getFactory(String repositoryName) |
Repository |
getRepository(String repositoryName)
Gets a repository given its name.
|
List<String> |
getRepositoryNames() |
Session |
getSession(String repositoryName)
Creates a new session with the given session id from the given repository.
|
protected void |
initializeRepository(RepositoryInitializationHandler handler,
String name) |
void |
initRepositories()
Start a tx and initialize repositories content.
|
protected void |
openRepository(String name) |
void |
shutdown() |
void |
start(ComponentContext context)
Start the component.
|
void |
stop(ComponentContext context)
Stop the component.
|
activate, deactivate, getLastModified, registerContribution, registerExtension, setLastModified, setModifiedNow, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted
public static final ComponentName NAME
public static final String XP_REPOSITORY
public RepositoryService()
public void shutdown()
public int getApplicationStartedOrder()
Component
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext)
.
Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
public void start(ComponentContext context)
Component
start
in interface Component
start
in class DefaultComponent
public void stop(ComponentContext context)
Component
stop
in interface Component
stop
in class DefaultComponent
public void initRepositories()
protected void doInitRepositories()
public <T> T getAdapter(Class<T> adapter)
Adaptable
null
if no such object can be found.getAdapter
in interface Adaptable
getAdapter
in class DefaultComponent
adapter
- the adapter class to look upnull
if this object does not have an adapter for
the given classprotected void openRepository(String name)
protected void initializeRepository(RepositoryInitializationHandler handler, String name)
public Repository getRepository(String repositoryName)
Null is returned if no repository with that name was registered.
repositoryName
- the repository nameprotected Repository doGetRepository(String repositoryName)
getRepository(String)
,
#getSession(String, String)
protected RepositoryFactory getFactory(String repositoryName)
public List<String> getRepositoryNames()
public Session getSession(String repositoryName)
Copyright © 2017 Nuxeo. All rights reserved.