hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cherry Development <>
Subject Re: Injecting a state object into another service?
Date Tue, 23 Aug 2005 20:21:30 GMT
Sorry, I didn't explain this particular well, I think.

I was planning to get the 'final' object out of hivemind, not out of 
spring.  I've already pulled the spring object into hivemind, and can 
vend the object out of hivemind this way.  This already works.  'All' I 
need to do is to assign a hivemind 'state' object into my service 
before I send it out of hivemind (and into Tapestry).

Here's a full example of what I want to do:
I have spring services that need to interact with session-stateful 
object.  Rather than pass the stateful object into my service from the 
presentation layer (Tapestry) each time I run a service method, I'd 
like to have my service object come pre-injected with my stateful 
object.  I could try to do this entirely within spring, but as things 
are now, I have no simple way to get Spring to access the session.  
Therefore, I was planning to go around the other way:  Inject my spring 
object into hivemind, set the stateful object into a property of my 
spring service, then inject the result (spring service object with a 
hivemind stateful object as a property) into my tapestry pages.  I'm 
pretty sure this isn't difficult to do, but I simply don't know enough 
about how hivemind works to be able to make it happen.

I guess I'm just looking for something like BuilderFactory, which will 
let me set arbitrary objects into services, except that I don't want to 
actually create a new instance of the object.

I'd appreciate any advice you can offer.


On Aug 23, 2005, at 1:04 PM, James Carman wrote:

> That's not something you should ask us.  That's something you should 
> ask the
> Spring folks.  HiveMind doesn't do the injecting into Spring-managed
> objects.  HiveMind can, however, use Spring-managed objects as 
> services (and
> inject them into its own objects that it manages).  How often do you 
> run
> across this case?  If it's just this once, you might create a little 
> bean
> that's able to delegate/proxy to the service in the hivemind registry. 
>  You
> could have Spring instantiate that bean and inject it into its object.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message