コード例 #1
0
  protected HttpROPConnector createHttpRopConnector() {
    String url = runtimeProperties.get(Constants.ROP_SERVICE_URL_PROPERTY);
    if (url == null) {
      throw new ConfigurationException(
          "No property defined for '%s', can't initialize HessianConnection",
          Constants.ROP_SERVICE_URL_PROPERTY);
    }

    String userName = runtimeProperties.get(Constants.ROP_SERVICE_USERNAME_PROPERTY);
    String password = runtimeProperties.get(Constants.ROP_SERVICE_PASSWORD_PROPERTY);

    long readTimeout = runtimeProperties.getLong(Constants.ROP_SERVICE_TIMEOUT_PROPERTY, -1L);

    HttpROPConnector result = new HttpROPConnector(url, userName, password);

    if (readTimeout > 0) {
      result.setReadTimeout(readTimeout);
    }

    return result;
  }
コード例 #2
0
  @Override
  public ClientConnection get() throws DIRuntimeException {
    String sharedSession = runtimeProperties.get(Constants.ROP_SERVICE_SHARED_SESSION_PROPERTY);

    HttpROPConnector ropConnector = createHttpRopConnector();
    ProxyRemoteService remoteService = new ProxyRemoteService(serializationService, ropConnector);

    HttpClientConnection clientConnection = new HttpClientConnection(remoteService, sharedSession);
    ropConnector.setClientConnection(clientConnection);

    return clientConnection;
  }