Java 类java.rmi.RemoteException 实例源码

项目:openNaEF    文件:FilteringFieldsMaker.java   
public List<FilterQueryContext> makeFilteringFieldsView() throws RemoteException, IOException, ExternalServiceException {
    List<FilterQueryContext> result = new ArrayList<FilterQueryContext>();

    List<String> fields = getConfig().getFilteringFields();
    Properties conditions = getConfig().getConditionOfFiltering();
    Properties displayNames = getConfig().getDisplayNames();

    for (String field : fields) {
        FilterQueryContext context = new FilterQueryContext();
        context.setMatcherClass(getMatcherClass(conditions.getProperty(field)));
        context.setDisplayName(displayNames.getProperty(field));
        context.setName(field);

        context.setEditorName(getEditorName(conditions.getProperty(field)));
        if (context.getEditorName() != null) {
            setProposals(field, context);
        }

        result.add(context);
    }

    return result;
}
项目:jdk8u-jdk    文件:RemoteVmManager.java   
/**
 * Return the current set of monitorable Java Virtual Machines.
 * <p>
 * The set returned by this method depends on the user name passed
 * to the constructor. If no user name was specified, then this
 * method will return all candidate JVMs on the system. Otherwise,
 * only the JVMs for the given user will be returned. This assumes
 * that the RMI server process has the appropriate permissions to
 * access the target set of JVMs.
 *
 * @return Set - the Set of monitorable Java Virtual Machines
 */
public Set<Integer> activeVms() throws MonitorException {
    int[] active = null;

    try {
        active = remoteHost.activeVms();

    } catch (RemoteException e) {
        throw new MonitorException("Error communicating with remote host: "
                                   + e.getMessage(), e);
    }

    Set<Integer> activeSet = new HashSet<Integer>(active.length);

    for (int i = 0; i < active.length; i++) {
        activeSet.add(new Integer(active[i]));
    }

    return activeSet;
}
项目:Progetto-M    文件:RMIDatabaseServer.java   
public static void main(String[] args) {
   /*
    MarioNOTE:
    creating a connection to the database
    */
   DatabaseConnection connection = new DatabaseConnection("java", "password");

   try{
       int port = 1099;
       /*
       MarioNOTE:
       creating a Registry that allows the server to
       publish a service and client to retrieve the proxy
       */
       Registry registry = LocateRegistry.createRegistry(port);
       DatabaseGestion DBGestor = new DatabaseGestion();
       registry.rebind("MyDatabase", DBGestor);

       System.out.println("\nServer is ready...");

   }catch(RemoteException ex){
       System.out.println("\nRMIDatabaseServer ERROR: " + ex);
   }
}
项目:OpenJSharp    文件:Activation.java   
synchronized MarshalledObject<? extends Remote>
    activate(ActivationID id,
             boolean force,
             ActivationInstantiator inst)
    throws RemoteException, ActivationException
{
    MarshalledObject<? extends Remote> nstub = stub;
    if (removed) {
        throw new UnknownObjectException("object removed");
    } else if (!force && nstub != null) {
        return nstub;
    }

    nstub = inst.newInstance(id, desc);
    stub = nstub;
    /*
     * stub could be set to null by a group reset, so return
     * the newstub here to prevent returning null.
     */
    return nstub;
}
项目:openNaEF    文件:MplsnmsTefService.java   
@Override protected void serviceStarted() {
    super.serviceStarted();

    String rmiServiceName = System.getProperty(PROPERTYNAME_RMISERVICENAME);
    if (rmiServiceName == null) {
        throw new IllegalStateException("system property '" + PROPERTYNAME_RMISERVICENAME+ "' を設定してください.");
    }
    try {
        TefService.instance().getRmiRegistry().bind(rmiServiceName, new MplsnmsRmiServiceAccessPoint.Impl());
    } catch (RemoteException re) {
        throw new RuntimeException(re);
    } catch (AlreadyBoundException abe) {
        throw new RuntimeException(abe);
    }

    NaefTefService.instance().getRmcServerService()
        .registerMethod(AllocateVlanIpsubnetaddr.Call.class, new AllocateVlanIpsubnetaddr.Exec());
}
项目:MaximoForgeViewerPlugin    文件:FldBase64URN.java   
/**
 * Construct and attach to the specified mbo value
 * @throws RemoteException 
 */
