public class ManagedConnectionFactoryImpl extends Object implements javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ResourceAdapterAssociation, RepositoryManagement
ManagedConnection
(the physical connection).
It also is a factory for ConnectionFactory
s.
Constructor and Description |
---|
ManagedConnectionFactoryImpl(String name) |
Modifier and Type | Method and Description |
---|---|
int |
cleanupDeletedDocuments(int max,
Calendar beforeTime)
Cleans up (hard-deletes) any documents that have been soft-deleted in the database.
|
int |
clearCaches()
Clears all the caches.
|
Object |
createConnectionFactory() |
Object |
createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager) |
javax.resource.spi.ManagedConnection |
createManagedConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo connectionRequestInfo) |
int |
getActiveSessionsCount()
Gets the number of active sessions.
|
long |
getCachePristineSize()
Evaluate number of elements in hier cache
|
long |
getCacheSelectionSize()
Evaluate number of elements in selection cache
|
long |
getCacheSize()
Evaluate number of elements in all caches
|
protected SessionImpl |
getConnection()
Called by the
ManagedConnectionImpl constructor to get a new physical connection. |
PrintWriter |
getLogWriter() |
String |
getName()
Gets the repository name.
|
protected static RepositoryDescriptor |
getRepositoryDescriptor(String name)
Gets the repository descriptor provided by the repository extension point.
|
javax.resource.spi.ResourceAdapter |
getResourceAdapter() |
void |
markReferencedBinaries()
Marks the binaries in use by passing them to the binary manager(s)'s GC mark() method.
|
javax.resource.spi.ManagedConnection |
matchManagedConnections(Set set,
Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Returns a matched connection from the candidate set of connections.
|
static Map<String,String> |
parseProperties(String expr)
Parses a string of the form:
key1=val1;key2=val2;... and collects the key/value pairs. |
void |
processClusterInvalidationsNext()
Makes sure that the next transaction will process cluster invalidations.
|
void |
setLogWriter(PrintWriter out) |
void |
setResourceAdapter(javax.resource.spi.ResourceAdapter resourceAdapter)
Called by the application server exactly once to associate this ManagedConnectionFactory with a ResourceAdapter.
|
void |
shutdown() |
public ManagedConnectionFactoryImpl(String name)
public String getName()
RepositoryManagement
getName
in interface RepositoryManagement
public void setResourceAdapter(javax.resource.spi.ResourceAdapter resourceAdapter) throws javax.resource.ResourceException
setResourceAdapter
in interface javax.resource.spi.ResourceAdapterAssociation
javax.resource.ResourceException
public javax.resource.spi.ResourceAdapter getResourceAdapter()
getResourceAdapter
in interface javax.resource.spi.ResourceAdapterAssociation
public void setLogWriter(PrintWriter out)
setLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
public PrintWriter getLogWriter()
getLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
public Object createConnectionFactory() throws javax.resource.ResourceException
createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public Object createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager) throws javax.resource.ResourceException
createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public javax.resource.spi.ManagedConnection createManagedConnection(Subject subject, javax.resource.spi.ConnectionRequestInfo connectionRequestInfo) throws javax.resource.ResourceException
createManagedConnection
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public javax.resource.spi.ManagedConnection matchManagedConnections(Set set, Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
Called by the application server when it's looking for an appropriate connection to server from a pool.
matchManagedConnections
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public int getActiveSessionsCount()
RepositoryManagement
getActiveSessionsCount
in interface RepositoryManagement
public int clearCaches()
RepositoryManagement
clearCaches
in interface RepositoryManagement
public long getCacheSize()
RepositoryManagement
getCacheSize
in interface RepositoryManagement
public long getCachePristineSize()
RepositoryManagement
getCachePristineSize
in interface RepositoryManagement
public long getCacheSelectionSize()
RepositoryManagement
getCacheSelectionSize
in interface RepositoryManagement
public void processClusterInvalidationsNext()
RepositoryManagement
processClusterInvalidationsNext
in interface RepositoryManagement
public void markReferencedBinaries()
RepositoryManagement
markReferencedBinaries
in interface RepositoryManagement
public int cleanupDeletedDocuments(int max, Calendar beforeTime)
RepositoryManagement
cleanupDeletedDocuments
in interface RepositoryManagement
max
- the maximum number of documents to delete at a timebeforeTime
- the maximum deletion time of the documents to deletepublic void shutdown()
protected static RepositoryDescriptor getRepositoryDescriptor(String name)
protected SessionImpl getConnection()
ManagedConnectionImpl
constructor to get a new physical connection.public static Map<String,String> parseProperties(String expr)
key1=val1;key2=val2;...
and collects the key/value pairs.
A ';' character may end the expression. If a value has to contain a ';', it can be escaped by doubling it.
Examples of valid expressions: key1=val1
, key1=val1;
, key1=val1;key2=val2
,
key1=a=b;;c=d;key2=val2
.
Syntax errors are reported using the logger and will stop the parsing but already collected properties will be available. The ';' or '=' characters cannot be escaped in keys.
expr
- the expression to parseCopyright © 2018 Nuxeo. All rights reserved.