use of org.glassfish.api.admin.config.ApplicationName in project Payara by payara.
the class DynamicReloader method chooseAppsToReload.
private synchronized List<AppReloadInfo> chooseAppsToReload() throws URISyntaxException {
List<AppReloadInfo> result = new ArrayList<AppReloadInfo>();
/*
* The collectionof AppReloadInfo might not contain entries for all
* current apps (for example, if an app has been deployed since the
* previous run of the reloader). Use the current list of all known
* apps, and for each of those try to find an AppReloadInfo entry for
* it.
*/
Set<AppReloadInfo> possiblyUndeployedApps = new HashSet<AppReloadInfo>(appReloadInfo.values());
for (ApplicationName m : applications.getModules()) {
if (m instanceof Application) {
Application app = (Application) m;
if (app.getLocation() == null || Boolean.valueOf(app.getDeployProperties().getProperty(ServerTags.IS_LIFECYCLE))) {
// skip lifecycle modules
continue;
}
AppReloadInfo reloadInfo = findOrCreateAppReloadInfo(app);
if (reloadInfo.needsReload()) {
logger.fine("[Reloader] Selecting app " + reloadInfo.getApplication().getName() + " to reload");
result.add(reloadInfo);
}
possiblyUndeployedApps.remove(reloadInfo);
}
}
/*
* Remove any apps from the reload info that are no longer present.
*/
for (AppReloadInfo info : possiblyUndeployedApps) {
logger.fine("[Reloader] Removing undeployed app " + info.getApplication().getName() + " from reload info");
appReloadInfo.remove(info.getApplication().getName());
}
return result;
}
use of org.glassfish.api.admin.config.ApplicationName in project Payara by payara.
the class DynamicReloader method initAppReloadInfo.
/**
* Records reload information about the currently-known applications.
*
* @param applications
*/
private synchronized void initAppReloadInfo(Applications applications) throws URISyntaxException {
appReloadInfo = new HashMap<String, AppReloadInfo>();
logger.fine("[Reloader] Preparing list of apps to monitor:");
for (ApplicationName m : applications.getModules()) {
if (m instanceof Application) {
Application app = (Application) m;
if (Boolean.valueOf(app.getDeployProperties().getProperty(ServerTags.IS_LIFECYCLE))) {
// skip lifecycle modules
continue;
}
AppReloadInfo info = new AppReloadInfo(app);
appReloadInfo.put(app.getName(), info);
logger.fine("[Reloader] Monitoring " + app.getName() + " at " + app.getLocation());
}
}
}
use of org.glassfish.api.admin.config.ApplicationName in project Payara by payara.
the class ConfigBeansUtilities method getAllDefinedSystemApplications.
public List<Application> getAllDefinedSystemApplications() {
List<Application> allSysApps = new ArrayList<Application>();
SystemApplications sa = domain.getSystemApplications();
if (sa != null) {
for (ApplicationName m : sa.getModules()) {
if (m instanceof Application)
allSysApps.add((Application) m);
}
}
return allSysApps;
}
use of org.glassfish.api.admin.config.ApplicationName in project Payara by payara.
the class ConfigBeansUtilities method getLocation.
public String getLocation(String moduleID) {
ApplicationName module = getModule(moduleID);
if (module == null) {
return null;
}
String location = null;
if (module instanceof Application) {
location = ((Application) module).getLocation();
}
try {
if (location != null) {
return new URI(location).getPath();
} else {
return null;
}
} catch (URISyntaxException e) {
return null;
}
}
use of org.glassfish.api.admin.config.ApplicationName in project Payara by payara.
the class ConnectorsUtil method isStandAloneRA.
public static boolean isStandAloneRA(String moduleName) {
ConfigBeansUtilities cbu = getConfigBeansUtilities();
ApplicationName an = null;
if (cbu != null) {
an = cbu.getModule(moduleName);
}
return (an != null);
}
Aggregations