Java Code Examples for java.rmi.RemoteException.getMessage()

The following are Jave code examples for showing how to use getMessage() of the java.rmi.RemoteException class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: OpenJSharp   File: RemoteVmManager.java   Source Code and License Vote up 6 votes
/**
 * 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;
}
 
Example 2
Project: jdk8u-jdk   File: RemoteVmManager.java   Source Code and License Vote up 6 votes
/**
 * 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;
}
 
Example 3
Project: openjdk-jdk10   File: RemoteVmManager.java   Source Code and License Vote up 6 votes
/**
 * 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(active[i]);
    }

    return activeSet;
}
 
Example 4
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public void close() {
    try {
        session.close();
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 5
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public VarBind get(String oid) throws SocketTimeoutException,
        SocketException, IOException, SnmpResponseException,
        AbortedException {
    try {
        SerializableVarBind vb = session.get(oid);
        if (vb != null) {
            return vb.getVarBind();
        }
        return null;
    } catch (RemoteException e) {
        throw new IOException(e.getMessage(), e);
    }
}
 
Example 6
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public String getCommunityString() {
    try {
        return session.getCommunityString();
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 7
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public VarBind getNextChild(String oid) throws AbortedException,
        SocketTimeoutException, SocketException, IOException,
        SnmpResponseException {
    try {
        SerializableVarBind vb = session.getNextChild(oid);
        if (vb != null) {
            return vb.getVarBind();
        }
        return null;
    } catch (RemoteException e) {
        throw new IOException(e.getMessage(), e);
    }
}
 
Example 8
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public InetSocketAddress getSnmpAgentAddress() {
    try {
        return session.getSnmpAgentAddress();
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 9
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public Map<String, VarBind> multiGet(String[] oids)
        throws SocketTimeoutException, SocketException, IOException,
        SnmpResponseException, AbortedException {
    try {
        Map<String, SerializableVarBind> res = session.multiGet(oids);
        Map<String, VarBind> result = new HashMap<String, VarBind>();
        for (Map.Entry<String, SerializableVarBind> entry : res.entrySet()) {
            result.put(entry.getKey(), entry.getValue().getVarBind());
        }
        return result;
    } catch (RemoteException e) {
        throw new IOException(e.getMessage(), e);
    }
}
 
Example 10
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public void setCommunityString(String community) {
    try {
        session.setCommunityString(community);
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 11
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public int getSnmpRetry() {
    try {
        return session.getSnmpRetry();
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 12
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public int getSnmpTimeoutSeconds() {
    try {
        return session.getSnmpTimeoutSeconds();
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 13
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public void setSnmpRetry(int retry) {
    try {
        session.setSnmpRetry(retry);
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 14
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public void setSnmpTimeoutSeconds(int sec) {
    try {
        session.setSnmpTimeoutSeconds(sec);
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 15
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
@Override
public void walk(String oid, SerializableWalkProcessor walkProcessor)
        throws AbortedException, SocketTimeoutException, SocketException,
        IOException, RepeatedOidException, SnmpResponseException {
    try {
        session.walk(oid, walkProcessor);
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
Example 16
Project: openNaEF   File: RemoteSnmpAccessClient.java   Source Code and License Vote up 5 votes
public List<String> getCachedVarbinds() {
    try {
        return session.getCachedVarbinds();
    } catch (RemoteException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}