Class MappingConnectorPool
- java.lang.Object
-
- org.apache.manifoldcf.authorities.mappingconnectorpool.MappingConnectorPool
-
- All Implemented Interfaces:
IMappingConnectorPool
public class MappingConnectorPool extends java.lang.Object implements IMappingConnectorPool
An implementation of IMappingConnectorPool. 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 classMappingConnectorPool.LocalPoolActual static mapping connector pool
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected static MappingConnectorPool.LocalPoollocalPoolLocal connector poolprotected IThreadContextthreadContextThread context
-
Constructor Summary
Constructors Constructor Description MappingConnectorPool(IThreadContext threadContext)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseAllConnectors()Clean up all open mapping connector handles.voidflushUnusedConnectors()Flush only those connector handles that are currently unused.IMappingConnectorgrab(IMappingConnection mappingConnection)Get a mapping connector.IMappingConnector[]grabMultiple(java.lang.String[] orderingKeys, IMappingConnection[] mappingConnections)Get multiple mapping connectors, all at once.voidpollAllConnectors()Idle notification for inactive mapping connector handles.voidrelease(IMappingConnection connection, IMappingConnector connector)Release a mapping connector.voidreleaseMultiple(IMappingConnection[] connections, IMappingConnector[] connectors)Release multiple mapping connectors.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
localPool
protected static final MappingConnectorPool.LocalPool localPool
Local connector pool
-
threadContext
protected final IThreadContext threadContext
Thread context
-
-
Constructor Detail
-
MappingConnectorPool
public MappingConnectorPool(IThreadContext threadContext) throws ManifoldCFException
Constructor- Throws:
ManifoldCFException
-
-
Method Detail
-
grabMultiple
public IMappingConnector[] grabMultiple(java.lang.String[] orderingKeys, IMappingConnection[] mappingConnections) throws ManifoldCFException
Get multiple mapping connectors, all at once. Do this in a particular order so that any connector exhaustion will not cause a deadlock.- Specified by:
grabMultiplein interfaceIMappingConnectorPool- Parameters:
orderingKeys- are the keys which determine in what order the connectors are obtained.mappingConnections- are the connections to use the build the connector instances.- Throws:
ManifoldCFException
-
grab
public IMappingConnector grab(IMappingConnection mappingConnection) throws ManifoldCFException
Get a mapping connector. The connector is specified by an mapping connection object.- Specified by:
grabin interfaceIMappingConnectorPool- Parameters:
mappingConnection- is the mapping connection to base the connector instance on.- Throws:
ManifoldCFException
-
releaseMultiple
public void releaseMultiple(IMappingConnection[] connections, IMappingConnector[] connectors) throws ManifoldCFException
Release multiple mapping connectors.- Specified by:
releaseMultiplein interfaceIMappingConnectorPool- Parameters:
connections- are the connections describing the instances to release.connectors- are the connector instances to release.- Throws:
ManifoldCFException
-
release
public void release(IMappingConnection connection, IMappingConnector connector) throws ManifoldCFException
Release a mapping connector.- Specified by:
releasein interfaceIMappingConnectorPool- 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 mapping connector handles. This method polls all inactive handles.- Specified by:
pollAllConnectorsin interfaceIMappingConnectorPool- Throws:
ManifoldCFException
-
flushUnusedConnectors
public void flushUnusedConnectors() throws ManifoldCFExceptionFlush only those connector handles that are currently unused.- Specified by:
flushUnusedConnectorsin interfaceIMappingConnectorPool- Throws:
ManifoldCFException
-
closeAllConnectors
public void closeAllConnectors() throws ManifoldCFExceptionClean up all open mapping connector handles. This method is called when the connector pool needs to be flushed, to free resources.- Specified by:
closeAllConnectorsin interfaceIMappingConnectorPool- Throws:
ManifoldCFException
-
-