Package java.rmi

Examples of java.rmi.NoSuchObjectException


            throw new NullPointerException("invalid argument");
        }

        if (StubAdapter.isStub(obj) ||
            obj instanceof java.rmi.server.RemoteStub) {
            throw new NoSuchObjectException(
                "Can only unexport a server object.");
        }

        Tie theTie = Util.getTie(obj);
        if (theTie != null) {
            Util.unexportObject(obj);
        } else {
            if (Utility.loadTie(obj) == null) {
                UnicastRemoteObject.unexportObject(obj,true);
            } else {
                throw new NoSuchObjectException("Object not exported.");
            }
        }
    }
View Full Code Here


        // Now map to the correct RemoteException type...
        if (ex instanceof COMM_FAILURE) {
            return new MarshalException(message, ex);
        } else if (ex instanceof INV_OBJREF) {
            RemoteException newEx = new NoSuchObjectException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof NO_PERMISSION) {
            return new AccessException(message, ex);
        } else if (ex instanceof MARSHAL) {
            return new MarshalException(message, ex);
        } else if (ex instanceof OBJECT_NOT_EXIST) {
            RemoteException newEx = new NoSuchObjectException(message);
            newEx.detail = ex;
            return newEx;
        } else if (ex instanceof TRANSACTION_REQUIRED) {
            RemoteException newEx = new TransactionRequiredException(message);
            newEx.detail = ex;
View Full Code Here

    /**
     * Deregisters a server object from the runtime.
     */
    public static void unexportObject(Remote obj) throws IOException {
        if (proxy == null)
            throw new NoSuchObjectException("Object not exported");
        proxy.unexportObject(obj);
    }
View Full Code Here

    /**
     * Returns a stub for the given server object.
     */
    public static Remote toStub(Remote obj) throws IOException {
        if (proxy == null)
            throw new NoSuchObjectException("Object not exported");
        return proxy.toStub(obj);
    }
View Full Code Here

    public synchronized Proxy getProxy(URI uri)
            throws NoSuchObjectException {

        Proxy proxy = (Proxy) _proxies.get(uri);
        if (proxy == null) {
            throw new NoSuchObjectException(
                    "Object not exported on URI=" + uri);
        }
        return proxy;
    }
View Full Code Here

//         if (uri == null) {
//             throw new IllegalArgumentException("Argument 'uri' is null");
//         }
        ObjectRef ref = (ObjectRef) _objectMap.get(object);
        if (ref == null) {
            throw new NoSuchObjectException("Object not exported");
        }
        URI parsed = null;
        if (uri != null) {
            try {
                parsed = URIHelper.parse(uri);
            } catch (InvalidURIException exception) {
                throw new NoSuchObjectException(exception.getMessage());
            }
        }
        return ref.getProxy(parsed);
    }
View Full Code Here

//         if (uri == null) {
//             throw new IllegalArgumentException("Argument 'uri' is null");
//         }
        ObjectRef ref = (ObjectRef) _objIDMap.get(objID);
        if (ref == null) {
            throw new NoSuchObjectException("Object not exported");
        }
        // ref.getProxy(uri);
        // ensures it has been exported on the specified uri
        return ref.getObject();
    }
View Full Code Here

        ObjectRef ref = (ObjectRef) _objectMap.remove(object);
        if (ref != null) {
            _objIDMap.remove(ref.getObjID());
        } else {
            throw new NoSuchObjectException("Object not exported");
        }
    }
View Full Code Here

                throw new SystemException("Unexpected load exception", e);
            }

            // Did we find the instance?
            if (instance == null) {
                throw new InvalidateReferenceException(new NoSuchObjectException("Not Found"));
            }

            // remember instance until it is returned to the cache
            checkedOutInstances.put(primaryKey, instance);
        }
View Full Code Here

                    throw new SystemException("Unexpected load exception", e);
                }

                // Did we find the instance?
                if (instance == null) {
                    throw new InvalidateReferenceException(new NoSuchObjectException("Not Found"));
                }

               
                // remember instance until it is returned to the cache               
                checkedOutInstances.put(primaryKey, instance);
View Full Code Here

TOP

Related Classes of java.rmi.NoSuchObjectException

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.