@Override public ManagedReference getReference() { final ClassLoader oldCL = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader); final ServiceRefFactory serviceRefFactory = getServiceRefFactory(); return new ImmediateManagedReference(serviceRefFactory.newServiceRef(serviceRef)); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldCL); } }
@Override public ManagedReference getReference() { final ClassLoader oldCL = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader); final ServiceRefFactory serviceRefFactory = getServiceRefFactory(); return new ImmediateManagedReference(serviceRefFactory.newServiceRef(serviceRef)); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldCL); } }
public Object getValue() { final ClassLoader oldCL = getContextClassLoader(); try { final ClassLoader integrationCL = new DelegateClassLoader(getClassLoader(), classLoader); setContextClassLoader(integrationCL); final ServiceRefFactory serviceRefFactory = getServiceRefFactory(); return serviceRefFactory.newServiceRef(serviceRef); } finally { setContextClassLoader(oldCL); } }