Package org.fusesource.hawtdispatch

Examples of org.fusesource.hawtdispatch.Task


        getConnectedFuture().await();
    }

    public Future<Void> getConnectedFuture() {
        final Promise<Void> rc = new Promise<Void>();
        queue().execute(new Task() {
            @Override
            public void run() {
                onConnected(rc);
            }
        });
View Full Code Here


        getDisconnectedFuture().await();
    }

    public Future<Void> getDisconnectedFuture() {
        final Promise<Void> rc = new Promise<Void>();
        queue().execute(new Task() {
            @Override
            public void run() {
                onDisconnected(rc);
            }
        });
View Full Code Here

        return transport.getFailure();
    }

    public Future<Throwable> getTransportFailureFuture() {
        final Promise<Throwable> rc = new Promise<Throwable>();
        queue().execute(new Task() {
            @Override
            public void run() {
                onTransportFailure(rc);
            }
        });
View Full Code Here

    /**
     * @return the future remote delivery state when it changes.
     */
    public Future<DeliveryState> getRemoteStateChangeFuture() {
        final Promise<DeliveryState> rc = new Promise<DeliveryState>();
        link().queue().execute(new Task() {
            @Override
            public void run() {
                onRemoteStateChange(rc);
            }
        });
View Full Code Here

    /**
     * @return the future remote delivery state once the delivery is settled.
     */
    public Future<DeliveryState> getSettleFuture() {
        final Promise<DeliveryState> rc = new Promise<DeliveryState>();
        link().queue().execute(new Task() {
            @Override
            public void run() {
                onSettle(rc);
            }
        });
View Full Code Here

        getRemoteOpenFuture().await();
    }

    public Future<Void> getRemoteOpenFuture() {
        final Promise<Void> rc = new Promise<Void>();
        queue().execute(new Task() {
            @Override
            public void run() {
                onRemoteOpen(rc);
            }
        });
View Full Code Here

        return getRemoteCloseFuture().await();
    }

    public Future<EndpointError> getRemoteCloseFuture() {
        final Promise<EndpointError> rc = new Promise<EndpointError>();
        queue().execute(new Task() {
            @Override
            public void run() {
                onRemoteClose(rc);
            }
        });
View Full Code Here

        });
        consumers.add(consumer);
    }

    void removeConsumer(final StompConsumer consumer) {
        connection.getDispatchQueue().execute(new Task() {
            @Override
            public void run() {
                StompFrame frame = new StompFrame(UNSUBSCRIBE);
                frame.addHeader(DESTINATION, StompFrame.encodeHeader(destination));
                frame.addHeader(ID, consumer.id);
View Full Code Here

        stomp.setPasscode(configuration.getPasscode());
        stomp.connectCallback(promise);

        connection = promise.await();

        connection.getDispatchQueue().execute(new Task() {
            @Override
            public void run() {
                connection.receive(new Callback<StompFrame>() {
                    @Override
                    public void onFailure(Throwable value) {
View Full Code Here

        });
    }

    @Override
    protected void doStop() throws Exception {
        connection.getDispatchQueue().execute(new Task() {
            @Override
            public void run() {
                StompFrame frame = new StompFrame(DISCONNECT);
                connection.send(frame, null);
            }
View Full Code Here

TOP

Related Classes of org.fusesource.hawtdispatch.Task

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.