final EjbDeploymentInformation info = new EjbDeploymentInformation(ejbComponentDescription.getEJBName(), componentInjectedValue, remoteViews, localViews, module.getClassLoader(), iorFactory); deploymentInformationMap.put(ejbComponentDescription.getEJBName(), info);
final EJBLocator<?> locator = invocation.getLocator(); final EjbDeploymentInformation ejb = findBean(locator); final EJBComponent ejbComponent = ejb.getEjbComponent(); final ComponentView view = ejb.getView(viewClass.getName()); if (view == null) { throw EjbLogger.ROOT_LOGGER.viewNotFound(viewClass.getName(), ejb.getEjbName()); if (!ejb.isRemoteView(viewClass.getName())) { throw EjbLogger.ROOT_LOGGER.viewNotFound(viewClass.getName(), ejb.getEjbName()); paramConfig.setClassCloner(new ClassLoaderClassCloner(ejb.getDeploymentClassLoader())); final ObjectCloner parameterCloner = createCloner(paramConfig);
private EjbIIOPService serviceForLocator(final EJBLocator<?> locator, DeploymentRepository deploymentRepository) { final ModuleDeployment module = deploymentRepository.getModules().get(new DeploymentModuleIdentifier(locator.getAppName(), locator.getModuleName(), locator.getDistinctName())); if (module == null) { EjbLogger.ROOT_LOGGER.couldNotFindEjbForLocatorIIOP(locator); return null; } final EjbDeploymentInformation ejb = module.getEjbs().get(locator.getBeanName()); if (ejb == null) { EjbLogger.ROOT_LOGGER.couldNotFindEjbForLocatorIIOP(locator); return null; } final EjbIIOPService factory = ejb.getIorFactory(); if (factory == null) { EjbLogger.ROOT_LOGGER.ejbNotExposedOverIIOP(locator); return null; } return factory; }
final ClassLoader classLoader = ejbDeploymentInformation.getDeploymentClassLoader(); if (!ejbDeploymentInformation.isRemoteView(viewClassName)) { invocationRequest.writeWrongViewType(); return CancelHandle.NULL; final ComponentView componentView = ejbDeploymentInformation.getView(viewClassName);
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(); } } } }
try { SecurityActions.setContextClassLoader(ejbDeploymentInformation.getDeploymentClassLoader()); classResolver.switchClassLoader(ejbDeploymentInformation.getDeploymentClassLoader()); if (!ejbDeploymentInformation.isRemoteView(viewClassName)) { this.writeNoSuchEJBFailureMessage(channelAssociation, invocationId, appName, moduleName, distinctName, beanName, viewClassName); return; final ComponentView componentView = ejbDeploymentInformation.getView(viewClassName); final Method invokedMethod = this.findMethod(componentView, methodName, methodParamTypes); if (invokedMethod == null) {
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.getAppName(), locator.getModuleName(), locator.getDistinctName(), locator.getBeanName()); final EJBComponent ejbComponent = ejb.getEjbComponent(); final ComponentView view = ejb.getView(viewClass.getName()); if (view == null) { throw MESSAGES.viewNotFound(viewClass.getName(), ejb.getEjbName()); if (!ejb.isRemoteView(viewClass.getName())) { throw MESSAGES.viewNotFound(viewClass.getName(), ejb.getEjbName()); paramConfig.setClassCloner(new ClassLoaderClassCloner(ejb.getDeploymentClassLoader())); final ObjectCloner parameterCloner = ObjectCloners.getSerializingObjectClonerFactory().createCloner(paramConfig);
return CancelHandle.NULL; final Component component = ejbDeploymentInformation.getEjbComponent(); component.waitForComponentStart(); if (!(component instanceof StatefulSessionComponent)) {
private EjbIIOPService serviceForLocator(final EJBLocator locator, DeploymentRepository deploymentRepository) { final ModuleDeployment module = deploymentRepository.getModules().get(new DeploymentModuleIdentifier(locator.getAppName(), locator.getModuleName(), locator.getDistinctName())); if (module == null) { EjbLogger.ROOT_LOGGER.couldNotFindEjbForLocatorIIOP(locator); return null; } final EjbDeploymentInformation ejb = module.getEjbs().get(locator.getBeanName()); if (ejb == null) { EjbLogger.ROOT_LOGGER.couldNotFindEjbForLocatorIIOP(locator); return null; } final EjbIIOPService factory = ejb.getIorFactory(); if (factory == null) { EjbLogger.ROOT_LOGGER.ejbNotExposedOverIIOP(locator); return null; } return factory; }
final EjbDeploymentInformation info = new EjbDeploymentInformation(ejbComponentDescription.getEJBName(), componentInjectedValue, remoteViews, localViews, module.getClassLoader(), iorFactory); deploymentInformationMap.put(ejbComponentDescription.getEJBName(), info);
@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()); }