org.globus.exec.service.test.throughput.util
Class StubCache
java.lang.Object
org.globus.exec.service.test.throughput.util.StubCache
public class StubCache
- extends java.lang.Object
Cache for connections with duplicate entries.
Caching strategy: LRU
The key of a stub in the cache is a concatenation of
- A string representation of the EPR of the service generated by
EPRUtil.getEPRAsString(EndpointReferenceType)
- The DN of the credential, if set in the security descriptor
- The hashCode of the security descriptor
|
Constructor Summary |
StubCache(int connectionTimeout,
int maxSize)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.commons.logging.Log log
scheduler
private java.util.concurrent.ScheduledExecutorService scheduler
sweeperHandle
private java.util.concurrent.ScheduledFuture<?> sweeperHandle
cache
private java.util.LinkedList<Connection> cache
connectionTimeout
private int connectionTimeout
maxSize
private int maxSize
StubCache
public StubCache(int connectionTimeout,
int maxSize)
getStub
public javax.xml.rpc.Stub getStub(org.globus.axis.message.addressing.EndpointReferenceType epr,
ClientSecurityDescriptor secDesc)
- Get a stub from the cache.
- Returns:
- stub that fits to epr and secDesc, or null if no
suitable stub is found.
addStub
public void addStub(org.globus.axis.message.addressing.EndpointReferenceType epr,
javax.xml.rpc.Stub stub)
- Add a stub to the cache
shutdown
public void shutdown()
- Shutdown the cache.
createStubId
private java.lang.String createStubId(org.globus.axis.message.addressing.EndpointReferenceType epr,
ClientSecurityDescriptor secDesc)
throws java.lang.Exception
- Throws:
java.lang.Exception
removeExpiredStubs
private void removeExpiredStubs()
connectionExpired
private boolean connectionExpired(Connection connection)