@Override public EnterpriseBean[] getEnterpriseBeans() { return super.getEnterpriseBeans(); }
@Override public EnterpriseBean[] getEnterpriseBeans() { return super.getEnterpriseBeans(); }
private boolean isLocalBean(Class clazz) { DeploymentModule module = getModule(); if (module instanceof EjbModule) { Set<String> localbeans = new HashSet<String>(); EjbModule ejbModule = (EjbModule) module; for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (bean instanceof SessionBean) { if (((SessionBean) bean).getLocalBean() != null) { localbeans.add(bean.getEjbClass()); } } } if (localbeans.contains(clazz.getName())) { return true; } } return false; }
public void validate(EjbModule ejbModule) { for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { String beanType = getType(bean); if (beanType.equals("Stateful")) continue; // skip statefuls for (PersistenceContextRef ref : bean.getPersistenceContextRef()) { if (isExtented(ref)) { String refName = ref.getName(); String prefix = bean.getEjbClass() + "/"; if (refName.startsWith(prefix)) { refName = refName.substring(prefix.length()); } fail(bean, "persistenceContextExtented.nonStateful", refName, beanType); } } } }
/** * Test if a module contains CMP entity beans that will * need a JPA mapping generated. * * @param appModule The source application module. * * @return true if the module contains any entity beans * using container managed persistence. */ private boolean hasCmpEntities(AppModule appModule) { for (EjbModule ejbModule : appModule.getEjbModules()) { for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (isCmpEntity(bean)) return true; } } return false; }
/** * Test if a module contains CMP entity beans that will * need a JPA mapping generated. * * @param appModule The source application module. * @return true if the module contains any entity beans * using container managed persistence. */ private boolean hasCmpEntities(final AppModule appModule) { for (final EjbModule ejbModule : appModule.getEjbModules()) { for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (isCmpEntity(bean)) { return true; } } } return false; }
/** * Test if a module contains CMP entity beans that will * need a JPA mapping generated. * * @param appModule The source application module. * @return true if the module contains any entity beans * using container managed persistence. */ private boolean hasCmpEntities(final AppModule appModule) { for (final EjbModule ejbModule : appModule.getEjbModules()) { for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (isCmpEntity(bean)) { return true; } } } return false; }
public void validate(final EjbModule ejbModule) { for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (bean.getTransactionType() == CONTAINER) { final Collection<ResourceEnvRef> resRefs = bean.getResourceEnvRef(); for (final ResourceEnvRef resRef : resRefs) { if ("javax.transaction.UserTransaction".equals(resRef.getResourceEnvRefType())) { fail(bean, "userTransactionRef.forbiddenForCmtdBeans", resRef.getName()); } } } } } }
public void validate(final EjbModule ejbModule) { for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (bean.getTransactionType() == CONTAINER) { final Collection<ResourceEnvRef> resRefs = bean.getResourceEnvRef(); for (final ResourceEnvRef resRef : resRefs) { if ("javax.transaction.UserTransaction".equals(resRef.getResourceEnvRefType())) { fail(bean, "userTransactionRef.forbiddenForCmtdBeans", resRef.getName()); } } } } } }
public void validate(EjbModule ejbModule) { for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (bean.getTransactionType() == CONTAINER) { Collection<ResourceEnvRef> resRefs = bean.getResourceEnvRef(); for (ResourceEnvRef resRef : resRefs) { if ("javax.transaction.UserTransaction".equals(resRef.getResourceEnvRefType())) { fail(bean, "userTransactionRef.forbiddenForCmtdBeans", resRef.getName()); } } } } } }
@Override public AppModule deploy(final AppModule appModule) throws OpenEJBException { for (final EjbModule ejbModule : appModule.getEjbModules()) { final ClassLoader classLoader = ejbModule.getClassLoader(); for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (bean.getEjbClass() == null) { continue; } try { final Class<?> clazz = classLoader.loadClass(bean.getEjbClass()); process(clazz, bean); } catch (final ClassNotFoundException e) { // skip, we'll get this in validation } } } return appModule; }
@Override public AppModule deploy(final AppModule appModule) throws OpenEJBException { for (final EjbModule ejbModule : appModule.getEjbModules()) { final ClassLoader classLoader = ejbModule.getClassLoader(); for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (bean.getEjbClass() == null) { continue; } try { final Class<?> clazz = classLoader.loadClass(bean.getEjbClass()); process(clazz, bean); } catch (final ClassNotFoundException e) { // skip, we'll get this in validation } } } return appModule; }
public void buildComponentPermissions(ComponentPermissions componentPermissions) throws DeploymentException { List<MethodPermission> methodPermissions = ejbModule.getEjbJar().getAssemblyDescriptor().getMethodPermission(); if (earContext.getSecurityConfiguration() != null) { earContext.setHasSecurity(true); } if (earContext.getSecurityConfiguration() == null && methodPermissions.size() > 0) { throw new DeploymentException("Ejb app has method permissions but no security configuration supplied in geronimo plan"); } for (EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) { addSecurityData(enterpriseBean, componentPermissions); } }
public AppModule deploy(final AppModule appModule) throws OpenEJBException { for (final EjbModule ejbModule : appModule.getEjbModules()) { for (final JndiConsumer consumer : ejbModule.getEjbJar().getEnterpriseBeans()) { clearEmptyMappedName(consumer); } } for (final ClientModule clientModule : appModule.getClientModules()) { clearEmptyMappedName(clientModule.getApplicationClient()); } for (final WebModule webModule : appModule.getWebModules()) { clearEmptyMappedName(webModule.getWebApp()); } return appModule; }
public AppModule deploy(AppModule appModule) throws OpenEJBException { for (EjbModule ejbModule : appModule.getEjbModules()) { for (JndiConsumer consumer : ejbModule.getEjbJar().getEnterpriseBeans()) { clearEmptyMappedName(consumer); } } for (ClientModule clientModule : appModule.getClientModules()) { clearEmptyMappedName(clientModule.getApplicationClient()); } for (WebModule webModule : appModule.getWebModules()) { clearEmptyMappedName(webModule.getWebApp()); } return appModule; }
public void addTimeoutInterceptor(@Observes final BeforeAppInfoBuilderEvent event) { LOGGER.fine(GovernanceCodes.EXTENSION_ADDING_INTERCEPTOR, "Adding governance interceptor to application > " + event.getAppModule().getModuleId()); final List<EjbModule> ejbModules = event.getAppModule().getEjbModules(); for (final EjbModule ejbModule : ejbModules) { if (ejbModule.getEjbJar().getEnterpriseBeans().length > 0) { final InterceptorBinding binding = new InterceptorBinding(); binding.setEjbName("*"); binding.getInterceptorClass().add(TimeoutGovernanceInterceptor.class.getName()); ejbModule.getEjbJar().getAssemblyDescriptor().addInterceptorBinding(binding); final Interceptor interceptor = new Interceptor(); interceptor.setInterceptorClass(TimeoutGovernanceInterceptor.class.getName()); interceptor.addAroundTimeout("timeout"); ejbModule.getEjbJar().addInterceptor(interceptor); } } } }
public AppModule deploy(final AppModule appModule) throws OpenEJBException { for (final EjbModule ejbModule : appModule.getEjbModules()) { for (final JndiConsumer consumer : ejbModule.getEjbJar().getEnterpriseBeans()) { clearEmptyMappedName(consumer); } } for (final ClientModule clientModule : appModule.getClientModules()) { clearEmptyMappedName(clientModule.getApplicationClient()); } for (final WebModule webModule : appModule.getWebModules()) { clearEmptyMappedName(webModule.getWebApp()); } return appModule; }
public void validate(EjbModule ejbModule) { for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (!(bean instanceof RemoteBean)) continue; RemoteBean b = (RemoteBean) bean; if (b.getHome() != null) { check_remoteInterfaceMethods(b); check_homeInterfaceMethods(b); } if (b.getLocalHome() != null) { check_localInterfaceMethods(b); check_localHomeInterfaceMethods(b); } check_unusedCreateMethods(b); check_unusedPostCreateMethods(b); } }
public void validate(final EjbModule ejbModule) { for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (!(bean instanceof RemoteBean)) { continue; } final RemoteBean b = (RemoteBean) bean; if (b.getHome() != null) { check_remoteInterfaceMethods(b); check_homeInterfaceMethods(b); } if (b.getLocalHome() != null) { check_localInterfaceMethods(b); check_localHomeInterfaceMethods(b); } check_unusedCreateMethods(b); check_unusedPostCreateMethods(b); } }
public void validate(final EjbModule ejbModule) { for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (!(bean instanceof RemoteBean)) { continue; } final RemoteBean b = (RemoteBean) bean; if (b.getHome() != null) { check_remoteInterfaceMethods(b); check_homeInterfaceMethods(b); } if (b.getLocalHome() != null) { check_localInterfaceMethods(b); check_localHomeInterfaceMethods(b); } check_unusedCreateMethods(b); check_unusedPostCreateMethods(b); } }