|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.api.CoreInstance
public class CoreInstance
The CoreInstance is the main access point to a repository server.
A server instance is a singleton object that exists on each client JVM but also on the server JVM. The instance on the server JVM is used to access the server locally while those on client JVMs are used to access the server remotely.
A server instance uses a CoreSessionFactory to create CoreSession instances.
CoreSessionFactory objects are implementation-dependent and may be
registered using extension points. See CoreSessionFactory
for more
details.
Thus you can use a different implementation for the local ServerConnector than the one for the remote ServerConnector.
When clients need to perform a connection to a repository, they simply open
a new session using the open(String, Map)
method.
When the client has done its work it must close its session by
calling close(CoreSession)
.
This ensures correctly freeing all the resources held by the client session.
So a client session looks something like this:
<code> CoreInstance server = CoreInstance.getInstance(); CoreSession client = server.open("demo", null); DocumentModel root = client.getRootDocument(); // ... do something in that session ... // close the client -> this is closing the core session server.close(client); </code>
Method Summary | |
---|---|
void |
cacheDocumentType(DocumentType docType)
|
void |
close(CoreSession client)
|
DocumentType |
getCachedDocumentType(String type)
|
CoreSessionFactory |
getFactory()
|
static CoreInstance |
getInstance()
Gets the CoreInstance singleton. |
int |
getNumberOfSessions()
Returns the number of registered sessions. |
CoreSession |
getSession(String sid)
Gets the client bound to the given session. |
CoreSession[] |
getSessions()
|
void |
initialize(CoreSessionFactory factory)
|
boolean |
isSessionStarted(String sid)
|
CoreSession |
open(String repositoryName,
Map<String,Serializable> context)
|
void |
registerSession(String sid,
CoreSession session)
|
CoreSession |
unregisterSession(String sid)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static CoreInstance getInstance()
public DocumentType getCachedDocumentType(String type)
public void cacheDocumentType(DocumentType docType)
public CoreSession open(String repositoryName, Map<String,Serializable> context) throws ClientException
ClientException
public void registerSession(String sid, CoreSession session)
public CoreSession unregisterSession(String sid)
public void close(CoreSession client)
public boolean isSessionStarted(String sid)
public int getNumberOfSessions()
public CoreSession[] getSessions()
public CoreSession getSession(String sid)
sid
- the session id
public void initialize(CoreSessionFactory factory)
public CoreSessionFactory getFactory()
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |