use of com.sun.messaging.jmq.jmsserver.util.BrokerException in project openmq by eclipse-ee4j.
the class ServiceConfig method resume.
public void resume() throws MBeanException {
try {
if (isAdminService()) {
throw (new BrokerException("Cannot resume admin service: " + service));
}
logger.log(Logger.INFO, rb.I_RESUMING_SVC, service);
ServiceUtil.resumeService(service);
} catch (BrokerException e) {
handleOperationException(ServiceOperations.RESUME, e);
}
}
use of com.sun.messaging.jmq.jmsserver.util.BrokerException in project openmq by eclipse-ee4j.
the class ServiceConfig method pause.
public void pause() throws MBeanException {
try {
if (isAdminService()) {
throw (new BrokerException("Cannot pause admin service: " + service));
}
logger.log(Logger.INFO, rb.I_PAUSING_SVC, service);
ServiceUtil.pauseService(service);
} catch (BrokerException e) {
handleOperationException(ServiceOperations.PAUSE, e);
}
}
use of com.sun.messaging.jmq.jmsserver.util.BrokerException in project openmq by eclipse-ee4j.
the class ServiceConfig method updateService.
private void updateService(int port, int min, int max) throws IOException, PropertyUpdateException, BrokerException {
ServiceManager sm = Globals.getServiceManager();
Service svc = sm.getService(getName());
IMQService stsvc;
if (svc == null) {
throw new BrokerException(rb.getString(rb.X_NO_SUCH_SERVICE, getName()));
}
if (!(svc instanceof IMQService)) {
throw new BrokerException("Internal Error: can updated non-standard Service");
}
stsvc = (IMQService) svc;
stsvc.updateService(port, min, max);
}
use of com.sun.messaging.jmq.jmsserver.util.BrokerException in project openmq by eclipse-ee4j.
the class DestinationUtil method getMessageFromException.
/**
* Get a message from an Exception. This basically checks if the exception is a BrokerException and properly formats the
* linked exceptions message. The string returned does NOT include the exception name.
*/
public static String getMessageFromException(Exception e) {
String m = e.getMessage();
if (e instanceof BrokerException) {
Throwable root_ex = ((BrokerException) e).getCause();
if (root_ex == null) {
// no root cause
return m;
}
String lm = root_ex.getMessage();
if (lm != null) {
m = m + "\n" + lm;
}
}
return m;
}
use of com.sun.messaging.jmq.jmsserver.util.BrokerException in project openmq by eclipse-ee4j.
the class DestinationUtil method compactAllDestinations.
public static void compactAllDestinations() throws BrokerException {
Iterator[] itrs = Globals.getDestinationList().getAllDestinations(null);
// PART
Iterator itr = itrs[0];
boolean docompact = true;
String errMsg = null;
BrokerResources rb = Globals.getBrokerResources();
while (itr.hasNext()) {
// make sure all are paused
Destination d = (Destination) itr.next();
/*
* Skip internal, admin, or temp destinations. Skipping temp destinations may need to be revisited.
*/
if (d.isInternal() || d.isAdmin() || d.isTemporary()) {
continue;
}
if (!d.isPaused()) {
docompact = false;
String msg = rb.getString(rb.E_SOME_DESTINATIONS_NOT_PAUSED);
errMsg = rb.getString(rb.X_COMPACT_DSTS_EXCEPTION, msg);
throw (new BrokerException(errMsg));
}
}
if (docompact) {
itrs = Globals.getDestinationList().getAllDestinations(null);
itr = itrs[0];
while (itr.hasNext()) {
Destination d = (Destination) itr.next();
/*
* Skip internal, admin, or temp destinations. Skipping temp destinations may need to be revisited.
*/
if (d.isInternal() || d.isAdmin() || d.isTemporary()) {
continue;
}
d.compact();
}
}
}
Aggregations