public synchronized void close() { vertx.cancelTimer(timerID); Set<Deployment> deps = new HashSet<>(); for (Map.Entry<Path, Set<Deployment>> entry: watchedDeployments.entrySet()) { deps.addAll(entry.getValue()); } toUndeploy.addAll(deps); processUndeployments(); try { watchService.close(); } catch (IOException ex) { log.warn("Error while shutting down watch service: " + ex.getMessage(), ex); } closed = true; }
/** * Create the singleton Hazelcast instance if necessary * @return */ private synchronized HazelcastInstance initHazelcast() { if (instance == null) { Config cfg = getConfig(null); if (cfg == null) { log.warn("Cannot find cluster.xml on classpath. Using default cluster configuration"); } // default instance instance = Hazelcast.init(cfg); // Properly shutdown all instances Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { Hazelcast.shutdownAll(); } }); } return instance; }
log.warn("Overflow event on watched directory"); continue;
is = getClass().getClassLoader().getResourceAsStream("langs.properties"); if (is == null) { log.warn("No language mappings found!"); } else { Properties props = new Properties();
logger.warn("Invalid URI: " + uri + ". Attempting to parse query string.", e); QueryStringDecoder decoder = new QueryStringDecoder(uri);
String prevMod = includedJars.get(jarName); if (prevMod != null) { log.warn("Warning! jar file " + jarName + " is contained in module " + prevMod + " and also in module " + modName + " which are both included (perhaps indirectly) by module " +
private void unzipModule(final ModuleIdentifier modID, final ModuleZipInfo zipInfo, boolean deleteZip) { // We synchronize to prevent a race whereby it tries to unzip the same module at the // same time (e.g. deployModule for the same module name has been called in parallel) String modName = modID.toString(); synchronized (modName.intern()) { checkCreateModDirs(); File fdest = new File(modRoot, modName); File sdest = new File(systemModRoot, modName); if (fdest.exists() || sdest.exists()) { // This can happen if the same module is requested to be installed // at around the same time // It's ok if this happens log.warn("Module " + modID + " is already installed"); return; } // Unzip into temp dir first File tdest = unzipIntoTmpDir(zipInfo, deleteZip); // Check if it's a system module JsonObject conf = loadModuleConfig(createModJSONFile(tdest), modID); ModuleFields fields = new ModuleFields(conf); boolean system = fields.isSystem(); // Now copy it to the proper directory String moveFrom = tdest.getAbsolutePath(); safeMove(moveFrom, system ? sdest.getAbsolutePath() : fdest.getAbsolutePath()); log.info("Module " + modID +" successfully installed"); } }
ModuleIdentifier modID = new ModuleIdentifier(moduleName); if (included.contains(modID.toString())) { log.warn("Module " + modID + " is included more than once in chain of includes"); } else { included.add(modID.toString());