Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.storage.sql.ra
Class ConnectionFactoryImpl

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl
All Implemented Interfaces:
java.io.Serializable, javax.naming.Referenceable, javax.resource.cci.ConnectionFactory, Repository, RepositoryManagement

public class ConnectionFactoryImpl
extends java.lang.Object
implements Repository, Repository

The connection factory delegates connection requests to the application server ConnectionManager.

An instance of this class is returned to the application when a JNDI lookup is done. This is the datasource equivalent of SQLRepository.

Author:
Florent Guillaume
See Also:
Serialized Form

Constructor Summary
ConnectionFactoryImpl(ManagedConnectionFactoryImpl managedConnectionFactory, javax.resource.spi.ConnectionManager connectionManager)
           
 
Method Summary
 void activateServer()
          Activates the VCS server used for remote connections.
 int clearCaches()
          Clears all the caches.
 void close()
          Closes the repository and release all resources.
 void deactivateServer()
          Deactivates the VCS server used for remote connections.
 int getActiveSessionsCount()
          Gets the number of active sessions.
 java.util.Collection<MapperClientInfo> getClientInfos()
          Get info about current VCS server clients
 int getClosedSessionsCount()
           
 Session getConnection()
          Gets a new connection, with no credentials.
 Session getConnection(javax.resource.cci.ConnectionSpec connectionSpec)
          Gets a new connection.
 ManagedConnectionFactoryImpl getManagedConnectionFactory()
           
 javax.resource.cci.ResourceAdapterMetaData getMetaData()
           
 java.lang.String getName()
          Gets the repository name.
 SecurityManager getNuxeoSecurityManager()
           
 Session[] getOpenedSessions()
           
 javax.resource.cci.RecordFactory getRecordFactory()
           
 javax.naming.Reference getReference()
           
 java.lang.String getServerURL()
          Which is the remote location ?
 Session getSession(long sessionId)
          Deprecated. unused
 Session getSession(java.util.Map<java.lang.String,java.io.Serializable> context)
           
 int getStartedSessionsCount()
           
 SchemaManager getTypeManager()
           
 void initialize()
           
 boolean isServerActivated()
          Is the server available remotely ?
 void processClusterInvalidationsNext()
          Makes sure that the next transaction will process cluster invalidations.
 void setReference(javax.naming.Reference reference)
           
 void shutdown()
           
 boolean supportsTags()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionFactoryImpl

public ConnectionFactoryImpl(ManagedConnectionFactoryImpl managedConnectionFactory,
                             javax.resource.spi.ConnectionManager connectionManager)
Method Detail

getManagedConnectionFactory

public ManagedConnectionFactoryImpl getManagedConnectionFactory()

getConnection

public Session getConnection()
                      throws StorageException
Gets a new connection, with no credentials.

Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory
Returns:
the connection
Throws:
StorageException

getConnection

public Session getConnection(javax.resource.cci.ConnectionSpec connectionSpec)
                      throws StorageException
Gets a new connection.

Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory
Parameters:
connectionSpec - the connection spec, containing credentials
Returns:
the connection
Throws:
StorageException

getMetaData

public javax.resource.cci.ResourceAdapterMetaData getMetaData()
                                                       throws javax.resource.ResourceException
Specified by:
getMetaData in interface javax.resource.cci.ConnectionFactory
Throws:
javax.resource.ResourceException

getRecordFactory

public javax.resource.cci.RecordFactory getRecordFactory()
                                                  throws javax.resource.ResourceException
Specified by:
getRecordFactory in interface javax.resource.cci.ConnectionFactory
Throws:
javax.resource.ResourceException

getReference

public javax.naming.Reference getReference()
Specified by:
getReference in interface javax.naming.Referenceable

setReference

public void setReference(javax.naming.Reference reference)

close

public void close()
           throws StorageException
Description copied from interface: Repository
Closes the repository and release all resources.

Throws:
StorageException

getName

public java.lang.String getName()
Description copied from interface: RepositoryManagement
Gets the repository name.

Specified by:
getName in interface Repository
Specified by:
getName in interface RepositoryManagement

getSession

public Session getSession(java.util.Map<java.lang.String,java.io.Serializable> context)
                   throws DocumentException
Specified by:
getSession in interface Repository
Throws:
DocumentException

getSession

@Deprecated
public Session getSession(long sessionId)
                   throws DocumentException
Deprecated. unused

Specified by:
getSession in interface Repository
Throws:
DocumentException

getNuxeoSecurityManager

public SecurityManager getNuxeoSecurityManager()
Specified by:
getNuxeoSecurityManager in interface Repository

getTypeManager

public SchemaManager getTypeManager()
Specified by:
getTypeManager in interface Repository

initialize

public void initialize()
Specified by:
initialize in interface Repository

getOpenedSessions

public Session[] getOpenedSessions()
Specified by:
getOpenedSessions in interface Repository

shutdown

public void shutdown()
Specified by:
shutdown in interface Repository

getStartedSessionsCount

public int getStartedSessionsCount()
Specified by:
getStartedSessionsCount in interface Repository

getClosedSessionsCount

public int getClosedSessionsCount()
Specified by:
getClosedSessionsCount in interface Repository

getActiveSessionsCount

public int getActiveSessionsCount()
Description copied from interface: RepositoryManagement
Gets the number of active sessions.

Specified by:
getActiveSessionsCount in interface Repository
Specified by:
getActiveSessionsCount in interface RepositoryManagement

clearCaches

public int clearCaches()
Description copied from interface: RepositoryManagement
Clears all the caches.

Specified by:
clearCaches in interface RepositoryManagement
Returns:
an indicative count of objects removed

processClusterInvalidationsNext

public void processClusterInvalidationsNext()
Description copied from interface: RepositoryManagement
Makes sure that the next transaction will process cluster invalidations.

Specified by:
processClusterInvalidationsNext in interface RepositoryManagement

supportsTags

public boolean supportsTags()
Specified by:
supportsTags in interface Repository

activateServer

public void activateServer()
Description copied from interface: RepositoryManagement
Activates the VCS server used for remote connections.

Specified by:
activateServer in interface RepositoryManagement

deactivateServer

public void deactivateServer()
Description copied from interface: RepositoryManagement
Deactivates the VCS server used for remote connections.

Specified by:
deactivateServer in interface RepositoryManagement

getClientInfos

public java.util.Collection<MapperClientInfo> getClientInfos()
Description copied from interface: RepositoryManagement
Get info about current VCS server clients

Specified by:
getClientInfos in interface RepositoryManagement

isServerActivated

public boolean isServerActivated()
Description copied from interface: RepositoryManagement
Is the server available remotely ?

Specified by:
isServerActivated in interface RepositoryManagement

getServerURL

public java.lang.String getServerURL()
Description copied from interface: RepositoryManagement
Which is the remote location ? TODO this info would be better served by a provisioning service. The remote location is dependent to the context of access.

Specified by:
getServerURL in interface RepositoryManagement

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.