-
1. Re: Can JBoss Messaging uses direct method invocation while
gary.c.chen Jun 11, 2008 4:07 AM (in response to gary.c.chen)|---------------------------------------------|
| JVM |
| |
| |---------------| |---------------| |
| | Servlet 1 | | Servlet 2 | |
| | | | | |
| | |-----------| | | |-----------| | |
| | | Sender | | | | Receiver | | |
| | | Client | | | | Client | | |
| | |-----------| | | |-----------| | |
| | | | | /|\ | |
| |-------|-------| |-------|-------| |
| | | |
| | | |
| |-------| |-------| |
| | | |
| \|/ | |
| |-------------------| |
| | | |
| | | |
| | JMS Server | |
| | | |
| |-------------------| |
| |
|---------------------------------------------| -
2. Re: Can JBoss Messaging uses direct method invocation while
timfox Jun 12, 2008 2:40 AM (in response to gary.c.chen)Yes, JBM will automatically use in vm optimisation if client and server are in same vm (and classloader).
-
3. Re: Can JBoss Messaging uses direct method invocation while
gary.c.chen Jun 13, 2008 1:54 AM (in response to gary.c.chen)En, could you please tell me how JBM determine client and server are in the same VM ?
You know, in a Servlet we use JNDI as follow :
Context ctx = new InitialContext();
QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("java:/ConnectionFactory");
and we don't use the JNDI URL property.
I had ever developed Application Server before, in our Application Server, we used the JNDI URL property to determine the JNDI lookup action is inside the server VM or outside, according to this we return a ConnectionFactory that it's created Connection used direct method invocation or used Socket.
So I am very interesting in how JBM achieve the optimisation. Like the above I describe ?
And you said the client and the server must in the same VM and loaded by the same ClassLoader, so JBM can do the optimisation, is that right ?
And we know that the Servlet class and the JMS Server class are not loaded by the same ClassLoader. -
4. Re: Can JBoss Messaging uses direct method invocation while
timfox Jun 13, 2008 4:33 AM (in response to gary.c.chen)This is handled by JBoss Remoting, not JBM.
I believe they use statics to identify whether clients and servers are in same classloader. -
5. Re: Can JBoss Messaging uses direct method invocation while
gary.c.chen Jun 13, 2008 4:55 AM (in response to gary.c.chen)en, I see, may be the client and the server have the same parent ClassLoader so they are in the same ClassLoader.