File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get the LOCAL interface of Session Bean form a application in the same JVM?

 
Jamy Wang
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a startup class in Weblogic Server, I want to get the LOCAL inteface of a Session Bean. I think they are in the same JVM...Maybe I can use the LOCAL EJB interface? If it is ok, something will be effective.
Anybody who could give me some advice or point out my fault?
Thank you very much!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about simply testing whether you can use local interfaces? (I think you can but I'm not sure) Besides, if your startup class only executes once during startup, the performance overhead of a remote interface shouldn't be a problem either.
 
Jamy Wang
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My startup class is a server for client. So it's meanful for accessing LOCAL interface.
 
David Harkness
Ranch Hand
Posts: 1646
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by james wang:
I have a startup class in Weblogic Server, I want to get the LOCAL inteface of a Session Bean. I think they are in the same JVM...Maybe I can use the LOCAL EJB interface? If it is ok, something will be effective.
Anybody who could give me some advice or point out my fault?
Thank you very much!

From what I can tell of WebLogic, if the startup class is not in the same *JAR* as the EJB it's accessing, it cannot use a local interface. Note that local interfaces do not mean "local to this JVM" or even "local to this container" but rather "local to this JAR" (ClassLoader context?). This is related to the fact that a CMR between two entity beans can exist if and only if the two beans are packaged into the same JAR.
That being said, I haven't used WebLogic's T3StartupDef class because it runs for the container -- not each EJB application deployed in the container. Instead, I created a SLSB called "StartupSessionEJB" and gave it an initial pool size of 1 and max pool size of 1 and then didn't publish it in JNDI. It's ejbCreate() method gets called once and bingo I'm home free.
 
Jamy Wang
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

That being said, I haven't used WebLogic's T3StartupDef class because it runs for the container -- not each EJB application deployed in the container. Instead, I created a SLSB called "StartupSessionEJB" and gave it an initial pool size of 1 and max pool size of 1 and then didn't publish it in JNDI. It's ejbCreate() method gets called once and bingo I'm home free.

How to create a SLSB and give it an initial and max pool size?
How can I call ejbCreate() method when the Application Server start?
Thanks a lot!!
 
David Harkness
Ranch Hand
Posts: 1646
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by james wang:
How to create a SLSB and give it an initial and max pool size?
How can I call ejbCreate() method when the Application Server start?

Specifying the initial and maximum pool sizes is vendor-specific. I'm using XDoclet to generate our WebLogic deployment descriptors, but here's the resulting block from weblogic-ejb-jar.xml.

As for calling ejbCreate() on the bean, the container does this as part of filling the free pool with initial beans -- one in this case.
 
Jamy Wang
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, David Harkness. Thank you very much!!
I have just another question, how to describe the pool size in JBOSS?
Thank you again!
 
David Harkness
Ranch Hand
Posts: 1646
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by james wang:
Hi, David Harkness. Thank you very much!!
I have just another question, how to describe the pool size in JBOSS?
Thank you again!

I'm always glad to help. Unfortunately I have never used JBoss before. You might try a JBoss-specific forum or mailing list.
Good luck!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic