Methods to EventForwardingFactory

Srinivas Yermal <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Could we add these methods to EventForwardingFactory (may be to 
EventRedirectFactory as well) so that it could be used in assembler 
without having to define it in the Gateway? Or is there any other method 
to do it?

    public EventForwardingFactory() {
        if (logger.isInfoEnabled()) logger.info("Creating new 
EventForwardingFactory [forward event not set]");
    }

    public void setForwardEvent(String eventClass) {
        if (null == eventClass) return;
        try {
            Class c = Class.forName(eventClass);
            fevent = (BaseEvent)c.newInstance();
        } catch (ClassNotFoundException nfe) {
            logger.error("Event class " + eventClass + " not found", nfe);
        } catch (InstantiationException ie) {
            logger.error("Error instantiating " + eventClass, ie);
        } catch (IllegalAccessException iae) {
            logger.error("Error instantiating " + eventClass, iae);
        } catch (ClassCastException ce) {
            logger.error("The class " + eventClass + " should be a 
BaseEvent", ce);           
        }
    }

Thanks,
Srini.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.