@Override public boolean contains(Object o) { return ejbJarDescription.hasComponent((String) o); } };
@Override PopulatingMap<String, Map<ArrayKey, T>> populate() { return new PopulatingMap<String, Map<ArrayKey, T>>() { @Override Map<ArrayKey, T> populate() { return new HashMap<ArrayKey, T>(); } }; } };
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; }
private EjbDeploymentInformation findEJB(final String appName, final String moduleName, final String distinctName, final String beanName) { final DeploymentModuleIdentifier ejbModule = new DeploymentModuleIdentifier(appName, moduleName, distinctName); final Map<DeploymentModuleIdentifier, ModuleDeployment> modules = this.deploymentRepository.getStartedModules(); if (modules == null || modules.isEmpty()) { return null; } final ModuleDeployment moduleDeployment = modules.get(ejbModule); if (moduleDeployment == null) { return null; } return moduleDeployment.getEjbs().get(beanName); }
private EjbDeploymentInformation findBean(final EJBLocator<?> locator) { final String appName = locator.getAppName(); final String moduleName = locator.getModuleName(); final String distinctName = locator.getDistinctName(); final String beanName = locator.getBeanName(); final DeploymentModuleIdentifier moduleIdentifier = new DeploymentModuleIdentifier(appName, moduleName, distinctName); final ModuleDeployment module = deploymentRepository.getModules().get(moduleIdentifier); if (module == null) { throw EjbLogger.ROOT_LOGGER.unknownDeployment(locator); } final EjbDeploymentInformation ejbInfo = module.getEjbs().get(beanName); if (ejbInfo == null) { throw EjbLogger.ROOT_LOGGER.ejbNotFoundInDeployment(locator); } return ejbInfo; }
static EJBModuleIdentifier toModuleIdentifier(final DeploymentModuleIdentifier identifier) { return new EJBModuleIdentifier(identifier.getApplicationName(), identifier.getModuleName(), identifier.getDistinctName()); }
public T getViewAttribute(MethodIntf methodIntf, final Method method) { assert methodIntf != null : "methodIntf is null"; Method classMethod = resolveRealMethod(method); String[] methodParams = MethodInfoHelper.getCanonicalParameterTypes(classMethod); final String methodName = classMethod.getName(); ArrayKey methodParamsKey = new ArrayKey((Object[]) methodParams); T attr = get(get(get(perViewStyle3, methodIntf), methodName), methodParamsKey); if (attr != null) return attr; attr = get(get(perViewStyle2, methodIntf), methodName); if (attr != null) return attr; attr = get(perViewStyle1, methodIntf); if (attr != null) return attr; return null; }
public T getAttributeStyle3(MethodIntf methodIntf, final String className, String methodName, String... methodParams) { ArrayKey methodParamsKey = new ArrayKey((Object[]) methodParams); if (methodIntf == null) return style3.pick(className).pick(methodName).get(methodParamsKey); else return perViewStyle3.pick(methodIntf).pick(methodName).get(methodParamsKey); }
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(); } } } }
@Override public void start(StartContext context) throws StartException { deploymentRepository.getValue().add(identifier, ModuleDeployment.this); }
@Override public void stop(StopContext context) { deploymentRepository.getValue().remove(identifier); }
public T getAttributeStyle2(MethodIntf methodIntf, String methodName) { if (methodIntf == null) return style2.get(methodName); else return perViewStyle2.pick(methodIntf).get(methodName); }
public T getAttribute(MethodIntf methodIntf, Method method) { return getAttribute(methodIntf, method, null); }
@Override public void addListener(final DeploymentRepositoryListener listener) { synchronized (this) { listeners.add(listener); } listener.listenerAdded(this); }
@Override public void run() { deploymentRepository.getValue().startDeployment(identifier); } };
protected static EjbJarDescription getEjbJarDescription(final DeploymentUnit deploymentUnit) { EjbJarDescription ejbJarDescription = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_DESCRIPTION); final EEApplicationClasses applicationClassesDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_APPLICATION_CLASSES_DESCRIPTION); if (ejbJarDescription == null) { final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); ejbJarDescription = new EjbJarDescription(moduleDescription, deploymentUnit.getName().endsWith(".war")); deploymentUnit.putAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_DESCRIPTION, ejbJarDescription); } return ejbJarDescription; }
/** * Style 3 (13.3.7.2.1 @3) * * @param methodIntf the method-intf the annotations apply to or null if EJB class itself * @param transactionAttribute * @param methodName * @param methodParams */ public void setAttribute(MethodIntf methodIntf, T transactionAttribute, final String className, String methodName, String... methodParams) { ArrayKey methodParamsKey = new ArrayKey((Object[]) methodParams); if (methodIntf == null) style3.pick(className).pick(methodName).put(methodParamsKey, transactionAttribute); else perViewStyle3.pick(methodIntf).pick(methodName).put(methodParamsKey, transactionAttribute); }
@Override PopulatingMap<String, Map<ArrayKey, T>> populate() { return new PopulatingMap<String, Map<ArrayKey, T>>() { @Override Map<ArrayKey, T> populate() { return new HashMap<ArrayKey, T>(); } }; } };
/** * Style 2 (13.3.7.2.1 @2) * * @param methodIntf the method-intf the annotations apply to or null if EJB class itself * @param transactionAttribute * @param methodName */ public void setAttribute(MethodIntf methodIntf, T transactionAttribute, String methodName) { if (methodIntf == null) style2.put(methodName, transactionAttribute); else perViewStyle2.pick(methodIntf).put(methodName, transactionAttribute); }