public ManagedReference getReference(final Object instance) { if (component == null) { synchronized (this) { if (component == null) { component = (ServiceController<Component>) serviceRegistry.getService(serviceName); } } } if (component == null) { return null; } return new ComponentManagedReference(component.getValue().createInstance(instance)); }
@Override public String toString() { return "Component view " + viewClass + " for component " + component.getComponentClass(); }
throw new BAD_OPERATION(opName); final NamespaceContextSelector selector = componentView.getComponent().getNamespaceContextSelector(); final ClassLoader oldCl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); NamespaceContextSelector.pushCurrentSelector(selector);
component.waitForComponentStart(); if (!(component instanceof StatefulSessionComponent)) { sessionOpenRequest.writeNotStateful();
final Throwable cause = exception.getCause(); if (componentView.getComponent() instanceof StatefulSessionComponent && exception instanceof EJBException && cause != null) { if (!(componentView.getComponent().isRemotable(cause))) {
throw new BAD_OPERATION(opName); final NamespaceContextSelector selector = componentView.getComponent().getNamespaceContextSelector(); final ClassLoader oldCl = SecurityActions.getContextClassLoader(); NamespaceContextSelector.pushCurrentSelector(selector);
@Override public ManagedReference getReference() { if (component == null) { synchronized (this) { if (component == null) { component = (ServiceController<Component>) serviceRegistry.getService(serviceName); } } } if (view == null && viewServiceName != null) { synchronized (this) { if (view == null) { view = (ServiceController<ViewService.View>) serviceRegistry.getService(viewServiceName); } } } if (component == null) { return null; } if(view == null) { return new ComponentManagedReference(component.getValue().createInstance()); } else { try { return view.getValue().createInstance(); } catch (Exception e) { throw new RuntimeException(e); } } }
@Override public String getInstanceClassName() { return view.getComponent().getComponentClass().getName(); }
public Object processInvocation(final InterceptorContext context) throws Exception { final ComponentClientInstance instance = context.getPrivateData(ComponentClientInstance.class); final Component component = context.getPrivateData(Component.class); final ComponentInstance componentInstance = component.createInstance(); boolean ok = false; try { context.putPrivateData(ComponentInstance.class, componentInstance); instance.setViewInstanceData(ComponentInstance.class, componentInstance); final Object result = context.proceed(); ok = true; return result; } finally { context.putPrivateData(ComponentInstance.class, null); if (! ok) { componentInstance.destroy(); instance.setViewInstanceData(ComponentInstance.class, null); } } } }
@Override public Method getMethod(final String name, final String descriptor) { Method method = this.methods.get(new MethodDescription(name, descriptor)); if (method == null) { throw EeLogger.ROOT_LOGGER.viewMethodNotFound(name, descriptor, viewClass, component.getComponentClass()); } return method; }
public ManagedReference getReference(final Object instance) { if (component == null) { synchronized (this) { if (component == null) { component = (ServiceController<Component>) serviceRegistry.getService(serviceName); } } } if (component == null) { return null; } return new ComponentManagedReference(component.getValue().createInstance(instance)); }
public ManagedReference createInstance(Map<Object, Object> contextData) throws Exception { // view instance creation can lead to instantiating application component classes (like the MDB implementation class // or even the EJB implementation class of a no-interface view exposing bean). Such class initialization needs to // have the TCCL set to the component/application's classloader. @see https://issues.jboss.org/browse/WFLY-3989 final ClassLoader oldTCCL = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(component.getComponentClass()); return viewInstanceFactory.createViewInstance(this, contextData); } finally { // reset the TCCL WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTCCL); } }
public ManagedReference getReference(final Object instance) { if (component == null) { synchronized (this) { if (component == null) { component = (ServiceController<Component>) serviceRegistry.getService(serviceName); } } } if (component == null) { return null; } return new ComponentManagedReference(component.getValue().createInstance(instance)); }
@Override public void release() { try { InterceptorContext interceptorContext = new InterceptorContext(); interceptorContext.putPrivateData(ComponentView.class, componentView); interceptorContext.putPrivateData(Component.class, component); clientPreDestroyInterceptor.processInvocation(interceptorContext); } catch (Exception e) { ROOT_LOGGER.preDestroyInterceptorFailure(e, component.getComponentClass()); } }
public Object processInvocation(final InterceptorContext context) throws Exception { final AtomicReference<ComponentInstance> componentInstanceReference = this.componentInstanceReference; final Component component = context.getPrivateData(Component.class); final ComponentInstance componentInstance = component.createInstance(); boolean ok = false; try { context.putPrivateData(ComponentInstance.class, componentInstance); componentInstanceReference.set(componentInstance); final Object result = context.proceed(); ok = true; return result; } finally { context.putPrivateData(ComponentInstance.class, null); if (! ok) { componentInstance.destroy(); componentInstanceReference.set(null); } } } }
@Override public String toString() { return "Component view " + viewClass + " for component " + component.getComponentClass(); }
instance = applicationClientComponent.getValue().createInstance();
@Override public String toString() { return "Component view " + viewClass + " for component " + component.getComponentClass(); }
@Override public ManagedReference getReference() { if (component == null) { synchronized (this) { if (component == null) { component = (ServiceController<Component>) serviceRegistry.getService(serviceName); } } } if (view == null && viewServiceName != null) { synchronized (this) { if (view == null) { view = (ServiceController<ViewService.View>) serviceRegistry.getService(viewServiceName); } } } if (component == null) { return null; } if(view == null) { return new ComponentManagedReference(component.getValue().createInstance()); } else { try { return view.getValue().createInstance(); } catch (Exception e) { throw new RuntimeException(e); } } }
@Override public String toString() { return "Component view " + viewClass + " for component " + component.getComponentClass(); }