本文整理了Java中org.apache.geronimo.j2ee.deployment.EARContext.getNaming()
方法的一些代码示例,展示了EARContext.getNaming()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EARContext.getNaming()
方法的具体详情如下:
包路径:org.apache.geronimo.j2ee.deployment.EARContext
类名称:EARContext
方法名:getNaming
暂无
代码示例来源:origin: org.apache.geronimo.modules/geronimo-j2ee-builder
@Override
public Naming getNaming() {
return hostContext.getNaming();
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-openejb-builder
public AbstractName createEjbName(EARContext earContext, EjbModule ejbModule, EnterpriseBean enterpriseBean) {
String ejbName = enterpriseBean.getEjbName();
String type = null;
if (enterpriseBean instanceof SessionBean) {
SessionBean sessiOnBean= (SessionBean) enterpriseBean;
switch (sessionBean.getSessionType()) {
case STATELESS:
type = NameFactory.STATELESS_SESSION_BEAN;
break;
case STATEFUL:
type = NameFactory.STATEFUL_SESSION_BEAN;
break;
case SINGLETON:
type = NameFactory.SINGLETON_BEAN;
break;
case MANAGED:
type = NameFactory.MANAGED_BEAN;
break;
}
} else if (enterpriseBean instanceof EntityBean) {
type = NameFactory.ENTITY_BEAN;
} else if (enterpriseBean instanceof MessageDrivenBean) {
type = NameFactory.MESSAGE_DRIVEN_BEAN;
}
if (type == null) {
throw new IllegalArgumentException("Unknown enterprise bean type XXX " + enterpriseBean.getClass().getName());
}
return earContext.getNaming().createChildName(ejbModule.getModuleName(), ejbName, type);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-jetty6-builder
private GBeanData configureDefaultServlet(Object defaultServlet, EARContext earContext, AbstractName moduleName, Set knownServletMappings, EARContext moduleContext) throws GBeanNotFoundException, GBeanAlreadyExistsException {
GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet);
AbstractName defaultServletObjectName = earContext.getNaming().createChildName(moduleName, (String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET);
servletGBeanData.setAbstractName(defaultServletObjectName);
servletGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
Set
defaultServletMappings.removeAll(knownServletMappings);
servletGBeanData.setAttribute("servletMappings", defaultServletMappings);
moduleContext.addGBean(servletGBeanData);
return servletGBeanData;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-corba-builder
switch (bean.type) {
case EnterpriseBeanInfo.STATELESS: {
return earContext.getNaming().createChildName(ejbModule.getModuleName(), name, NameFactory.STATELESS_SESSION_BEAN);
return earContext.getNaming().createChildName(ejbModule.getModuleName(), name, NameFactory.STATEFUL_SESSION_BEAN);
return earContext.getNaming().createChildName(ejbModule.getModuleName(), name, NameFactory.ENTITY_BEAN);
return earContext.getNaming().createChildName(ejbModule.getModuleName(), name, NameFactory.MESSAGE_DRIVEN_BEAN);
代码示例来源:origin: org.apache.geronimo.modules/geronimo-j2ee-builder
public EARContext(File baseDir,
File inPlaceConfigurationDir,
Environment environment,
ConfigurationModuleType moduleType,
AbstractName baseName,
AbstractNameQuery transactionManagerName,
AbstractNameQuery connectionTrackerName,
AbstractNameQuery corbaGBeanName,
EARContext parent) throws DeploymentException {
super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, parent.getNaming(), parent.getConfigurationManager(), parent.getBundleContext());
this.serverName = parent.getServerName();
this.transactiOnManagerObjectName= transactionManagerName;
this.cOnnectionTrackerObjectName= connectionTrackerName;
this.corbaGBeanObjectName = corbaGBeanName;
this.messageDestinatiOns= new HashMap();
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-persistence-jpa20-builder
LinkedHashSet
do {
AbstractName childName = module.getEarContext().getNaming().createChildName(module.getModuleName(), "", NameFactory.PERSISTENCE_UNIT);
Map
name.remove(NameFactory.J2EE_NAME);
代码示例来源: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-jetty6-builder
private void addFiltersGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, WebAppType webApp) throws GBeanAlreadyExistsException {
FilterType[] filterArray = webApp.getFilterArray();
for (FilterType filterType : filterArray) {
String filterName = filterType.getFilterName().getStringValue().trim();
AbstractName filterAbstractName = earContext.getNaming().createChildName(moduleName, filterName, NameFactory.WEB_FILTER);
GBeanData filterData = new GBeanData(filterAbstractName, JettyFilterHolder.GBEAN_INFO);
filterData.setAttribute("filterName", filterName);
filterData.setAttribute("filterClass", filterType.getFilterClass().getStringValue().trim());
Map
ParamValueType[] initParamArray = filterType.getInitParamArray();
for (ParamValueType paramValueType : initParamArray) {
initParams.put(paramValueType.getParamName().getStringValue().trim(), paramValueType.getParamValue().getStringValue().trim());
}
filterData.setAttribute("initParams", initParams);
filterData.setReferencePattern("JettyServletRegistration", moduleName);
moduleContext.addGBean(filterData);
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-jetty6-builder
private void configureHosts(EARContext earContext, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws GBeanAlreadyExistsException {
String[] hosts = jettyWebApp.getHostArray();
for (int i = 0; i
}
String[] virtualHosts = jettyWebApp.getVirtualHostArray();
for (int i = 0; i
}
if (hosts.length > 0 || virtualHosts.length > 0) {
//use name same as module
AbstractName hostName = earContext.getNaming().createChildName(webModuleData.getAbstractName(), "Host", "Host");
GBeanData hostData = new GBeanData(hostName, Host.GBEAN_INFO);
hostData.setAttribute("hosts", hosts);
hostData.setAttribute("virtualHosts", virtualHosts);
earContext.addGBean(hostData);
webModuleData.setReferencePattern("Host", hostName);
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-connector-builder-1_6
private void addDataSourceGBean(Module module, Map
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.
} catch (IOException e) {
throw new DeploymentException("Could not construct Reference for datasource " + dsDescription, e);
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-persistence-jpa20-builder
abstractName = moduleContext.getNaming().createChildName(module.getModuleName(), persistenceUnitName, NameFactory.PERSISTENCE_UNIT);
} else {
abstractName = moduleContext.getNaming().createChildName(module.getModuleName(), persistenceModulePath, NameFactory.PERSISTENCE_UNIT_MODULE);
abstractName = moduleContext.getNaming().createChildName(abstractName, moduleContext.getConfigID(), persistenceUnitName, NameFactory.PERSISTENCE_UNIT);
gbeanData.setReferencePattern("TransactionManager", transactionManagerName);
gbeanData.setReferencePattern("EntityManagerRegistry", extendedEntityManagerRegistryName);
AbstractName validatorName = moduleContext.getNaming().createChildName(module.getModuleName(), "ValidatorFactory", NameFactory.VALIDATOR_FACTORY);
gbeanData.setReferencePattern("ValidatorFactory", validatorName);
代码示例来源:origin: org.apache.geronimo.modules/geronimo-jaxws-ejb-builder
AbstractName sessiOnName= earContext.getNaming().createChildName(module.getModuleName(), ejbName, j2eeType);
代码示例来源:origin: org.apache.geronimo.modules/geronimo-openwebbeans-builder
webModule.setClassFinder(originalFinder);
AbstractName openWebBeansWebAppCOntextGBeanName= moduleContext.getNaming().createChildName(moduleName, "OpenWebBeansWebAppContext", "OpenWebBeansWebAppContext");
GBeanData openWebBeansWebAppCOntextGBean= new GBeanData(openWebBeansWebAppContextGBeanName, OpenWebBeansWebAppContext.class);
try {
代码示例来源:origin: org.apache.geronimo.modules/geronimo-connector-builder
private void addOutboundGBeans(EARContext earContext, AbstractName jcaResourceName, AbstractName resourceAdapterAbstractName, GBeanData managedConnectionFactoryPrototypeGBeanData, GerConnectiondefinitionInstanceType connectiondefinitionInstance, String transactionSupport, ClassLoader cl) throws DeploymentException {
GBeanData managedCOnnectionFactoryInstanceGBeanData= new GBeanData(managedConnectionFactoryPrototypeGBeanData);
AbstractName cOnnectionFactoryAbstractName= earContext.getNaming().createChildName(jcaResourceName, connectiondefinitionInstance.getName().trim(), NameFactory.JCA_CONNECTION_FACTORY);
AbstractName managedCOnnectionFactoryAbstractName= earContext.getNaming().createChildName(connectionFactoryAbstractName, connectiondefinitionInstance.getName().trim(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
代码示例来源:origin: org.apache.geronimo.modules/geronimo-connector-builder
private void addAdminObjectGBeans(EARContext earContext, AbstractName jcaResourceName, GBeanData resourceAdapterModuleData, ClassLoader cl, AbstractName resourceAdapterAbstractName, GerAdminobjectType[] adminObjects) throws DeploymentException {
for (GerAdminobjectType gerAdminObject : adminObjects) {
String adminObjectInterface = gerAdminObject.getAdminobjectInterface().trim();
GBeanData adminObjectGBeanData = locateAdminObjectInfo(resourceAdapterModuleData, adminObjectInterface);
if (adminObjectGBeanData == null) {
throw new DeploymentException("No admin object declared for interface: " + adminObjectInterface);
}
for (GerAdminobjectInstanceType gerAdminObjectInstance : gerAdminObject.getAdminobjectInstanceArray()) {
GBeanData adminObjectInstanceGBeanData = new GBeanData(adminObjectGBeanData);
setDynamicGBeanDataAttributes(adminObjectInstanceGBeanData, gerAdminObjectInstance.getConfigPropertySettingArray(), cl);
// add it
AbstractName adminObjectAbstractName = earContext.getNaming().createChildName(jcaResourceName, gerAdminObjectInstance.getMessageDestinationName().trim(), NameFactory.JCA_ADMIN_OBJECT);
adminObjectInstanceGBeanData.setAbstractName(adminObjectAbstractName);
if (resourceAdapterAbstractName != null) {
adminObjectInstanceGBeanData.setReferencePattern("ResourceAdapterWrapper", resourceAdapterAbstractName);
}
try {
earContext.addGBean(adminObjectInstanceGBeanData);
} catch (GBeanAlreadyExistsException e) {
throw new DeploymentException("Could not add admin object gbean to context", e);
}
}
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-security-builder
private void buildJaccManager(EARContext earContext) throws DeploymentException {
if (earContext.isHasSecurity()) {
//Be sure to only set once per app
earContext.setHasSecurity(false);
AbstractName applicatiOnPolicyManagerName= earContext.getNaming().createChildName(earContext.getModuleName(), SecurityNames.JACC_MANAGER, SecurityNames.JACC_MANAGER);
//TODO A better way to avoid the multiple invocation on securityBuilder.addGBeans ?
try {
if (earContext.getGBeanInstance(applicationPolicyManagerName) != null) {
return;
}
} catch (GBeanNotFoundException e1) {
}
AbstractNameQuery roleMapperDataName = (AbstractNameQuery)earContext.getGeneralData().get(ROLE_MAPPER_DATA_NAME);
if (roleMapperDataName == null) {
roleMapperDataName = defaultRoleMappingName;
EnvironmentBuilder.mergeEnvironments(earContext.getConfiguration().getEnvironment(), defaultEnvironment);
}
GBeanData jaccBeanData = configureApplicationPolicyManager(applicationPolicyManagerName, earContext.getContextIDToPermissionsMap());
jaccBeanData.setReferencePattern("PrincipalRoleMapper", roleMapperDataName);
try {
earContext.addGBean(jaccBeanData);
earContext.getGeneralData().put(EARContext.JACC_MANAGER_NAME_KEY, jaccBeanData.getAbstractName());
} catch (GBeanAlreadyExistsException e) {
throw new DeploymentException("JACC manager gbean already present", e);
}
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-jetty6-builder
private AbstractName addDefaultFiltersGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, AbstractName previous) throws GBeanNotFoundException, GBeanAlreadyExistsException {
for (Object defaultFilter : defaultFilters) {
GBeanData filterGBeanData = getGBeanData(kernel, defaultFilter);
String filterName = (String) filterGBeanData.getAttribute("filterName");
AbstractName defaultFilterAbstractName = earContext.getNaming().createChildName(moduleName, filterName, NameFactory.WEB_FILTER);
filterGBeanData.setAbstractName(defaultFilterAbstractName);
filterGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
moduleContext.addGBean(filterGBeanData);
//add a mapping to /*
GBeanData filterMappingGBeanData = new GBeanData(JettyFilterMapping.GBEAN_INFO);
if (previous != null) {
filterMappingGBeanData.addDependency(previous);
}
filterMappingGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
String urlPattern = "/*";
filterMappingGBeanData.setAttribute("urlPattern", urlPattern);
AbstractName filterMappingName = earContext.getNaming().createChildName(defaultFilterAbstractName, urlPattern, NameFactory.URL_WEB_FILTER_MAPPING);
filterMappingGBeanData.setAbstractName(filterMappingName);
previous = filterMappingName;
filterMappingGBeanData.setAttribute("requestDispatch", TRUE);
filterMappingGBeanData.setAttribute("forwardDispatch", TRUE);
filterMappingGBeanData.setAttribute("includeDispatch", TRUE);
filterMappingGBeanData.setAttribute("errorDispatch", FALSE);
filterMappingGBeanData.setReferencePattern("Filter", defaultFilterAbstractName);
moduleContext.addGBean(filterMappingGBeanData);
}
return previous;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-corba-builder
AbstractName ejbName = resolveEjb(earContext, ejbModule, link.getEjbName());
AbstractName tssLinkName = earContext.getNaming().createChildName(ejbName, link.getTssName(), NameFactory.CORBA_TSS_LINK);
GBeanData tssLinkData = new GBeanData(tssLinkName, TSSLinkGBean.GBEAN_INFO);
tssLinkData.setAttribute("jndiNames", link.getJndiNameArray());
代码示例来源:origin: org.apache.geronimo.modules/geronimo-connector-builder
resourceAdapterAbstractName = earContext.getNaming().createChildName(jcaResourceName, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER);
resourceAdapterInstanceGBeanData.setAbstractName(resourceAdapterAbstractName);
try {
代码示例来源:origin: org.apache.geronimo.modules/geronimo-corba-builder
AbstractName tssLinkName = module.getEarContext().getNaming().createChildName(ejbName, "tssLink" + i, "TSSLink");
GBeanData tssLinkData = new GBeanData(tssLinkName, TSSLinkGBean.GBEAN_INFO);
tssLinkData.setAttribute("jndiNames", jndiNames);
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");
GBeanData tssLinkData = new GBeanData(tssLinkName, TSSLinkGBean.GBEAN_INFO);
tssLinkData.setAttribute("jndiNames", jndiNames);