Hugo, I think you will have to implement a simple HiveMind service factory (e.g. JndiServiceFactory). Inject the NameLookup service into this factory and construct the service instances using that.
HTH, --knut On Mon, 07 Mar 2005 13:18:40 +0000, Hugo Palma <[EMAIL PROTECTED]> wrote: > You didn't get the datasource from the jndi tree. I think it has to be > through the NameLookup service. > > Do you know how to do this ? > > Thanks. > > Hugo > > Achim Huegen wrote: > > > Ok, let's start with the DataSource declaration from the wiki: > > > > <service-point id="DefaultDataSource" nterface="javax.sql.DataSource"> > > <invoke-factory service-id="hivemind.BuilderFactory"> > > <construct class="org.apache.commons.dbcp.BasicDataSource"> > > .... > > </construct> > > </invoke-factory> > > </service-point> > > > > To inject this datasource in a service Consumer : > > > > <service-point id="Consumer" interface="..."> > > <invoke-factory> > > <construct class="impl.TaskExecutor"> > > <set-service service-id="DefaultDataSource" property="dataSource"/> > > </construct> > > </invoke-factory> > > </service-point> > > > > Hivemind will call the setter > > setDefaultDataSource(javax.sql.DataSource) and hand over a reference > > to the DefaultDataSource. > > > > I hope this helps > > > > Achim > > > > > > > > Hugo Palma wrote: > > > >> Forgot to say one thing. > >> I know how to get the data source in java code, after i've declared > >> the NameLookup service in my module. What i want is to get the > >> datasource and inject it as a property of another service. All this > >> in the module descriptor. > >> > >> Thanks. > >> > >> Hugo > >> > >> Hugo Palma wrote: > >> > >>> Hi, i'm having some trouble in grasping all the concepts behind > >>> hivemind so i'd like to ask for some help in what i think should be > >>> a pretty easy thing to do. > >>> What i want is just to get a data source from the app server jndi > >>> tree. I've found an example of getting a data source in the > >>> wiki(http://wiki.apache.org/jakarta-hivemind/DatasourceService) and > >>> i know i have to use the hivemind.lib.NameLookup service, but i just > >>> haven't been able to figure out how. An example of how to do this > >>> would be great. > >>> > >>> > >>> Thanks. > >>> > >>> Hugo > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: [EMAIL PROTECTED] > >>> For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
