final List<String> tempLibNames = new LinkedList<>(); for (ModuleInfo moduleInfo : appInfo.getModuleInfos()) { final String jarName = moduleInfo.getName(); if (jarName.endsWith(".jar") || jarName.endsWith(".war")) { final String moduleName = jarName.substring(0, jarName.length() - 4); tempLibNames.add(moduleName); final Object bundleDescriptor = moduleInfo.getMetaData(EjbBundleDescriptorImpl.class.getName()); if (bundleDescriptor instanceof EjbBundleDescriptorImpl) { final Collection<EjbDescriptor> ejbs = ((EjbBundleDescriptorImpl) bundleDescriptor).getEjbs();
ModuleInfo mi = new ModuleInfo(events, moduleName, addedEngines, context.getModuleProps()); for (EngineRef er : mi.getEngineRefs()) { ApplicationConfig c = savedAppConfig.get(mi.getName(), er.getContainerInfo().getSniffer().getModuleType()); if (c != null) {
/** * Saves its state to the configuration. this method must be called within a transaction * to the configured Application instance. * * @param app the application being persisted */ public void save(Application app) throws TransactionFailure, PropertyVetoException { for (EngineRef ref : engines) { Engine engine = app.createChild(Engine.class); app.getEngine().add(engine); ref.save(engine); } for (ModuleInfo module : modules) { Module modConfig = app.getModule(module.getName()); if (modConfig == null) { // not a JavaEE module, create it here modConfig = app.createChild(Module.class); modConfig.setName(module.getName()); app.getModule().add(modConfig); } module.save(modConfig); } }
public void start( ExtendedDeploymentContext context, ProgressTracker tracker) throws Exception { DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class); if (tracing!=null) { tracing.addMark(DeploymentTracing.Mark.START); } super.start(context, tracker); // registers all deployed items. for (ModuleInfo module : getModuleInfos()) { if (tracing!=null) { tracing.addModuleMark(DeploymentTracing.ModuleMark.START, module.getName()); } module.start(getSubContext(module, context), tracker); if (tracing!=null) { tracing.addModuleMark( DeploymentTracing.ModuleMark.STARTED, module.getName()); } } if (tracing!=null) { tracing.addMark(DeploymentTracing.Mark.START_EVENTS); } if (events!=null) { events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_STARTED, this), false); } if (tracing!=null) { tracing.addMark(DeploymentTracing.Mark.STARTED); } }
for (Sniffer moduleSniffer : moduleInfo.getSniffers()) ReadableArchive moduleArchive = appInfo.getSource().getSubArchive(moduleInfo.getName()); addToResultDDList(moduleInfo.getName(), moduleSniffer.getDeploymentConfigurations(moduleArchive), part);
public Set<EngineRef> getEngineRefs() { Set<EngineRef> copy = new LinkedHashSet<EngineRef>(); copy.addAll(_getEngineRefs()); return copy; }
info.map.put(module.getName(), module.getModuleProps()); deploymentContext.getModuleProps().putAll(module.getModuleProps());
@Override protected ExtendedDeploymentContext getSubContext(ModuleInfo module, ExtendedDeploymentContext context) { return subContext(application, context, module.getName()); }
moduleInfo.addMetaData(m); appInfo.addMetaData(m); for (EngineRef ref : moduleInfo.getEngineRefs()) { appInfo.add(ref);
public void clean(ExtendedDeploymentContext context) throws Exception { super.clean(context); for (ModuleInfo info : reversedModules) { info.clean(getSubContext(info,context)); info = null; if (module.getClassLoaders() != null) { for (ClassLoader cloader : module.getClassLoaders()) { try { PreDestroy.class.cast(cloader).preDestroy(); module.cleanClassLoaders();
Thread.currentThread().setContextClassLoader(appClassLoader); context.setClassLoader(appClassLoader); super.unload(context); for (ModuleInfo module : getModuleInfos()) { module.unload(getSubContext(module, context)); if (module.getClassLoaders() != null) { for (ClassLoader cloader : module.getClassLoaders()) { try { PreDestroy.class.cast(cloader).preDestroy(); module.cleanClassLoaders();
/** * Returns the list of sniffers that participated in loaded this * application * * @return array of sniffer that loaded the application's module */ public Collection<Sniffer> getSniffers() { List<Sniffer> sniffers = new ArrayList<Sniffer>(); for (EngineRef ref : engines) { sniffers.add(ref.getContainerInfo().getSniffer()); } for (ModuleInfo module : modules) { sniffers.addAll(module.getSniffers()); } return sniffers; }
(WebBundleDescriptor) moduleInfo.getMetaData( "org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl"); loadPolicy(webBD, false);
public ModuleInfo doBundle(ModuleDescriptor bundle) throws Exception { ExtendedDeploymentContext sContext = subContext(application, context, bundle.getArchiveUri()); ModuleInfo info = prepareBundle(bundle, application, sContext); if (info == null) { sContext.getActionReport().setActionExitCode(ActionReport.ExitCode.WARNING); String msg = localStrings.getLocalString("skipmoduleprocessing", "Skipped processing for module {0} as its module type was not recognized", bundle.getArchiveUri()); sContext.getActionReport().setMessage(msg); deplLogger.log(Level.WARNING, UNRECOGNIZED_MODULE_TYPE, bundle.getArchiveUri()); return null; } info.addMetaData(application); BundleDescriptor bundleDesc = application.getModuleByUri( bundle.getArchiveUri()); info.addMetaData(bundleDesc); for (RootDeploymentDescriptor ext : bundleDesc.getExtensionsDescriptors()) { info.addMetaData(ext); } appInfo.addModule(info); return info; }
public void clean(ExtendedDeploymentContext context) throws Exception { // clean the app level classloader if it's not already // cleaned if (appClassLoader != null) { try { PreDestroy.class.cast(appClassLoader).preDestroy(); } catch (Exception e) { // ignore, the class loader does not need to be // explicitely stopped or already stopped } appClassLoader = null; } super.clean(context); for (ModuleInfo info : modules) { info.clean(getSubContext(info,context)); info = null; } if (events!=null) { events.send(new EventListener.Event<DeploymentContext>(Deployment.APPLICATION_CLEANED, context), false); } }
ModuleInfo mi = new ModuleInfo(events, moduleName, addedEngines, context.getModuleProps()); for (EngineRef er : mi.getEngineRefs()) { ApplicationConfig c = savedAppConfig.get(mi.getName(), er.getContainerInfo().getSniffer().getModuleType()); if (c != null) {
/** * Saves its state to the configuration. this method must be called within a transaction * to the configured Application instance. * * @param app the application being persisted */ public void save(Application app) throws TransactionFailure, PropertyVetoException { for (EngineRef ref : engines) { Engine engine = app.createChild(Engine.class); app.getEngine().add(engine); ref.save(engine); } for (ModuleInfo module : modules) { Module modConfig = app.getModule(module.getName()); if (modConfig == null) { // not a JavaEE module, create it here modConfig = app.createChild(Module.class); modConfig.setName(module.getName()); app.getModule().add(modConfig); } module.save(modConfig); } }
public void start( ExtendedDeploymentContext context, ProgressTracker tracker) throws Exception { DeploymentTracing tracing = context.getModuleMetaData(DeploymentTracing.class); if (tracing!=null) { tracing.addMark(DeploymentTracing.Mark.START); } super.start(context, tracker); // registers all deployed items. for (ModuleInfo module : getModuleInfos()) { if (tracing!=null) { tracing.addModuleMark(DeploymentTracing.ModuleMark.START, module.getName()); } module.start(getSubContext(module, context), tracker); if (tracing!=null) { tracing.addModuleMark( DeploymentTracing.ModuleMark.STARTED, module.getName()); } } if (tracing!=null) { tracing.addMark(DeploymentTracing.Mark.START_EVENTS); } if (events!=null) { events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_STARTED, this), false); } if (tracing!=null) { tracing.addMark(DeploymentTracing.Mark.STARTED); } }