|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.extensions.jcr.JcrSessionFactory
public class JcrSessionFactory
Jcr Session Factory. This class is just a simple wrapper around the repository which facilitates session retrieval through a central point. No exception conversion from Jcr Repository exceptions to Spring DAO exceptions is done.
The session factory is able to add event listener definitions for each session and some utility methods.setForceNamespacesRegistration(boolean),
{@link #setKeepNewNamespaces(boolean) and
| Constructor Summary | |
|---|---|
JcrSessionFactory()
Empty constructor. |
|
JcrSessionFactory(javax.jcr.Repository repository,
java.lang.String workspaceName,
javax.jcr.Credentials credentials)
Constructor with all the required fields. |
|
JcrSessionFactory(javax.jcr.Repository repository,
java.lang.String workspaceName,
javax.jcr.Credentials credentials,
SessionHolderProviderManager sessionHolderProviderManager)
Constructor containing all the fields available. |
|
| Method Summary | |
|---|---|
protected javax.jcr.Session |
addListeners(javax.jcr.Session session)
Hook for adding listeners to the newly returned session. |
void |
afterPropertiesSet()
|
void |
destroy()
|
boolean |
equals(java.lang.Object obj)
|
javax.jcr.Credentials |
getCredentials()
|
EventListenerDefinition[] |
getEventListeners()
|
java.util.Properties |
getNamespaces()
|
javax.jcr.Repository |
getRepository()
|
javax.jcr.Session |
getSession()
Returns a JCR Session using the credentials and workspace on this JcrSessionFactory. |
SessionHolder |
getSessionHolder(javax.jcr.Session session)
Returns a specific SessionHolder for the given Session. |
protected SessionHolderProvider |
getSessionHolderProvider()
Used internally. |
SessionHolderProviderManager |
getSessionHolderProviderManager()
|
java.lang.String |
getWorkspaceName()
|
int |
hashCode()
|
boolean |
isForceNamespacesRegistration()
|
boolean |
isKeepNewNamespaces()
|
boolean |
isSkipExistingNamespaces()
|
protected void |
registerNamespaces()
Register the namespaces. |
protected void |
registerNodeTypes()
Hook for registering node types on the underlying repository. |
void |
setCredentials(javax.jcr.Credentials credentials)
|
void |
setEventListeners(EventListenerDefinition[] eventListenerDefinitions)
|
void |
setForceNamespacesRegistration(boolean forceNamespacesRegistration)
Indicate if the given namespace registrations will override the namespace already registered in the repository under the same prefix. |
void |
setKeepNewNamespaces(boolean keepNamespaces)
Indicate if the given namespace registrations will be kept (the default) when the application context closes down or if they will be unregistered. |
void |
setNamespaces(java.util.Properties namespaces)
|
void |
setRepository(javax.jcr.Repository repository)
|
protected void |
setSessionHolderProvider(SessionHolderProvider sessionHolderProvider)
Used internally. |
void |
setSessionHolderProviderManager(SessionHolderProviderManager sessionHolderProviderManager)
|
void |
setSkipExistingNamespaces(boolean skipRegisteredNamespace)
Indicate if the given namespace registrations will skip already registered namespaces or not. |
void |
setWorkspaceName(java.lang.String workspaceName)
|
java.lang.String |
toString()
|
protected void |
unregisterNamespaces()
Removes the namespaces. |
protected void |
unregisterNodeTypes()
Hook for un-registering node types on the underlying repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JcrSessionFactory(javax.jcr.Repository repository,
java.lang.String workspaceName,
javax.jcr.Credentials credentials)
repository - workspaceName - credentials -
public JcrSessionFactory(javax.jcr.Repository repository,
java.lang.String workspaceName,
javax.jcr.Credentials credentials,
SessionHolderProviderManager sessionHolderProviderManager)
repository - workspaceName - credentials - sessionHolderProviderManager - public JcrSessionFactory()
| Method Detail |
|---|
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exception
protected void registerNodeTypes()
throws java.lang.Exception
java.lang.Exception
protected void unregisterNodeTypes()
throws java.lang.Exception
java.lang.Exception
protected void registerNamespaces()
throws java.lang.Exception
session -
javax.jcr.RepositoryException
java.lang.Exception
public void destroy()
throws java.lang.Exception
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.ExceptionDisposableBean.destroy()
protected void unregisterNamespaces()
throws java.lang.Exception
session -
java.lang.Exception
public javax.jcr.Session getSession()
throws javax.jcr.RepositoryException
SessionFactory" Each Session object is associated one-to-one with a Workspace object. The Workspace object represents a `view` of an actual repository workspace entity as seen through the authorization settings of its associated Session." (quote from javax.jcr.Session javadoc).
getSession in interface SessionFactoryjavax.jcr.RepositoryExceptionSessionFactory.getSession()public SessionHolder getSessionHolder(javax.jcr.Session session)
SessionFactory
getSessionHolder in interface SessionFactorySessionFactory.getSessionHolder(javax.jcr.Session)
protected javax.jcr.Session addListeners(javax.jcr.Session session)
throws javax.jcr.RepositoryException
session - JCR session
javax.jcr.RepositoryExceptionpublic javax.jcr.Repository getRepository()
public void setRepository(javax.jcr.Repository repository)
repository - The repository to set.public void setWorkspaceName(java.lang.String workspaceName)
workspaceName - The workspaceName to set.public void setCredentials(javax.jcr.Credentials credentials)
credentials - The credentials to set.public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public EventListenerDefinition[] getEventListeners()
public void setEventListeners(EventListenerDefinition[] eventListenerDefinitions)
eventListenerDefinitions - The eventListenerDefinitions to set.public java.util.Properties getNamespaces()
public void setNamespaces(java.util.Properties namespaces)
namespaces - The namespaces to set.protected SessionHolderProvider getSessionHolderProvider()
protected void setSessionHolderProvider(SessionHolderProvider sessionHolderProvider)
sessionHolderProvider - The sessionHolderProvider to set.public SessionHolderProviderManager getSessionHolderProviderManager()
public void setSessionHolderProviderManager(SessionHolderProviderManager sessionHolderProviderManager)
sessionHolderProviderManager - The sessionHolderProviderManager to set.public void setKeepNewNamespaces(boolean keepNamespaces)
keepNamespaces - The keepNamespaces to set.forceNamespacesRegistrationpublic void setForceNamespacesRegistration(boolean forceNamespacesRegistration)
setKeepNewNamespaces(boolean) setting, the old namespaces can be
registered back once the application context is destroyed. False by default.
forceNamespacesRegistration - The forceNamespacesRegistration to set.public void setSkipExistingNamespaces(boolean skipRegisteredNamespace)
setForceNamespacesRegistration(boolean) method useless (as namespace registration
cannot be forced).
skipRegisteredNamespace - The skipRegisteredNamespace to set.public boolean isForceNamespacesRegistration()
public boolean isKeepNewNamespaces()
public boolean isSkipExistingNamespaces()
public javax.jcr.Credentials getCredentials()
public java.lang.String getWorkspaceName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||