final ApplicationInfo appInfo = getApplicationInfo(ejbUtil); 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();
private ApplicationInfo getApplicationInfo(EjbContainerUtil ejbUtil) throws NamingException { ApplicationRegistry appRegistry = ejbUtil.getServices().getService(ApplicationRegistry.class); Applications applications = ejbUtil.getServices().getService(Applications.class); String appNamePrefix = (String) initialContext.lookup("java:app/AppName"); Set<String> appNames = appRegistry.getAllApplicationNames(); Set<String> disabledApps = new TreeSet<>(); for (String appName : appNames) { if (appName.startsWith(appNamePrefix)) { Application appDesc = applications.getApplication(appName); if (appDesc != null && !ejbUtil.getDeployment().isAppEnabled(appDesc)) { // skip disabled version of the app disabledApps.add(appName); } else { return ejbUtil.getDeployment().get(appName); } } } // grab the latest one, there is no way to make // sure which one the user is actually enabling, // so use the best case, i.e. upgrade Iterator<String> it = disabledApps.iterator(); String lastDisabledApp = null; while (it.hasNext()) { lastDisabledApp = it.next(); } if (lastDisabledApp != null) { return ejbUtil.getDeployment().get(lastDisabledApp); } throw new NamingException("Application Information Not Found"); }
protected Application getApplicationFromApplicationInfo( String appName) { ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo == null) { return null; } return appInfo.getMetaData(Application.class); }
private boolean getBooleanStateFromApplicationInfo(String flag, String appName) { ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo == null) { // appInfo can be null when running EjbDeployer.clean after a failed deploy return false; } Boolean rc = appInfo.getTransientAppMetaData(flag, Boolean.class); return (rc == null ? false : rc); }
/** * Suspends this application. * * @param appName the registration application ID * @return true if suspending was successful, false otherwise. */ public boolean suspend(String appName) { boolean isSuccess = true; ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo != null) { isSuccess = appInfo.suspend(logger); } return isSuccess; }
/** * Resumes this application. * * @param appName the registration application ID * @return true if resumption was successful, false otherwise. */ public boolean resume(String appName) { boolean isSuccess = true; ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo != null) { isSuccess = appInfo.resume(logger); } return isSuccess; }
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; }
public void load(ExtendedDeploymentContext context, ProgressTracker tracker) { getContainerInfo().load(context); tracker.add("loaded", EngineRef.class, this); }
/** * 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 engine : _getEngineRefs()) { sniffers.add(engine.getContainerInfo().getSniffer()); } return sniffers; }
@Override protected ExtendedDeploymentContext getSubContext(ModuleInfo module, ExtendedDeploymentContext context) { return subContext(application, context, module.getName()); }
public <T> void addAll(Class<T> type, Iterable<T> subjects) { for (T subject : subjects) { add(type, subject); } }
private boolean getBooleanStateFromApplicationInfo(String flag, String appName) { ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo == null) { // appInfo can be null when running EjbDeployer.clean after a failed deploy return false; } Boolean rc = appInfo.getTransientAppMetaData(flag, Boolean.class); return (rc == null ? false : rc); }
/** * Suspends this application. * * @param appName the registration application ID * @return true if suspending was successful, false otherwise. */ public boolean suspend(String appName) { boolean isSuccess = true; ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo != null) { isSuccess = appInfo.suspend(logger); } return isSuccess; }
/** * Resumes this application. * * @param appName the registration application ID * @return true if resumption was successful, false otherwise. */ public boolean resume(String appName) { boolean isSuccess = true; ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo != null) { isSuccess = appInfo.resume(logger); } return isSuccess; }
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; }
public void load(ExtendedDeploymentContext context, ProgressTracker tracker) { getContainerInfo().load(context); tracker.add("loaded", EngineRef.class, this); }
public <T> void addAll(Class<T> type, Iterable<T> subjects) { for (T subject : subjects) { add(type, subject); } }