LocalTxConnectorAllocatorpublic class LocalTxConnectorAllocator extends AbstractConnectorAllocator
Constructors Summary |
---|
public LocalTxConnectorAllocator(com.sun.enterprise.PoolManager poolMgr, ManagedConnectionFactory mcf, ResourceSpec spec, Subject subject, ConnectionRequestInfo reqInfo, ClientSecurityInfo info, com.sun.enterprise.deployment.ConnectorDescriptor desc)
super(poolMgr, mcf, spec, subject, reqInfo, info, desc);
|
Methods Summary |
---|
public ResourceHandle | createResource()
try {
ManagedConnection mc =
mcf.createManagedConnection(subject, reqInfo);
ResourceHandle resource =
new ResourceHandle(mc, spec, this, info);
ConnectionEventListener l =
new LocalTxConnectionEventListener(resource);
mc.addConnectionEventListener(l);
resource.setListener(l);
XAResource xares =
new ConnectorXAResource(resource, spec, this, info);
resource.fillInResourceObjects(null, xares);
return resource;
} catch (ResourceException ex) {
_logger.log(Level.WARNING,"poolmgr.create_resource_error",ex.getMessage());
_logger.log(Level.FINE,"Resource Exception while creating resource",ex);
if (ex.getLinkedException() != null) {
_logger.log(Level.WARNING,"poolmgr.create_resource_error",ex.getLinkedException().getMessage());
}
throw new PoolingException(ex);
}
| public void | destroyResource(ResourceHandle resource)
try {
ManagedConnection mc = (ManagedConnection) resource.getResource();
ConnectorXAResource.freeListener(mc);
mc.destroy();
if (_logger.isLoggable( Level.FINEST ) ) {
_logger.finest( "destroyResource for LocalTxConnectorAllocator done");
}
} catch (Exception ex) {
_logger.log(Level.WARNING, ex.getMessage());
throw new PoolingException(ex);
}
| public void | fillInResourceObjects(ResourceHandle resource)
try {
ManagedConnection mc = (ManagedConnection) resource.getResource();
Object con = mc.getConnection(subject, reqInfo);
ConnectorXAResource xares = (ConnectorXAResource) resource.getXAResource();
xares.setUserHandle(con);
resource.fillInResourceObjects(con, xares);
} catch (ResourceException ex) {
throw new PoolingException(ex);
}
| public boolean | shareableWithinComponent()
//For local transactions, a resource is always shareable within components
//within the same transaction
return true;
|
|