public FldBase64URN(
    MboValue mbv 
   )
    throws MXException, RemoteException
{
        super( mbv );

    String query =  "(" + Constants.FIELD_SITEID + " = :" + Model.FIELD_SITEID + " OR " + Model.FIELD_SITEID + " IS NULL )"
    + " AND (" + Constants.FIELD_ORGID + " = :" + Model.FIELD_ORGID + " OR " + Model.FIELD_ORGID + " IS NULL )";

       String thisAttr = getMboValue().getAttributeName() ;
       setRelationship(  Viewable.TABLE_NAME, query );

        setLookupKeyMapInOrder(
                new String[] { thisAttr, BuildingModel.FIELD_URL, BuildingModel.FIELD_PARAMNAME, BuildingModel.FIELD_DESCRIPTION,
                               BuildingModel.FIELD_LONGDESCRIPTION }
            ,
            new String[] {  Viewable.FIELD_OBJECTKEY, Viewable.FIELD_BASE64URN, Viewable.FIELD_OBJECTKEY, Viewable.FIELD_DESCRIPTION,
                                Viewable.FIELD_LONGDESCRIPTION }
            ); 

        setListCriteria( query );
}
项目:jdk8u-jdk    文件:FilterUSRTest.java   
@Test(dataProvider = "bindData")
public void UnicastServerRef(String name, Object obj, int expectedFilterCount) throws RemoteException {
    try {
        RemoteImpl impl = RemoteImpl.create();
        UnicastServerRef ref = new UnicastServerRef(new LiveRef(0), impl.checker);

        Echo client = (Echo) ref.exportObject(impl, null, false);

        int count = client.filterCount(obj);
        System.out.printf("count: %d, obj: %s%n", count, obj);
        Assert.assertEquals(count, expectedFilterCount, "wrong number of filter calls");
    } catch (RemoteException rex) {
        if (expectedFilterCount == -1 &&
                UnmarshalException.class.equals(rex.getCause().getClass()) &&
                InvalidClassException.class.equals(rex.getCause().getCause().getClass())) {
            return; // normal expected exception
        }
        rex.printStackTrace();
        Assert.fail("unexpected remote exception", rex);
    } catch (Exception ex) {
        Assert.fail("unexpected exception", ex);
    }
}
项目:openNaEF    文件:LocationViewPage.java   
private void populateNode() throws ExternalServiceException, IOException, RemoteException {
    ListView<NodeDto> list = new ListView<NodeDto>("nodeList", this.model) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<NodeDto> item) {
            NodeDto node = item.getModelObject();
            BookmarkablePageLink<Void> link = NodePageUtil.createNodeLink("nodeLink", node);
            item.add(link);
        }
    };
    add(list);
    WebMarkupContainer container = new WebMarkupContainer("nodeBlock");
    add(container);
    container.setVisible(this.model.isVisible());
}
项目:witsml-client    文件:TrajectoryRequestTracker.java   
private String executeQuery() throws RemoteException {
    lastQueryTime = LocalDateTime.now().atZone(ZoneId.systemDefault());
    String query = "";
    setOptionsIn("");
    try {
        if (getVersion().toString().equals("1.3.1.1")) {
            query = getQuery("/1311/GetTrajectoryData.xml");
        } else if (getVersion().toString().equals("1.4.1.1")) {
            query = getQuery("/1411/GetTrajectoryData.xml");
            setOptionsIn("dataVersion=1.4.1.1");
        }
    } catch (Exception ex) {
        System.out.println("Error in getQuery ex : " + ex);
    }
    query = query.replace("%uidWell%", wellId);
    query = query.replace("%uidWellbore%", wellboreId);
    query = query.replace("%uidTrajectory%", trajectoryId);
    query = query.replace("%mdMn%", getQueryStartMd());
    setQuery(query);
    setCapabilitesIn("");
    return witsmlClient.executeTrajectoryQuery(getQuery(), getOptionsIn(), getCapabilitiesIn());
}
项目:asw    文件:ServiceFactory.java   
public SessionCounter getSessionCounter(String registryHost) {
    SessionCounter sessionCounter = null;
    /* ottiene la factory del session counter */
    SessionCounterFactory sessionCounterFactory = getSessionCounterFactory(registryHost);
    /* ora ottiene un riferimento al servizio remoto */
    try {
        logger.info("ServiceFactory: Getting a session counter from the factory");
        sessionCounter = sessionCounterFactory.getSessionCounter();
        int counterId = sessionCounter.getId();
        logger.info(
                "ServiceFactory: Obtained a new session counter from the factory: "
                + "SessionCounter[" + counterId + "]"
            );
    } catch (RemoteException e) {
        logger.info("ServiceFactory: RemoteException: " + e.getMessage());
    }
    return sessionCounter;
}
项目:MaximoForgeViewerPlugin    文件:FldURL.java   
/**
 * Sets the orgid in the table that is referenced for the site selected.
 */
