/** Construct the terminator participant client. */
  private TerminationCoordinatorClient() {
    MAPBuilder builder = PrivilegedMapBuilderFactory.getInstance().getBuilderInstance();
    completeAction = ArjunaTXConstants.WSARJTX_ACTION_COMPLETE;
    closeAction = ArjunaTXConstants.WSARJTX_ACTION_CLOSE;
    cancelAction = ArjunaTXConstants.WSARJTX_ACTION_CANCEL;
    final ServiceRegistry serviceRegistry =
        PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
    final String terminationParticipantURIString =
        serviceRegistry.getServiceURI(
            ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, false);
    final String secureTerminationParticipantURIString =
        serviceRegistry.getServiceURI(
            ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, true);

    terminationParticipant = builder.newEndpoint(terminationParticipantURIString);
    secureTerminationParticipant = builder.newEndpoint(secureTerminationParticipantURIString);
  }
  public static void startup() {
    final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry();
    WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
    String bindAddress = wscEnvironmentBean.getBindAddress11();
    int bindPort = wscEnvironmentBean.getBindPort11();
    int secureBindPort = wscEnvironmentBean.getBindPortSecure11();
    WSTEnvironmentBean wstEnvironmentBean = XTSPropertyManager.getWSTEnvironmentBean();
    String participantServiceURLPath = wstEnvironmentBean.getParticipantServiceURLPath();
    if (participantServiceURLPath == null) {
      participantServiceURLPath = "/ws-t11-participant";
    }

    if (bindAddress == null) {
      bindAddress = "localhost";
    }

    if (bindPort == 0) {
      bindPort = 8080;
    }

    if (secureBindPort == 0) {
      secureBindPort = 8443;
    }

    final String baseUri = "http://" + bindAddress + ":" + bindPort + participantServiceURLPath;
    final String uri =
        baseUri + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;
    final String secureBaseUri =
        "https://" + bindAddress + ":" + secureBindPort + participantServiceURLPath;
    final String secureUri =
        secureBaseUri
            + "/"
            + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;

    serviceRegistry.registerServiceProvider(
        BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, uri);
    serviceRegistry.registerSecureServiceProvider(
        BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, secureUri);
  }
  public UserBusinessActivityStandaloneImple() {
    try {
      _activationCoordinatorService =
          XTSPropertyManager.getWSCEnvironmentBean().getCoordinatorURL11();

      /*
       * If the coordinator URL hasn't been specified via the
       * configuration file then assume we are using a locally registered
       * implementation.
       */

      if (_activationCoordinatorService == null) {
        final ServiceRegistry serviceRegistry =
            PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
        _activationCoordinatorService =
            serviceRegistry.getServiceURI(CoordinationConstants.ACTIVATION_SERVICE_NAME);
      }
    } catch (Exception ex) {
      // TODO

      ex.printStackTrace();
    }
  }