This content has been marked as final.
Show 2 replies
-
1. Re: Deploy Stateless Bean before Sheduler starts work
jae77 Jun 24, 2004 9:40 AM (in response to anny_lut)did you try adding a "depends" tag for the session bean to the scheduler-service.xml file?
-
2. Re: Deploy Stateless Bean before Sheduler starts work
pualsa Jun 24, 2004 10:10 AM (in response to anny_lut)A possible solution: your MBean can listen for notification event of type EJBDeployer.START_NOTIFICATION.
1) implement NotificationFilter, NotificationListener
public boolean isNotificationEnabled(Notification n) {
return EJBDeployer.START_NOTIFICATION_TYPE.equals(n.getType());
}
public void handleNotification(Notification n, Object handback) {
DeploymentInfo di = (DeploymentInfo) n.getUserObject();
if (di.shortName.equals("yourbean.ear")) {
//now start the scheduler
}
}
2) in create() method of your bean:
ObjectName name = new ObjectName("jboss.ejb:service=EJBDeployer");
getServer().addNotificationListener(name, this, this, "someName");
See javax.management.*