EmsConnection emsConnection = asResourceComponenet.getEmsConnection();
if (emsConnection == null) {
throw new RuntimeException("Can not connect to the server");
}
EmsBean bean = emsConnection.getBean("jboss.messaging:service=ServerPeer");
EmsOperation operation = bean.getOperation("enableMessageCounters");
List<EmsParameter> params = operation.getParameters();
int count = params.size();
if (count == 0)
operation.invoke(new Object[0]);
else { // overloaded operation
operation.invoke(new Object[] { 0 }); // return code of 0
}
//reset counters
operation = bean.getOperation("resetAllMessageCounters");
params = operation.getParameters();
count = params.size();
if (count == 0)
operation.invoke(new Object[0]);
else { // overloaded operation
operation.invoke(new Object[] { 0 }); // return code of 0
}
operation = bean.getOperation("resetAllMessageCounterHistories");
params = operation.getParameters();
count = params.size();
if (count == 0)
operation.invoke(new Object[0]);
else { // overloaded operation