public Class<?> getEjbObjectType() { if (ejbObjectViewServiceName == null) { return null; } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(ejbObjectViewServiceName); final ComponentView view = (ComponentView) serviceController.getValue(); 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(); }
protected <T> T createViewInstanceProxy(final Class<T> viewInterface, final Map<Object, Object> contextData, final ServiceName serviceName) { final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(serviceName); final ComponentView view = (ComponentView) serviceController.getValue(); final ManagedReference instance; try { if(WildFlySecurityManager.isChecking()) { instance = WildFlySecurityManager.doUnchecked(new PrivilegedExceptionAction<ManagedReference>() { @Override public ManagedReference run() throws Exception { return view.createInstance(contextData); } }); } else { instance = view.createInstance(contextData); } } catch (Exception e) { //TODO: do we need to let the exception propagate here? throw new RuntimeException(e); } return viewInterface.cast(instance.getInstance()); }
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)); }
protected <T> T createViewInstanceProxy(final Class<T> viewInterface, final Map<Object, Object> contextData, final ServiceName serviceName) { final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(serviceName); final ComponentView view = (ComponentView) serviceController.getValue(); final ManagedReference instance; try { instance = view.createInstance(contextData); } catch (Exception e) { //TODO: do we need to let the exception propagate here? throw new RuntimeException(e); } return viewInterface.cast(instance.getInstance()); }
public Class<?> getEjbObjectType() { if (ejbObjectViewServiceName == null) { return null; } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(ejbObjectViewServiceName); final ComponentView view = (ComponentView) serviceController.getValue(); 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 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)); }