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

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


        final String errorTo =
            message.getSubject() + "." + message.getCommandType() + ":" + id + ":Errors:RPC";

        if (remoteCallback != null) {
          bus.subscribe(replyTo,
              new MessageCallback() {
                @Override
                public void callback(Message message) {
                  bus.unsubscribeAll(replyTo);
                  if (DefaultRemoteCallBuilder.this.message.getErrorCallback() != null) {
                    bus.unsubscribeAll(errorTo);
                  }
                  remoteCallback.callback(message.get(responseType, "MethodReply"));
                }
              }
          );
          message.set(MessageParts.ReplyTo, replyTo);
        }

        if (message.getErrorCallback() != null) {
          bus.subscribe(errorTo,
              new MessageCallback() {
                @Override
                public void callback(Message m) {
                  bus.unsubscribeAll(errorTo);
                  if (remoteCallback != null) {
                    bus.unsubscribeAll(replyTo);
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

  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

                                  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

* @author Mike Brock
*/
public class ClientOTBusService {

  public static void startOTService(final MessageBus messageBus, final OTEngine engine) {
    messageBus.subscribe("ClientOTEngineSyncService", new MessageCallback() {
      @Override
      public void callback(Message message) {
        final Integer value = message.getValue(Integer.class);
        final OTPeer peer = engine.getPeerState().getPeer("<ServerEngine>");

        peer.beginSyncRemoteEntity("<ServerEngine>", value, new StateEntitySyncCompletionCallback(engine, value,
            new EntitySyncCompletionCallback<State>() {
              @Override
              public void syncComplete(OTEntity<State> entity) {
                engine.getPeerState().notifyResync(entity);
              }
            }));
      }
    });

    messageBus.subscribe("ClientOTEngine", new MessageCallback() {
      @Override
      public void callback(Message message) {
        final OpDto opDto = message.getValue(OpDto.class);

        if (opDto == null && message.hasPart("PurgeHint")) {
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, context.getBus());
      if (callback != null) {
        if (svcParser.isLocal()) {
          context.getBus().subscribeLocal(svcParser.getServiceName(), callback);
        }
        else {
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

                                  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

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.