@Override public void release() { reference.release(); } }
@Override public void release() { reference.release(); } };
public void destroyInstance(Object instance) { final ManagedReference reference = instanceMap.remove(instance); if (reference != null) { reference.release(); } }
@Override public synchronized void stop(final StopContext context) { if (refreshTask != null) { refreshTask.cancel(); } knownTimerIds.clear(); managedReference.release(); managedReference = null; dataSource = null; }
@Override public String getInstanceClassName() { if(factory instanceof ContextListManagedReferenceFactory) { return ((ContextListManagedReferenceFactory) factory).getInstanceClassName(); } ManagedReference ref = getReference(); try { final Object value = ref.getInstance(); return value != null ? value.getClass().getName() : ContextListManagedReferenceFactory.DEFAULT_INSTANCE_CLASS_NAME; } finally { ref.release(); } }
@Override public String getJndiViewInstanceValue() { if(factory instanceof ContextListAndJndiViewManagedReferenceFactory) { return ((ContextListAndJndiViewManagedReferenceFactory) factory).getJndiViewInstanceValue(); } ManagedReference reference = getReference(); try { return String.valueOf(reference.getInstance()); } finally { reference.release(); } } }
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { try { return context.proceed(); } finally { final ManagedReference managedReference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); if (managedReference != null) { managedReference.release(); } } } }
@Override public void run() { try { if(managedReference != null) { managedReference.release(); } invokeLifecycleMethod(destroyMethod, context); } catch (Exception e) { SarLogger.ROOT_LOGGER.error(SarLogger.ROOT_LOGGER.failedExecutingLegacyMethod("destroy()"), e); } finally { uninjectDependencies(); context.complete(); } } };
if (!ok) { componentInstance.setInstanceData(valueContextKey, null); reference.release();
if (!ok) { componentInstance.setInstanceData(valueKey, 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(); } }
@Override public void stop(StopContext context) { ManagedReference reference = null; try { // get the process application component ProcessApplicationInterface processApplication = null; ComponentView componentView = paComponentViewInjector.getOptionalValue(); if(componentView != null) { reference = componentView.createInstance(); processApplication = (ProcessApplicationInterface) reference.getInstance(); } else { processApplication = noViewProcessApplication.getValue(); } invokePreUndeploy(processApplication); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception while stopping process application", e); } finally { if(reference != null) { reference.release(); } } }
@Override public void stop(StopContext context) { ManagedReference reference = null; try { // get the process application component ProcessApplicationInterface processApplication = null; ComponentView componentView = paComponentViewInjector.getOptionalValue(); if(componentView != null) { reference = componentView.createInstance(); processApplication = (ProcessApplicationInterface) reference.getInstance(); } else { processApplication = noViewProcessApplication.getValue(); } invokePreUndeploy(processApplication); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception while stopping process application", e); } finally { if(reference != null) { reference.release(); } } }
@Override public void stop(StopContext context) { ManagedReference reference = null; try { // get the process application component ProcessApplicationInterface processApplication = null; ComponentView componentView = paComponentViewInjector.getOptionalValue(); if(componentView != null) { reference = componentView.createInstance(); processApplication = (ProcessApplicationInterface) reference.getInstance(); } else { processApplication = noViewProcessApplication.getValue(); } invokePreUndeploy(processApplication); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception while stopping process application", e); } finally { if(reference != null) { reference.release(); } } }
@Override public void stop(StopContext arg0) { ManagedReference reference = null; try { // get the process application component ProcessApplicationInterface processApplication = null; ComponentView componentView = paComponentViewInjector.getOptionalValue(); if(componentView != null) { reference = componentView.createInstance(); processApplication = (ProcessApplicationInterface) reference.getInstance(); } else { processApplication = noViewProcessApplication.getValue(); } BpmPlatformPlugins bpmPlatformPlugins = platformPluginsInjector.getValue(); List<BpmPlatformPlugin> plugins = bpmPlatformPlugins.getPlugins(); for (BpmPlatformPlugin bpmPlatformPlugin : plugins) { bpmPlatformPlugin.postProcessApplicationUndeploy(processApplication); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Exception while invoking BpmPlatformPlugin.postProcessApplicationUndeploy", e); } finally { if(reference != null) { reference.release(); } } }
@Override public void stop(StopContext arg0) { ManagedReference reference = null; try { // get the process application component ProcessApplicationInterface processApplication = null; ComponentView componentView = paComponentViewInjector.getOptionalValue(); if(componentView != null) { reference = componentView.createInstance(); processApplication = (ProcessApplicationInterface) reference.getInstance(); } else { processApplication = noViewProcessApplication.getValue(); } BpmPlatformPlugins bpmPlatformPlugins = platformPluginsInjector.getValue(); List<BpmPlatformPlugin> plugins = bpmPlatformPlugins.getPlugins(); for (BpmPlatformPlugin bpmPlatformPlugin : plugins) { bpmPlatformPlugin.postProcessApplicationUndeploy(processApplication); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Exception while invoking BpmPlatformPlugin.postProcessApplicationUndeploy", e); } finally { if(reference != null) { reference.release(); } } }
@Override public void stop(StopContext arg0) { ManagedReference reference = null; try { // get the process application component ProcessApplicationInterface processApplication = null; ComponentView componentView = paComponentViewInjector.getOptionalValue(); if(componentView != null) { reference = componentView.createInstance(); processApplication = (ProcessApplicationInterface) reference.getInstance(); } else { processApplication = noViewProcessApplication.getValue(); } BpmPlatformPlugins bpmPlatformPlugins = platformPluginsInjector.getValue(); List<BpmPlatformPlugin> plugins = bpmPlatformPlugins.getPlugins(); for (BpmPlatformPlugin bpmPlatformPlugin : plugins) { bpmPlatformPlugin.postProcessApplicationUndeploy(processApplication); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Exception while invoking BpmPlatformPlugin.postProcessApplicationUndeploy", e); } finally { if(reference != null) { reference.release(); } } }
reference.release();
reference.release();
reference.release();