HI,
Iam having to EJB's one is of Local and the other is Remote.I have to dynamically know and call Local and Remote.How to call them dynamically from a session Bean.
Please help me out.
Regards
Samy
-
when to call Local and Remote Ejb Dynamically (3 messages)
- Posted by: samy mohan
- Posted on: June 21 2004 03:25 EDT
Threaded Messages (3)
- when to call Local and Remote Ejb Dynamically by Arun Nair on June 21 2004 12:45 EDT
- when to call Local and Remote Ejb Dynamically by samy mohan on June 22 2004 03:39 EDT
- when to call Local and Remote Ejb Dynamically by Arun Nair on June 23 2004 05:38 EDT
- when to call Local and Remote Ejb Dynamically by samy mohan on June 22 2004 03:39 EDT
-
when to call Local and Remote Ejb Dynamically[ Go to top ]
- Posted by: Arun Nair
- Posted on: June 21 2004 12:45 EDT
- in response to samy mohan
I dont really understand why you wanted to call your EJB from a session bean remotely. The whole idea of having local components is to avoid the overhead of remote call and network traffic.
I think you should not make any remote calls to access Entity beans from a session bean because they both have same container and jvm.
You should not publish any Entity bean interface remotely. All the calls have to come thru Session Facades.
-arun -
when to call Local and Remote Ejb Dynamically[ Go to top ]
- Posted by: samy mohan
- Posted on: June 22 2004 03:39 EDT
- in response to Arun Nair
Thanks arun,
But i have a specific condition in my project that I have to call local interface and also remote interface which is in another JVM in a single call.
How to solve this situation.
Regards
Samy -
when to call Local and Remote Ejb Dynamically[ Go to top ]
- Posted by: Arun Nair
- Posted on: June 23 2004 05:38 EDT
- in response to samy mohan
I dont think (or rather i dont know) how to achive that ...
But probably ... you could try something on this line.
Your session bean can take an Action interface ...
For example :-
public storeEmpoyeeDetails(EmpDetailsDO, Action localORRemote) //Action is an interface type
{
localORRemote.getInitialContext();
}
And when you call this storeEmpoyeeDetails(), and you wanted to make a Remote call in there than a local call then your argument would be like this...
storeEmpoyeeDetails(EmpDetailsDO object, RemoteAction remoteAction);
---
RemoteAction - is remote specific impl for Action.
RemoteAction.java :-
public context getInitialContext()
{
* create jndi properties
* get context using that property object.
return new InitialContext(properties);
}
On other hand if you are looking for Local components. the have LocalAction
LocalAction.java :-
public context getInitialContext()
{
return new InitialContext();
}
Will this throw any light at all ?
This looks ok but imagine a situation where you wanted to make both (local and remote) in single Sesion Bean call ......
-arun