|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.repository.util.AbstractSessionFactory
org.jboss.dna.repository.util.SimpleSessionFactory
public class SimpleSessionFactory
A SessionFactory implementation that creates Session instances using Repository instances registered in JNDI.
This factory using a naming convention where the name supplied to the AbstractSessionFactory.createSession(String) contains both the name of
the repository and the name of the workspace. Typically, this is repositoryName/workspaceName, where
repositoryName is the JNDI name under which the Repository instance was bound, and workspaceName
is the name of the workspace. Note that this method looks for the last delimiter in the whole name to distinguish between the
repository and workspace names.
For example, if "java:comp/env/repository/dataRepository/myWorkspace" is passed to the
AbstractSessionFactory.createSession(String) method, this factory will look for a Repository instance registered in JDNI with the
name "java:comp/env/repository/dataRepository" and use it to create a session
to the workspace named "myWorkspace".
By default, this factory creates an anonymous JCR session. To use sessions with specific Credentials, simply
register credentials for the appropriate repository/workspace name. For
security reasons, it is not possible to retrieve the Credentials once registered with this factory.
| Field Summary |
|---|
| Fields inherited from class org.jboss.dna.repository.util.AbstractSessionFactory |
|---|
DEFAULT_DELIMITERS |
| Constructor Summary | |
|---|---|
SimpleSessionFactory()
Create an instance of the factory by creating a new InitialContext. |
|
SimpleSessionFactory(char... workspaceDelimiters)
Create an instance of the factory by supplying the characters that may be used to delimit the workspace name from the repository name. |
|
| Method Summary | |
|---|---|
protected void |
doRegisterRepository(String name,
javax.jcr.Repository repository)
|
protected void |
doUnregisterRepository(String name)
|
protected javax.jcr.Repository |
findRegisteredRepository(String name)
|
| Methods inherited from class org.jboss.dna.repository.util.AbstractSessionFactory |
|---|
createSession, getIndexOfLastWorkspaceDelimiter, getRepositoryName, getWorkspaceName, registerCredentials, registerCredentials, registerRepository, removeCredentials |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleSessionFactory()
InitialContext.
public SimpleSessionFactory(char... workspaceDelimiters)
workspaceDelimiters - the delimiters, or null/empty if the default delimiter of '/' should be used.| Method Detail |
|---|
protected void doRegisterRepository(String name,
javax.jcr.Repository repository)
doRegisterRepository in class AbstractSessionFactory
protected void doUnregisterRepository(String name)
throws org.jboss.dna.common.SystemFailureException
doUnregisterRepository in class AbstractSessionFactoryorg.jboss.dna.common.SystemFailureException
protected javax.jcr.Repository findRegisteredRepository(String name)
throws org.jboss.dna.common.SystemFailureException
findRegisteredRepository in class AbstractSessionFactoryorg.jboss.dna.common.SystemFailureException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||