Example usage for java.rmi ConnectException ConnectException

List of usage examples for java.rmi ConnectException ConnectException

Introduction

In this page you can find the example usage for java.rmi ConnectException ConnectException.

Prototype

public ConnectException(String s, Exception ex) 

Source Link

Document

Constructs a ConnectException with the specified detail message and nested exception.

Usage

From source file:eu.openanalytics.rsb.component.SystemHealthResource.java

private void verifyRServiConnectivity(final URI rServiUri) throws Exception {
    RServi rServi = null;//from  w w  w.  j  av a  2 s  .  c o  m

    try {
        // never use pooled clients to check connectivity
        rServi = rServiInstanceProvider.getRServiInstance(rServiUri.toString(), Constants.RSERVI_CLIENT_ID,
                PoolingStrategy.NEVER);
    } catch (final Exception e) {
        throw new ConnectException("Failed to retrieve an RServi instance at URI: " + rServiUri, e);
    }

    try {
        Validate.isTrue(Util.isRResponding(rServi), "R is not responding at URI: " + rServiUri);
    } finally {
        rServi.close();
    }
}