-
1. Re: can MBean invoke EJB method ?
dhulley Sep 20, 2002 8:00 AM (in response to sharetop)Yes. I was checking it out as well, and the following worked, effectively passing a value from the MBean to the EJB, i.e. as a means of manually calling an EJB method. I have ordered the JMX book, so I might find out that there are more efficient ways of doing this.
===========================
public void setFileName(String fileName) throws Exception {
try {
Context ctx = new InitialContext();
Object obj = ctx
.lookup("ejb/com.activiti.jmx.ejb.TestReader");
TestReaderHome testReaderHome = (TestReaderHome) PortableRemoteObject
.narrow(obj, TestReaderHome.class);
TestReader testReader = testReaderHome.create();
testReader.setFileName(fileName);
} catch (Exception e) {
cat.error(e);
throw e;
}
}
===============================
Derek -
2. Re: can MBean invoke EJB method ?
juha Sep 20, 2002 11:27 AM (in response to sharetop)i don't think there are more efficient ways to go about this (at the moment anyway) but hope you enjoy the book nevertheless