public Object getObject() throws Exception { return ResourceFactory.getResourceChangeScannerService(); }
public Object getObject() throws Exception { return ResourceFactory.getResourceChangeScannerService(); }
public void afterPropertiesSet() throws Exception { ResourceFactory.getResourceChangeScannerService().setInterval( this.interval ); if (enabled != null && enabled.equalsIgnoreCase("true")) { ResourceFactory.getResourceChangeNotifierService().start(); ResourceFactory.getResourceChangeScannerService().start(); } }
public void afterPropertiesSet() throws Exception { ResourceFactory.getResourceChangeScannerService().setInterval( this.interval ); if (enabled != null && enabled.equalsIgnoreCase("true")) { ResourceFactory.getResourceChangeNotifierService().start(); ResourceFactory.getResourceChangeScannerService().start(); } }
/** * If this is the last time calling stop, then stop the change services. * @param name the name to keep track of */ public static synchronized void stop(final String name) { _names.remove(name); if (_names.size() == 0 && _running) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Stopping resource change service..."); } // ORDER IS IMPORTANT! // 1) stop the scanner ResourceFactory.getResourceChangeScannerService().stop(); // 2) stop the notifier ResourceFactory.getResourceChangeNotifierService().stop(); // 3) set the system event listener back to the original implementation SystemEventListenerFactory.setSystemEventListener(_originalSystemEventListener); _originalSystemEventListener = null; _running = false; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Resource change service stopped."); } } }
unconfigAgent.applyChangeSet(ResourceFactory.newClassPathResource(getDroolsRuleSet())); ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration(); sconf.setProperty( "drools.resource.scanner.interval", Integer.toString(getUpdateInterval()) ); ResourceFactory.getResourceChangeScannerService().configure( sconf ); ResourceFactory.getResourceChangeNotifierService().start(); ResourceFactory.getResourceChangeScannerService().start();
protected KnowledgeAgent buildKnowledgeAgent(GuvnorConnectionUtils guvnorUtils) { try { ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration(); sconf.setProperty( "drools.resource.scanner.interval", "10" ); ResourceFactory.getResourceChangeScannerService().configure( sconf ); ResourceFactory.getResourceChangeScannerService().start(); ResourceFactory.getResourceChangeNotifierService().start(); KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); aconf.setProperty("drools.agent.newInstance", "false"); KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("Guvnor default", aconf); kagent.applyChangeSet(ResourceFactory.newReaderResource(guvnorUtils.createChangeSet())); return kagent; } catch (Throwable t) { logger.error("Could not load processes from Guvnor: " + t.getMessage(), t); return null; } } }
ResourceChangeScanner rcs = ResourceFactory.getResourceChangeScannerService(); String drsi = Strings.trimToNull(System.getProperty(DROOLS_RESOURCE_SCANNER_INTERVAL)); if (drsi != null && !drsi.equals("60")) {
this.notifier.addResourceChangeMonitor( ResourceFactory.getResourceChangeScannerService() ); monitor = true; // if scanning, monitor must be true;