org.apache.geronimo.j2ee.deployment.Module类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(16.0k)|赞(0)|评价(0)|浏览(164)

本文整理了Java中org.apache.geronimo.j2ee.deployment.Module类的一些代码示例,展示了Module类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module类的具体详情如下:
包路径:org.apache.geronimo.j2ee.deployment.Module
类名称:Module

Module介绍

暂无

代码示例

代码示例来源:origin: org.apache.geronimo.modules/geronimo-openejb-builder

  1. installModule(module, earContext);
  2. EARContext moduleContext;
  3. if (module.isStandAlone()) {
  4. moduleContext = earContext;
  5. earContext.addToClassPath(DEFAULT_BUNDLE_CLASSPATH);
  6. module.setEarContext(moduleContext);
  7. module.setRootEarContext(earContext);
  8. if (((EjbModule) module).getEjbJar().getAssemblyDescriptor() != null) {
  9. namingBuilder.buildEnvironment(null, null, module.getEnvironment());
  10. LinkedHashSet<Module<?,?>> modules = module.getModules();
  11. for (Module<?,?> subModule: modules) {
  12. if (subModule instanceof EjbModule) {
  13. subModule.setEarContext(module.getEarContext());
  14. subModule.setRootEarContext(module.getRootEarContext());
  15. earContext = module.getEarContext();

代码示例来源:origin: org.apache.geronimo.modules/geronimo-concurrent-builder

  1. private ResourceReferenceFactory buildManagedObjectReference(Module module, AbstractNameQuery containerId, Class iface) throws DeploymentException {
  2. Configuration localConfiguration = module.getEarContext().getConfiguration();
  3. try {
  4. // first, lookup in configuration
  5. localConfiguration.findGBean(containerId);
  6. } catch (GBeanNotFoundException e) {
  7. // second, lookup in kernel
  8. Set results = this.kernel.listGBeans(containerId);
  9. if (results == null || results.isEmpty()) {
  10. throw new DeploymentException("Cannot resolve managed object ref " + containerId);
  11. } else if (results.size() > 1) {
  12. throw new DeploymentException("Managed object ref resolved to multiple results " + containerId);
  13. }
  14. }
  15. return new ResourceReferenceFactory(module.getConfigId(), containerId, iface, module.getModuleName());
  16. }

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat-builder

  1. public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
  2. WebAppType webApp = (WebAppType) module.getSpecDD();
  3. // MessageDestinationType[] messageDestinations = webApp.getMessageDestinationArray();
  4. TomcatWebAppType gerWebApp = (TomcatWebAppType) module.getVendorDD();
  5. // GerMessageDestinationType[] gerMessageDestinations = gerWebApp.getMessageDestinationArray();
  6. // ENCConfigBuilder.registerMessageDestinations(earContext, module.getName(), messageDestinations, gerMessageDestinations);
  7. getNamingBuilders().initContext(webApp, gerWebApp, module.getEarContext().getConfiguration(), earContext.getConfiguration(), module);
  8. if ((webApp.getSecurityConstraintArray().length > 0 || webApp.getSecurityRoleArray().length > 0) &&
  9. !gerWebApp.isSetSecurityRealmName()) {
  10. throw new DeploymentException("web.xml for web app " + module.getName() + " includes security elements but Geronimo deployment plan is not provided or does not contain <security-realm-name> element necessary to configure security accordingly.");
  11. }
  12. boolean hasSecurityRealmName = gerWebApp.isSetSecurityRealmName();
  13. buildSubstitutionGroups(gerWebApp, hasSecurityRealmName, module, earContext);
  14. }

代码示例来源:origin: org.apache.geronimo.modules/geronimo-web-2.5-builder

  1. protected static Map<JndiKey, Map<String, Object>> shareJndi(Module parent) {
  2. return Module.share(Module.APP, parent == null ? null : parent.getJndiContext());
  3. }

代码示例来源:origin: org.apache.geronimo.modules/geronimo-jaxws-builder

  1. protected Set<String> getEJBWebServiceClassNames(Module module) {
  2. if (module.getModules().size() == 0) {
  3. return Collections.<String> emptySet();
  4. }
  5. Set<String> ejbWebServiceClassNames = new HashSet<String>();
  6. for (Module subModule : (LinkedHashSet<Module<?, ?>>) module.getModules()) {
  7. if (subModule.getType() == ConfigurationModuleType.EJB) {
  8. Set<String> currentEJBWebServiceClassNames = (Set<String>) subModule.getSharedContext().get(EJB_WEB_SERVICE_CLASS_NAMES);
  9. if (ejbWebServiceClassNames != null) {
  10. ejbWebServiceClassNames.addAll(currentEJBWebServiceClassNames);
  11. }
  12. }
  13. }
  14. return ejbWebServiceClassNames;
  15. }

代码示例来源:origin: org.apache.geronimo.modules/geronimo-jaxws-builder

  1. public static void getModuleClasspath(Module module, DeploymentContext context, LinkedHashSet<URL> classpath) throws Exception {
  2. getModuleClasspath(module.getEarContext(), classpath);
  3. if (module.getRootEarContext() != module.getEarContext()) {
  4. getModuleClasspath(module.getRootEarContext(), classpath);
  5. }
  6. }

代码示例来源:origin: org.apache.geronimo.modules/geronimo-connector-builder-1_6

  1. AbstractName validatorName = module.getEarContext().getNaming().createChildName(module.getModuleName(), "ValidatorFactory", NameFactory.VALIDATOR_FACTORY);
  2. connector = mergeMetadata(bundle, classFinder, connector);
  3. addExportPackages(connector, module.getEnvironment(), bundle);
  4. AbstractName resourceAdapterjsr77Name = earContext.getNaming().createChildName(resourceAdapterModuleName, module.getName(), NameFactory.RESOURCE_ADAPTER);
  5. AbstractName jcaResourcejsr77Name = earContext.getNaming().createChildName(resourceAdapterjsr77Name, module.getName(), NameFactory.JCA_RESOURCE);
  6. resourceAdapterModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
  7. resourceAdapterModuleData.setAttribute("displayName", connector.getDisplayName());
  8. resourceAdapterModuleData.setAttribute("description", connector.getDescription());
  9. GerConnectorType geronimoConnector = (GerConnectorType) module.getVendorDD();

代码示例来源:origin: org.apache.geronimo.modules/geronimo-connector-builder-1_6

  1. public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
  2. if ((module != null) && (module.getClassFinder() != null)) {
  3. ResourceAnnotationHelper.processAnnotations(specDD, module.getClassFinder(), ResourceRefProcessor.INSTANCE);
  4. log.warn("Unable to process @Resource annotations for module" + module.getName(), e);
  5. Map<String, GerResourceRefType> refMap = mapResourceRefs(gerResourceRefsUntyped);
  6. List<String> unresolvedRefs = new ArrayList<String>();
  7. Bundle bundle = module.getEarContext().getDeploymentBundle();
  8. for (Map.Entry<String, ResourceRef> entry : specDD.getResourceRefMap().entrySet()) {
  9. String name = entry.getKey();
  10. unresolvedRefs.add(name);
  11. } else {
  12. put(name, value, ReferenceType.RESOURCE, module.getJndiContext(), resourceRef.getInjectionTarget(), sharedContext);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-persistence-jpa20-builder

  1. AbstractName childName = module.getEarContext().getNaming().createChildName(module.getModuleName(), persistenceUnitName, NameFactory.PERSISTENCE_UNIT);
  2. persistenceUnitNameQuery = new AbstractNameQuery(null, childName.getName(), PERSISTENCE_UNIT_INTERFACE_TYPES);
  3. try {

代码示例来源:origin: org.apache.geronimo.modules/geronimo-persistence-jpa20-builder

  1. public void initContext(EARContext earContext, Module module, Bundle bundle) throws DeploymentException {
  2. if (module.getDeployable() instanceof DeployableBundle) {
  3. return;
  4. XmlObject container = (XmlObject) module.getVendorDD();
  5. XmlObject[] raws = container.selectChildren(PERSISTENCE_QNAME);
  6. if (!module.isStandAlone() && module.getType() == ConfigurationModuleType.WAR) {
  7. resolveWARcp = true;
  8. final Collection<String> manifestcp = module.getClassPath();
  9. for (String classpath : manifestcp) {
  10. if (resolveWARcp) {
  11. manifestcpCopy.add(module.resolve(classpath).toString());
  12. } else {
  13. manifestcpCopy.add(classpath);
  14. if (module.isStandAlone() && module.getType() == ConfigurationModuleType.EJB) {
  15. manifestcpCopy.add("");
  16. EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), defaultEnvironment);
  17. GBeanData data = installPersistenceUnitGBean(persistenceUnit, module, module.getTargetPath());
  18. respectExcludeUnlistedClasses(data);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-j2ee-builder

  1. Map<JndiKey, Map<String, Object>> jndiContext = Module.share(Module.APP, module.getJndiContext());
  2. ApplicationInfo applicationInfo = new ApplicationInfo(module.getType(),
  3. module.getEnvironment(),
  4. module.getModuleName(),
  5. module.getName(),
  6. jarFile,
  7. null,

代码示例来源:origin: org.apache.geronimo.modules/geronimo-connector-builder-1_6

  1. AbstractNameQuery transactionManager = module.getEarContext().getTransactionManagerName();
  2. if (transactionManager != null) {
  3. Set<AbstractNameQuery> query = new HashSet<AbstractNameQuery>();
  4. query.add(transactionManager);
  5. GBeanReference transactionManagerRef = new GBeanReference(module.getConfigId(), query, TransactionManager.class);
  6. put("java:comp/TransactionManager", transactionManagerRef, ReferenceType.RESOURCE_ENV, module.getJndiContext(), Collections.<InjectionTarget>emptySet(), sharedContext);
  7. GBeanReference transactionSynchronizationRef = new GBeanReference(module.getConfigId(), query, TransactionSynchronizationRegistry.class);
  8. put("java:comp/TransactionSynchronizationRegistry", transactionSynchronizationRef, ReferenceType.RESOURCE_ENV, module.getJndiContext(), Collections.<InjectionTarget>emptySet(), sharedContext);
  9. put("java:comp/Bundle", new BundleReference(), ReferenceType.RESOURCE_ENV, module.getJndiContext(), Collections.<InjectionTarget> emptySet(), sharedContext);
  10. put("java:comp/BundleContext", new BundleContextReference(), ReferenceType.RESOURCE_ENV, module.getJndiContext(), Collections.<InjectionTarget> emptySet(), sharedContext);
  11. Map<String, Map<String, GerMessageDestinationType>> messageDestinations = module.getRootEarContext().getMessageDestinations();
  12. if (module.getClassFinder() != null) {
  13. ResourceAnnotationHelper.processAnnotations(specDD, module.getClassFinder(), new AdminObjectRefProcessor(refMap, messageDestinations, module.getEarContext()));
  14. log.warn("Unable to process @Resource annotations for module" + module.getName(), e);
  15. Bundle bundle = module.getEarContext().getDeploymentBundle();
  16. for (Map.Entry<String, ResourceEnvRef> entry : specDD.getResourceEnvRefMap().entrySet()) {
  17. String name = entry.getKey();
  18. unresolvedRefs.add(name);
  19. } else {
  20. put(name, value, ReferenceType.RESOURCE_ENV, module.getJndiContext(), resourceEnvRef.getInjectionTarget(), sharedContext);
  21. put(name, value, ReferenceType.RESOURCE_ENV, module.getJndiContext(), messageDestinationRef.getInjectionTarget(), sharedContext);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-connector-builder

  1. public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
  2. if ((module != null) && (module.getClassFinder() != null)) {
  3. ResourceAnnotationHelper.processAnnotations(module.getAnnotatedApp(), module.getClassFinder(), ResourceRefProcessor.INSTANCE);
  4. log.warn("Unable to process @Resource annotations for module" + module.getName(), e);
  5. Map refMap = mapResourceRefs(gerResourceRefsUntyped);
  6. List unresolvedRefs = new ArrayList();
  7. ClassLoader cl = module.getEarContext().getClassLoader();
  8. for (ResourceRefType resourceRef : resourceRefsUntyped) {
  9. String name = resourceRef.getResRefName().getStringValue().trim();
  10. Artifact[] moduleId = module.getConfigId();
  11. Map context = getJndiContextMap(componentContext);
  12. context.put(ENV + name, new ORBReference(moduleId, corbaName));
  13. unresolvedRefs.remove(name);
  14. EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), corbaEnvironment);
  15. AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, null, gerResourceRef);
  16. module.getEarContext().findGBean(containerId);
  17. Object ref = new ResourceReferenceFactory<ResourceException>(module.getConfigId(), containerId, iface);
  18. getJndiContextMap(componentContext).put(ENV + name, ref);
  19. for (Dependency dependency : module.getEnvironment().getDependencies()) {
  20. errorMessage.append(dependency).append("\n");

代码示例来源:origin: org.apache.geronimo.modules/geronimo-jetty6-builder

  1. public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection repository) throws DeploymentException {
  2. EARContext moduleContext = module.getEarContext();
  3. AbstractName moduleName = moduleContext.getModuleName();
  4. WebModule webModule = (WebModule) module;
  5. module.setOriginalSpecDD(module.getSpecDD().toString());
  6. webModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
  7. if (!module.isStandAlone()) {
  8. ConfigurationData moduleConfigurationData = moduleContext.getConfigurationData();
  9. earContext.addChildConfiguration(module.getTargetPath(), moduleConfigurationData);
  10. throw new DeploymentException("Unable to initialize webapp GBean for " + module.getName(), e);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-openwebbeans-builder

  1. EARContext moduleContext = module.getEarContext();
  2. Map sharedContext = module.getSharedContext();
  3. webAppInfo.listeners.add(0, CONTEXT_LISTENER_NAME);
  4. AbstractName moduleName = module.getModuleName();
  5. Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
  6. buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleName);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-jaxws-builder

  1. private URL getCatalog(String name) throws IOException {
  2. URL catalogURL = this.bundle.getResource(name);
  3. if (catalogURL == null) {
  4. File f = this.module.getEarContext().getTargetFile(URI.create(name));
  5. if (f.exists()) {
  6. catalogURL = f.toURI().toURL();
  7. }
  8. }
  9. return catalogURL;
  10. }

代码示例来源:origin: org.apache.geronimo.modules/geronimo-jasper-builder

  1. EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), defaultEnvironment);
  2. EARContext moduleContext = module.getEarContext();
  3. Map sharedContext = module.getSharedContext();
  4. AbstractName moduleName = module.getModuleName();
  5. Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
  6. buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleName);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat-builder

  1. public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection repository) throws DeploymentException {
  2. EARContext moduleContext = module.getEarContext();
  3. ClassLoader webClassLoader = moduleContext.getClassLoader();
  4. AbstractName moduleName = moduleContext.getModuleName();
  5. try {
  6. webModuleData.setReferencePattern("J2EEServer", moduleContext.getServerName());
  7. if (!module.isStandAlone()) {
  8. webModuleData.setReferencePattern("J2EEApplication", earContext.getModuleName());
  9. webModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
  10. Set securityRoles = collectRoleNames(webApp);
  11. Map rolePermissions = new HashMap();
  12. if (!module.isStandAlone()) {
  13. ConfigurationData moduleConfigurationData = moduleContext.getConfigurationData();
  14. earContext.addChildConfiguration(module.getTargetPath(), moduleConfigurationData);
  15. throw new DeploymentException("Unable to initialize GBean for web app " + module.getName(), e);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-openejb-builder

  1. Deployable deployable = parentModule.getDeployable();
  2. if (!(deployable instanceof DeployableJarFile)) {
  3. throw new IllegalArgumentException("Expected DeployableJarFile");
  4. standAlone = parentModule.isStandAlone();
  5. .getAppClientName() : parentModule.getModuleName();
  6. name = parentModule.getName();
  7. } else if (ejbJar.getModuleName() != null) {
  8. name = ejbJar.getModuleName().trim();
  9. context = parentModule.getJndiContext();
  10. } else if (parentModule != null) {
  11. context = Module.share(Module.APP, parentModule.getJndiContext());
  12. builder.createModule(module, plan, moduleFile, targetPath, specDDUrl, environment, null, parentModule == null ? null : parentModule.getModuleName(), naming, idBuilder);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-web-2.5-builder

  1. if (module.isStandAlone()) {
  2. moduleContext = earContext;
  3. } else {
  4. EnvironmentBuilder.mergeEnvironments(earContext.getEnvironment(), module.getEnvironment());
  5. moduleContext = new FragmentContext(earContext, ConfigurationModuleType.WAR);
  6. module.setEarContext(moduleContext);
  7. module.setRootEarContext(earContext);
  8. try {
  9. Collection<String> manifestcp = module.getClassPath();
  10. JarFile warFile = module.getModuleFile();
  11. Enumeration<JarEntry> entries = warFile.entries();
  12. List<ZipEntry> libs = new ArrayList<ZipEntry>();
  13. while (entries.hasMoreElements()) {
  14. ZipEntry entry = entries.nextElement();
  15. URI targetPath = module.resolve(entry.getName());
  16. if (entry.getName().equals("WEB-INF/web.xml")) {
  17. moduleContext.addFile(targetPath, module.getOriginalSpecDD());
  18. } else if (entry.getName().startsWith("WEB-INF/lib") && entry.getName().endsWith(".jar")) {
  19. moduleContext.addToClassPath(module.resolve("WEB-INF/classes").getPath());
  20. manifestcp.add("WEB-INF/classes"); // NOTE: Spec requires there be no trailing "/" on this.
  21. URI targetPath = module.resolve(entry.getName());
  22. moduleContext.addInclude(targetPath, warFile, entry);
  23. manifestcp.add(entry.getName());

相关文章