@Override
   public void action() 
    throws MXException, 
           RemoteException
{
    super.action();

    String URL = getMboValue().getString();
    Mbo mbo    = getMboValue().getMbo();
       String bucketKey = DataRESTAPI.bucketFromBase64URN( URL );
    mbo.setValue( Bucket.FIELD_BUCKETKEYFULL, bucketKey, NOACCESSCHECK );
}
项目:openjdk-jdk10    文件:DynamicMethodMarshallerImpl.java   
public Object copyResult( Object result, ORB orb ) throws RemoteException
{
    if (needsResultCopy)
        return Util.copyObject( result, orb ) ;
    else
        return result ;
}
项目:OpenJSharp    文件:Util.java   
/**
 * Maps a SystemException to a RemoteException.
 * @param ex the SystemException to map.
 * @return the mapped exception.
 */
public static RemoteException mapSystemException(SystemException ex) {

    if (utilDelegate != null) {
        return utilDelegate.mapSystemException(ex);
    }
    return null;
}
项目:openjdk-jdk10    文件:RegistryFilterTest.java   
@Test
public void simpleDepthBuiltinNonRejectable() throws RemoteException, AlreadyBoundException, NotBoundException {
    int depthOverride = Integer.getInteger("test.maxdepth", REGISTRY_MAX_DEPTH);
    depthOverride = Math.min(depthOverride, REGISTRY_MAX_DEPTH);
    System.out.printf("overrideDepth: %d, filter: %s%n", depthOverride, registryFilter);
    try {
        String name = "reject2";
        DepthRejectableClass r1 = DepthRejectableClass.create(depthOverride);
        registry.bind(name, r1);
        registry.unbind(name);
    } catch (Exception rex) {
        Assert.fail("Registry filter should not have rejected depth: "
                        + depthOverride);
    }
}
项目:MaximoForgeViewerPlugin    文件:ExtCOBie24Factory.java   
@Override
public ModelValidator makeModelValidator(
    BIMProjectRemote projectMbo,
    ModelLoaderOptions options,
    ProgressLogger<ItemFACILITY> logger ) throws RemoteException, MXException
{
    System.out.println( "Ext Factry: makeModelValidator" );
 return super.makeModelValidator( projectMbo, options, logger );
}
项目:OpenJSharp    文件:Activation.java   
public void rebind(String name, Remote obj)
    throws RemoteException, AccessException
{
    if (name.equals(NAME)) {
        throw new AccessException(
            "binding ActivationSystem is disallowed");
    } else {
        super.rebind(name, obj);
    }
}
项目:MaximoForgeViewerPlugin    文件:ViewableManageBean.java   
public int detatchViewable() 
    throws MXException, 
           RemoteException
{
    instantdelete();
    save();
    return EVENT_HANDLED;
}
项目:Progetto-M    文件:ManagerGoal.java   
@Override
public void deleteGoal(int idPartita, int minuto, int numeroGiocatore, String nomeSquadra, String cittaSquadra, String nomeTorneo, int annoTorneo) throws RemoteException {
    try{
        query= "DELETE FROM GOAL\n "
                + "WHERE IDPARTITA = '" + idPartita + "' AND MINUTO = '" + minuto + "' AND MINUTO = '" + minuto + "' AND NUMEROGIOCATORE = '" + numeroGiocatore + "' AND NOMESQUADRA = '" + nomeSquadra.toUpperCase() + "' AND CITTASQUADRA = '" + cittaSquadra.toUpperCase() + "' AND NOMETORNEO = '" + nomeTorneo.toUpperCase() + "' AND ANNOTORENO = '" + annoTorneo + "' ;";
        PreparedStatement posted = DatabaseConnection.connection.prepareStatement(query);
        posted.executeUpdate(query);
    }catch(SQLException ex){
        System.out.println("ERROR:" + ex);
    } 
}
项目:Progetto-M    文件:ManagerGiocatore.java   
@Override
public void updateNomeGiocatore(int numero, String nomeSquadra, String cittaSquadra, String nuovoNome) throws RemoteException {
    try{
        query= "UPDATE GIOCATORE\n "
                + "SET NOMEGIOCATORE = '" + nuovoNome.toUpperCase() + "'\n "
                + "WHERE NUMERO = '" + numero + "' AND NOMESQUADRA = '" + nomeSquadra.toUpperCase() + "' AND CITTASQUADRA = '" + cittaSquadra.toUpperCase() + "' ;";
        PreparedStatement posted = DatabaseConnection.connection.prepareStatement(query);
        posted.executeUpdate(query);
    }catch(SQLException ex){
        System.out.println("ERROR:" + ex);
    }
}
项目:openjdk-jdk10    文件:AppleUserImpl.java   
/**
 * "Use" supplied apple object.  Create an AppleUserThread to
 * stress it out.
 */
