use of org.omg.CORBA.portable.ObjectImpl in project wildfly by wildfly.
the class HandleDelegateImpl method reconnect.
protected void reconnect(Object object) throws IOException {
if (object instanceof ObjectImpl) {
try {
// Check we are still connected
ObjectImpl objectImpl = (ObjectImpl) object;
objectImpl._get_delegate();
} catch (BAD_OPERATION e) {
try {
// Reconnect
final Stub stub = (Stub) object;
final ORB orb = (ORB) new InitialContext().lookup("java:comp/ORB");
stub.connect(orb);
} catch (NamingException ne) {
throw EjbLogger.ROOT_LOGGER.failedToLookupORB();
}
}
} else {
throw EjbLogger.ROOT_LOGGER.notAnObjectImpl(object.getClass());
}
}
Aggregations