List<AppModule> apps = new LinkedList<AppModule>();
// get all modules that were started with dynamo
for ( Object o : getAppLauncher().getModules() ) {
AppModule module = (AppModule) o;
for ( String APPLICATION_PRODUCT_MODULE : APPLICATION_PRODUCT_MODULES ) {
// in order to work around bug 80207, we allow a colon ":" in
// the specified module names. if a colon exists, the name
// before the colon is the name of the module that would be
// started if the application is running. the name after the
// colon is the module containing the MANIFEST.MF file with
// build info. if there is no colon, assume the two modules
// are the same.
int idx = APPLICATION_PRODUCT_MODULE.indexOf(":");
if ( idx == -1 ) {
// no colon...
if ( (APPLICATION_PRODUCT_MODULE).equals(module.getName()) ) {
apps.add(module);
}
} else {
if ( APPLICATION_PRODUCT_MODULE.substring(0, idx).equals(module.getName()) ) {
// NOTE: getAppLauncher().getModule(...) will return a
// module as long as it exists; the module does not need
// to be running.
try {
AppModule mod = getAppLauncher().getModule(
APPLICATION_PRODUCT_MODULE.substring(idx + 1)
);
logger.info("Mod: {}", mod);
if ( mod != null ) {
apps.add(mod);