-
1. Re: Create entity bean instances after deploy
davidjencks Jan 31, 2002 5:54 PM (in response to huiminli)You could write an mbean to do that. In order to avoid problems with "who starts first" you may want to have your mbean programatically deploy your application, then create the entity beans. In 3.0 (cvs) I believe you can get the same effect by packing your ejb-jar inside a sar.
-
2. Re: Create entity bean instances after deploy
huiminli Jan 31, 2002 9:52 PM (in response to huiminli)Thanks for your advice. Do you know any tutorial or
example on how to do that ? -
3. Re: Create entity bean instances after deploy
ppetit Feb 1, 2002 3:39 AM (in response to huiminli)in case of... just another idea :
I already got this kinf of need, I resolved it by calling a singleton class instance within the Create method of my EJB, so every time this EJB is instanciated by the container it referes to this singleton that performs tasks at initialization time of the ejb, you can implement other tasks in the postCreate method of your EJB as well.
the singleton is usefull to insure not having multiple instances of a utility class jut needed once.
your singelton class can perform any file load through a call to the ContextClassLoader, etc etc
it was just an idea
Philippe -
4. Re: Create entity bean instances after deploy
huiminli Feb 1, 2002 1:24 PM (in response to huiminli)Philippe
Thanks for the suggestion. My understanding is, to be able to invoke the Create method of your EJB, you still need a invoker (client) which is outside the JVM of the application server. I need a way to invoke a bean method directly from application server's JVM after the bean is deployed. Is there any simple way to do it ? Seems this should be a common problem to deal with. -
5. Re: Create entity bean instances after deploy
ppetit Feb 4, 2002 5:39 AM (in response to huiminli)absolutely, you need a first call by a client within the same jvm or not.
but I can't figure why a server should need data if there's no client needing them...
at the very first call you can load data needed, just once in a cache, as I mentioned in my earlier message.
Philippe