return deployment.get(deploymentInfo);
}
public void contextEntered(ThreadContext oldContext, ThreadContext newContext) {
BeanContext deploymentInfo = newContext.getBeanContext();
if (deploymentInfo == null) return;
EjbDeployment ejbDeployment = getEjbDeployment(deploymentInfo);
if (ejbDeployment == null) return;
// Geronimo call context is used to track old state that must be restored
GeronimoCallContext geronimoCallContext = new GeronimoCallContext();
// Demarcate component boundaries for connection tracking if we have a tracker
TrackedConnectionAssociator trackedConnectionAssociator = ejbDeployment.getTrackedConnectionAssociator();
if (trackedConnectionAssociator != null) {
// create the connector context... this only works with a TrackedConnectionAssociator using lazy association
ConnectorInstanceContext connectorContext = new ConnectorInstanceContextImpl(ejbDeployment.getUnshareableResources(),
ejbDeployment.getApplicationManagedSecurityResources());
// Set connector context
try {
geronimoCallContext.oldConnectorContext = trackedConnectionAssociator.enter(connectorContext);
} catch (ResourceException e) {
log.error("Error while entering TrackedConnectionAssociator");
return;
}
}
// Get the jndi context
Context jndiContext = deploymentInfo.getJndiEnc();
geronimoCallContext.oldJndiContext = RootContext.getComponentContext();
// Set the jndi context into Geronimo's root context
RootContext.setComponentContext(jndiContext);
// set the policy (security) context id