/** * notify the work-context-listener that the context setup is complete * * @param listener listener to be notified */ private void notifyContextSetupComplete(WorkContextLifecycleListener listener) { if (listener != null) { debug("notifying context setup complete"); listener.contextSetupComplete(); } }
/** * Calls listener after work context is setted up. * @param listener work context listener */ private void fireWorkContextSetupComplete(Object workContext) { if (workContext != null && workContext instanceof WorkContextLifecycleListener) { log.tracef("WorkContextSetupComplete(%s) for %s", workContext, this); WorkContextLifecycleListener listener = (WorkContextLifecycleListener)workContext; listener.contextSetupComplete(); } }
/** * Fire complete for HintsContext * @param work The work instance */ private void fireHintsComplete(Work work) { if (work != null && work instanceof WorkContextProvider) { WorkContextProvider wcProvider = (WorkContextProvider) work; List<WorkContext> contexts = wcProvider.getWorkContexts(); if (contexts != null && contexts.size() > 0) { Iterator<WorkContext> it = contexts.iterator(); while (it.hasNext()) { WorkContext wc = it.next(); if (wc instanceof HintsContext) { HintsContext hc = (HintsContext) wc; if (hc instanceof WorkContextLifecycleListener) { WorkContextLifecycleListener listener = (WorkContextLifecycleListener)hc; listener.contextSetupComplete(); } } } } } }