* Send specified event notification over admin channel
*/
public AdminEventResult sendNotification(AdminEvent event) {
// Normal handling, send the event
boolean doRetry = true;
AdminEventResult result = null;
if (stub != null) {
try {
result = stub.sendNotification(key, event);
doRetry = false;
} catch (ServerException re) {
if ((re.detail != null) &&
(re.detail instanceof java.lang.IllegalArgumentException
|| re.detail instanceof java.lang.SecurityException)) {
doRetry = false;
warn(EVENT_NOTIFY_ERROR);
debug(re.detail);
} else {
if (re.detail != null) {
debug(re.detail);
}
debug(re);
}
} catch (RemoteException re) {
if (re.detail != null) {
debug(re.detail);
}
debug(re);
}
}
if (doRetry) {
// Normal processing did not work, try to get stub again and then
// attempt to send the event
boolean gotNew = checkServerStatus();
if (stub != null && gotNew) {
try {
result = stub.sendNotification(key, event);
} catch (RemoteException re) {
warn(EVENT_RENOTIFY_ERROR);
if (re.detail != null) {
debug(re.detail);
}
debug(re);
}
}
}
if (result == null) {
// Still couldn't communicate, set result appropriately
result = new AdminEventResult(event.getSequenceNumber());
result.setResultCode(AdminEventResult.TRANSMISSION_ERROR);
if (stub == null) {
result.addMessage(event.getEffectiveDestination(),
"Remote Stub is null");
}
}
return result;
}