code: public Response directInvoke(ActivityRuntimeContext runtimeContext, Object request)
              throws AdapterException, ConnectionException {
  
          prepare(runtimeContext);
  
          if (isStubMode()) {
              logger.info("Adapter is running in StubMode. AdapterName:" + this.getClass().getName());
              return getStubbedResponse(request);
          }
          else {
              Object connection = null;
              try {
                  connection = openConnection();
                  if (doLogging()){
                       String requestString = externalRequestToString(request);
                       logRequest(requestString);
                  }
                  Object responseObj = invoke(connection, request);
                  String responseString = externalResponseToString(responseObj);
                  if (responseObj != null && doLogging()) {
                       responseString = externalResponseToString(responseObj);
                       logResponse(responseString);
                  }
                  Response response = new Response();
                  response.setObject(responseObj);
                  response.setContent(responseString);
                  return response;
              }
              finally {
                  if (connection != null)
                      closeConnection(connection);
              }
          }
      }
docs: This method is used for directly invoke the adapter activity
  from code, rather than as part of process execution flow.
  If logging is desired, extenders should override logMessage().
  
  @param request request message
  @return response message
  @throws AdapterException
  @throws ConnectionException