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"); }
private void notifyLifecycleInterceptorsBefore(final ExtendedDeploymentContext.Phase phase, final ExtendedDeploymentContext dc) { for (ApplicationLifecycleInterceptor i : alcInterceptors) { i.before(phase, dc); } }
public int compare(Object o1, Object o2) { if ((o1 instanceof ApplicationOrderInfo) && (o2 instanceof ApplicationOrderInfo)) { return compare((ApplicationOrderInfo)o1, (ApplicationOrderInfo)o2); } return defaultCompare(o1, o2); }
/** Creates a new instance of DeploymentContext */ public DeploymentContextImpl(Deployment.DeploymentContextBuilder builder, ServerEnvironment env) { this(builder.report(), builder.logger(), builder.sourceAsArchive(), builder.params(), env); } public DeploymentContextImpl(ActionReport actionReport, Logger logger,
public boolean isInstance(Object obj) { if (super.isInstance(obj)) { ApplicationOrderInfo appOrderInfo = (ApplicationOrderInfo)obj; if ((appOrderInfo.getApplication().containsSnifferType(ServerTags.CONNECTOR)) && (appOrderInfo.getApplication().isStandaloneModule())) { return true; } } return false; } };
void print(PrintStream ps) { ps.println("Container : " + name + " Mark " + mark.toString() + " at " + elapsedInMs()); } }
void print(PrintStream ps) { ps.println("Module " + moduleName + " Mark " + mark.toString() + " at " + elapsedInMs()); } }
void print(PrintStream ps) { ps.println("Mark " + mark.toString() + " at " + elapsedInMs()); } }
private void notifyLifecycleInterceptorsAfter(final ExtendedDeploymentContext.Phase phase, final ExtendedDeploymentContext dc) { for (ApplicationLifecycleInterceptor i : alcInterceptors) { i.after(phase, dc); } }
public String getDefaultApplicationName(ReadableArchive archive) { return getDefaultApplicationName(archive, null); }
protected int compare(ApplicationOrderInfo d1, ApplicationOrderInfo d2) { int comp = new Integer(d1.getApplication().getDeploymentOrder()).compareTo(new Integer(d2.getApplication().getDeploymentOrder())); if (comp == 0) { return defaultCompare(d1,d2); } return comp; } }
/** * This is called by getTypeDependencies(). * @return an array of all ejb annotation types */ protected Class<? extends Annotation>[] getEjbAnnotationTypes() { if (ejbProvider!=null) { return ejbProvider.getAnnotationTypes(); } else { return new Class[0]; } }
public boolean isInstance(Object obj) { if (super.isInstance(obj)) { ApplicationOrderInfo appOrderInfo = (ApplicationOrderInfo)obj; if (appOrderInfo.getApplication().getObjectType().equals(USER)) { return true; } } return false; } };
private void notifyLifecycleInterceptorsBefore(final ExtendedDeploymentContext.Phase phase, final ExtendedDeploymentContext dc) { for (ApplicationLifecycleInterceptor i : alcInterceptors) { i.before(phase, dc); } }
private void notifyLifecycleInterceptorsAfter(final ExtendedDeploymentContext.Phase phase, final ExtendedDeploymentContext dc) { for (ApplicationLifecycleInterceptor i : alcInterceptors) { i.after(phase, dc); } }
public String getDefaultApplicationName(ReadableArchive archive) { return getDefaultApplicationName(archive, null); }
public boolean isInstance(Object obj) { if (super.isInstance(obj)) { ApplicationOrderInfo appOrderInfo = (ApplicationOrderInfo)obj; if (appOrderInfo.getApplication().getObjectType().startsWith(SYSTEM_PREFIX)) { return true; } } return false; } };