Package org.jboss.errai.bus.client.framework

Examples of org.jboss.errai.bus.client.framework.RequestDispatcher


    }


    /*** Dispatcher ***/

    RequestDispatcher dispatcher = createInjector(new AbstractModule() {

      @Override
      protected void configure() {
        Class<? extends RequestDispatcher> dispatcherImplementation = SimpleDispatcher.class;

View Full Code Here


          throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
        }
      }

      public void reply() {
        RequestDispatcher dispatcher = (RequestDispatcher)
                getIncomingMessage().getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();

        if (dispatcher == null) {
          throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
        }

        Message msg = getIncomingMessage();

        message.copyResource("Session", msg);

        try {
          dispatcher.dispatch(message);
        }
        catch (Exception e) {
          throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
        }
      }

      public AsyncTask replyRepeating(TimeUnit unit, int interval) {
        Message msg = getIncomingMessage();
        message.copyResource("Session", msg);
        RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
        return _sendRepeatingWith(message, dispatcher, unit, interval);
      }

      public AsyncTask replyDelayed(TimeUnit unit, int interval) {
        Message msg = getIncomingMessage();
        message.copyResource("Session", msg);
        RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
        return _sendDelayedWith(message, dispatcher, unit, interval);
      }

      private Message getIncomingMessage() {
        return ((ConversationMessageWrapper) message).getIncomingMessage();
View Full Code Here

        if (!incomingMessage.hasResource(RequestDispatcher.class.getName())) {
          throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
        }

        RequestDispatcher dispatcher = (RequestDispatcher)
                incomingMessage.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();

        if (dispatcher == null) {
          throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
        }

        Message msg = getIncomingMessage();

        message.copyResource("Session", msg);
        message.copyResource(RequestDispatcher.class.getName(), msg);

        try {
          dispatcher.dispatch(message);
        }
        catch (Exception e) {
          throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
        }
      }

      @Override
      public AsyncTask replyRepeating(TimeUnit unit, int interval) {
        Message msg = getIncomingMessage();
        message.copyResource("Session", msg);
        RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
        return _sendRepeatingWith(message, dispatcher, unit, interval);
      }

      @Override
      public AsyncTask replyDelayed(TimeUnit unit, int interval) {
        Message msg = getIncomingMessage();
        message.copyResource("Session", msg);
        RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
        return _sendDelayedWith(message, dispatcher, unit, interval);
      }

      private Message getIncomingMessage() {
        return ((ConversationMessageWrapper) message).getIncomingMessage();
View Full Code Here

        if (!incomingMessage.hasResource(RequestDispatcher.class.getName())) {
          throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
        }

        RequestDispatcher dispatcher = (RequestDispatcher)
                incomingMessage.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();

        if (dispatcher == null) {
          throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
        }

        Message msg = getIncomingMessage();

        message.copyResource("Session", msg);
        message.copyResource(RequestDispatcher.class.getName(), msg);

        try {
          dispatcher.dispatch(message);
        }
        catch (Exception e) {
          throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
        }
      }

      @Override
      public AsyncTask replyRepeating(TimeUnit unit, int interval) {
        Message msg = getIncomingMessage();
        message.copyResource("Session", msg);
        RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
        return _sendRepeatingWith(message, dispatcher, unit, interval);
      }

      @Override
      public AsyncTask replyDelayed(TimeUnit unit, int interval) {
        Message msg = getIncomingMessage();
        message.copyResource("Session", msg);
        RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
        return _sendDelayedWith(message, dispatcher, unit, interval);
      }

      private Message getIncomingMessage() {
        return ((ConversationMessageWrapper) message).getIncomingMessage();
View Full Code Here

                    throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
                }
            }

            public void reply() {
                RequestDispatcher dispatcher = (RequestDispatcher)
                        getIncomingMessage().getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();

                if (dispatcher == null) {
                    throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
                }

                try {
                    dispatcher.dispatch(message);
                }
                catch (Exception e) {
                    throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
                }
            }

            public AsyncTask replyRepeating(TimeUnit unit, int interval) {
                Message msg = getIncomingMessage();
                message.copyResource("Session", msg);
                RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
                return _sendRepeatingWith(message, dispatcher, unit, interval);
            }

            public AsyncTask replyDelayed(TimeUnit unit, int interval) {
                Message msg = getIncomingMessage();
                message.copyResource("Session", msg);
                RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
                return _sendDelayedWith(message, dispatcher, unit, interval);
            }

            private Message getIncomingMessage() {
                return ((ConversationMessageWrapper) message).getIncomingMessage();
View Full Code Here

    public static MessageBus get() {                         
        return bus;
    }

    public static RequestDispatcher getDispatcher() {
        return new RequestDispatcher() {
            public void dispatchGlobal(Message message) {
                get().sendGlobal(message);
            }

            public void dispatch(Message message) {
View Full Code Here

        if (!incomingMessage.hasResource(RequestDispatcher.class.getName())) {
          throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
        }

        RequestDispatcher dispatcher = (RequestDispatcher)
                incomingMessage.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();

        if (dispatcher == null) {
          throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
        }

        Message msg = getIncomingMessage();

        message.copyResource("Session", msg);
        message.copyResource(RequestDispatcher.class.getName(), msg);

        try {
          dispatcher.dispatch(message);
        }
        catch (Exception e) {
          throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
        }
      }

      @Override
      public AsyncTask replyRepeating(TimeUnit unit, int interval) {
        Message msg = getIncomingMessage();
        message.copyResource("Session", msg);
        RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
        return _sendRepeatingWith(message, dispatcher, unit, interval);
      }

      @Override
      public AsyncTask replyDelayed(TimeUnit unit, int interval) {
        Message msg = getIncomingMessage();
        message.copyResource("Session", msg);
        RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
        return _sendDelayedWith(message, dispatcher, unit, interval);
      }

      private Message getIncomingMessage() {
        return ((ConversationMessageWrapper) message).getIncomingMessage();
View Full Code Here

                    throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
                }
            }

            public void reply() {
                RequestDispatcher dispatcher = (RequestDispatcher)
                        getIncomingMessage().getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();

                if (dispatcher == null) {
                    throw new IllegalStateException("Cannot reply.  Cannot find RequestDispatcher resource.");
                }

                try {
                    dispatcher.dispatch(message);
                }
                catch (Exception e) {
                    throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e);
                }
            }

            public AsyncTask replyRepeating(TimeUnit unit, int interval) {
                Message msg = getIncomingMessage();
                message.copyResource("Session", msg);
                RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
                return _sendRepeatingWith(message, dispatcher, unit, interval);
            }

            public AsyncTask replyDelayed(TimeUnit unit, int interval) {
                Message msg = getIncomingMessage();
                message.copyResource("Session", msg);
                RequestDispatcher dispatcher = (RequestDispatcher) msg.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get();
                return _sendDelayedWith(message, dispatcher, unit, interval);
            }

            private Message getIncomingMessage() {
                return ((ConversationMessageWrapper) message).getIncomingMessage();
View Full Code Here

    public static MessageBus get() {
        return bus;
    }

    public static RequestDispatcher getDispatcher() {
        return new RequestDispatcher() {
            public void dispatchGlobal(Message message) {
                get().sendGlobal(message);
            }

            public void dispatch(Message message) {
View Full Code Here

    }


    /*** Dispatcher ***/

    RequestDispatcher dispatcher = createInjector(new AbstractModule() {

      @Override
      protected void configure() {
        Class<? extends RequestDispatcher> dispatcherImplementation = SimpleDispatcher.class;

View Full Code Here

TOP

Related Classes of org.jboss.errai.bus.client.framework.RequestDispatcher

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.