Examples of MessageFilter


Examples of com.brewtab.irc.messages.filter.MessageFilter

            log.debug("<<< {}", message.toString().trim());
        }

        for (Map.Entry<MessageListener, MessageFilter> entry : messageListeners.entrySet()) {
            final MessageListener listener = entry.getKey();
            final MessageFilter filter = entry.getValue();

            if (filter.check(message)) {
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            listener.onMessage(message);
View Full Code Here

Examples of com.google.collide.client.communication.MessageFilter

  public AppContext() {

    // Things that depend on nothing
    this.keyBindings = new KeyBindings();
    this.statusManager = new StatusManager();
    this.messageFilter = new MessageFilter();
    this.awesomeBoxModel = new AwesomeBoxModel();
    this.awesomeBoxComponentHostModel = new AwesomeBoxComponentHostModel();
    this.userActivityManager = new UserActivityManager();
    this.windowUnloadingController = new WindowUnloadingController();
View Full Code Here

Examples of com.netflix.suro.routing.filter.MessageFilter

     
        inPred.create("//a/h", null, wrap(new Object[]{"a", "b", "c", "d"}))
    );
   
    System.out.println("Generated filter string: "+input);
        MessageFilter ef = null;
        try {
            ef = MessageFilterCompiler.compile(input);
        } catch (InvalidFilterException e) {
            throw new AssertionError("Invalid filter string generated. Error: " + e.getMessage());
        }
View Full Code Here

Examples of dijjer.io.comm.MessageFilter

    m1.set("list", ll);
    System.out.println("Original: " + m1);
    DatagramPacket dp = m1.encodeToPacket();
    Message m2 = Message.decodeFromPacket(dp);
    System.out.println("Decoded: " + m2);
    MessageFilter filter1 = MessageFilter.create(1000, request).setField("string", "abacus");
    MessageFilter filter2 = MessageFilter.create(1000, request).setField("string", "gnirts");
    assertFalse(filter1.match(m2));
    assertTrue(filter2.match(m2));

    request.unregister();
   
    MessageType shortRequest = new MessageType("Request");
    shortRequest.addField("boolean", Boolean.class);
View Full Code Here

Examples of freenet.io.comm.MessageFilter

    private DO waitForAccepted(RequestLikelyAcceptedState expectedAcceptState, PeerNode next, UIDTag origTag) {
      while(true) {
       
        Message msg;
       
        MessageFilter mf = makeAcceptedRejectedFilter(next, getAcceptedTimeout(), origTag);
       
        try {
          msg = node.usm.waitFor(mf, this);
          if(logMINOR) Logger.minor(this, "first part got "+msg);
        } catch (DisconnectedException e) {
View Full Code Here

Examples of freenet.io.comm.MessageFilter

   * Receive the file.
   * @return True if the whole file was received, false otherwise.
   */
  public boolean receive() {
    while(true) {
      MessageFilter mfSendKilled = MessageFilter.create().setSource(peer).setType(DMT.FNPBulkSendAborted) .setField(DMT.UID, uid).setTimeout(TIMEOUT);
      MessageFilter mfPacket = MessageFilter.create().setSource(peer).setType(DMT.FNPBulkPacketSend) .setField(DMT.UID, uid).setTimeout(TIMEOUT);
      if(prb.hasWholeFile()) {
        try {
          peer.sendAsync(DMT.createFNPBulkReceivedAll(uid), null, ctr);
        } catch (NotConnectedException e) {
          // Ignore, we have the data.
View Full Code Here

Examples of freenet.io.comm.MessageFilter

          }
        });
      }
      _senderThread.schedule();

      MessageFilter mfAllReceived = MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();
      MessageFilter mfSendAborted = MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();
     
      try {
        _usm.addAsyncFilter(mfAllReceived, cbAllReceived, _ctr);
        _usm.addAsyncFilter(mfSendAborted, cbSendAborted, _ctr);
      } catch (DisconnectedException e) {
View Full Code Here

Examples of freenet.io.comm.MessageFilter

    }
    _usm.addAsyncFilter(relevantMessages(timeout), notificationWaiter, _ctr);
  }

  private MessageFilter relevantMessages(long timeout) {
    MessageFilter mfPacketTransmit = MessageFilter.create().setTimeout(timeout).setType(DMT.packetTransmit).setField(DMT.UID, _uid).setSource(_sender);
    MessageFilter mfAllSent = MessageFilter.create().setTimeout(timeout).setType(DMT.allSent).setField(DMT.UID, _uid).setSource(_sender);
    MessageFilter mfSendAborted = MessageFilter.create().setTimeout(timeout).setType(DMT.sendAborted).setField(DMT.UID, _uid).setSource(_sender);
    return mfPacketTransmit.or(mfAllSent.or(mfSendAborted));
  }
View Full Code Here

Examples of freenet.io.comm.MessageFilter

        // Ignore.
      }
    }
   
    while(headers == null || data == null || pubKey == null) {
      MessageFilter mfDataInsertRejected = MessageFilter.create().setType(DMT.FNPDataInsertRejected).setField(DMT.UID, uid).setSource(source).setTimeout(DATA_INSERT_TIMEOUT);
      MessageFilter mf = mfDataInsertRejected;
      if(headers == null) {
        MessageFilter m = MessageFilter.create().setType(DMT.FNPSSKInsertRequestHeaders).setField(DMT.UID, uid).setSource(source).setTimeout(DATA_INSERT_TIMEOUT);
        mf = m.or(mf);
      }
      if(data == null) {
        MessageFilter m = MessageFilter.create().setType(DMT.FNPSSKInsertRequestData).setField(DMT.UID, uid).setSource(source).setTimeout(DATA_INSERT_TIMEOUT);
        mf = m.or(mf);
      }
      if(pubKey == null) {
        MessageFilter m = MessageFilter.create().setType(DMT.FNPSSKPubKey).setField(DMT.UID, uid).setSource(source).setTimeout(DATA_INSERT_TIMEOUT);
        mf = m.or(mf);
      }
      Message msg;
      try {
        msg = node.usm.waitFor(mf, this);
      } catch (DisconnectedException e) {
View Full Code Here

Examples of freenet.io.comm.MessageFilter

        if (logDEBUG) Logger.debug(Probe.class, "acceptProbability is " + acceptProbability);
        if (node.random.nextFloat() < acceptProbability) {
          if (logDEBUG) Logger.debug(Probe.class, "Accepted candidate.");
          //Filter for response to this probe with requested result type.
          final MessageFilter filter = createResponseFilter(type, candidate, uid, htl);
          message.set(DMT.HTL, htl);
          try {
            node.getUSM().addAsyncFilter(filter, new ResultListener(listener), this);
            if (logDEBUG) Logger.debug(Probe.class, "Sending.");
            candidate.sendAsync(message, null, this);
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.