import karl.event.NotificationMessage;
public interface CAProxyMessageHandler {
public void processMessage(NotificationMessage msg) throws Exception;
}
package karl.message;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import karl.event.NotificationMessage;
@Stateless
@Local(CAProxyMessageHandler.class)
@Remote(CAProxyMessageHandler.class)
public class CAProxyMessageHandlerImpl implements CAProxyMessageHandler {
@Override
public void processMessage(NotificationMessage msg) throws Exception {
//TODO
}
}
package karl.message;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import karl.event.NotificationMessage;
@Stateless
@Local(CAProxyMessageHandler.class)
@Remote(CAProxyMessageHandler.class)
public class CAProxySubMessageHandlerImpl implements CAProxyMessageHandler {
@Override
public void processMessage(NotificationMessage msg) throws Exception {
//TODO
}
}
在其他的EJB里面可以这么引用这个两个EJB
private CAProxyMessageHandler submessageHandler;
private CAProxyMessageHandler messageHandler;