@Override public Object processInvocation(InterceptorContext context) throws Exception { final ComponentView componentView = context.getPrivateData(ComponentView.class); if (componentView == null) { throw EjbLogger.ROOT_LOGGER.componentViewNotAvailableInContext(context); } return "Proxy for view class: " + componentView.getViewClass().getName() + " of EJB: " + name; } }
public Class<?> getInvokedBusinessInterface() throws IllegalStateException { final InterceptorContext invocation = CurrentInvocationContext.get(); final ComponentView view = invocation.getPrivateData(ComponentView.class); if (view.getViewClass().equals(getComponent().getEjbObjectType()) || view.getViewClass().equals(getComponent().getEjbLocalObjectType())) { throw EjbLogger.ROOT_LOGGER.cannotCall("getInvokedBusinessInterface", "EjbObject", "EJBLocalObject"); } return view.getViewClass(); }
public Class<?> getEjbLocalObjectType() { if (ejbLocalObjectViewServiceName == null) { return null; } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(ejbLocalObjectViewServiceName); final ComponentView view = (ComponentView) serviceController.getValue(); return view.getViewClass(); }
public Class<?> getEjbObjectType() { if (ejbObjectViewServiceName == null) { return null; } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(ejbObjectViewServiceName); final ComponentView view = (ComponentView) serviceController.getValue(); return view.getViewClass(); }
@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) throws Exception { SessionID sessionID = (SessionID) contextData.get(SessionID.class); final StatefulEJBLocator<?> statefulEJBLocator; final StatefulSessionComponent statefulSessionComponent = (StatefulSessionComponent) componentView.getComponent(); if (sessionID == null) { statefulEJBLocator = EJBClient.createSession(StatelessEJBLocator.create(componentView.getViewClass(), identifier, Affinity.LOCAL)); } else { statefulEJBLocator = StatefulEJBLocator.create(componentView.getViewClass(), identifier, sessionID, statefulSessionComponent.getCache().getStrictAffinity()); } final Object ejbProxy = EJBClient.createProxy(statefulEJBLocator); return new ValueManagedReference(new ImmediateValue<Object>(ejbProxy)); }
@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) { Object value = EJBClient.createProxy(new EJBHomeLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName, Affinity.LOCAL)); return new ValueManagedReference(new ImmediateValue(value)); }
@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) { Object value = EJBClient.createProxy(StatelessEJBLocator.create(componentView.getViewClass(), identifier, Affinity.LOCAL)); return new ValueManagedReference(new ImmediateValue<>(value)); }
String viewClassOfInvokedMethod = componentView.getViewClass().getName();
public EJBHome getEJBHome() throws IllegalStateException { if (ejbHomeViewServiceName == null) { throw EjbLogger.ROOT_LOGGER.beanHomeInterfaceIsNull(getComponentName()); } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(ejbHomeViewServiceName); final ComponentView view = (ComponentView) serviceController.getValue(); final String locatorAppName = earApplicationName == null ? "" : earApplicationName; return EJBClient.createProxy(createHomeLocator(view.getViewClass().asSubclass(EJBHome.class), locatorAppName, moduleName, getComponentName(), distinctName)); }
final String viewClassOfInvokedMethod = componentView.getViewClass().getName();
@Override public EJBObject run() { return EJBClient.createProxy(new StatefulEJBLocator<EJBObject>((Class<EJBObject>) view.getViewClass(), locatorAppName, getModuleName(), getComponentName(), getDistinctName(), getSessionIdOf(ctx), getCache().getStrictAffinity())); } });
if (component instanceof StatelessSessionComponent) { ejbMetaData = new EJBMetaDataImplIIOP(remoteView.getValue().getViewClass(), homeView.getValue().getViewClass(), null, true, true, homeHandle); } else { ejbMetaData = new EJBMetaDataImplIIOP(remoteView.getValue().getViewClass(), homeView.getValue().getViewClass(), null, true, false, homeHandle); WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader()); try { DynamicStubFactoryFactory.makeStubClass(homeView.getValue().getViewClass()); } catch (Exception e) { EjbLogger.ROOT_LOGGER.dynamicStubCreationFailed(homeView.getValue().getViewClass().getName(), e); DynamicStubFactoryFactory.makeStubClass(remoteView.getValue().getViewClass()); } catch (Exception e) { EjbLogger.ROOT_LOGGER.dynamicStubCreationFailed(remoteView.getValue().getViewClass().getName(), e);
@SuppressWarnings("unchecked") @Override public EJBObject getEJBObject(final InterceptorContext ctx) throws IllegalStateException { if (getEjbObjectViewServiceName() == null) { throw EjbLogger.ROOT_LOGGER.beanComponentMissingEjbObject(getComponentName(), "EJBObject"); } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(getEjbObjectViewServiceName()); final ComponentView view = (ComponentView) serviceController.getValue(); final String locatorAppName = getEarApplicationName() == null ? "" : getEarApplicationName(); if(WildFlySecurityManager.isChecking()) { //need to use doPrivileged rather than doUnchecked, as this can run user code in the proxy constructor return AccessController.doPrivileged(new PrivilegedAction<EJBObject>() { @Override public EJBObject run() { return EJBClient.createProxy(new StatefulEJBLocator<EJBObject>((Class<EJBObject>) view.getViewClass(), locatorAppName, getModuleName(), getComponentName(), getDistinctName(), getSessionIdOf(ctx), getCache().getStrictAffinity())); } }); } else { return EJBClient.createProxy(new StatefulEJBLocator<EJBObject>((Class<EJBObject>) view.getViewClass(), locatorAppName, getModuleName(), getComponentName(), getDistinctName(), getSessionIdOf(ctx), this.getCache().getStrictAffinity())); } }
@Override public Object processInvocation(InterceptorContext context) throws Exception { final ComponentView componentView = context.getPrivateData(ComponentView.class); if (componentView == null) { throw MESSAGES.componentViewNotAvailableInContext(context); } return "Proxy for view class: " + componentView.getViewClass().getName() + " of EJB: " + name; } }
public Class<?> getInvokedBusinessInterface() throws IllegalStateException { final InterceptorContext invocation = CurrentInvocationContext.get(); final ComponentView view = invocation.getPrivateData(ComponentView.class); if (view.getViewClass().equals(getComponent().getEjbObjectType()) || view.getViewClass().equals(getComponent().getEjbLocalObjectType())) { throw MESSAGES.cannotCall("getInvokedBusinessInterface", "EjbObject", "EJBLocalObject"); } return view.getViewClass(); }
public Class<?> getEjbObjectType() { if (ejbObjectViewServiceName == null) { return null; } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(ejbObjectViewServiceName); final ComponentView view = (ComponentView) serviceController.getValue(); return view.getViewClass(); }
@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) { Object value = EJBClient.createProxy(new EJBHomeLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName)); return new ValueManagedReference(new ImmediateValue(value)); }
@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) { Object value = EJBClient.createProxy(new StatelessEJBLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName)); return new ValueManagedReference(new ImmediateValue(value)); }
public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) throws Exception { Object primaryKey = contextData.get(EntityBeanComponent.PRIMARY_KEY_CONTEXT_KEY); if (primaryKey == null) { primaryKey = invokeCreate(componentView.getComponent(), contextData); } Object value = EJBClient.createProxy(new EntityEJBLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName, primaryKey)); return new ValueManagedReference(new ImmediateValue(value)); }
public EJBHome getEJBHome() throws IllegalStateException { if (ejbHomeViewServiceName == null) { throw MESSAGES.beanHomeInterfaceIsNull(getComponentName()); } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(ejbHomeViewServiceName); final ComponentView view = (ComponentView) serviceController.getValue(); final String locatorAppName = earApplicationName == null ? "" : earApplicationName; return EJBClient.createProxy(new EJBHomeLocator<EJBHome>((Class<EJBHome>) view.getViewClass(), locatorAppName, moduleName, getComponentName(), distinctName)); }