org.apache.geronimo.j2ee.deployment.Module.getEarContext()方法的使用及代码示例

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

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

Module.getEarContext介绍

暂无

代码示例

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

private URL getCatalog(String name) throws IOException {
  URL catalogURL = this.bundle.getResource(name);
  if (catalogURL == null) {
    File f = this.module.getEarContext().getTargetFile(URI.create(name));
    if (f.exists()) {
      catalogURL = f.toURI().toURL();
    }
  }
  return catalogURL;
}

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

private static void saveOrderedLibAttribute(EARContext earContext, Module module, WebFragmentEntry[] webFragmentEntries) {
    //Save ORDERED_LIBS Attribute
    List<String> orderedLibs = new ArrayList<String>();
    for (WebFragmentEntry webFragmentEntry : webFragmentEntries) {
      String jarURL = webFragmentEntry.getJarURL();
      if (jarURL != null) {
        int iBeginIndex = jarURL.indexOf("WEB-INF/");
        if (iBeginIndex > 0) {
          orderedLibs.add(jarURL.substring(iBeginIndex + 8));
        }
      }
    }
    module.getEarContext().getGeneralData().put(AbstractWebModuleBuilder.ORDERED_LIBS, orderedLibs);
  }
}

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

public void initContext(EARContext earContext, Module module, Bundle bundle) throws DeploymentException {
  if (!JSF_SUPPORT) {
    return;
  }
  module.getEarContext().getGeneralData().put(JSF_META_INF_CONFIGURATION_RESOURCES, findMetaInfConfigurationResources(earContext, module, bundle));
  module.getEarContext().getGeneralData().put(JSF_FACELET_CONFIG_RESOURCES, findFaceletConfigResources(earContext, module, bundle));
}

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

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

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

Set<String> excludedURLs = AbstractWebModuleBuilder.EXCLUDED_JAR_URLS.get(module.getEarContext().getGeneralData());

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

@Override
public void initContext(EARContext earContext, Module module, Bundle bundle) throws DeploymentException {
  if (module instanceof EjbModule) {
    doInitContext(earContext, module, bundle);
  } else {
    LinkedHashSet<Module<?,?>> modules = module.getModules();
    for (Module<?,?> subModule: modules) {
      if (subModule instanceof EjbModule)  {
        if(module instanceof AppClientModule){
          earContext = module.getEarContext();
        }
        doInitContext(earContext, subModule, bundle);
      }
    }
  }
}

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

