Package com.taobao.metamorphosis.network

Examples of com.taobao.metamorphosis.network.TransactionCommand


    private void mockInvokeSuccess(final String serverUrl, final TransactionInfo info, final String result)
            throws InterruptedException, TimeoutException, NotifyRemotingException {
        info.setUniqueQualifier(UNIQUE_QUALIFIER);
        EasyMock.expect(
            this.remotingClient.invokeToGroup(serverUrl, new TransactionCommand(info, OpaqueGenerator.getNextOpaque()),
                DEFAULT_REQ_TIMEOUT, TimeUnit.MILLISECONDS)).andReturn(
                    new BooleanCommand(HttpStatus.Success, result, 0));
    }
View Full Code Here


    }


    private void mockSend(final String serverUrl, final TransactionInfo info) throws NotifyRemotingException {
        info.setUniqueQualifier(UNIQUE_QUALIFIER);
        this.remotingClient.sendToGroup(serverUrl, new TransactionCommand(info, OpaqueGenerator.getNextOpaque()),
            TransactionContext.END_XA_TX_LISTENER, 5000, TimeUnit.MILLISECONDS);
        EasyMock.expectLastCall();
    }
View Full Code Here

            }
            // Recover from all XA resources.
            for (final String serverUrl : this.xareresourceURLs) {
                try {
                    final BooleanCommand receipt =
                            (BooleanCommand) this.remotingClient.invokeToGroup(serverUrl, new TransactionCommand(info,
                                OpaqueGenerator.getNextOpaque()), this.transactionRequestTimeoutInMills,
                                TimeUnit.MILLISECONDS);
                    if (receipt.getCode() != HttpStatus.Success) {
                        log.warn("Recover XAResource(" + serverUrl + ") failed,error message:" + receipt.getErrorMsg());
                        continue;
View Full Code Here


    private BooleanCommand syncSendXATxCommand(final TransactionInfo info) throws XAException {
        try {
            final BooleanCommand resp =
                    (BooleanCommand) this.remotingClient.invokeToGroup(this.serverUrl, new TransactionCommand(info,
                        OpaqueGenerator.getNextOpaque()), this.transactionRequestTimeoutInMills, TimeUnit.MILLISECONDS);
            if (resp.getResponseStatus() != ResponseStatus.NO_ERROR) {
                final String msg = resp.getErrorMsg();
                if (msg.startsWith("XAException:")) {
                    final Matcher m = EXCEPTION_PAT.matcher(msg);
View Full Code Here

            final TransactionInfo info =
                    new TransactionInfo(this.transactionId, this.sessionId, TransactionInfo.TransactionType.END,
                        this.uniqueQualifier);
            try {
                this.remotingClient.sendToGroup(this.serverUrl,
                    new TransactionCommand(info, OpaqueGenerator.getNextOpaque()), END_XA_TX_LISTENER,
                    this.transactionRequestTimeoutInMills, TimeUnit.MILLISECONDS);
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Ended XA transaction: " + this.transactionId);
                }
            }
View Full Code Here

    private void syncSendLocalTxCommand(final TransactionInfo info) throws MetaClientException, TimeoutException {
        try {

            final BooleanCommand resp =
                    (BooleanCommand) this.remotingClient.invokeToGroup(this.serverUrl, new TransactionCommand(info,
                        OpaqueGenerator.getNextOpaque()), this.transactionRequestTimeoutInMills, TimeUnit.MILLISECONDS);
            if (resp.getResponseStatus() != ResponseStatus.NO_ERROR) {
                throw new MetaClientException(resp.getErrorMsg());
            }
        }
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.network.TransactionCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.