use of alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx in project ACS by ACS-Community.
the class Helper method createNotifyChannel_internal.
/**
* Broken out from {@link #createNotificationChannel(String, String, String)}
* to give tests better control about the timing when this call to the event factory is made.
* @throws NameAlreadyUsed if the call to NotifyFactory#create_named_channel fails with this exception.
* @throws AcsJCORBAProblemEx if the TAO extension throws a NameMapError or if the QoS attributes cause a UnsupportedAdmin.
*/
protected EventChannel createNotifyChannel_internal(Property[] initial_qos, Property[] initial_admin, IntHolder channelIdHolder) throws NameAlreadyUsed, UnsupportedQoS, AcsJNarrowFailedEx, AcsJCORBAProblemEx {
EventChannel ret = null;
StopWatch stopwatch = new StopWatch();
try {
// The TAO extension of the notify factory that we use declares only the plain EventChannel type,
// even though it creates the TAO-extension subtype.
org.omg.CosNotifyChannelAdmin.EventChannel eventChannelBaseType = notifyFactory.create_named_channel(initial_qos, initial_admin, channelIdHolder, channelName);
LOG_NC_ChannelCreatedRaw_OK.log(m_logger, channelName, channelIdHolder.value, stopwatch.getLapTimeMillis());
// re-create the client side corba stub, to get the extension subtype
ret = gov.sandia.NotifyMonitoringExt.EventChannelHelper.narrow(eventChannelBaseType);
} catch (BAD_PARAM ex) {
LOG_NC_TaoExtensionsSubtypeMissing.log(m_logger, channelName, EventChannel.class.getName(), org.omg.CosNotifyChannelAdmin.EventChannelHelper.id());
AcsJNarrowFailedEx ex2 = new AcsJNarrowFailedEx(ex);
ex2.setNarrowType(EventChannelHelper.id());
throw ex2;
} catch (NameMapError ex) {
String msg = "Got a TAO extension-specific NameMapError exception that means the TAO NC extension is not usable. Bailing out since we need the extension.";
m_logger.log(AcsLogLevel.ERROR, msg, ex);
AcsJCORBAProblemEx ex2 = new AcsJCORBAProblemEx(ex);
ex2.setInfo(msg);
throw ex2;
} catch (UnsupportedAdmin ex) {
AcsJCORBAProblemEx ex2 = new AcsJCORBAProblemEx(ex);
ex2.setInfo(createUnsupportedAdminLogMessage(ex));
throw ex2;
}
return ret;
}
use of alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx in project ACS by ACS-Community.
the class LogLevelSelectorPanel method loggersLbl.
/**
* Gets the loggers and their levels.
* <p>
* This method makes remote calls and should not be called in the event thread!
*
* @return
* @throws AcsJCORBAProblemEx In case of ORB / network failure or if remote process is unresponsive or unreachable.
*/
private LogLevelHelper[] loggersLbl() throws AcsJCORBAProblemEx {
List<LogLevelHelper> ret = new ArrayList<LogLevelHelper>();
try {
// get the logger names
final String[] logNames = logConf.get_logger_names();
// get the log levels for each logger
for (String logName : logNames) {
try {
LogLevels logLevels = logConf.get_logLevels(logName);
ret.add(new LogLevelHelper(logName, logLevels));
} catch (LoggerDoesNotExistEx ex) {
logger.warning("Failed to retrieve log levels info for logger '" + logName + "'. Will skip this logger.");
}
}
return ret.toArray(new LogLevelHelper[0]);
} catch (SystemException ex) {
AcsJCORBAProblemEx ex2 = new AcsJCORBAProblemEx(ex);
ex2.setInfo("Failed to retrieve logger names or levels.");
throw ex2;
}
}
use of alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx in project ACS by ACS-Community.
the class BACIRemoteAccess method logACSException.
/**
* Logs ACSException.
* @param exceptionThrown
*/
private void logACSException(Exception exceptionThrown) {
/* all user exception is expected to be using ACS Error System */
if (exceptionThrown instanceof DataException) {
DataException de = (DataException) exceptionThrown;
/*
* This is just to probe if we have an ACS Exception.
* All applications should deal with ACS Exception and we want
* to issue a warning if this is not the case.
* In this case we get an exception and the trap will log the warning.
*/
if (de.get("errorTrace") != null) {
AcsJObjectExplorerReportEx objexpEx = new AcsJObjectExplorerReportEx(exceptionThrown);
objexpEx.log(BACILogger.getLogger());
} else {
AcsJObjectExplorerReportEx notAnAcsEx = new AcsJObjectExplorerReportEx(exceptionThrown);
notAnAcsEx.setContext("Logging a User Exception that is NOT an ACS Exception");
notAnAcsEx.log(BACILogger.getLogger());
notifier.reportDebug("BACIRemoteAccess::logACSExcpetion", "Failed to wrap user exception into native ACS Error System exception" + " for '" + de.id() + "'.");
}
} else /* End if org.omg.CORBA.UserException */
if (exceptionThrown instanceof alma.acs.exceptions.AcsJException) {
AcsJObjectExplorerReportEx objexpEx = new AcsJObjectExplorerReportEx(exceptionThrown);
objexpEx.log(BACILogger.getLogger());
} else if (exceptionThrown instanceof org.omg.CORBA.SystemException) {
org.omg.CORBA.SystemException corbaSys = (org.omg.CORBA.SystemException) exceptionThrown;
AcsJCORBAProblemEx corbaProblemEx = new AcsJCORBAProblemEx(exceptionThrown);
corbaProblemEx.setMinor(corbaSys.minor);
corbaProblemEx.setCompletionStatus(corbaSys.completed.value());
corbaProblemEx.setInfo(corbaSys.toString());
AcsJObjectExplorerReportEx objexpEx = new AcsJObjectExplorerReportEx(corbaProblemEx);
objexpEx.log(BACILogger.getLogger());
} else {
AcsJUnexpectedExceptionEx unexpectedEx = new AcsJUnexpectedExceptionEx(exceptionThrown);
AcsJObjectExplorerReportEx objexpEx = new AcsJObjectExplorerReportEx(unexpectedEx);
objexpEx.log(BACILogger.getLogger());
notifier.reportDebug("BACIRemoteAccess::logACSException", "Received an unexpected exception: " + " '" + exceptionThrown.getClass().getName() + "'.");
}
}
Aggregations