protected SessionID createSession(final EJBReceiverSessionCreationContext receiverContext) throws Exception { final StatelessEJBLocator<?> statelessLocator = receiverContext.getClientInvocationContext().getLocator().asStateless(); final EjbDeploymentInformation ejbInfo = findBean(statelessLocator); final EJBComponent component = ejbInfo.getEjbComponent(); if (!(component instanceof StatefulSessionComponent)) { throw EjbLogger.ROOT_LOGGER.notStatefulSessionBean(statelessLocator.getAppName(), statelessLocator.getModuleName(), statelessLocator.getDistinctName(), statelessLocator.getBeanName()); } component.waitForComponentStart(); return ((StatefulSessionComponent) component).createSession(); }
final EJBClientInvocationContext invocation = receiverContext.getClientInvocationContext(); final EJBLocator<?> locator = invocation.getLocator(); final EjbDeploymentInformation ejb = findBean(locator); final EJBComponent ejbComponent = ejb.getEjbComponent();
@Override protected boolean exists(final String appName, final String moduleName, final String distinctName, final String beanName) { try { final EjbDeploymentInformation ejbDeploymentInformation = findBean(appName, moduleName, distinctName, beanName); return ejbDeploymentInformation != null; } catch (IllegalArgumentException iae) { return false; } }
@Override protected <T> StatefulEJBLocator<T> openSession(EJBReceiverContext context, Class<T> viewType, String appName, String moduleName, String distinctName, String beanName) throws IllegalArgumentException { final EjbDeploymentInformation ejbInfo = findBean(appName, moduleName, distinctName, beanName); final EJBComponent component = ejbInfo.getEjbComponent(); if (!(component instanceof StatefulSessionComponent)) { throw MESSAGES.notStatefulSessionBean(beanName, appName, moduleName, distinctName); } final StatefulSessionComponent statefulComponent = (StatefulSessionComponent) component; final SessionID sessionID = statefulComponent.createSession(); return new StatefulEJBLocator<T>(viewType, appName, moduleName, beanName, distinctName, sessionID, statefulComponent.getCache().getStrictAffinity(), this.getNodeName()); }
@Override protected void processInvocation(final EJBClientInvocationContext invocation, final EJBReceiverInvocationContext receiverContext) throws Exception { final EJBLocator locator = invocation.getLocator(); final EjbDeploymentInformation ejb = findBean(locator.getAppName(), locator.getModuleName(), locator.getDistinctName(), locator.getBeanName()); final EJBComponent ejbComponent = ejb.getEjbComponent();