cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hunsberger, Peter" <Peter.Hunsber...@stjude.org>
Subject RE: sexy open source
Date Wed, 14 Aug 2002 16:30:30 GMT
> I don't care for JBoss that much but would like to
> have J2EE for business logic scalability. My BIG
> question is - HOW DO YOU ACCESS EJBs FROM COCOON?
> Please, give us your secrets!

Didn't I just answer this?  Nothing special is required: define your EJB's
to jBoss as normal. Deploy the EJBs along with the Cocoon servlet as part of
an ear through jBoss.  The Cocoon code can then see anything in the EJB jar.
We mostly use proxy code to wrap the EJB references, but you could call them
directly from your code.  

We do cache our EJB references using code like:

         Foo foo = (Foo)EJBUtil.getFooBLHome().create().getFoo(fData);

Where EJBUtil has code like:

public static FooBLHome getFooBLHome()
   throws BackEndException {
      try {
         return
(FooBLHome)ResourceFactory.getFactory().lookUpHome(FooBLHome.class);
      } catch (NamingException e) {
         throw new BackEndException(e.getMessage());
      }
   }

and ResourceFactory is just a singleton that keeps a hash map of the
references.  No need to jump through these hoops if you're not pounding on
the EJB references a lot...


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message