that would be the simplest solution

i *think* the OP wanted a complete EJB jar implementation (using either 
annotations and or ejb-jar.xml) 
which can be accomplished with OpenEJB except he would need to know the type 
vis-a-vis Stateless/Stateful Local/Remote beforehand
http://openejb.apache.org/3.0/examples.html

thanks,
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Sun, 14 Jun 2009 13:01:31 -0400
> Subject: Re: using static helper classes within servlets
> From: jhmast.develo...@gmail.com
> To: users@tomcat.apache.org
> 
> I've not done anything with EJBs and I'm not sure what exactly you mean by
> static "properties".  I have however dealt with reducing instantiations in
> servlets.  I simply created a BeanBag class with static methods to each one
> of my beans; these are not "proper" beans, but where simply objects that
> were formerly used in JSP via the jsp:useBean directive.
> 
> Here is the general pattern:
> 
> class BeanBag {
>       private static SomeBean someBean = null;
> 
>       public static synchronized getSomeBean() {
>              if (someBean == null) someBean = new SomeBean();
>              return someBean;
>      }
> }
> 
> I have now numerous Servlets, JSPs and POJOs that use BeanBag to obtain
> singleton instances of my beans.  Its worked great for me.
> 
> 
> On Sun, Jun 14, 2009 at 8:28 AM, Sid Sidney <pvcsv...@yahoo.com> wrote:
> 
> >
> >
> >
> >            HI,
> >
> >
> >
> > In my web app, my servlets user several delegate classes that connect
> > to ejbs (session beans.)  I was thinking
> > about putting these delegates into a helper class as static properties.
> > That way my servlets can just reference the same delegates. I
> > don't want to have to create a new instance of a delegate with every
> > request that my servlet(s) handles.
> >
> >
> >
> > However, I'm wondering if this will cause synchronization issues with
> > multiple requests being handled, as our site handles a heavy load of
> > requests. Any suggestions would be appreciated?
> >
> >
> >

_________________________________________________________________
Insert movie times and more without leaving Hotmail®. 
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

Reply via email to