private void deploy() { List startList = new ArrayList(); Iterator iter = dirMap.entrySet().iterator(); try { while (iter.hasNext() && !shutdown) { Map.Entry entry = (Map.Entry) iter.next(); File f = (File) entry.getKey(); QEntry qentry = (QEntry) entry.getValue(); long deployed = qentry.getDeployed(); if (deployed == 0) { if (deploy(f)) { if (qentry.isQBean()) startList.add(qentry.getInstance()); qentry.setDeployed(f.lastModified()); } else { // deploy failed, clean up. iter.remove(); } } else if (deployed != f.lastModified()) { undeploy(f); iter.remove(); loader.forceNewClassLoaderOnNextScan(); } } iter = startList.iterator(); while (iter.hasNext()) { start((ObjectInstance) iter.next()); } } catch (Exception e) { log.error("deploy", e); } }
private void undeploy() { Object[] set = dirMap.entrySet().toArray(); int l = set.length; while (l-- > 0) { Map.Entry entry = (Map.Entry) set[l]; File f = (File) entry.getKey(); undeploy(f); } }
private void checkModified() { Iterator iter = dirMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); File f = (File) entry.getKey(); QEntry qentry = (QEntry) entry.getValue(); if (qentry.isQBean() && qentry.isQPersist()) { ObjectName name = qentry.getObjectName(); if (getState(name) == QBean.STARTED && isModified(name)) { qentry.setDeployed(persist(f, name)); } } } }