LinkedHashSet<GBeanData> gbeans = new LinkedHashSet<GBeanData>();
do {
  AbstractName childName = module.getEarContext().getNaming().createChildName(module.getModuleName(), "", NameFactory.PERSISTENCE_UNIT);
  Map<String, String> name = new HashMap<String, String>(childName.getName());
  name.remove(NameFactory.J2EE_NAME);
  gbeans = localConfiguration.findGBeanDatas(module.getEarContext().getConfiguration(), patterns);

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

private Object buildMessageReference(Module module, String linkName, String type, GerMessageDestinationType destination)
    throws DeploymentException {
  Bundle bundle = module.getEarContext().getDeploymentBundle();

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

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

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

private Reference buildAdminObjectReference(Module module, AbstractNameQuery containerId) throws DeploymentException {
  Configuration localConfiguration = module.getEarContext().getConfiguration();
  try {
    AbstractName abstractName = localConfiguration.findGBean(containerId);
    //String osgiJndiName = "aries:services/" + module.getEarContext().getNaming().toOsgiJndiName(abstractName);
    return new JndiReference("aries:services/", abstractName);
  } catch (GBeanNotFoundException e) {
    throw new DeploymentException("Can not resolve admin object ref " + containerId + " in configuration " + localConfiguration.getId(), e);
  }
}

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

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

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

private void addDataSourceGBean(Module module, Map<EARContext.Key, Object> sharedContext, DataSource ds)
  throws DeploymentException {
  String jndiName = ds.getKey();
  if (lookupJndiContextMap(module, jndiName) != null) {
    return;
  }
  String name = jndiName;
  if (name.startsWith("java:")) {
    name = name.substring(5);
  }
  EARContext earContext = module.getEarContext();
  AbstractName dataSourceAbstractName = earContext.getNaming().createChildName(module.getModuleName(), name, "GBean");
  DataSourceDescription dsDescription = createDataSourceDescription(ds);
  String osgiJndiName = null;
  if (dsDescription.getProperties() != null) {
    osgiJndiName = dsDescription.getProperties().get(ConnectorModuleBuilder.OSGI_JNDI_SERVICE_NAME);
  }
  if (osgiJndiName == null) {
    osgiJndiName = module.getEarContext().getNaming().toOsgiJndiName(dataSourceAbstractName);
  }
  dsDescription.setOsgiServiceName(osgiJndiName);
  try {
    Object ref = DataSourceService.buildReference(dsDescription);
    put(jndiName, ref, ReferenceType.DATA_SOURCE, module.getJndiContext(), Collections.<InjectionTarget>emptySet(), sharedContext);
  } catch (IOException e) {
    throw new DeploymentException("Could not construct Reference for datasource " + dsDescription, e);
  }
}

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

private ResourceReferenceFactory<RuntimeException> buildAdminObjectReference(Module module, AbstractNameQuery containerId, Class iface) throws DeploymentException {
  Configuration localConfiguration = module.getEarContext().getConfiguration();
  try {
    localConfiguration.findGBean(containerId);
  } catch (GBeanNotFoundException e) {
    throw new DeploymentException("Can not resolve admin object ref " + containerId + " in configuration " + localConfiguration.getId(), e);
  }
  return new ResourceReferenceFactory<RuntimeException>(module.getConfigId(), containerId, iface);
}

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

gBeanData = module.getEarContext().getConfiguration().findGBeanData(queries);
} catch (GBeanNotFoundException e) {
  throw new DeploymentException("Could not resolve reference at deploy time for queries " + queries, e);
  interfaceTypes.add(gBeanData.getGBeanInfo().getClassName());
Bundle bundle = module.getEarContext().getDeploymentBundle();
Class gBeanType;
try {

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

XmlObject[] tsss = plan.selectChildren(TSS_QNAME);
String[] jndiNames = toStringArray(plan.selectChildren(JNDI_NAME_QNAME));
AbstractNameQuery ejbModuleName = NameFactory.newTypeNameQuery(module.getEarContext().getConfigID(), NameFactory.EJB_MODULE, module.getName());
for (int i = 0; i < tssLinks.length; i++) {
  String tssLink = tssLinks[i];
  AbstractNameQuery tssBeanName = ENCConfigBuilder.buildAbstractNameQuery(null, moduleString, tssLink, NameFactory.EJB_MODULE, NameFactory.EJB_MODULE);
  try {
    module.getEarContext().findGBean(tssBeanName);
  } catch (GBeanNotFoundException e) {
    tssBeanName = ENCConfigBuilder.buildAbstractNameQuery(null, null, tssLink, null, NameFactory.EJB_MODULE);
    try {
      module.getEarContext().findGBean(tssBeanName);
    } catch (GBeanNotFoundException e1) {
      throw new DeploymentException("No tss bean found", e);
  AbstractName tssLinkName = module.getEarContext().getNaming().createChildName(ejbName, "tssLink" + i, "TSSLink");
  GBeanData tssLinkData = new GBeanData(tssLinkName, TSSLinkGBean.GBEAN_INFO);
  tssLinkData.setAttribute("jndiNames", jndiNames);
  tssLinkData.addDependency(ejbModuleName);
  try {
    module.getEarContext().addGBean(tssLinkData);
  } catch (GBeanAlreadyExistsException e) {
    throw new DeploymentException("tss link gbean already present", e);
  GerPatternType tss = (GerPatternType) tsss[i];
  AbstractNameQuery tssBeanName = ENCConfigBuilder.buildAbstractNameQuery(tss, NameFactory.CORBA_TSS, NameFactory.EJB_MODULE, null);
  AbstractName tssLinkName = module.getEarContext().getNaming().createChildName(ejbName, "tssRef" + i, "TSSLink");

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

public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
  Collection<EjbRef> ejbRefsUntyped = specDD.getEjbRef();
  XmlObject[] gerEjbRefsUntyped = plan == null ? NO_REFS : convert(plan.selectChildren(GER_EJB_REF_QNAME_SET), OPENEJB_CONVERTER, GerEjbRefType.type);
  Map ejbRefMap = mapEjbRefs(gerEjbRefsUntyped);
  Bundle bundle = module.getEarContext().getDeploymentBundle();
  for (EjbRef ejbRef : ejbRefsUntyped) {
    String ejbRefName = getStringValue(ejbRef.getKey());
    GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
    Reference ejbReference = addEJBRef(module, ejbRef, remoteRef, bundle);
    if (ejbReference != null) {
      put(ejbRefName, ejbReference, ReferenceType.EJB, module.getJndiContext(), ejbRef.getInjectionTarget(), sharedContext);
    }
  }
}

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

module.getEarContext().findGBean(cssBean);
} catch (GBeanNotFoundException e) {
  throw new DeploymentException("Could not find css bean matching " + cssBean + " from configuration " + module.getConfigId(), e);

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

Bundle bundle = module.getEarContext().getDeploymentBundle();

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

private GBeanData installPersistenceUnitGBean(Persistence.PersistenceUnit persistenceUnit, Module module, String persistenceModulePath) throws DeploymentException {
  EARContext moduleContext = module.getEarContext();
  String persistenceUnitName = persistenceUnit.getName().trim();
  if (persistenceUnitName.length() == 0) {

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

public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
    WebAppType webApp = (WebAppType) module.getSpecDD();
//        MessageDestinationType[] messageDestinations = webApp.getMessageDestinationArray();
    TomcatWebAppType gerWebApp = (TomcatWebAppType) module.getVendorDD();
//        GerMessageDestinationType[] gerMessageDestinations = gerWebApp.getMessageDestinationArray();

//        ENCConfigBuilder.registerMessageDestinations(earContext, module.getName(), messageDestinations, gerMessageDestinations);
    getNamingBuilders().initContext(webApp, gerWebApp, module.getEarContext().getConfiguration(), earContext.getConfiguration(), module);
    if ((webApp.getSecurityConstraintArray().length > 0 || webApp.getSecurityRoleArray().length > 0) &&
        !gerWebApp.isSetSecurityRealmName()) {
      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.");
    }
    boolean hasSecurityRealmName = gerWebApp.isSetSecurityRealmName();
    buildSubstitutionGroups(gerWebApp, hasSecurityRealmName, module, earContext);
  }

相关文章