componentInstance.setInstanceData(valueContextKey, reference); Object injected = reference.getInstance(); try { } finally { if (!ok) { componentInstance.setInstanceData(valueContextKey, null); reference.release();
public Object processInvocation(final InterceptorContext context) throws Exception { final ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); final ManagedReference existing = (ManagedReference) componentInstance.getInstanceData(contextKey); if (existing == null) { final ManagedReference reference = componentFactory.create(context); boolean ok = false; try { componentInstance.setInstanceData(contextKey, reference); if (setTarget) { context.setTarget(reference.getInstance()); } Object result = context.proceed(); ok = true; return result; } finally { if (!ok) { reference.release(); componentInstance.setInstanceData(contextKey, reference); } } } else { return context.proceed(); } }
componentInstance.setInstanceData(valueKey, reference); final InvocationType invocationType = context.getPrivateData(InvocationType.class); try { } finally { if (!ok) { componentInstance.setInstanceData(valueKey, null); reference.release();
@Override public void setInterceptorInstances(ComponentInstance componentInstance, InterceptorInstances interceptorInstances) { componentInstance.setInstanceData(SerializedCdiInterceptorsKey.class, interceptorInstances); }
componentInstance.setInstanceData(valueContextKey, reference); Object injected = reference.getInstance(); try { } finally { if (!ok) { componentInstance.setInstanceData(valueContextKey, null); reference.release();
componentInstance.setInstanceData(valueContextKey, reference); Object injected = reference.getInstance(); try { } finally { if (!ok) { componentInstance.setInstanceData(valueContextKey, null); reference.release();
public Object processInvocation(final InterceptorContext context) throws Exception { final ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); final ManagedReference existing = (ManagedReference) componentInstance.getInstanceData(contextKey); if (existing == null) { final ManagedReference reference = componentFactory.create(context); boolean ok = false; try { componentInstance.setInstanceData(contextKey, reference); if (setTarget) { context.setTarget(reference.getInstance()); } Object result = context.proceed(); ok = true; return result; } finally { if (!ok) { reference.release(); componentInstance.setInstanceData(contextKey, reference); } } } else { return context.proceed(); } }
public Object processInvocation(final InterceptorContext context) throws Exception { final ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); final ManagedReference existing = (ManagedReference) componentInstance.getInstanceData(contextKey); if (existing == null) { final ManagedReference reference = componentFactory.create(context); boolean ok = false; try { componentInstance.setInstanceData(contextKey, reference); if (setTarget) { context.setTarget(reference.getInstance()); } Object result = context.proceed(); ok = true; return result; } finally { if (!ok) { reference.release(); componentInstance.setInstanceData(contextKey, reference); } } } else { return context.proceed(); } }
@Override public Object processInvocation(InterceptorContext interceptorContext) throws Exception { ComponentInstance componentInstance = interceptorContext.getPrivateData(ComponentInstance.class); Map<String, ExtendedEntityManager> entityManagers = null; if(componentInstance.getInstanceData(SFSBInvocationInterceptor.CONTEXT_KEY) == null) { // Get all of the extended persistence contexts in use by the bean (some of which may of been inherited from // other beans). entityManagers = new HashMap<String, ExtendedEntityManager>(); componentInstance.setInstanceData(SFSBInvocationInterceptor.CONTEXT_KEY, new ImmediateManagedReference(entityManagers)); } else { ManagedReference entityManagerRef = (ManagedReference) componentInstance.getInstanceData(SFSBInvocationInterceptor.CONTEXT_KEY); entityManagers = (Map<String, ExtendedEntityManager>)entityManagerRef.getInstance(); } final ExtendedEntityManager[] ems = CreatedEntityManagers.getDeferredEntityManagers(); for (ExtendedEntityManager e : ems) { entityManagers.put(e.getScopedPuName(), e); } return interceptorContext.proceed(); } }
@Override public Object processInvocation(InterceptorContext interceptorContext) throws Exception { ComponentInstance componentInstance = interceptorContext.getPrivateData(ComponentInstance.class); Map<String, ExtendedEntityManager> entityManagers = null; if(componentInstance.getInstanceData(SFSBInvocationInterceptor.CONTEXT_KEY) == null) { // Get all of the extended persistence contexts in use by the bean (some of which may of been inherited from // other beans). entityManagers = new HashMap<String, ExtendedEntityManager>(); componentInstance.setInstanceData(SFSBInvocationInterceptor.CONTEXT_KEY, new ImmediateManagedReference(entityManagers)); } else { ManagedReference entityManagerRef = (ManagedReference) componentInstance.getInstanceData(SFSBInvocationInterceptor.CONTEXT_KEY); entityManagers = (Map<String, ExtendedEntityManager>)entityManagerRef.getInstance(); } final ExtendedEntityManager[] ems = CreatedEntityManagers.getDeferredEntityManagers(); for (ExtendedEntityManager e : ems) { entityManagers.put(e.getScopedPuName(), e); } return interceptorContext.proceed(); } }
componentInstance.setInstanceData(valueKey, reference); final InvocationType invocationType = context.getPrivateData(InvocationType.class); try { } finally { if (!ok) { componentInstance.setInstanceData(valueKey, null); reference.release();
componentInstance.setInstanceData(valueKey, reference); final InvocationType invocationType = context.getPrivateData(InvocationType.class); try { } finally { if (!ok) { componentInstance.setInstanceData(valueKey, null); reference.release();