public StatefulSessionBeanSerializabilityChecker(ModuleDeployment deployment) { // Find component classes of any stateful components and any superclasses for (EjbDeploymentInformation info: deployment.getEjbs().values()) { EJBComponent component = info.getEjbComponent(); if (component instanceof StatefulSessionComponent) { Class<?> componentClass = component.getComponentClass(); while (componentClass != Object.class) { this.serializableClasses.add(componentClass); componentClass = componentClass.getSuperclass(); } } } }
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 EJBLocator<?> locator = invocation.getLocator(); final EjbDeploymentInformation ejb = findBean(locator); final EJBComponent ejbComponent = ejb.getEjbComponent();
return CancelHandle.NULL; final Component component = ejbDeploymentInformation.getEjbComponent(); component.waitForComponentStart(); if (!(component instanceof StatefulSessionComponent)) {
@Override public void processMessage(ChannelAssociation channelAssociation, MessageInputStream messageInputStream) throws IOException { if (messageInputStream == null) { throw EjbMessages.MESSAGES.messageInputStreamCannotBeNull(); } final DataInputStream dataInputStream = new DataInputStream(messageInputStream); // read invocation id final short invocationId = dataInputStream.readShort(); final String appName = dataInputStream.readUTF(); final String moduleName = dataInputStream.readUTF(); final String distinctName = dataInputStream.readUTF(); final String beanName = dataInputStream.readUTF(); final EjbDeploymentInformation ejbDeploymentInformation = this.findEJB(appName, moduleName, distinctName, beanName); if (ejbDeploymentInformation == null) { this.writeNoSuchEJBFailureMessage(channelAssociation, invocationId, appName, moduleName, distinctName, beanName, null); return; } final Component component = ejbDeploymentInformation.getEjbComponent(); if (!(component instanceof StatefulSessionComponent)) { final String failureMessage = EjbMessages.MESSAGES.notStatefulSessionBean(beanName, appName, moduleName, distinctName).getLocalizedMessage(); this.writeInvocationFailure(channelAssociation, HEADER_EJB_NOT_STATEFUL, invocationId, failureMessage); return; } final StatefulSessionComponent statefulSessionComponent = (StatefulSessionComponent) component; // generate the session id and write out the response on a separate thread executorService.submit(new SessionIDGeneratorTask(statefulSessionComponent, channelAssociation, invocationId)); }
@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()); }
final EJBLocator locator = invocation.getLocator(); final EjbDeploymentInformation ejb = findBean(locator.getAppName(), locator.getModuleName(), locator.getDistinctName(), locator.getBeanName()); final EJBComponent ejbComponent = ejb.getEjbComponent();