/** Finds the matching entry. */ @Override public final void generateController(String name, ArrayList<E> controllerList) { updateIfModifiedNow(); Thread thread = Thread.currentThread(); ClassLoader oldLoader = thread.getContextClassLoader(); try { thread.setContextClassLoader(getParentClassLoader()); String key = nameToKey(name); ExpandVersion version = _expandManager.getPrimaryVersion(key); if (version == null) version = _expandManager.getVersion(key); if (version == null) return; E controller = createController(version); if (controller != null) { controller.addExpandCleanupFileSet(_expandCleanupFileSet); controllerList.add(controller); // _controllerNames.add(name); // server/1d19 } } finally { thread.setContextClassLoader(oldLoader); } }
/** Returns true if the deployment has modified. */ @Override public boolean isModified() { if (!_isChecking.compareAndSet(false, true)) { return _isModified; } try { long now = Alarm.getCurrentTime(); if (now < _lastCheckTime + _checkInterval) { return _isModified; } _lastCheckTime = Alarm.getCurrentTime(); if (_expandManager != null) { _isModified = _expandManager.isModified(); _digest = _expandManager.getDigest(); } else _isModified = true; return _isModified; } catch (Exception e) { log.log(Level.FINE, e.toString(), e); return false; } finally { _isChecking.set(false); } }
private void deploy() { try { _expandManager = new ExpandManager( getId(), _directoryManager, _archiveManager, _repositoryManager, _isVersioning); _deployedKeys = _expandManager.getBaseKeySet(); _versionKeys = _expandManager.getKeySet(); _isModified = false; } catch (Exception e) { log.log(Level.WARNING, e.toString(), e); } }
public ExpandVersion getPrimaryVersion(String key) { return _expandManager.getPrimaryVersion(key); }
/** Return true for a matching key. */ protected boolean isDeployedKey(String key) { if (key == null) return false; else if (_deployedKeys.contains(key)) return true; else if (_expandManager.getKeySet().contains(key)) return true; else return false; }
/** Log the reason for modification */ @Override public boolean logModified(Logger log) { return _expandManager.logModified(log); }