public Interceptor create(final InterceptorFactoryContext context) {
return new Interceptor() {
@Override
public Object processInvocation(InterceptorContext interceptorContext) throws Exception {
StatefulSessionComponentInstance sfsb = (StatefulSessionComponentInstance) context.getContextData().get(AbstractComponent.COMPONENT_INSTANCE_KEY);
SFSBContextHandleImpl sfsbContextHandle = new SFSBContextHandleImpl(sfsb);
List<EntityManager> readyToClose = SFSBXPCMap.getINSTANCE().remove(sfsbContextHandle);
if (readyToClose != null && readyToClose.size() > 0) {
for (EntityManager entityManager : readyToClose) {
if (entityManager instanceof ExtendedEntityManager) {
// TODO: continue iterating through remaining entity managers and chain any exceptions