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()); } }
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 Stub stub = (Stub) object; ORB orb = (ORB) new InitialContext().lookup("java:comp/ORB"); stub.connect(orb); } catch (NamingException ne) { throw new IOException("Unable to lookup java:comp/ORB"); } } } else throw new IOException("Not an ObjectImpl " + object.getClass().getName()); } }
/** * delegation of serialization behavior */ @Override public <T> T readExternal(Bean<T> bean, ObjectInput in) throws IOException, ClassNotFoundException { T actualResource = null; // default behavior actualResource = (T) in.readObject(); if (actualResource instanceof javax.rmi.CORBA.Stub) { // for remote ejb stub, reconnect after deserialization. org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(new String[0], null); ((javax.rmi.CORBA.Stub)actualResource).connect(orb); } else if (actualResource.equals(DUMMY_STRING)) { actualResource = (T) ((ResourceBean)bean).getActualInstance(); } return actualResource; }
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 MESSAGES.failedToLookupORB(); } } } else { throw MESSAGES.notAnObjectImpl(object.getClass()); } }
public static void connect(Object stub, ORB orb) throws java.rmi.RemoteException { if (stub instanceof DynamicStub) ((DynamicStub) stub).connect(orb); else if (stub instanceof javax.rmi.CORBA.Stub) ((javax.rmi.CORBA.Stub) stub).connect(orb); else if (stub instanceof ObjectImpl) orb.connect((org.omg.CORBA.Object) stub); else throw wrapper.connectRequiresStub(); }
public static void connect(Object stub, ORB orb) throws java.rmi.RemoteException { if (stub instanceof DynamicStub) ((DynamicStub) stub).connect(orb); else if (stub instanceof javax.rmi.CORBA.Stub) ((javax.rmi.CORBA.Stub) stub).connect(orb); else if (stub instanceof ObjectImpl) orb.connect((org.omg.CORBA.Object) stub); else throw wrapper.connectRequiresStub(); }
public static void connect( Object stub, ORB orb ) throws java.rmi.RemoteException { if (stub instanceof DynamicStub) ((DynamicStub)stub).connect( (com.sun.corba.se.spi.orb.ORB)orb ) ; else if (stub instanceof javax.rmi.CORBA.Stub) ((javax.rmi.CORBA.Stub)stub).connect( orb ) ; else if (stub instanceof ObjectImpl) orb.connect( (org.omg.CORBA.Object)stub ) ; else throw wrapper.connectRequiresStub() ; }
Remote proxy = PortableRemoteObject.toStub(impl); if (orb != null) { ((Stub) proxy).connect(orb);
Stub stub = (Stub)obj; ORB orb = getORB(); stub.connect(orb);
((javax.rmi.CORBA.Stub)actualResource).connect(orb);
final Stub stub = (Stub) obj; final ORB orb = getORB(); stub.connect(orb);
stub.connect(orb); if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("reconnected");
public void connect(Remote target, Remote source) throws java.rmi.RemoteException { if (!(source instanceof javax.rmi.CORBA.Stub)) source = toStub(source); ObjectImpl obj; if (target instanceof ObjectImpl) { obj = (ObjectImpl) target; } else { try { exportObject(target); } catch (java.rmi.RemoteException ex) { // ignore "already exported test" // } try { obj = (ObjectImpl) toStub(target); } catch (java.rmi.NoSuchObjectException ex) { throw (java.rmi.RemoteException)new java.rmi.RemoteException("cannot convert to stub!").initCause(ex); } } try { ((javax.rmi.CORBA.Stub) source).connect(((ObjectImpl) obj)._orb()); } catch (org.omg.CORBA.BAD_OPERATION bad_operation) { throw (RemoteException)new RemoteException(bad_operation.getMessage()) .initCause(bad_operation); } }
((Stub) stub).connect(orb); } catch (RemoteException e) {