Package com.sun.jini.discovery

Examples of com.sun.jini.discovery.MulticastRequest


    }
    for (count = multicastRequestMax;
                                          --count >= 0 && !isInterrupted(); )
                {
                    DatagramPacket[] reqs = encodeMulticastRequest
      (new MulticastRequest(multicastRequestHost,
                responsePort,
                groups,
                getServiceIDs()));
                    sendPacketByNIC(sock, reqs);
        Thread.sleep(count > 0 ?
View Full Code Here


   * registrar's service ID in its list of known registrars.  This method
   * assumes that the protocol version of the request has already been
   * checked.
   */
  public void run() {
      MulticastRequest req;
      try {
    req = decoder.decodeMulticastRequest(
        datagram,
        multicastRequestConstraints.getUnfulfilledConstraints(),
        multicastRequestSubjectChecker, true);
      } catch (Exception e) {
    if (!(e instanceof InterruptedIOException) &&
        logger.isLoggable(Levels.HANDLED))
    {
        logThrow(
      Levels.HANDLED,
      getClass().getName(),
      "run",
      "exception decoding multicast request from {0}:{1}",
      new Object[]{
          datagram.getAddress(),
          new Integer(datagram.getPort()) },
      e);
    }
    return;
      }
      String[] groups = req.getGroups();
      if ((groups.length == 0 || overlap(memberGroups, groups)) &&
    indexOf(req.getServiceIDs(), myServiceID) < 0)
      {
    try {
        req.checkConstraints();
    } catch (Exception e) {
        if (!(e instanceof InterruptedIOException) &&
      logger.isLoggable(Levels.HANDLED))
        {
      logThrow(
          Levels.HANDLED,
          getClass().getName(),
          "run",
          "exception decoding multicast request from {0}:{1}",
          new Object[]{
        datagram.getAddress(),
        new Integer(datagram.getPort()) },
          e);
        }
        return;
    }
    tasker.addIfNew(new AddressTask(req.getHost(), req.getPort()));
      }
  }
View Full Code Here

        } catch (BufferUnderflowException e) {
      throw new DiscoveryProtocolException(null, e);
        }
        multicastRequestConstraints.checkProtocolVersion(pv);

        MulticastRequest req =
      getDiscovery(pv).decodeMulticastRequest(
          dgram,
          multicastRequestConstraints.
        getUnfulfilledConstraints(),
          multicastRequestSubjectChecker);
        if ((req.getGroups().length != 0 &&
       !overlap(memberGroups, req.getGroups())) ||
      indexOf(req.getServiceIDs(), lookupServiceID) >= 0)
      continue;
        logger.log(Level.FINE, "Received valid multicast for " + lookupLocator);
        taskMgr.addIfNew(
      new AddressTask(InetAddress.getByName(req.getHost()),
          req.getPort()));
    } catch (InterruptedIOException ignore) {
        break;
    } catch (DiscoveryProtocolException ignore) {
        break;
    } catch (Exception e) {
View Full Code Here

    }
    for (count = multicastRequestMax;
                                          --count >= 0 && !isInterrupted(); )
                {
                    DatagramPacket[] reqs = encodeMulticastRequest
      (new MulticastRequest(multicastRequestHost,
                responsePort,
                groups,
                getServiceIDs()));
                    sendPacketByNIC(sock, reqs);
        Thread.sleep(count > 0 ?
View Full Code Here

   * registrar's service ID in its list of known registrars.  This method
   * assumes that the protocol version of the request has already been
   * checked.
   */
  public void run() {
      MulticastRequest req;
      try {
    req = decoder.decodeMulticastRequest(
        datagram,
        multicastRequestConstraints.getUnfulfilledConstraints(),
        multicastRequestSubjectChecker, true);
      } catch (Exception e) {
    if (!(e instanceof InterruptedIOException) &&
        logger.isLoggable(Levels.HANDLED))
    {
        logThrow(
      Levels.HANDLED,
      getClass().getName(),
      "run",
      "exception decoding multicast request from {0}:{1}",
      new Object[]{
          datagram.getAddress(),
          new Integer(datagram.getPort()) },
      e);
    }
    return;
      }
      String[] groups = req.getGroups();
      if ((groups.length == 0 || overlap(memberGroups, groups)) &&
    indexOf(req.getServiceIDs(), myServiceID) < 0)
      {
    try {
        req.checkConstraints();
    } catch (Exception e) {
        if (!(e instanceof InterruptedIOException) &&
      logger.isLoggable(Levels.HANDLED))
        {
      logThrow(
          Levels.HANDLED,
          getClass().getName(),
          "run",
          "exception decoding multicast request from {0}:{1}",
          new Object[]{
        datagram.getAddress(),
        new Integer(datagram.getPort()) },
          e);
        }
        return;
    }
    tasker.addIfNew(new AddressTask(req.getHost(), req.getPort()));
      }
  }
View Full Code Here

   * registrar's service ID in its list of known registrars.  This method
   * assumes that the protocol version of the request has already been
   * checked.
   */
  public void run() {
      MulticastRequest req;
      try {
    req = decoder.decodeMulticastRequest(
        datagram,
        multicastRequestConstraints.getUnfulfilledConstraints(),
        multicastRequestSubjectChecker, true);
      } catch (Exception e) {
    if (!(e instanceof InterruptedIOException) &&
        logger.isLoggable(Levels.HANDLED))
    {
        logThrow(
      Levels.HANDLED,
      getClass().getName(),
      "run",
      "exception decoding multicast request from {0}:{1}",
      new Object[]{
          datagram.getAddress(),
          new Integer(datagram.getPort()) },
      e);
    }
    return;
      }
      String[] groups = req.getGroups();
      if ((groups.length == 0 || overlap(memberGroups, groups)) &&
    indexOf(req.getServiceIDs(), myServiceID) < 0)
      {
    try {
        req.checkConstraints();
    } catch (Exception e) {
        if (!(e instanceof InterruptedIOException) &&
      logger.isLoggable(Levels.HANDLED))
        {
      logThrow(
          Levels.HANDLED,
          getClass().getName(),
          "run",
          "exception decoding multicast request from {0}:{1}",
          new Object[]{
        datagram.getAddress(),
        new Integer(datagram.getPort()) },
          e);
        }
        return;
    }
    tasker.addIfNew(new AddressTask(req.getHost(), req.getPort()));
      }
  }
View Full Code Here

    long hi = buf.getLong();
    long lo = buf.getLong();
    ids[i] = new ServiceID(hi, lo);
      }

      return new MulticastRequest(host, port, groups, ids);

  } catch (RuntimeException e) {
      throw new DiscoveryProtocolException(null, e);
  }
    }
