Examples of UpHandler


Examples of org.jgroups.UpHandler

            case Event.MSG:
                Message msg = (Message) evt.getArg();
                MuxHeader hdr = (MuxHeader) msg.getHeader(MuxRequestCorrelator.MUX_ID);
                if (hdr != null) {
                    short id = hdr.getId();
                    UpHandler handler = handlers.get(id);
                    return (handler != null) ? handler.up(evt) : new NoMuxHandler(id);
                }
                break;
            case Event.GET_APPLSTATE:
            case Event.GET_STATE_OK:
            case Event.STATE_TRANSFER_OUTPUTSTREAM:
View Full Code Here

Examples of org.jgroups.UpHandler

    NodeSelectorStrategyHolder masterNodeSelector = serviceManager.requestService( MasterSelectorServiceProvider.class, context );
    JGroupsMasterMessageListener listener = new JGroupsMasterMessageListener( context, masterNodeSelector );

    JChannel channel = channelContainer.getChannel();

    UpHandler handler = channel.getUpHandler();
    if ( handler instanceof Muxer ) {
      Short muxId = (Short) props.get( MUX_ID );
      if ( muxId == null ) {
        throw log.missingJGroupsMuxId();
      }
View Full Code Here

Examples of org.jgroups.UpHandler

         return stateId != null && stateId.startsWith(CoreGroupCommunicationService.this.stateIdPrefix );
      }

      @SuppressWarnings("unchecked")
      private Muxer<UpHandler> getMuxer() {
          UpHandler handler = channel.getUpHandler();
          return ((handler != null) && (handler instanceof Muxer<?>)) ? (Muxer<UpHandler>) handler : null;
      }
View Full Code Here

Examples of org.jgroups.UpHandler

                                    InboundInvocationHandler inboundInvocationHandler) {
      // MessageDispatcher superclass constructors will call start() so perform all init here
      this.setMembershipListener(transport);
      this.setChannel(channel);
      // If existing up handler is a muxing up handler, setChannel(..) will not have replaced it
      UpHandler handler = channel.getUpHandler();
      if (handler instanceof Muxer<?>) {
         @SuppressWarnings("unchecked")
         Muxer<UpHandler> mux = (Muxer<UpHandler>) handler;
         mux.setDefaultHandler(this.prot_adapter);
      }
View Full Code Here

Examples of org.jgroups.UpHandler

        setRequestHandler(handler);
        start();
    }

    private Muxer<UpHandler> getMuxer() {
        UpHandler handler = channel.getUpHandler();
        return ((handler != null) && (handler instanceof MuxUpHandler)) ? (MuxUpHandler) handler : null;
    }
View Full Code Here

Examples of org.jgroups.UpHandler

        channel.addChannelListener(this);
        start();
    }
   
    private Muxer<UpHandler> getMuxer() {
        UpHandler handler = channel.getUpHandler();
        return ((handler != null) && (handler instanceof MuxUpHandler)) ? (MuxUpHandler) handler : null;
    }
View Full Code Here

Examples of org.jgroups.UpHandler

                                    InboundInvocationHandler inboundInvocationHandler) {
      // MessageDispatcher superclass constructors will call start() so perform all init here
      this.setMembershipListener(transport);
      this.setChannel(channel);
      // If existing up handler is a muxing up handler, setChannel(..) will not have replaced it
      UpHandler handler = channel.getUpHandler();
      if (handler instanceof Muxer<?>) {
         @SuppressWarnings("unchecked")
         Muxer<UpHandler> mux = (Muxer<UpHandler>) handler;
         mux.setDefaultHandler(this.prot_adapter);
      }
View Full Code Here

Examples of org.jgroups.UpHandler

          // MessageDispatcher constructor, when this.scope is not yet defined
          return new MuxRequestCorrelator(scopeId, transport, handler, localAddr);
      }

      private Muxer<UpHandler> getMuxer() {
          UpHandler handler = channel.getUpHandler();
          return ((handler != null) && (handler instanceof MuxUpHandler)) ? (MuxUpHandler) handler : null;
      }
View Full Code Here

Examples of org.jgroups.UpHandler

            case Event.MSG: {
                Message msg = (Message) evt.getArg();
                MuxHeader hdr = (MuxHeader) msg.getHeader(MUX_ID);
                if (hdr != null) {
                    short id = hdr.getId();
                    UpHandler handler = handlers.get(id);
                    return (handler != null) ? handler.up(evt) : new NoMuxHandler(id);
                }
                break;
            }
            case Event.GET_APPLSTATE:
            case Event.GET_STATE_OK:
            case Event.STATE_TRANSFER_OUTPUTSTREAM:
            case Event.STATE_TRANSFER_INPUTSTREAM: {
                StateTransferInfo info=(StateTransferInfo)evt.getArg();
                String state_id=info.state_id;
                UpHandler basicHandler = null;
                boolean multipleBasic = false;
                for (UpHandler uh: handlers.values())
                {
                   if (uh instanceof StateTransferFilter)
                   {
                      if (((StateTransferFilter) uh).accepts(state_id))
                      {
                         return (uh.up(evt));
                      }
                   }
                   else if (basicHandler == null)
                   {
                      basicHandler = uh;
                   }
                   else
                   {
                      multipleBasic = true;
                   }
                }
               
                if (basicHandler != null)
                {
                   if (multipleBasic)
                   {
                      // TODO throw exception
                      log.warn("Received state transfer related event with more " +
                          "than one basic UpHandler registered. Arbitrarily " +
                          "picking a handler to handle request");
                   }
                  
                   return basicHandler.up(evt);
                }
                // else let default handler handle it below
                break;
            }
            case Event.BLOCK:
View Full Code Here

Examples of org.jgroups.UpHandler

      // MessageDispatcher superclass constructors will call start() so perform all init here
      this.setMembershipListener(transport);
      this.setChannel(channel);
      // If existing up handler is a muxing up handler, setChannel(..) will not have replaced it
      UpHandler handler = channel.getUpHandler();
      if (handler instanceof Muxer<?>) {
         @SuppressWarnings("unchecked")
         Muxer<UpHandler> mux = (Muxer<UpHandler>) handler;
         mux.setDefaultHandler(this.prot_adapter);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.