|
From: <jue...@we...> - 2004-04-13 15:37:11
|
I just checked the Struts 1.1 RequestProcessor implementation: You're = right, it's one instance per Action type, not one instance per mapping. = Thus, I've just removed the delegateAction instance variable; our only = choice is to freshly fetch the Spring-managed Action bean on each = execution. It's not much slower anyway, according to my ad-hoc = benchmark. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Dirk Markert Sent: Tuesday, April 13, 2004 1:12 PM To: j=FCrgen h=F6ller [werk3AT] Subject: Re[2]: [Springframework-developer] Struts Spring Plugin Hello J=FCrgen, I think there is a problem with your implementation. Struts will create only _one_ instance for the same Action class in a module. Thus, if you have to mappings with the same action class they will point to the same spring bean. Tuesday, April 13, 2004, 12:31:15 PM, you wrote: jhw> Of course, you're right that the synchronized block should jhw> include the return statement - thanks for spotting this. The jhw> synchronization there isn't terribly important though, as it's jhw> just about unnecessarily re-fetching the bean from the jhw> application context. jhw> The only reason for the delegateAction member attribute is jhw> speed: to avoid repeated lookups of the Action bean in the Spring jhw> application context. It might be worth benchmarking whether the jhw> synchronized block isn't the bigger performance threat here, jhw> though, as the context.getBean call boils down to a HashMap jhw> lookup. jhw> It's a pity that Struts doesn't pass in the ActionMapping jhw> in some Action initialization callback. As far as I can tell, the jhw> mapping is determined at Action initialization time, so this jhw> would have been feasible. If we had such a callback, we could jhw> simply fetch the delegate Action at initialization time, jhw> completely avoiding the need for synchronization. jhw> Juergen jhw> -----Original Message----- jhw> From: spr...@li... jhw> [mailto:spr...@li...]On = Behalf jhw> Of Dirk Markert jhw> Sent: Tuesday, April 13, 2004 10:54 AM jhw> To: j=FCrgen h=F6ller [werk3AT] jhw> Subject: Re[2]: [Springframework-developer] Struts Spring Plugin jhw> Hello J=FCrgen, jhw> I just had a look at the implementation of DelegatingActionProxy. I jhw> wonder why you are using a membar attribute delegateAction. The = class has to jhw> be thread safe, and I thing using this attribute it isn't. In = getDelegateAction jhw> your synchronized access does not include the return statement. jhw> Do I miss something? jhw> Best regards, jhw> Dirk jhw> ------------------------------------------------------- jhw> This SF.Net email is sponsored by: IBM Linux Tutorials jhw> Free Linux tutorial presented by Daniel Robbins, President and CEO = of jhw> GenToo technologies. Learn everything from fundamentals to system jhw> = administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck jhw> _______________________________________________ jhw> Springframework-developer mailing list jhw> Spr...@li... jhw> = https://lists.sourceforge.net/lists/listinfo/springframework-developer jhw> ------------------------------------------------------- jhw> This SF.Net email is sponsored by: IBM Linux Tutorials jhw> Free Linux tutorial presented by Daniel Robbins, President and CEO = of jhw> GenToo technologies. Learn everything from fundamentals to system jhw> administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&oplick jhw> _______________________________________________ jhw> Springframework-developer mailing list jhw> Spr...@li... jhw> = https://lists.sourceforge.net/lists/listinfo/springframework-developer --=20 Best regards, Dirk N=18=ACHS^=B5=E9sSX=AC=B2s'=B2S=DEu=BC^=04=C2=E2z=ECS=BA=DA+?=A9l=16=B7z.= )=EE=C6=DB=AD=A2=B8s-s=DE=B1=E9=EDy=D6=F2 =A9=E2zThm=B8=A7=B0=FA=DE=B2'^z=D6=A7t!=0E=A1=F1z=9D:(=B5=E7!z?h''=AC-=E6= =AB=9D=EB=DE=AF+aSx=1F=AE?Y=BAwZ(tm)=E9=EDj[-=A2=CC=AC=B5=E9svh=A7S=CBkj=D8= =A8z=1Bm=A7=FF=DAv=CA,vw(>=F6=9D?=D0=E3=BD-Z?=EB |