geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <tbo...@yahoo.com>
Subject Re: GBean use and deployment
Date Fri, 14 Jul 2006 23:29:17 GMT
Aaron,

Found this note in your book:

The schema includes a placeholder element (gbean-ref)
for GBean references (that is, putting a reference to
an arbitrary GBean in the component's java:comp/env
JNDI space), but that is not yet working in Geronimo
1.0 so it is not covered here.

I guess we need to upgrade to 1.0, huh? Please verify.

Tyler


--- Aaron Mulder <ammulder@alumni.princeton.edu>
wrote:

> The GBean should implement at least one interface,
> say
> com.example.Foo, which includes all the methods your
> web app wants to
> call on it.
> 
> Then you add a block like this to the deployment
> plan for the web app
> (geronimo-web.xml):
> 
> <gbean-ref>
>     <ref-name>MyGBean</ref-name>
>     <ref-type>com.example.Foo</ref-type>
>     <pattern>
>         <name>YourGbeanInstanceName</name>
>     </pattern>
> </gbean-ref>
> 
> That will stick the GBean named
> YourGbeanInstanceName (e.g. plan has
> <gbean name="YourGbeanInstanceName" class=...>) in
> JNDI for the web
> app at java:comp/env/MyGBean (java:comp/env/ plus
> the <ref-name>
> above).  When you access that JNDI location, you'll
> get something that
> implements com.example.Foo (the <ref-type> above),
> so you can use it
> like this:
> 
> Foo foo = (Foo)new
> InitialContext().lookup("java:comp/env/MyGBean");
> 
> Make sure that the GBeanInfo for your GBean has a
> line like
> infoFactory.addInterface(com.example.Foo.class); for
> this to work.
> 
> Thanks,
>     Aaron
> 
> On 7/14/06, tbot55@yahoo.com <tbot55@yahoo.com>
> wrote:
> > I have successfully deployed a GBean using a
> > deployment plan. I have added a new jar to the
> > repository, and I reference the class in the
> > deployment plan.
> >
> > Now, my question is: How do I access the deployed
> > class via the GBean from my web
> service/application?
> >
> > Thanks.
> > Tyler
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message