/** * Can be overridden if needed */ @Override protected void start(Node pollingNode, BuildableItem project, boolean newInstance, XTriggerLog log) throws XTriggerException { if (isContextOnStartupFetched()) { context = getContext(pollingNode, log); } }
@Override protected boolean checkIfModified(XTriggerLog log) throws XTriggerException { // make sure the lock is not null; when de-serialising if(lock==null){ lock = new Object(); } synchronized (lock) { C newContext = getContext(log); if (context == null) { log.info("Recording context. Check changes in next poll."); setNewContext(newContext); return false; } boolean changed = checkIfModified(context, newContext, log); return changed; } }
@Override protected boolean checkIfModified(Node pollingNode, XTriggerLog log) throws XTriggerException { // make sure the lock is not null; when de-serialising if(lock==null){ lock = new Object(); } synchronized (lock) { C newContext = getContext(pollingNode, log); if (offlineSlaveOnStartup) { log.info("No nodes were available at startup or at previous poll."); log.info("Recording environment context and waiting for next schedule to check if there are modifications."); offlineSlaveOnStartup = false; setNewContext(newContext); return false; } if (context == null) { log.info("Recording context. Check changes in next poll."); setNewContext(newContext); return false; } boolean changed = checkIfModified(context, newContext, log); return changed; } }