Object oid = invocation.getMetaData(Dispatcher.DISPATCHER, Dispatcher.OID);
Container container = null;
try
{
container = Ejb3Registry.getContainer(oid.toString());
}
catch (IllegalStateException ignored)
{
if (log.isTraceEnabled())
log.trace("Cannot find local container for " + oid);
}
if (container != null)
{
String partitionName = (String) invocation.getMetaData(PARTITION_NAME, PARTITION_NAME);
if (partitionName != null)
{
if (!partitionName.equals(((EJBContainer) container).getPartitionName()))
{
if (log.isTraceEnabled())
{
log.trace("Partition (" + ((EJBContainer) container).getPartitionName() +
") for local container " + oid + " does not match invocation (" +
partitionName + ")");
}
container = null;
}
else if (log.isTraceEnabled())
{
log.trace("Partition (" + ((EJBContainer) container).getPartitionName() +
") for local container " + oid + " matches invocation (" +
partitionName + ")");
}
}
else
{
log.warn("No PARTITION_NAME metadata associated with invocation");
container = null;
}
}
return container;