Class AuthorityConnectorPool
- java.lang.Object
-
- org.apache.manifoldcf.authorities.authorityconnectorpool.AuthorityConnectorPool
-
- All Implemented Interfaces:
IAuthorityConnectorPool
public class AuthorityConnectorPool extends java.lang.Object implements IAuthorityConnectorPool
An implementation of IAuthorityConnectorPool. Coordination and allocation among cluster members is managed within. These objects are thread-local, so do not share them among threads.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAuthorityConnectorPool.LocalPoolActual static output connector pool
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected static AuthorityConnectorPool.LocalPoollocalPoolLocal connector poolprotected IThreadContextthreadContextThread context
-
Constructor Summary
Constructors Constructor Description AuthorityConnectorPool(IThreadContext threadContext)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseAllConnectors()Clean up all open authority connector handles.voidflushUnusedConnectors()Flush only those connector handles that are currently unused.IAuthorityConnectorgrab(IAuthorityConnection authorityConnection)Get an authority connector.IAuthorityConnector[]grabMultiple(java.lang.String[] orderingKeys, IAuthorityConnection[] authorityConnections)Get multiple authority connectors, all at once.voidpollAllConnectors()Idle notification for inactive authority connector handles.voidrelease(IAuthorityConnection connection, IAuthorityConnector connector)Release an output connector.voidreleaseMultiple(IAuthorityConnection[] connections, IAuthorityConnector[] connectors)Release multiple authority connectors.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
localPool
protected static final AuthorityConnectorPool.LocalPool localPool
Local connector pool
-
threadContext
protected final IThreadContext threadContext
Thread context
-
-
Constructor Detail
-
AuthorityConnectorPool
public AuthorityConnectorPool(IThreadContext threadContext) throws ManifoldCFException
Constructor- Throws:
ManifoldCFException
-
-
Method Detail
-
grabMultiple
public IAuthorityConnector[] grabMultiple(java.lang.String[] orderingKeys, IAuthorityConnection[] authorityConnections) throws ManifoldCFException
Get multiple authority connectors, all at once. Do this in a particular order so that any connector exhaustion will not cause a deadlock.- Specified by:
grabMultiplein interfaceIAuthorityConnectorPool- Parameters:
orderingKeys- are the keys which determine in what order the connectors are obtained.authorityConnections- are the connections to use the build the connector instances.- Throws:
ManifoldCFException
-
grab
public IAuthorityConnector grab(IAuthorityConnection authorityConnection) throws ManifoldCFException
Get an authority connector. The connector is specified by an authority connection object.- Specified by:
grabin interfaceIAuthorityConnectorPool- Parameters:
authorityConnection- is the authority connection to base the connector instance on.- Throws:
ManifoldCFException
-
releaseMultiple
public void releaseMultiple(IAuthorityConnection[] connections, IAuthorityConnector[] connectors) throws ManifoldCFException
Release multiple authority connectors.- Specified by:
releaseMultiplein interfaceIAuthorityConnectorPool- Parameters:
connections- are the connections describing the instances to release.connectors- are the connector instances to release.- Throws:
ManifoldCFException
-
release
public void release(IAuthorityConnection connection, IAuthorityConnector connector) throws ManifoldCFException
Release an output connector.- Specified by:
releasein interfaceIAuthorityConnectorPool- Parameters:
connection- is the connection describing the instance to release.connector- is the connector to release.- Throws:
ManifoldCFException
-
pollAllConnectors
public void pollAllConnectors() throws ManifoldCFExceptionIdle notification for inactive authority connector handles. This method polls all inactive handles.- Specified by:
pollAllConnectorsin interfaceIAuthorityConnectorPool- Throws:
ManifoldCFException
-
flushUnusedConnectors
public void flushUnusedConnectors() throws ManifoldCFExceptionFlush only those connector handles that are currently unused.- Specified by:
flushUnusedConnectorsin interfaceIAuthorityConnectorPool- Throws:
ManifoldCFException
-
closeAllConnectors
public void closeAllConnectors() throws ManifoldCFExceptionClean up all open authority connector handles. This method is called when the connector pool needs to be flushed, to free resources.- Specified by:
closeAllConnectorsin interfaceIAuthorityConnectorPool- Throws:
ManifoldCFException
-
-