protected void startService () throws Exception { if (task instanceof Configurable) { Element e = getPersist (); QFactory factory = getServer().getFactory(); ((Configurable)task).setConfiguration ( factory.getConfiguration (e) ); } (thisThread = new Thread(this)).start(); } protected void stopService () throws Exception {
public void setConfiguration (Object obj, Element e) throws ConfigurationException { try { if (obj instanceof Configurable) ((Configurable)obj).setConfiguration (getConfiguration (e)); if (obj instanceof XmlConfigurable) ((XmlConfigurable)obj).setConfiguration(e); } catch (ConfigurationException ex) { throw new ConfigurationException (ex); } } /**
protected void startService () throws Exception { Object obj = getObject(); if (obj instanceof Configurable) { QFactory factory = getServer().getFactory(); Element e = getPersist (); ((Configurable)obj).setConfiguration ( factory.getConfiguration (e) ); } CardAgentLookup.add ((CardAgent) getObject ()); } protected void stopService () throws Exception {
private void addListener (Element e) throws ConfigurationException { QFactory factory = getServer().getFactory(); String clazz = e.getAttributeValue ("class"); LogListener listener = (LogListener) factory.newInstance (clazz); if (listener instanceof Configurable) { try { ((Configurable) listener).setConfiguration ( factory.getConfiguration (e) ); } catch (ConfigurationException ex) { throw new ConfigurationException (ex); } } if (listener instanceof XmlConfigurable) { try { ((XmlConfigurable) listener).setConfiguration (e); } catch (ConfigurationException ex) { throw new ConfigurationException (ex); } } logger.addListener (listener); } }
protected void initService () throws Exception { QFactory factory = getServer().getFactory(); dirPoll = createDirPoll(); dirPoll.setPath (getPath ()); dirPoll.setThreadPool (new ThreadPool (1, poolSize)); dirPoll.setPollInterval (pollInterval); if (priorities != null) dirPoll.setPriorities (priorities); dirPoll.setLogger (getLog().getLogger(), getLog().getRealm ()); Configuration cfg = factory.getConfiguration (getPersist()); dirPoll.setConfiguration (cfg); dirPoll.createDirs (); Object dpp = factory.newInstance (getProcessor()); if (dpp instanceof LogSource) { ((LogSource) dpp).setLogger ( getLog().getLogger(), getLog().getRealm () ); } if (dpp instanceof Configurable) { ((Configurable) dpp).setConfiguration (cfg); } dirPoll.setProcessor (dpp); }