Package org.jboss.errai.bus.client.api.messaging

Examples of org.jboss.errai.bus.client.api.messaging.MessageCallback


  public SSEHandler(final ClientMessageBusImpl clientMessageBus) {
    this.clientMessageBus = clientMessageBus;
    this.pollingHandler = HttpPollingHandler.newNoPollingInstance(clientMessageBus);

    sseAgentSubscription = clientMessageBus.subscribe(SSE_AGENT_SERVICE, new MessageCallback() {
      @Override
      public void callback(final Message message) {
        notifyConnected();
      }
    });
View Full Code Here


        registered.remove(delegateClass);
       
        for (final ServiceParser svcParser : managedTypes.getDelegateServices(delegateClass)) {
          final Object delegateInstance = CDIServerUtil.lookupBean(beanManager, delegateClass, getQualifiers(delegateClass));
          final MessageCallback callback = svcParser.getCallback(delegateInstance);
         
          if (callback != null) {
            if (svcParser.isLocal()) {
              bus.subscribeLocal(svcParser.getServiceName(), callback);
            }
View Full Code Here

                RPCEndpointFactory.createEndpointFor(genericSvc, method, bus));
      }
    }

    final RemoteServiceCallback delegate = new RemoteServiceCallback(epts);
    bus.subscribe(remoteIface.getName() + ":RPC", new MessageCallback() {
      @Override
      public void callback(final Message message) {
        delegate.callback(message);
      }
    });
View Full Code Here

                                  final MessageCallback callback,
                                  final boolean local,
                                  final WrappedCallbackHolder callbackHolder) {
    final boolean isNew = !isSubscribed(subject);

    final MessageCallback cb = new MessageCallback() {
      @Override
      public void callback(final Message message) {
        try {
          callback.callback(message);
        }
View Full Code Here

    if (isRemoteCommunicationEnabled()) {
      remoteSubscribe(BuiltInServices.ServerEchoService.name());
    }

    if (!isSubscribed(DefaultErrorCallback.CLIENT_ERROR_SUBJECT)) {
      directSubscribe(DefaultErrorCallback.CLIENT_ERROR_SUBJECT, new MessageCallback() {
        @Override
        public void callback(final Message message) {
          final String errorTo = message.get(String.class, MessageParts.ErrorTo);
          if (errorTo == null) {
            managementConsole.displayError(message.get(String.class, MessageParts.ErrorMessage),
                message.get(String.class, MessageParts.AdditionalDetails), null);
          }
          else {
            message.toSubject(errorTo);
            message.sendNowWith(ClientMessageBusImpl.this);
          }
        }
      }, false);
    }

    if (!isSubscribed(BuiltInServices.ClientBus.name())) {
      directSubscribe(BuiltInServices.ClientBus.name(), new MessageCallback() {
        @Override
        @SuppressWarnings({"unchecked"})
        public void callback(final Message message) {
          BusCommand busCommand;
          if (message.getCommandType() == null) {
View Full Code Here

                                  final MessageCallback callback,
                                  final boolean local,
                                  final WrappedCallbackHolder callbackHolder) {
    final boolean isNew = !isSubscribed(subject);

    final MessageCallback cb = new MessageCallback() {
      @Override
      public void callback(final Message message) {
        try {
          callback.callback(message);
        }
View Full Code Here

                RPCEndpointFactory.createEndpointFor(genericSvc, method, bus));
      }
    }

    final RemoteServiceCallback delegate = new RemoteServiceCallback(epts);
    bus.subscribe(remoteIface.getName() + ":RPC", new MessageCallback() {
      @Override
      public void callback(final Message message) {
        delegate.callback(message);
      }
    });
View Full Code Here

        registered.remove(delegateClass);
       
        for (final ServiceParser svcParser : managedTypes.getDelegateServices(delegateClass)) {
          final Object delegateInstance = CDIServerUtil.lookupBean(beanManager, delegateClass, getQualifiers(delegateClass));
          final MessageCallback callback = svcParser.getCallback(delegateInstance);
         
          if (callback != null) {
            if (svcParser.isLocal()) {
              bus.subscribeLocal(svcParser.getServiceName(), callback);
            }
View Full Code Here

    final ServerMessageBus bus = context.getBus();

    /**
     * The standard ServerEchoService.
     */
    bus.subscribe(ErraiService.SERVER_ECHO_SERVICE, new MessageCallback() {
      public void callback(Message c) {
        MessageBuilder.createConversation(c)
            .subjectProvided().noErrorHandling()
            .sendNowWith(bus);
      }
View Full Code Here

      svc = createServiceInjector(loadClass, context, config, false);
    }

    // If we have created an injector, get a callback and register it
    if (svc != null) {
      MessageCallback callback = svcParser.getCallback(svc);
      if (callback != null) {
        if (svcParser.isLocal()) {
          context.getBus().subscribeLocal(svcParser.getServiceName(), callback);
        }
        else {
View Full Code Here

TOP

Related Classes of org.jboss.errai.bus.client.api.messaging.MessageCallback

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.