Geert Bevin wrote:
thanks a lot for updating the wiki page with Spring information. I'm not so sure about the "Injecting RIFE objects into Spring beans" section though. Instead of aggregating the datasource in a static class variable that it afterwards accessible to Spring, isn't it possible to inject bean declarations into the Spring bean factory using a participant?

If I do it using a subclass of ParticipantSpringWeb, maybe. I'll try that tomorrow. The problem is that Spring doesn't really support adding beans on the fly (or at least not as far as I'm aware) -- the beans pretty much have to all be available when Spring starts up so it can create everything in the right order to satisfy dependencies. So in any event the RIFE objects would have to be ready to go before the Spring initialization.

Another minor note: "The order is important here: our factory has to come after all the resources it wants to supply to Spring, and before the Spring participant. Otherwise Spring might try to call it before it has the objects it needs." This is not correct. Participants are not sequentially initialized unless you add set the blocking attribute to true. Otherwise, they are all just launched in a separate thread and do their thing. THe getObject(s) methods are wrapped to the any thread that obtains a participant data object is but into a wait state until the initialization is finishes. This allows an application to start up as fast as possible with only delays when data is really needed from a participant that hasn't finished initializing yet.

Ah, okay, that's good to know. In this case I actually need my participant to finish initializing before the Spring participant is launched, though -- if Spring calls my getInstance() method before RIFE has called my initialize() method, I won't have a Datasource to hand out. So it sounds like I should have my getInstance() method call waitUntilFinished() to force it to wait for the initialization to finish? (I'm subclassing BlockingParticipant.) I will update the Wiki.

-Steve
_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to