Methods Summary |
---|
public void | postDeregister()Allows the MBean to perform any operations needed after having been
de-registered in the MBean server.
// do nothing
|
public void | postRegister(java.lang.Boolean registrationDone)Allows the MBean to perform any operations needed after having been
registered in the MBean server or after the registration has failed.
// do nothing
|
public void | preDeregister()Allows the MBean to perform any operations it needs before being de-registered
by the MBean server.
// do nothing
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)Allows the MBean to perform any operations it needs before being registered
in the MBean server. If the name of the MBean is not specified, the
MBean can provide a name for its registration. If any exception is
raised, the MBean will not be registered in the MBean server.
ObjectName objName = new ObjectName(OBJECT_NAME + ",role=" + ROLE);
return objName;
|
public void | run()
_queue.addSupplier();
//**********
// This is where the "work" takes place. In a real-world
/// application that uses this pattern, this logic would
/// be replaced by the real application logic.
//**********
while (!_stopCalled) {
while (_suspended) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {}
}
// Burn some cycles...
calculatePrimes(_workFactor);
// Now place a WorkUnit in the Queue
_queue.add(new WorkUnit());
_numberOfUnitsProcessed++;
}
_queue.removeSupplier();
|