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() |
ManagedConnectionFactoryImpl(RepositoryDescriptor repositoryDescriptor) |
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.
|
BinaryGarbageCollector |
getBinaryGarbageCollector()
Gets the binary GC for this repository.
|
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
|
PrintWriter |
getLogWriter() |
String |
getName()
Gets the repository name.
|
String |
getProperty() |
javax.resource.spi.ResourceAdapter |
getResourceAdapter() |
String |
getXaDataSource() |
void |
markReferencedBinaries(BinaryGarbageCollector gc)
Marks the binaries actually in use with the GC so that they won't be deleted.
|
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 |
setName(String name) |
void |
setProperty(String property)
Properties are specified in the format key=val1[;key2=val2;...]
|
void |
setResourceAdapter(javax.resource.spi.ResourceAdapter resourceAdapter)
Called by the application server exactly once to associate this ManagedConnectionFactory with a ResourceAdapter.
|
void |
setXaDataSource(String xaDataSourceName) |
void |
shutdown() |
public ManagedConnectionFactoryImpl()
public ManagedConnectionFactoryImpl(RepositoryDescriptor repositoryDescriptor)
public void setName(String name)
public String getName()
RepositoryManagement
getName
in interface RepositoryManagement
public void setXaDataSource(String xaDataSourceName)
public String getXaDataSource()
public void setProperty(String property)
If a value has to contain a semicolon, it can be escaped by doubling it.
property
- parseProperties(String)
public String getProperty()
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 BinaryGarbageCollector getBinaryGarbageCollector()
RepositoryManagement
getBinaryGarbageCollector
in interface RepositoryManagement
public void markReferencedBinaries(BinaryGarbageCollector gc)
RepositoryManagement
The passed GC may or may not be the one returned by RepositoryManagement.getBinaryGarbageCollector()
in case it's been
determined that another repository's GC is pointing to the same binary data.
markReferencedBinaries
in interface RepositoryManagement
gc
- the binary garbage collector to use for this repository's binariespublic 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() throws StorageException
StorageException
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 © 2015 Nuxeo SA. All rights reserved.