View Full Code Here

        } catch (BufferUnderflowException e) {
      throw new DiscoveryProtocolException(null, e);
        }
        multicastRequestConstraints.checkProtocolVersion(pv);

        MulticastRequest req =
      getDiscovery(pv).decodeMulticastRequest(
          dgram,
          multicastRequestConstraints.
        getUnfulfilledConstraints(),
          multicastRequestSubjectChecker);
        if ((req.getGroups().length != 0 &&
       !overlap(memberGroups, req.getGroups())) ||
      indexOf(req.getServiceIDs(), lookupServiceID) >= 0)
      continue;
        logger.log(Level.FINE, "Received valid multicast for " + lookupLocator);
        taskMgr.addIfNew(
      new AddressTask(InetAddress.getByName(req.getHost()),
          req.getPort()));
    } catch (InterruptedIOException ignore) {
        break;
    } catch (DiscoveryProtocolException ignore) {
        break;
    } catch (Exception e) {
View Full Code Here

    }
    for (count = multicastRequestMax;
                                          --count >= 0 && !isInterrupted(); )
                {
                    DatagramPacket[] reqs = encodeMulticastRequest
      (new MulticastRequest(multicastRequestHost,
                responsePort,
                groups,
                getServiceIDs()));
                    sendPacketByNIC(sock, reqs);
        Thread.sleep(count > 0 ?
View Full Code Here

      data.limit(data.position() + len);
      buf.position(data.limit());

      X500Principal p = new X500Principal(Plaintext.getUtf(buf));
      ByteBuffer signed = (ByteBuffer) data.duplicate().position(0);
      MulticastRequest mr = Plaintext.decodeMulticastRequest(data);
           
            mr = new X500MulticastRequest(mr, constraints, p, buf.duplicate(),
            signed, checker);
            if (!delayConstraintCheck) {
                mr.checkConstraints();
            }
            return mr;
  } catch (IOException e) {
      throw e;
  } catch (SecurityException e) {
View Full Code Here

TOP

Related Classes of com.sun.jini.discovery.MulticastRequest

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.