Examples of ResponseCallback


Examples of org.apache.activemq.transport.ResponseCallback

        } else {
            if (isClosed()) {
                throw new ConnectionClosedException();
            }
            try {
                this.transport.asyncRequest(command, new ResponseCallback() {
                    @Override
                    public void onCompletion(FutureResponse resp) {
                        Response response;
                        Throwable exception = null;
                        try {
View Full Code Here

Examples of org.apache.activemq.transport.ResponseCallback

                            // The message was not sent using async send, so we
                            // should only ack the local
                            // broker when we get confirmation that the remote
                            // broker has received the message.
                            ResponseCallback callback = new ResponseCallback() {
                                public void onCompletion(FutureResponse future) {
                                    try {
                                        Response response = future.getResult();
                                        if (response.isException()) {
                                            ExceptionResponse er = (ExceptionResponse) response;
View Full Code Here

Examples of org.apache.activemq.transport.ResponseCallback

                           
                        } else {
                           
                            // The message was not sent using async send, so we should only ack the local
                            // broker when we get confirmation that the remote broker has received the message.
                            ResponseCallback callback = new ResponseCallback() {
                                public void onCompletion(FutureResponse future) {
                                    try {
                                        Response response = future.getResult();
                                        if(response.isException()){
                                            ExceptionResponse er=(ExceptionResponse) response;
View Full Code Here

Examples of org.apache.activemq.transport.ResponseCallback

                                // message being forwarded - we need to
                                // propagate the response to our local send
                                if (canDuplexDispatch(message)) {
                                    message.setProducerId(duplexInboundLocalProducerInfo.getProducerId());
                                    if (message.isResponseRequired() || configuration.isAlwaysSyncSend()) {
                                        duplexInboundLocalBroker.asyncRequest(message, new ResponseCallback() {
                                            final int correlationId = message.getCommandId();

                                            @Override
                                            public void onCompletion(FutureResponse resp) {
                                                try {
View Full Code Here

Examples of org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.ResponseCallback

    public void testResponseReceived() throws Exception {
        mexDao.expects(exactly(3)).method("getCorrelationId").will(returnValue("corrId"));

        final boolean[] responded = new boolean[1];
        myRoleMexImpl.callbacks().put("corrId", new ResponseCallback() {
            synchronized boolean responseReceived() {
                responded[0] = true;
                return true;
            }
View Full Code Here

Examples of org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.ResponseCallback

        context.checking(new Expectations() {{
            exactly(3).of(mexDao).getCorrelationId(); will(returnValue("corrId"));
        }});

        final boolean[] responded = new boolean[1];
        myRoleMexImpl.callbacks().put("corrId", new ResponseCallback() {
            synchronized boolean responseReceived() {
                responded[0] = true;
                return true;
            }
View Full Code Here

Examples of org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.ResponseCallback

   
    public void testResponseReceived() throws Exception {
        mexDao.expects(exactly(3)).method("getCorrelationId").will(returnValue("corrId"));
       
        final boolean[] responded = new boolean[1];
        myRoleMexImpl.callbacks().put("corrId", new ResponseCallback() {
            synchronized boolean responseReceived() {
                responded[0] = true;
                return true;
            }
View Full Code Here

Examples of org.dmd.dmp.client.ResponseCallback

       
        logger.severe("handleAsynchronousInfo() - received event with no listenerID: " + event.toOIF());
        return;
      }
     
      ResponseCallback cb = eventHandlers.get(event.getListenerID());
     
      if (cb == null){
        logger.severe("handleAsynchronousInfo() - couldn't get callback for event with listenerID: " + event.getListenerID());
      }
      else{
        // Set the handleID on the event so that the callback will know how to route the event
        event.setHandlerID(cb.getRequest().getHandlerID());
       
        if ( (originatorID != null) && (event.getOriginatorID() != null)){
          if (originatorID == event.getOriginatorID())
            event.setMyOwnEvent(true);
        }
       
        cb.getEventHandler().handleEvent(event);
      }
    }
    else if (async instanceof ResponseDMO){
      ResponseDMO response = (ResponseDMO) async;
     
      if (controllerTracing)
        logger.finest("handleAsynchronousInfo() - got response:\n\n" + response.toOIF() + "\n\n");

      ResponseCallback cb = requests.get(response.getNthRequestID(0));

      if (cb == null){
        logger.severe("handleAsynchronousInfo() - couldn't get callback for response: " + response.toOIF());
      }
      else{
        if (cb.getCallbackID() == GetResponseCallback.ID)
          registerEventHandler(cb, (GetResponseDMO) response);         
       
        cb.getHandler().handleResponse(response);
        if (response.isLastResponse()){
          if (controllerTracing)
            logger.finest("handleAsynchronousInfo() is last response...");

          requests.remove(response.getNthRequestID(0));
View Full Code Here

Examples of org.hypertable.AsyncComm.ResponseCallback

    }

    public void run() {
        int   fd;
        long  offset;
        ResponseCallback cb = new ResponseCallback(mComm, mEvent);

        try {

            if (mEvent.payload.remaining() < 12)
                throw new ProtocolException("Truncated message");

            fd = mEvent.payload.getInt();
            offset = mEvent.payload.getLong();

            mBroker.Seek(cb, fd, offset);

        }
        catch (ProtocolException e) {
            int error = cb.error(Error.PROTOCOL_ERROR, e.getMessage());
            log.severe("Protocol error (SEEK) - " + e.getMessage());
            if (error != Error.OK)
                log.severe("Problem sending (SEEK) error back to client - "
                           + Error.GetText(error));
        }
View Full Code Here

Examples of org.hypertable.AsyncComm.ResponseCallback

            case Protocol.COMMAND_RENAME:
                requestHandler = new RequestHandlerRename(mComm, mBroker,
                                                          event);
                break;
            default:
                ResponseCallback cb = new ResponseCallback(mComm, event);
                log.severe("Command code " + event.header.command
                           + " not implemented");
                cb.error(Error.PROTOCOL_ERROR, "Command code "
                         + event.header.command + " not implemented");
                return;
            }

            mAppQueue.Add(requestHandler);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.