public synchronized void useApple(Apple apple) throws RemoteException {
    String threadName = Thread.currentThread().getName();
    logger.log(Level.FINEST,
        threadName + ": AppleUserImpl.useApple(): BEGIN");

    AppleUserThread t =
        new AppleUserThread("AppleUserThread-" + (++threadNum), apple);
    t.start();

    logger.log(Level.FINEST,
        threadName + ": AppleUserImpl.useApple(): END");
}
项目:OpenJSharp    文件:Activation.java   
public ActivationDesc getActivationDesc(ActivationID id)
    throws ActivationException, UnknownObjectException, RemoteException
{
    checkShutdown();
    RegistryImpl.checkAccess("ActivationSystem.getActivationDesc");

    return getGroupEntry(id).getActivationDesc(id);
}
项目:OpenJSharp    文件:TCPTransport.java   
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
项目:openjdk-jdk10    文件:DynamicMethodMarshallerImpl.java   
public Object[] copyArguments( Object[] args,
    ORB orb ) throws RemoteException
{
    if (needsArgumentCopy)
        return Util.copyObjects( args, orb ) ;
    else
        return args ;
}
项目:openNaEF    文件:RemoteSnmpAccessClient.java   
@Override
public void setCommunityString(String community) {
    try {
        session.setCommunityString(community);
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
项目:common-services    文件:ServiceMessagingTest.java   
@Test
public void testRemoteRequestSerialTiming() throws NotBoundException, RemoteException {
  int count = 100;
  TestService srv = client.getInstance();

  long start = System.currentTimeMillis();
  for (int i = 0; i < count; i++) {
    srv.getString("str" + i);
  }
  long end = System.currentTimeMillis();
  long time = end - start;
  System.out.println(String.format("Executed %d invocations in %d ms (%.2f ms/req)", count, time, ((double) time) / count));
}
项目:parabuild-ci    文件:ParabuildSoapBindingImpl.java   
public AgentConfiguration getAgentConfiguration(final int in0) throws RemoteException {
  final AgentConfig o = BuilderConfigurationManager.getInstance().getAgentConfig(in0);
  final AgentConfiguration config = new AgentConfiguration();
  config.setDescription(o.getDescription());
  config.setEnabled(o.isEnabled());
  config.setHost(o.getHost());
  config.setID(o.getID());
  config.setLocal(o.isLocal());
  config.setTimeStamp(o.getTimeStamp());
  return config;
}
项目:monarch    文件:DUnitBlackboard.java   
/**
 * put an object into a mailbox slot. The object must be java-serializable
 */
public void setMailbox(String boxName, Object value) {
  try {
    blackboard.setMailbox(boxName, value);
  } catch (RemoteException e) {
    throw new RuntimeException("remote call failed", e);
  }
}
项目:OpenJSharp    文件:PerfDataBuffer.java   
/**
 * Create a PerfDataBuffer instance for accessing the specified
 * instrumentation buffer.
 *
 * @param rvm the proxy to the remote MonitredVm object
 * @param lvmid the local Java Virtual Machine Identifier of the
 *              remote target.
 *
 * @throws MonitorException
 */
public PerfDataBuffer(RemoteVm rvm, int lvmid) throws MonitorException {

    this.rvm = rvm;
    try {
        ByteBuffer buffer = ByteBuffer.allocate(rvm.getCapacity());
        sample(buffer);
        createPerfDataBuffer(buffer, lvmid);

    } catch (RemoteException e) {
        throw new MonitorException("Could not read data for remote JVM "
                                   + lvmid, e);
    }
}
项目:Progetto-M    文件:ManagerLogin.java   
@Override
public void updateUsernameLogin(String username, String password, String nuovoUsername) throws RemoteException {
    try{
        query= "UPDATE LOGIN\n "
                + "SET USERNAME = '" + nuovoUsername + "'\n "
                + "WHERE USERNAME = '" + username + "' AND PASSWORD = '" + password + "' ;";
        PreparedStatement posted = DatabaseConnection.connection.prepareStatement(query);
        posted.executeUpdate(query);
    }catch(SQLException ex){
        System.out.println("ERROR:" + ex);
    } 
}
项目:MaximoForgeViewerPlugin    文件:BucketAccessSet.java   
/** 
    * Construct the set of Non-Persistent Custom Mbos.
    * @param ms The MboServerInterface NonPersistentCustomMboSet uses to access 
    * internals of the MXServer.
    */
public BucketAccessSet(
    MboServerInterface ms
) 
    throws RemoteException
{
       super(ms);
   }
项目:OpenJSharp    文件:Activation.java   
/**
 * Returns the activation system stub if the specified name
 * matches the activation system's class name, otherwise
 * returns the result of invoking super.lookup with the specified
 * name.
 */
public Remote lookup(String name)
    throws RemoteException, NotBoundException
{
    if (name.equals(NAME)) {
        return systemStub;
    } else {
        return super.lookup(name);
    }
}
项目:ats-framework    文件:ISwtButton.java   
public void click(
String text,
String label,
String tooltip,
String inGroup,
int index ) throws RemoteException;
项目:openNaEF    文件:MplsnmsRmiServiceFacade.java   
public Impl() throws RemoteException {
}
项目:parabuild-ci    文件:ParabuildSoapBindingImpl.java   
/**
 * @noinspection ZeroLengthArrayAllocation
 */
public IssueAttribute[] getIssueAttributes(final int issueID) throws RemoteException {
  return new IssueAttribute[0];
}
项目:pandemie    文件:ServeurChatImpl.java   
@Override
public void Getmessage(String s,String User)throws RemoteException{
    this.program.addMessageChat("["+User+"] : "+s);
    notifyClient(s,User);
}
项目:Voice_Activated_EV3_Robot    文件:EV3Agent.java   
private AgentResponse returnTouchSensor() throws RemoteException {
    AgentResponse name = new AgentResponse("Firing in response to button");
    touchSensor();
    return name;
}
项目:jdk8u-jdk    文件:BooleanArrayCalls.java   
public Remote create() throws RemoteException {
    return new ServerImpl();
}
项目:Progetto-M    文件:ManagerPartita.java   
@Override
public void putPartita(int idPartita, String squadraCasa, String squadraOspite, Date data, String cfArbitro, String nomeTorneo, int annoTorneo) throws RemoteException {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
项目:openNaEF    文件:NaefDtoFacade.java   
public <T extends EntityDto> Set<T> selectIdPoolUsers(IdPoolDto<?, ?, T> pool, List<SearchCondition> conditions)
throws AuthenticationException, RemoteException;
项目:jdk8u-jdk    文件:RemoteObjArrayCalls.java   
public Remote[] call(Remote[] a) throws RemoteException {
    return a;
}