/** * Get the context manager. Simply calls the {@code static} method {@link #getContextManager()}. * * @return the context manager (not {@code null}) */ public ContextManager<EJBClientContext> getInstanceContextManager() { return getContextManager(); }
public void stop(final StopContext context) { clientContext = null; if (makeGlobal) { doPrivileged((PrivilegedAction<Void>) () -> { EJBClientContext.getContextManager().setGlobalDefault(null); return null; }); } }
@Override public void stop(StopContext context) { // de-associate the EJB client context with the deployment classloader doPrivileged((PrivilegedAction<Void>) () -> { final ModuleClassLoader classLoader = module.getClassLoader(); EjbLogger.DEPLOYMENT_LOGGER.debugf("unRegistering EJB client context for classloader %s", classLoader); EJBClientContext.getContextManager().setClassLoaderDefault(classLoader, null); Discovery.getContextManager().setClassLoaderDefault(classLoader, null); // this is redundant but should be safe AuthenticationContext.getContextManager().setClassLoaderDefault(classLoader, null); return null; }); }
}); EJBClientContext.getContextManager().setClassLoaderDefault(classLoader, ejbClientContext); Discovery.getContextManager().setClassLoaderDefault(classLoader, discoveryInjector.getValue()); return null;
if (makeGlobal) { doPrivileged((PrivilegedAction<Void>) () -> { EJBClientContext.getContextManager().setGlobalDefault(clientContext); return null; });
/** * Get the context manager. Simply calls the {@code static} method {@link #getContextManager()}. * * @return the context manager (not {@code null}) */ public ContextManager<EJBClientContext> getInstanceContextManager() { return getContextManager(); }
/** * Get the context manager. Simply calls the {@code static} method {@link #getContextManager()}. * * @return the context manager (not {@code null}) */ public ContextManager<EJBClientContext> getInstanceContextManager() { return getContextManager(); }
@Override public void stop(StopContext context) { deploymentRepositoryValue.getValue().remove(moduleIdentifier); doPrivileged((PrivilegedAction<Void>) () -> { final ClassLoader classLoader = getClass().getClassLoader(); EJBClientContext.getContextManager().setClassLoaderDefault(classLoader, null); Discovery.getContextManager().setClassLoaderDefault(classLoader, null); return null; }); }
@Override public void start(StartContext context) throws StartException { final DeploymentRepository repository = deploymentRepositoryValue.getValue(); moduleIdentifier = new DeploymentModuleIdentifier(APP_NAME, MODULE_NAME, DISTINCT_NAME); final InjectedValue<ComponentView> injectedHomeView = new InjectedValue<ComponentView>(); injectedHomeView.setValue(new ImmediateValue<ComponentView>(new ManagementHomeEjbComponentView())); final InjectedValue<ComponentView> injectedRemoteView = new InjectedValue<ComponentView>(); injectedRemoteView.setValue(new ImmediateValue<ComponentView>(new ManagementRemoteEjbComponentView(mbeanServerValue.getValue()))); Map<String, InjectedValue<ComponentView>> views = new HashMap<String, InjectedValue<ComponentView>>(); views.put(ManagementHome.class.getName(), injectedHomeView); views.put(Management.class.getName(), injectedRemoteView); final EjbDeploymentInformation ejb = new ManagementEjbDeploymentInformation(EJB_NAME, views, SecurityActions.getClassLoader(this.getClass())); final ModuleDeployment deployment = new ModuleDeployment(moduleIdentifier, Collections.singletonMap(EJB_NAME, ejb)); repository.add(moduleIdentifier, deployment); repository.startDeployment(moduleIdentifier); doPrivileged((PrivilegedAction<Void>) () -> { final ClassLoader classLoader = getClass().getClassLoader(); EJBClientContext.getContextManager().setClassLoaderDefault(classLoader, ejbClientContextValue.getValue().getClientContext()); Discovery.getContextManager().setClassLoaderDefault(classLoader, Discovery.create(associationServiceInjector.getValue().getLocalDiscoveryProvider())); return null; }); }