We have a stateless SessionBean "OrderManagementBean" which implements both local and remote interfaces.
We try to call it from a helper class of another MDB and therefore injection via @EJB does not work.
Currently we do lookup and get the remote. But for the helper class CreateOrder we would like to get the local interface.
Our question is how to address the local interface?
---
public class CreateOrder
implements ApplicationRule {
private OrderManagerInterface manager = null;
// ...
public ApplicationMessage action( ApplicationMessage inMessage )
throws ApplicationRuleException {
try {
if ( null == manager ) {
InitialContext context = new InitialContext();
manager = (OrderManagerInterface)context.lookup( OrderManagerRemote.DEFAULT_JNDI_NAME );
}
// ...
}
---
@Local
public interface OrderManagerLocal
extends OrderManagerInterface {
// ...
}
---
@Remote
public interface OrderManagerRemote
extends OrderManagerInterface {
public final static String DEFAULT_JNDI_NAME = "ejb/OrderManagerBean";
// ...
}
---
@Stateless( mappedName=OrderManagerRemote.DEFAULT_JNDI_NAME )
public class OrderManagerBean
implements OrderManagerRemote, OrderManagerLocal {
// ...
}
[Message sent by forum member 'ralf_zalas' (ralf_zalas)]
http://forums.java.net/jive/thread.jspa?messageID=273496