Re: Methods to EventForwardingFactory
Srinivas Yermal <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Christian, You are not holding me up. I have already implemented this as my own factory bcoz I need to be deriving from my own listener factories for other reasons. And it works really well. Now I dont have to specify them in my Gateways just for forwarding. I am interested in knowing more about the object repository. Not currently using it. Can you point me to any documentation and its proper use? Thanks, Srini. Christian Cryder wrote: >Hi Srinivas, > > > >>forwarding event. As far as the registration goes, the >>application assembler does a wonderful job. The problem with >>having a method like setForwardEvent(BaseEvent bevent) is that >>the assembler cannot handle it (setMethod method in >>DefaultApplicationAssembler handles only primitive types). I >> >> > >Hmm...well the ObjectRepositoryAssembler scripting _will_ handle complex >objects, BUT, I'm not sure that its going to work in this particular case, >since where you really need it is the event gateway assembly. > >Hmmm...ok, let's try this. Can you start by simply creating your own >EventForwardingFactory that extends the Barracuda one, and just add your >methods there? That would at least get you up and running... > >I'd like to talk with Jake and Shawn a bit to see if they have any ideas >before I just implement this the way you've proposed, largely because of the >reasons voiced by Jeremy. So I need to chew on this a bit, but I don't want >to slow you down either. Anyone else have any comments here? > >Christian >---------------------------------------------- >Christian Cryder >Internet Architect, ATMReports.com >Project Chair, BarracudaMVC - http://barracudamvc.org >---------------------------------------------- >"Coffee? I could quit anytime, just not today" > > > > >>-----Original Message----- >>From: [email protected] >>[mailto:[email protected]]On Behalf Of Srinivas Yermal >>Sent: Tuesday, September 30, 2003 6:28 PM >>To: [email protected] >>Subject: Re: [Barracuda] Methods to EventForwardingFactory >> >> >>I completely agree. Instead of eating up the exceptions we should >>just throw them up, so that the ApplicationAssembler handles it >>and I think there shouldnt be any problem doing that. >> >>What I am trying to achieve here is this - >> <event-interest event="com.encover.portal.events.GetCompanyList" >> >>factory="org.enhydra.barracuda.core.event.helper.EventForwardingFactory"> >> <set-property name="forwardEvent"> >> com.encover.portal.events.RenderCompanyList >> </set-property> >> </event-interest> >> >>I dont want to specify a new variable and a factory definition in >>my gateway (or elsewhere for that matter) everytime I have a >>forwarding event. As far as the registration goes, the >>application assembler does a wonderful job. The problem with >>having a method like setForwardEvent(BaseEvent bevent) is that >>the assembler cannot handle it (setMethod method in >>DefaultApplicationAssembler handles only primitive types). I >>might be barking at the wrong tree to start with, if so please correct me. >> >>Hope this helps. >>Thanks, >>Srini. >> >>Jeremy L Rosenberger wrote: >> >>A method like this, in its current form, is asking for trouble. It >>"eats" exceptions that the application would probably want to know about >>sooner (by having the opportunity to catch them) rather than later (by >>noticing a problem with the application, going back through the logs, >>and happening to notice a ClassCastException or something like that). >> >>That's my opinion, anyway. >> >>Cheers, >>Jeremy >> >>On Tue, 2003-09-30 at 19:33, Christian Cryder wrote: >> >> >>Hmmm...interesting idea. Anyone have any obj >> >> >> 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); >> } >> } >> >> >> >> >> > >_______________________________________________ >Barracuda mailing list >[email protected] >http://barracudamvc.org/lists/listinfo/barracuda > > >