Package org.apache.isis.runtimes.dflt.remoting.common.exchange

Examples of org.apache.isis.runtimes.dflt.remoting.common.exchange.ResponseEnvelope


        while (true) {
            final Request request = communication.getRequest();
            LOG.debug("client request: " + request);
            try {
                request.execute(facade);
                final ResponseEnvelope response = new ResponseEnvelope(request);
                LOG.debug("server response: " + response);
                communication.setResponse(response);
            } catch (final RuntimeException e) {
                communication.setException(e);
            } catch (final Exception e) {
View Full Code Here


            final RuntimeException toThrow = exception;
            exception = null;
            throw toThrow;
        }

        final ResponseEnvelope r = response;
        response = null;
        notify();
        return r;
    }
View Full Code Here

    private void executeRequest(final Request request) {
        request.execute(connection.getServerFacade());
    }

    private void sendResponse(final Request request) throws IOException {
        final ResponseEnvelope response = new ResponseEnvelope(request);

        if (LOG.isDebugEnabled()) {
            debugResponse = response.toString();
            LOG.debug("sending " + debugResponse);
        }
        connection.sendResponse(response);
    }
View Full Code Here

        serverFacade = (ServerFacade) control.getMock();
        final ClientConnection connection = new ClientConnection() {
            @Override
            public ResponseEnvelope executeRemotely(final Request request) {
                request.execute(serverFacade);
                return new ResponseEnvelope(request);
            }

            @Override
            public void init() {
            }
View Full Code Here

    public void testOutOfSequence() {
        final ClientConnection connection = new ClientConnection() {
            @Override
            public ResponseEnvelope executeRemotely(final Request request) {
                // create a response based on another request so id is different
                return new ResponseEnvelope(new RequestAbstract((AuthenticationSession) null) {
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void execute(final ServerFacade serverFacade) {
                    }
View Full Code Here

    // Helpers: execute
    // /////////////////////////////////////////////////////////////////

    private void execute(final Request request) {
        synchronized (connection) {
            final ResponseEnvelope response = connection.executeRemotely(request);
            if (request.getId() != response.getId()) {
                throw new IsisRemoteException("Response out of sequence with respect to the request: " + request.getId() + " & " + response.getId() + " respectively");
            }
            if (LOG.isDebugEnabled()) {
                LOG.debug("response " + response);
            }
            request.setResponse(response.getObject());
        }
    }
View Full Code Here

    // Helpers: execute
    // /////////////////////////////////////////////////////////////////

    private void execute(final Request request) {
        synchronized (connection) {
            final ResponseEnvelope response = connection.executeRemotely(request);
            if (request.getId() != response.getId()) {
                throw new IsisRemoteException("Response out of sequence with respect to the request: "
                    + request.getId() + " & " + response.getId() + " respectively");
            }
            if (LOG.isDebugEnabled()) {
                LOG.debug("response " + response);
            }
            request.setResponse(response.getObject());
        }
    }
View Full Code Here

        while (true) {
            final Request request = communication.getRequest();
            LOG.debug("client request: " + request);
            try {
                request.execute(facade);
                final ResponseEnvelope response = new ResponseEnvelope(request);
                LOG.debug("server response: " + response);
                communication.setResponse(response);
            } catch (final RuntimeException e) {
                communication.setException(e);
            } catch (final Exception e) {
View Full Code Here

            final RuntimeException toThrow = exception;
            exception = null;
            throw toThrow;
        }

        final ResponseEnvelope r = response;
        response = null;
        notify();
        return r;
    }
View Full Code Here

    private void executeRequest(final Request request) {
        request.execute(connection.getServerFacade());
    }

    private void sendResponse(final Request request) throws IOException {
        final ResponseEnvelope response = new ResponseEnvelope(request);

        if (LOG.isDebugEnabled()) {
            debugResponse = response.toString();
            LOG.debug("sending " + debugResponse);
        }
        connection.sendResponse(response);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.remoting.common.exchange.ResponseEnvelope

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.