Package java.rmi

Examples of java.rmi.RemoteException


  public void removePortlet(String userName, long choiceId)
    throws CreateException, FinderException, NamingException, RemoteException, RemoveException {
    User user = fetchUserHome().findByUserName(userName);
    Choice choice = fetchChoiceHome().findByPrimaryKey(new ChoicePK(choiceId));
    if(choice.getUserId()!=user.getId())
      throw new RemoteException(userName+" couldn't remove choice with id "+choiceId);
    choice.remove();
  }
View Full Code Here


        public IRemoteTransactionContainer getRemoteTransactionContainer() throws RemoteException {
            try {
                return new RemoteTransactionContainer();
            } catch (IOException e) {
                throw new RemoteException("",e);
            }
        }
View Full Code Here

        public long initTransaction(int transactioLockTimeout) throws RemoteException {
            Future future = _localTransactionExecutor.submit(_lockTransuctionRunnable);
            try {
                future.get(transactioLockTimeout, TimeUnit.MILLISECONDS);
            } catch (Exception e) {
                throw new RemoteException("",e);
            }
            if(!_lockTransuctionRunnable._gotLock){
                throw new RemoteException("Unable to obtain transaction lock");
            }

            _serverSocketAcceptor.addReciever(_newDataBuffer);
            _serverSocketAcceptor.addReciever(_replacementsBuffer);
            _serverSocketAcceptor.addReciever(_rollbackBuffer);
View Full Code Here

               RemoteObject robj = (RemoteObject) remobj;
               System.out.println("Using remote object: "+robj.getRef().remoteToString());
           }
           return rje;
       }
       throw new RemoteException("Could not find "+name);
    }
View Full Code Here

                localHost = InetAddress.getLocalHost();
            } else {
                localHost = InetAddress.getByName(host);
            }
        } catch (UnknownHostException e1) {
            throw new RemoteException("Cannot start. Unable to get local host IP address.");
        }
        log.info("IP address="+localHost.getHostAddress());
        String hostName = localHost.getHostName();
        if (localHost.isLoopbackAddress()){
            throw new RemoteException("Cannot start. "+hostName+" is a loopback address.");
        }
        log.debug("This = " + this);
        if (createServer){
            log.info("Creating RMI registry (server.rmi.create=true)");
            try {
                LocateRegistry.createRegistry(this.rmiPort);
            } catch (RemoteException e){
                String msg="Problem creating registry: "+e;
                log.warn(msg);
                System.err.println(msg);
                System.err.println("Continuing...");
            }
        }
        try {
            Registry reg = LocateRegistry.getRegistry(this.rmiPort);
            reg.rebind(JMETER_ENGINE_RMI_NAME, this);
            log.info("Bound to registry on port " + this.rmiPort);
        } catch (Exception ex) {
            log.error("rmiregistry needs to be running to start JMeter in server " + "mode\n\t" + ex.toString());
            // Throw an Exception to ensure caller knows ...
            throw new RemoteException("Cannot start. See server log file.");
        }
    }
View Full Code Here

        }

        try {
            ((javax.rmi.CORBA.Stub) source).connect(((ObjectImpl) obj)._orb());
        } catch (org.omg.CORBA.BAD_OPERATION bad_operation) {
            throw new RemoteException(bad_operation.getMessage());
        }
    }
View Full Code Here

        RMIState state = RMIState.current();

        try {
            state.checkShutDown();
        } catch (BAD_INV_ORDER ex) {
            throw new RemoteException("RMIState is deactivated", ex);
        }

        Tie tie = javax.rmi.CORBA.Util.getTie(obj);

        if (tie != null)
View Full Code Here

                    break;
                }
            }
        }

        RemoteException rex = null;

        // construct the exception message according to �1.4.8

        StringBuffer buf = new StringBuffer("CORBA ");

        final String prefix = "org.omg.CORBA";
        if (name.startsWith(prefix)) {
            buf.append(name.substring(prefix.length() + 1));
        } else {
            buf.append(name);
        }

        buf.append(" ");
        buf.append(ex.minor);

        switch (ex.completed.value()) {
        case org.omg.CORBA.CompletionStatus._COMPLETED_YES:
            buf.append(" Yes");
            break;

        case org.omg.CORBA.CompletionStatus._COMPLETED_NO:
            buf.append(" No");
            break;

        case org.omg.CORBA.CompletionStatus._COMPLETED_MAYBE:
            buf.append(" Maybe");
            break;
        }

        String exceptionMessage = buf.toString();

        try {

            rex = (RemoteException) newInstance(exclz,
                    new Class[] { String.class },
                    new Object[] { exceptionMessage });

            rex.detail = ex;

        } catch (RuntimeException ex2) {

            rex = new RemoteException(exceptionMessage, ex2);
        }

        return rex;
    }
View Full Code Here

            targetClass = Util.loadClass(desc.getJavaClass().getName(), stub
                    ._get_codebase(), loader);
        } catch (ClassNotFoundException ex) {
            logger.finer("copyRMIStub exception (current loader is: " + loader
                    + ") " + ex);
            throw new RemoteException("Class not found", ex);
        }

        return PortableRemoteObjectImpl.narrow1(RMIState.current(), stub,
                targetClass);
    }
View Full Code Here

    @Override
    public void enableHost(String hostName) throws RemoteException {
        try {
            HostsFileUtils.enableHost(hostName);
        } catch (Exception e) {
            throw new RemoteException(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of java.rmi.RemoteException

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.