private Application getApplicationByName(String name){ Application application = null; List<Application> apps = getApplications().getApplications(); for(Application app : apps){ if(app.getName().equals(name)){ application = app; break; } } return application; } /**
applications.getApplicationsWithSnifferType(ServerTags.CONNECTOR, true); allApplications.addAll(applications.getApplications()); allApplications.addAll(systemApplications.getApplications());
public static List<Application> getApplicationsInTarget(Domain me, String target) { if (target.equals("domain")) { // special target domain return me.getApplications().getApplications(); } List<Application> apps = new ArrayList<Application>(); List<ApplicationRef> applicationRefs = me.getApplicationRefsInTarget(target); for (ApplicationRef ref : applicationRefs) { Application app = me.getApplications().getApplication(ref.getRef()); if (app != null) { apps.add(app); } } return apps; }
public static List<Application> getApplicationsInTarget(Domain me, String target) { if (target.equals("domain")) { // special target domain return me.getApplications().getApplications(); } List<Application> apps = new ArrayList<Application>(); List<ApplicationRef> applicationRefs = me.getApplicationRefsInTarget(target); for (ApplicationRef ref : applicationRefs) { Application app = me.getApplications().getApplication(ref.getRef()); if (app != null) { apps.add(app); } } return apps; }
/** * @param directory * @return the name of the version currently using the directory, else null * @throws VersioningDeploymentSyntaxException */ public String getVersionFromSameDir(File dir) throws VersioningDeploymentSyntaxException{ try { Iterator it = domain.getApplications().getApplications().iterator(); Application app = null; // check if directory deployment exist while ( it.hasNext() ) { app = (Application) it.next(); if (app.getLocation().equals(dir.toURI().toString())) { if(!VersioningDeploymentUtil.getUntaggedName(app.getName()).equals(app.getName())){ return app.getName(); } } } } catch (VersioningDeploymentSyntaxException ex) { // return null if an exception is thrown } return null; } }
private Properties prepareUndeployActionProperties(String archiveName, String target) { DeploymentProperties dProps = new DeploymentProperties(); // we need to find the application registration name // which is not always the same as archive name String appName = archiveName; List<Application> applications = apps.getApplications(); for (Application app : applications) { String defaultAppName = app.getDeployProperties().getProperty (DeploymentProperties.DEFAULT_APP_NAME); if (defaultAppName != null && defaultAppName.equals(archiveName)) { appName = app.getName(); } } dProps.setName(appName); // dProps.setResourceAction(DeploymentProperties.RES_UNDEPLOYMENT); // dProps.setResourceTargetList(target); return (Properties)dProps; }
/** * Get the version directory-deployed from the given directory * * @param directory * @return the name of the version currently using the directory, else null * @throws VersioningSyntaxException * */ public String getVersionFromSameDir(File dir) throws VersioningSyntaxException{ try { Iterator it = domain.getApplications().getApplications().iterator(); Application app = null; // check if directory deployment exist while ( it.hasNext() ) { app = (Application) it.next(); if (app.getLocation().equals(dir.toURI().toString())) { if(!VersioningUtils.getUntaggedName(app.getName()).equals(app.getName())){ return app.getName(); } } } } catch (VersioningSyntaxException ex) { // return null if an exception is thrown } return null; } }
/** * Extract the set of version(s) of the given application represented as * an untagged version name * * @param untaggedName the application name as an untagged version : an * application name without version identifier * @param target the target where we want to get all the versions * @return all the version(s) of the given application */ private final List<String> getAllversions(String untaggedName, String target) { List<Application> allApplications = null; if (target != null) { allApplications = domain.getApplicationsInTarget(target); } else { allApplications = domain.getApplications().getApplications(); } return VersioningUtils.getVersions(untaggedName, allApplications); }
/** * Extract the set of version(s) of the given application represented as * an untagged version name * * @param untaggedName the application name as an untagged version : an * application name without version identifier * @param target the target where we want to get all the versions * @return all the version(s) of the given application */ public final List<String> getAllversions(String untaggedName, String target) { List<Application> allApplications = null; if (target != null) { allApplications = domain.getApplicationsInTarget(target); } else { allApplications = domain.getApplications().getApplications(); } return VersioningDeploymentUtil.getVersions(untaggedName, allApplications); }
allApps.addAll(domain.getApplications().getApplications()); allApps.addAll(domain.getSystemApplications().getApplications()); for (Application app : allApps) {
allApps.addAll(domain.getApplications().getApplications()); allApps.addAll(domain.getSystemApplications().getApplications()); for (Application app : allApps) {
private void onInitialization() throws ServerLifecycleException { List<Application> applications = apps.getApplications(); List<Application> lcms = new ArrayList<Application>();; for (Application app : applications) {
/** * Do cleanup of system-resource-adapter, resources, pools */ public void preDestroy() { if (isConnectorRuntimeInitialized()) { Collection<Application> apps = applications.getApplications(); if(apps != null){ for(Application app : apps){ Resources resources = app.getResources(); if(resources != null){ undeploySystemResources(resources); } List<Module> modules = app.getModule(); if(modules != null){ for(Module module : modules){ Resources moduleScopedResources = module.getResources(); if(moduleScopedResources != null){ undeploySystemResources(moduleScopedResources); } } } } } } else { if(_logger.isLoggable(Level.FINEST)){ _logger.finest("ConnectorRuntime not initialized, hence skipping " + "resource-adapters shutdown, resources, pools cleanup"); } } }
private Collection<ConnectorResource> getAllConnectorResources() { Collection<ConnectorResource> allResources = new ArrayList<ConnectorResource>(); Collection<ConnectorResource> connectorResources = domain.getResources().getResources(ConnectorResource.class); allResources.addAll(connectorResources); for(Application app : applications.getApplications()){ if(ResourcesUtil.createInstance().isEnabled(app)){ Resources appScopedResources = app.getResources(); if(appScopedResources != null && appScopedResources.getResources() != null){ allResources.addAll(appScopedResources.getResources(ConnectorResource.class)); } List<Module> modules = app.getModule(); if(modules != null){ for(Module module : modules){ Resources msr = module.getResources(); if(msr != null && msr.getResources() != null){ allResources.addAll(msr.getResources(ConnectorResource.class)); } } } } } return allResources; }
private Collection<JdbcResource> getAllJdbcResources() { Collection<JdbcResource> allResources = new ArrayList<JdbcResource>(); Collection<JdbcResource> jdbcResources = domain.getResources().getResources(JdbcResource.class); allResources.addAll(jdbcResources); for(Application app : applications.getApplications()){ if(ResourcesUtil.createInstance().isEnabled(app)){ Resources appScopedResources = app.getResources(); if(appScopedResources != null && appScopedResources.getResources() != null){ allResources.addAll(appScopedResources.getResources(JdbcResource.class)); } List<Module> modules = app.getModule(); if(modules != null){ for(Module module : modules){ Resources msr = module.getResources(); if(msr != null && msr.getResources() != null){ allResources.addAll(msr.getResources(JdbcResource.class)); } } } } } return allResources; }
for (Application application : domain.getApplications().getApplications()) { if (isSameApp(appName, application.getName())) {
public void postConstruct() { Collection<Application> apps = applications.getApplications(); if(apps != null){ for(Application app : apps){ Resources resources = app.getResources(); if(resources != null){ deployResources(resources.getResources()); } List<Module> modules = app.getModule(); if(modules != null){ for(Module module : modules){ Resources moduleResources = module.getResources(); if(moduleResources != null){ deployResources(moduleResources.getResources()); } } } } } }
for (Application app : domain.getApplications().getApplications()) { System.out.println("Checking app " + app.getName()); Application app_w = null;
for (Application app : domain.getApplications().getApplications()) { System.out.println("Checking app " + app.getName()); Application app_w = null;
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());