use of com.sun.messaging.jmq.jmsserver.management.agent.Agent in project openmq by eclipse-ee4j.
the class BrokerStateHandler method initiateShutdown.
public void initiateShutdown(String requestedBy, long time, boolean triggerFailover, int exitCode, boolean threadOff, boolean exit, boolean cleanupJMX) {
synchronized (this) {
if (shutdownStarted) {
if (targetShutdownTime > 0) {
if (time > 0) {
targetShutdownTime = System.currentTimeMillis() + time;
} else {
targetShutdownTime = 0;
}
this.notifyAll();
}
return;
}
shutdownStarted = true;
}
Agent agent = Globals.getAgent();
if (agent != null) {
agent.notifyShutdownStart();
}
if (time > 0) {
targetShutdownTime = System.currentTimeMillis() + time;
} else {
targetShutdownTime = 0;
}
ShutdownRunnable runner = new ShutdownRunnable(requestedBy, triggerFailover, exitCode, cleanupJMX);
if (threadOff) {
Thread thr = new MQThread(runner, "shutdown thread");
thr.setDaemon(false);
thr.start();
} else {
// run in current thread
int shutdown = runner.shutdown();
if (exit) {
System.exit(shutdown);
}
}
}
use of com.sun.messaging.jmq.jmsserver.management.agent.Agent in project openmq by eclipse-ee4j.
the class Destination method resumeDestination.
public void resumeDestination() {
assert (state > DestState.RUNNING && state <= DestState.PAUSED);
int oldstate = state;
state = DestState.RUNNING;
if (oldstate == DestState.PRODUCERS_PAUSED || oldstate == DestState.PAUSED) {
producerFlow.updateAllProducers(DEST_RESUME, "Destination is resumed");
}
if (oldstate == DestState.CONSUMERS_PAUSED || oldstate == DestState.PAUSED) {
synchronized (consumers) {
Iterator itr = consumers.values().iterator();
while (itr.hasNext()) {
Consumer c = (Consumer) itr.next();
c.resume("Destination.RESUME");
}
}
}
Agent agent = Globals.getAgent();
if (agent != null) {
agent.notifyDestinationResume(this);
}
}
use of com.sun.messaging.jmq.jmsserver.management.agent.Agent in project openmq by eclipse-ee4j.
the class Destination method compact.
/**
* Compact the message file.
*/
public void compact() throws BrokerException {
if (!(pstore instanceof DiskFileStore)) {
throw new BrokerException("XXXI18N - operation not supported");
}
((DiskFileStore) pstore).compactDestination(this);
Agent agent = Globals.getAgent();
if (agent != null) {
agent.notifyDestinationCompact(this);
}
}
Aggregations