Container container; try { container = engineInfo.getContainer(); } catch(Exception e) { logger.log(Level.SEVERE, KernelLoggerInfo.cantStartContainer, new Object[] {engineInfo.getSniffer().getModuleType(), e}); return false; try { deployer = habitat.getService(deployerClass); engineInfo.setDeployer(deployer); } catch (MultiException e) { report.failure(logger, "Cannot instantiate or inject "+deployerClass, e); engineInfo.stop(logger); return false; } catch (ClassCastException e) { engineInfo.stop(logger); report.failure(logger, deployerClass+" does not implement " + " the org.jvnet.glassfish.api.deployment.Deployer interface", e);
public void stop(Logger logger) { if (getDeployer()!=null) { Inhabitant i = registry.habitat.getInhabitantByType(getDeployer().getClass()); if (i!=null) { i.release(); } } if (getContainer()!=null) { Inhabitant i = registry.habitat.getInhabitantByType(getContainer().getClass()); if (i!=null) { i.release(); } } registry.removeContainer(this); if (logger.isLoggable(Level.FINE)) { logger.fine("Container " + getContainer().getName() + " stopped"); } } }
public void clean(ExtendedDeploymentContext context) { try { getContainerInfo().clean(context); } catch (Exception e) { context.getLogger().log(Level.WARNING, "Exception while cleaning module '" + this + "'" + e, e); } }
public void clean(ExtendedDeploymentContext context) throws Exception { getDeployer().clean(context); cleanup(); }
protected void stopContainers(EngineInfo[] ctrInfos, Logger logger) { for (EngineInfo ctrInfo : ctrInfos) { try { ctrInfo.stop(logger); } catch(Exception e) { // this is not a failure per se but we need to document it. logger.log(Level.INFO, KernelLoggerInfo.cantReleaseContainer, new Object[] {ctrInfo.getSniffer().getModuleType(), e}); } } }
public List<Sniffer> getStartedContainersSniffers() { ArrayList<Sniffer> sniffers = new ArrayList<Sniffer>(); for (EngineInfo info : getContainers() ) { sniffers.add(info.getSniffer()); } return sniffers; }
engineInfo.getSniffer().getModuleType()); Deployer deployer = engineInfo.getDeployer(); ApplicationContainer appCtr = deployer.load(engineInfo.getContainer(), context); if (appCtr==null) { String msg = "Cannot load application in " + engineInfo.getContainer().getName() + " container"; logger.fine(msg); continue; engineInfo.getSniffer().getModuleType());
Deployer deployer = engineInfo.getDeployer(); engineInfo.getSniffer().getModuleType() ); engineInfo.getSniffer().getModuleType() ); for (EngineRef er : mi.getEngineRefs()) { ApplicationConfig c = savedAppConfig.get(mi.getName(), er.getContainerInfo().getSniffer().getModuleType()); if (c != null) { er.setApplicationConfig(c);
public <T extends Container> EngineRef getEngineRefForContainer(Class<T> type) { for (EngineRef engine : _getEngineRefs()) { T container = null; try { container = type.cast(engine.getContainerInfo().getContainer()); } catch (Exception e) { // ignore, wrong container } if (container!=null) { return engine; } } return null; }
localStrings.getLocalString("status", "Status"), localStrings.getLocalString("started", "Started")); Module connectorModule = modulesRegistry.find(engineInfo.getSniffer().getClass()); container.addProperty(localStrings.getLocalString("connector", "Connector"), connectorModule.getModuleDefinition().getName() + ":" + connectorModule.getModuleDefinition().getVersion()); container.addProperty(localStrings.getLocalString("implementation", "Implementation"), engineInfo.getContainer().getClass().toString()); boolean atLeastOne = false; for (Application app : applications.getApplications()) { for (com.sun.enterprise.config.serverbeans.Module module : app.getModule()) { Engine engine = module.getEngine(engineInfo.getSniffer().getModuleType()); if (engine!=null) { if (!atLeastOne) {
/** * unloads the module from its container. * * @param context unloading context * @return */ public boolean unload(ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); // then remove the application from the container Deployer deployer = ctrInfo.getDeployer(); try { deployer.unload(appCtr, context); ctrInfo.unload(context); } catch(Exception e) { report.failure(context.getLogger(), "Exception while shutting down application container", e); return false; } appCtr=null; return true; }
protected <T extends Container, U extends ApplicationContainer> Deployer<T, U> getDeployer(EngineInfo<T, U> engineInfo) { return engineInfo.getDeployer(); }
public synchronized void addContainer(String name, EngineInfo info) { containers.put(name, info); info.setRegistry(this); }
public void load(ExtendedDeploymentContext context, ProgressTracker tracker) { getContainerInfo().load(context); tracker.add("loaded", EngineRef.class, this); }
engineInfo.stop(logger);
/** * Sets whether this application is a JavaEE application * @param engineInfos the engine info list */ public void setIsJavaEEApp(List<EngineInfo> engineInfos) { for (EngineInfo engineInfo : engineInfos) { Sniffer sniffer = engineInfo.getSniffer(); if (sniffer.isJavaEE()) { isJavaEEApp = true; break; } } }
engineInfo.getSniffer().getModuleType()); Deployer deployer = engineInfo.getDeployer(); ApplicationContainer appCtr = deployer.load(engineInfo.getContainer(), context); if (appCtr==null) { String msg = "Cannot load application in " + engineInfo.getContainer().getName() + " container"; logger.fine(msg); continue; engineInfo.getSniffer().getModuleType());
Deployer deployer = engineInfo.getDeployer(); engineInfo.getSniffer().getModuleType() ); engineInfo.getSniffer().getModuleType() ); for (EngineRef er : mi.getEngineRefs()) { ApplicationConfig c = savedAppConfig.get(mi.getName(), er.getContainerInfo().getSniffer().getModuleType()); if (c != null) { er.setApplicationConfig(c);
public <T extends Container> EngineRef getEngineRefForContainer(Class<T> type) { for (EngineRef engine : _getEngineRefs()) { T container = null; try { container = type.cast(engine.getContainerInfo().getContainer()); } catch (Exception e) { // ignore, wrong container } if (container!=null) { return engine; } } return null; }
protected void stopContainers(EngineInfo[] ctrInfos, Logger logger) { for (EngineInfo ctrInfo : ctrInfos) { try { ctrInfo.stop(logger); } catch(Exception e) { // this is not a failure per se but we need to document it. logger.log(Level.INFO, KernelLoggerInfo.cantReleaseContainer, new Object[] {ctrInfo.getSniffer().getModuleType(), e}); } } }