@Override protected String topLevelTagValue(Application descriptor) { return descriptor.getAppName(); }
public static String getApplicationName(JndiNameEnvironment env) { String appName = ""; Application app = getApplicationFromEnv(env); if (app != null) { appName = app.getAppName(); } else { throw new IllegalArgumentException("IllegalJndiNameEnvironment : env"); } return appName; }
private String getApplicationName(JndiNameEnvironment env) { String appName = ""; Application app = getApplicationFromEnv(env); if( app != null) { appName = app.getAppName(); } else { throw new IllegalArgumentException("IllegalJndiNameEnvironment : env"); } return appName; }
private void registerAppLevelDependencies(ApplicationInfo appInfo) { Application app = appInfo.getMetaData(Application.class); if( app == null ) { return; } try { compEnvManager.bindToComponentNamespace(app); } catch(Exception e) { throw new RuntimeException("Error binding app-level env dependencies " + app.getAppName(), e); } }
private void registerAppLevelDependencies(ApplicationInfo appInfo) { Application app = appInfo.getMetaData(Application.class); if( app == null ) { return; } try { compEnvManager.bindToComponentNamespace(app); } catch(Exception e) { throw new RuntimeException("Error binding app-level env dependencies " + app.getAppName(), e); } }
public static String getModuleName(EjbMessageBeanDescriptor descriptor) { String appName = descriptor.getApplication().getAppName(); String moduleName = descriptor.getEjbBundleDescriptor().getModuleID(); String actualModuleName = moduleName; if(moduleName != null){ String prefix = appName+"#"; if(moduleName.startsWith(prefix)){ actualModuleName = moduleName.substring(prefix.length()); } } return actualModuleName; } }
private String getAppName() throws NamingException { ComponentEnvManager namingMgr = (ComponentEnvManager)this.habitat.getComponent(ComponentEnvManager.class); String appName = null; if (namingMgr != null) { JndiNameEnvironment env = namingMgr.getCurrentJndiNameEnvironment(); BundleDescriptor bd = null; if ((env instanceof EjbDescriptor)) { bd = ((EjbDescriptor)env).getEjbBundleDescriptor(); } else if ((env instanceof BundleDescriptor)) { bd = (BundleDescriptor)env; } if (bd != null) { Application app = bd.getApplication(); appName = app.getAppName(); // <-- HERE! } } if (appName == null) throw new NamingException("Could not resolve java:app/AppName"); return appName; }
public String getGlobalJndiName() { String appName = null; if (enclosingBundle == null) return null; Application app = enclosingBundle.getApplication(); if ( !app.isVirtual() ) { appName = enclosingBundle.getApplication().getAppName(); } String modName = enclosingBundle.getModuleDescriptor().getModuleName(); StringBuffer javaGlobalPrefix = new StringBuffer("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); // If the managed bean is named, use the name for the final component // of the managed bean global name. Otherwise, use a derived internal // name since we'll still need a way to register and lookup the bean // from within the container. String componentName = isNamed() ? name : "___internal_managed_bean_" + beanClassName; javaGlobalPrefix.append(componentName); return javaGlobalPrefix.toString(); }
/** * Return the fully-qualified portable JNDI name for a given * client view (Remote, Local, or no-interface). */ public String getPortableJndiName(String clientViewType) { String appName = null; Application app = getEjbBundleDescriptor().getApplication(); if ( ! app.isVirtual() ) { appName = app.getAppName(); } String modName = getEjbBundleDescriptor().getModuleDescriptor().getModuleName(); StringBuffer javaGlobalPrefix = new StringBuffer("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(getName()); javaGlobalPrefix.append("!"); javaGlobalPrefix.append(clientViewType); return javaGlobalPrefix.toString(); }
protected String getJavaGlobalJndiNamePrefix() { String appName = null; Application app = ejbDescriptor.getApplication(); if ( ! app.isVirtual() ) { appName = ejbDescriptor.getApplication().getAppName(); } EjbBundleDescriptorImpl ejbBundle = ejbDescriptor.getEjbBundleDescriptor(); String modName = ejbBundle.getModuleDescriptor().getModuleName(); String ejbName = ejbDescriptor.getName(); StringBuffer javaGlobalPrefix = new StringBuffer("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(ejbName); return javaGlobalPrefix.toString(); }
protected String getJavaGlobalJndiNamePrefix() { String appName = null; Application app = ejbDescriptor.getApplication(); if ( ! app.isVirtual() ) { appName = ejbDescriptor.getApplication().getAppName(); } EjbBundleDescriptor ejbBundle = ejbDescriptor.getEjbBundleDescriptor(); String modName = ejbBundle.getModuleDescriptor().getModuleName(); String ejbName = ejbDescriptor.getName(); StringBuffer javaGlobalPrefix = new StringBuffer("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(ejbName); return javaGlobalPrefix.toString(); }
private String getJavaGlobalJndiNamePrefix(EjbDescriptor ejbDescriptor) { String appName = null; Application app = ejbDescriptor.getApplication(); if ( ! app.isVirtual() ) { appName = ejbDescriptor.getApplication().getAppName(); } EjbBundleDescriptor ejbBundle = ejbDescriptor.getEjbBundleDescriptor(); String modName = ejbBundle.getModuleDescriptor().getModuleName(); String ejbName = ejbDescriptor.getName(); StringBuilder javaGlobalPrefix = new StringBuilder("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(ejbName); return javaGlobalPrefix.toString(); }
public boolean start(ApplicationContext startupContext) throws Exception { cl = startupContext.getClassLoader(); try { app = deploymentCtx.getModuleMetaData(Application.class); Iterator<EjbEndpoint> iter = ejbendpoints.iterator(); EjbEndpoint ejbendpoint = null; while(iter.hasNext()) { ejbendpoint = iter.next(); String contextRoot = ejbendpoint.contextRoot; dispatcher.registerEndpoint(contextRoot, (com.sun.grizzly.tcp.Adapter)adapter, this); logger.info(format(rb.getString("enterprise.deployment.ejbendpoint.registration"), app.getAppName(), new WsUtil().getWebServerInfoForDAS().getWebServerRootURL(ejbendpoint.isSecure).toString() + contextRoot) ); } } catch (EndpointRegistrationException e) { logger.log(Level.SEVERE, format(rb.getString("error.registering.endpoint"),e.toString())); } return true; }
public void registerDataSourceDefinitions(com.sun.enterprise.deployment.Application application) { String appName = application.getAppName(); Set<BundleDescriptor> bundles = application.getBundleDescriptors(); for (BundleDescriptor bundle : bundles) { registerDataSourceDefinitions(appName, bundle); Collection<RootDeploymentDescriptor> dds = bundle.getExtensionsDescriptors(); if(dds != null){ for(RootDeploymentDescriptor dd : dds){ registerDataSourceDefinitions(appName, dd); } } } }
@Override public DummyApplication load(SecurityContainer container, DeploymentContext context) { DeployCommandParameters dparams = context.getCommandParameters(DeployCommandParameters.class); Application app = context.getModuleMetaData(Application.class); handleCNonceCacheBSInit(app.getAppName(), app.getBundleDescriptors(WebBundleDescriptor.class), dparams.availabilityenabled); return new DummyApplication(); }
EjbInvocation(String compEnvId, Container container) { super.componentId = compEnvId; super.container = container; super.setComponentInvocationType(ComponentInvocation.ComponentInvocationType.EJB_INVOCATION); EjbBundleDescriptor ejbBundleDesc = container.getEjbDescriptor().getEjbBundleDescriptor(); moduleName = ejbBundleDesc.getModuleName(); appName = ejbBundleDesc.getApplication().getAppName(); //By default we enable TransactionOperationsManager checks. But EjbInvocation.clone() // clears transactionOperationsManager so that, be default, cloned invocations // doesn't enforce Transaction Operations checks. transactionOperationsManager = this; }
public synchronized void undeploy(@ProbeParam("endpoint")WebServiceEndpoint endpoint) { // remove from [appName+moduleName+endpointName --> deployed data] com.sun.enterprise.deployment.Application app = endpoint.getBundleDescriptor().getApplication(); String appName = app.getAppName(); String moduleName = endpoint.getBundleDescriptor().getModuleName(); String endpointName = endpoint.getEndpointName(); Application application = applications.get(appName); if (application != null) { application.removeEndpoint(moduleName, endpointName); if (application.isEmpty()) { applications.remove(appName); } } }
public DeployedEndpointData(String path, Application app, WebServiceEndpoint endpoint) { super(path, "", ""); this.appName = app.getAppName(); this.endpointName = endpoint.getEndpointName(); this.namespace = endpoint.getServiceName().getNamespaceURI(); this.serviceName = endpoint.getServiceName().getLocalPart(); QName pName = endpoint.getWsdlPort(); this.portName = (pName != null) ? pName.getLocalPart() : ""; this.implClass = endpoint.implementedByEjbComponent() ? endpoint.getEjbComponentImpl().getEjbImplClassName() : endpoint.getServletImplClass(); this.address = path; this.wsdl = address+"?wsdl"; this.tester = address+"?Tester"; this.implType = endpoint.implementedByEjbComponent() ? "EJB" : "SERVLET"; this.deploymentType = "109"; fillStatMap(); }
private ComponentInvocation createComponentInvocation() { EjbBundleDescriptor ejbBundleDesc = getEjbDescriptor().getEjbBundleDescriptor(); ComponentInvocation newInv = new ComponentInvocation( getComponentId(), ComponentInvocation.ComponentInvocationType.SERVLET_INVOCATION, this, ejbBundleDesc.getApplication().getAppName(), ejbBundleDesc.getModuleName() ); //newInv.setJNDIEnvironment(getJNDIEnvironment()); ??? return newInv; }
public synchronized void deploy(@ProbeParam("endpoint")WebServiceEndpoint endpoint) { // add to [appName+moduleName+endpointName --> deployed data] com.sun.enterprise.deployment.Application app = endpoint.getBundleDescriptor().getApplication(); String appName = app.getAppName(); String moduleName = endpoint.getBundleDescriptor().getModuleName(); String endpointName = endpoint.getEndpointName(); // path (context path+url-pattern) --> deployed data //String id = new Endpoint(appName, moduleName, endpointName).toString(); String path = endpoint.getEndpointAddressPath(); DeployedEndpointData data = new DeployedEndpointData(path, app, endpoint); Application application = applications.get(appName); if (application == null) { application = new Application(appName); applications.put(appName, application); } application.addEndpoint(moduleName, endpointName, data); }