private void addGroups() throws NamingException { String[] groups = m_ldapService.getGroups(); for (int i = 0; i < groups.length; i++) { LeafParticipant p = new LeafParticipant(); Map params = new HashMap(); // @todo need to parametrize this as well. params.put("host", "127.0.0.1"); params.put("port", "7008"); params.put("dispatcherClass", "openwfe.org.engine.impl.dispatch.SocketDispatcher"); //p.init(this, groups[i], params); p.init(groups[i], params); if (log.isDebugEnabled()) { log.debug("LDAP adding " + p.getRegex()); } add(p); } }
/** * Overrides LeafParticipant dispatch method, by dispatching * then sending the email notification. */ public Object dispatch (final ApplicationContext context, final WorkItem wi) throws DispatchingException { final Object result = super.dispatch(context, wi); try { sendNotificationMail((InFlowWorkItem)wi); log.debug("apply() notification email sucessfully sent."); } catch (final Exception e) { log.warn("apply() failed to send notification mail", e); //throw new MinorDispatchingException // ("Failed to send notification email", e); } return result; }
if (isLocalDelivery(context, wi)) dClassName = LocalDispatcher.class.getName(); else ("participant '"+this.getRegex()+"' is missing a "+ "'dispatcherClass' parameter, "+ "cannot dispatch workitems to it"); dispatcherParams.putAll(getParams()); dispatcherParams.put(PARTICIPANT_NAME, this.getRegex()); (getRegex()+".dispatcher", context, dispatcherParams); "' for participant '"+getRegex()+"'", e);
protected void buildMap() throws NamingException { // add engine // @todo this should come through a composite map. LeafParticipant p = new LeafParticipant(); Map params = new HashMap(); // @todo need to parametrize this as well. params.put("host", "127.0.0.1"); params.put("port", "7007"); params.put("dispatcherClass", "openwfe.org.engine.impl.dispatch.SocketDispatcher"); params.put("workItemCoder", "xmlCoder"); //p.init(this, "mainEngine", params); p.init("mainEngine", params); add(p); // add groups from ldap addGroups(); // add users from ldap addUsers(); }
getDispatcher(context, wi); ifi.setParticipantName(getRegex());
/** * When instantiating a participant, the participant map calls * this method on it to make it ready to operate. * * @param regex the name (or regular expression) which maps to this * participant implementation * @param params the initialization parameters for this participant, as * found in the participant map */ public void init (String regex, java.util.Map params) { super.init(regex, params); // // archival path this.archivalDir = (String)params.get(P_ARCHIVAL_DIR); if (this.archivalDir == null) this.archivalDir = "archive"; if ( ! this.archivalDir.endsWith(java.io.File.separator)) this.archivalDir += java.io.File.separator; log.info("init() archivalDir is '"+this.archivalDir+"'"); }
public void init (final String regex, final java.util.Map params) { super.init(regex, params); this.dispatcherClassName = MapUtils .getAsString(params, P_DISPATCHER_CLASS); if (this.dispatcherClassName != null) { log.info ("init() '"+getRegex()+ "' uses dispatcher "+this.dispatcherClassName); } this.instantiateDispatcherEachTime = MapUtils.getAsBoolean (params, P_INSTANTIATE_DISPATCHER_EACH_TIME, false); log.info ("init() '"+getRegex()+ "' instantiateDispatcherEachTime ? "+ this.instantiateDispatcherEachTime); }
t); p = new LeafParticipant();
public void init (//final ParticipantMap pMap, final String regex, final java.util.Map params) { //super.init(pMap, regex, params); super.init(regex, params); //this.smtpServer = MapUtils.getAsString // (params, P_SMTP_SERVER, "127.0.0.1"); //this.smtpPort = MapUtils.getAsInt // (params, P_SMTP_PORT, 25); this.recipientField = MapUtils.getAsString (params, P_RECIPIENT_FIELD, DEFAULT_RECIPIENT_FIELD); this.mailFrom = MapUtils.getAsString (params, P_MAIL_FROM); this.mailEncoding = MapUtils.getAsString (params, P_MAIL_ENCODING); this.templateFileName = MapUtils.getAsString (params, P_TEMPLATE); }
private void addUsers() throws NamingException { String[] users = m_ldapService.getUsers(); for (int i = 0; i < users.length; i++) { LeafParticipant p = new LeafParticipant(); Map params = new HashMap(); // @todo need to parametrize this as well. params.put("host", "127.0.0.1"); params.put("port", "7008"); params.put("dispatcherClass", "openwfe.org.engine.impl.dispatch.SocketDispatcher"); //p.init(this, users[i], params); p.init(users[i], params); if (log.isDebugEnabled()) { log.debug("LDAP adding " + p.getRegex()); } add(p); } } }