public void close()
      throws TransactionRolledBackException, UnknownTransactionException, SystemException,
          WrongStateException {
    TxContextImple ctx = null;

    try {
      ctx = (TxContextImple) _ctxManager.suspend();
      if (ctx == null) {
        throw new WrongStateException();
      }

      final String id = ctx.identifier();
      final W3CEndpointReference terminatorCoordinatorRPC = getTerminationCoordinatorRPC(ctx);

      BusinessActivityTerminatorRPCStub terminatorRPCStub =
          new BusinessActivityTerminatorRPCStub(id, terminatorCoordinatorRPC);

      terminatorRPCStub.close();
    } catch (SystemException ex) {
      throw ex;
    } catch (TransactionRolledBackException ex) {
      throw ex;
    } catch (WrongStateException ex) {
      throw ex;
    } catch (UnknownTransactionException ex) {
      throw ex;
    } catch (Exception ex) {
      ex.printStackTrace();

      throw new SystemException(ex.toString());
    } finally {
      tidyup();
    }
  }