Package java.rmi.server

Examples of java.rmi.server.RemoteStub


        if(ref == null) {
            // rmi.log.107=ref == null
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.107")); //$NON-NLS-1$

            RemoteStub stub = (RemoteStub)id.activate(false); //ToDo Check whether it returns Remote or RemoteStub
            // rmi.log.3C=Stub = {0}
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.3C", stub)); //$NON-NLS-1$

            ActivatableRef aref = (ActivatableRef)stub.getRef();
            // rmi.log.108=aref = {0}
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.108", aref)); //$NON-NLS-1$

            ref = aref.ref; // Global variable stored for next calls
            rref = aref.ref; // local variable
        } else {
            rref = ref;
        }

        /*
         * If the group's VM was killed(or something bad happened to it) we may have stale activatable reference to the object.
         * In this case rref.invoke() will throw 3 types of Exceptions: ConnectException, ConnectIOException and UnknownObjectException
         * which should be catched and activation group should be activated again.
         */
        try {
            return rref.invoke(obj, method, params, opnum);
        }
        catch(ConnectException ce) {
        }
        catch(ConnectIOException cioe) {
        }
        catch(UnknownObjectException uoe) {
        }
        catch(Exception t) {
            signal_exception = t;
        }

        // rmi.log.109=signal_exception = {0}
        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.109", signal_exception)); //$NON-NLS-1$

        if (signal_exception == null) {
            RemoteStub stub = (RemoteStub)id.activate(true);
            ActivatableRef aref = (ActivatableRef) stub.getRef();
            ref = aref.ref;
            rref = aref.ref;
            return rref.invoke(obj, method, params, opnum);
        }
        else {
View Full Code Here


      // Print it.
      if (Boolean.getBoolean(PRINT_IOR_PROPERTY)) {
        if (server.getServant() instanceof RemoteObject) {
          RemoteObject remoteObject = (RemoteObject) server.getServant();
          RemoteStub remoteStub = (RemoteStub) RemoteObject.toStub(remoteObject);
          RemoteRef ref = remoteStub.getRef();
          System.out.print("RMI:");
          System.out.flush();
          ObjectOutputStream objOut
            = new ObjectOutputStream(new Base64EncodingOutputStream(System.out));
          objOut.writeObject(ref);
View Full Code Here

            Class cl = RMIClassLoader.loadClass(desc.getLocation(), cn);
            Class rcl = RMIUtil.getRemoteClass(cl);
            stubName = rcl.getName() + "_Stub"; //$NON-NLS-1$
            Class stubClass = RMIClassLoader.loadClass((String) null, stubName);
            Constructor constructor = stubClass.getConstructor(new Class[] { RemoteRef.class });
            RemoteStub stub = (RemoteStub) constructor.newInstance(new Object[] {
                    new ActivatableRef(aid, null)
            });
            return stub;

        } catch (Exception ex) {
View Full Code Here

        if(ref == null) {
            // rmi.log.107=ref == null
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.107")); //$NON-NLS-1$

            RemoteStub stub = (RemoteStub)id.activate(false); //ToDo Check whether it returns Remote or RemoteStub
            // rmi.log.3C=Stub = {0}
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.3C", stub)); //$NON-NLS-1$

            ActivatableRef aref = (ActivatableRef)stub.getRef();
            // rmi.log.108=aref = {0}
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.108", aref)); //$NON-NLS-1$

            ref = aref.ref; // Global variable stored for next calls
            rref = aref.ref; // local variable
        } else {
            rref = ref;
        }

        /*
         * If the group's VM was killed(or something bad happened to it) we may have stale activatable reference to the object.
         * In this case rref.invoke() will throw 3 types of Exceptions: ConnectException, ConnectIOException and UnknownObjectException
         * which should be caught and activation group should be activated again.
         */
        try {
            return rref.invoke(obj, method, params, opnum);
        }
        catch(ConnectException ce) {
        }
        catch(ConnectIOException cioe) {
        }
        catch(UnknownObjectException uoe) {
        }
        catch(Exception t) {
            signal_exception = t;
        }

        // rmi.log.109=signal_exception = {0}
        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.109", signal_exception)); //$NON-NLS-1$

        if (signal_exception == null) {
            RemoteStub stub = (RemoteStub)id.activate(true);
            ActivatableRef aref = (ActivatableRef) stub.getRef();
            ref = aref.ref;
            rref = aref.ref;
            return rref.invoke(obj, method, params, opnum);
        }
        else {
View Full Code Here

        if(ref == null) {
            // rmi.log.107=ref == null
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.107")); //$NON-NLS-1$

            RemoteStub stub = (RemoteStub)id.activate(false); //ToDo Check whether it returns Remote or RemoteStub
            // rmi.log.3C=Stub = {0}
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.3C", stub)); //$NON-NLS-1$

            ActivatableRef aref = (ActivatableRef)stub.getRef();
            // rmi.log.108=aref = {0}
            rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.108", aref)); //$NON-NLS-1$

            ref = aref.ref; // Global variable stored for next calls
            rref = aref.ref; // local variable
        } else {
            rref = ref;
        }

        /*
         * If the group's VM was killed(or something bad happened to it) we may have stale activatable reference to the object.
         * In this case rref.invoke() will throw 3 types of Exceptions: ConnectException, ConnectIOException and UnknownObjectException
         * which should be caught and activation group should be activated again.
         */
        try {
            return rref.invoke(obj, method, params, opnum);
        }
        catch(ConnectException ce) {
        }
        catch(ConnectIOException cioe) {
        }
        catch(UnknownObjectException uoe) {
        }
        catch(Exception t) {
            signal_exception = t;
        }

        // rmi.log.109=signal_exception = {0}
        rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.109", signal_exception)); //$NON-NLS-1$

        if (signal_exception == null) {
            RemoteStub stub = (RemoteStub)id.activate(true);
            ActivatableRef aref = (ActivatableRef) stub.getRef();
            ref = aref.ref;
            rref = aref.ref;
            return rref.invoke(obj, method, params, opnum);
        }
        else {
View Full Code Here


        server = createServiceInstance();
        logger.info("Exporting " + server.getClass().getName() + " under: {}/{}", serviceName,
                registry);
        RemoteStub stub = UnicastRemoteObject.exportObject(server);
        registry.rebind(serviceName, stub);
        logger.info("Exported " + server.getClass().getName() + ": {}", stub);
    }
View Full Code Here

            registry.list();
        }

        logger.info("Exporting Workspace Manager under: {}/{}", serviceName, registry);
        server = new ServerWorkspaceManager(workspaceManager);
        RemoteStub stub = UnicastRemoteObject.exportObject(server);
        registry.rebind(serviceName, stub);
        logger.info("Exported Workspace Manager: {}", stub);
    }
View Full Code Here

        EasyMock.replay(remote, workspace);

        Registry registry = LocateRegistry.createRegistry(10000);

        ServerWorkspaceManager server = new ServerWorkspaceManager(remote);
        RemoteStub stub = UnicastRemoteObject.exportObject(server);
        registry.rebind("wm", stub);

        RemoteWorkspaceManager client = (RemoteWorkspaceManager) registry.lookup("wm");
        WorkspaceManager local = new ClientWorkspaceManager(client);
View Full Code Here

TOP

Related Classes of java.rmi.server.RemoteStub

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.