use of org.omg.CORBA.OBJECT_NOT_EXIST in project ACS by ACS-Community.
the class BACIRemoteAccess method checkException.
/**
* @param req
* @throws Exception
*/
private void checkException(Object target, Request req) throws Exception {
Exception exceptionThrown = req.env().exception();
if (exceptionThrown != null) {
BACIRemoteNode device = getDeviceFromTarget(target);
if (device != null && device.isNonSticky() && exceptionThrown instanceof OBJECT_NOT_EXIST) {
// disconnect and provice nice error message
try {
device.disconnect();
} catch (Throwable th) {
/* noop, still report */
th.printStackTrace();
}
throw new NonStickyComponentReleased("Non-sticky component released, disconnecting it automatically.");
} else if (exceptionThrown instanceof org.omg.CORBA.UnknownUserException) {
// without ID int the CDROutputStream (value field)
Any exceptionValue = ((org.omg.CORBA.UnknownUserException) exceptionThrown).except;
java.lang.Object userException = baciIntrospector.extractAny(exceptionValue);
exceptionThrown = (Exception) userException;
}
// log ACS exception
logACSException(exceptionThrown);
throw exceptionThrown;
}
}
use of org.omg.CORBA.OBJECT_NOT_EXIST in project ACS by ACS-Community.
the class EventModel method resolveNotificationChannel.
/**
* Resolves a notification channel in the naming service.
*
* @return Reference to the event channel specified by channelName.
* @param bindingName
* Name of the event channel and trailing domain name, as the NC is registered with the CORBA Naming Service
* @throws AcsJException
* Standard ACS Java exception.
*/
protected EventChannel resolveNotificationChannel(String bindingName) throws AcsJException {
EventChannel retValue = null;
String nameServiceKind = alma.acscommon.NC_KIND.value;
//m_logger.info("Will call 'nctx.resolve' for binding='" + bindingName + "', kind='" + nameServiceKind + "'.");
try {
NameComponent[] t_NameSequence = { new NameComponent(bindingName, nameServiceKind) };
retValue = EventChannelHelper.narrow(nctx.resolve(t_NameSequence));
} catch (OBJECT_NOT_EXIST ex) {
m_logger.severe("The NC '" + bindingName + "' no longer exists, probably because its notify service was restarted. The naming service still lists this NC.");
throw new AcsJUnexpectedExceptionEx(ex);
} catch (org.omg.CosNaming.NamingContextPackage.NotFound e) {
// No other suppliers have created the channel yet
m_logger.info("The '" + bindingName + "' channel has not been created yet.");
throw new AcsJUnexpectedExceptionEx(e);
} catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e) {
// Think there is virtually no chance of this every happening but...
throw new AcsJUnexpectedExceptionEx(e);
} catch (org.omg.CosNaming.NamingContextPackage.InvalidName e) {
// Think there is virtually no chance of this every happening but...
throw new AcsJUnexpectedExceptionEx(e);
}
return retValue;
}
Aggregations