Package com.sun.jini.discovery

Examples of com.sun.jini.discovery.EncodeIterator


    disco = getDiscovery(
        multicastAnnouncementConstraints.chooseProtocolVersion());
      } catch (DiscoveryProtocolException e) {
    throw new AssertionError(e);
      }
      EncodeIterator ei = disco.encodeMulticastAnnouncement(
    new MulticastAnnouncement(System.currentTimeMillis(),
            lookupLocator.getHost(),
            lookupLocator.getPort(),
            groups,
            lookupServiceID),
    multicastAnnouncementConstraints.getMulticastMaxPacketSize(
            DEFAULT_MAX_PACKET_SIZE),
    multicastAnnouncementConstraints.getUnfulfilledConstraints());
      while (ei.hasNext()) {
    try {
        packets.addAll(Arrays.asList(ei.next()));
    } catch (Exception e) {
    // UnsupportedConstraintException is expected and normal
                    if (! (e instanceof UnsupportedConstraintException)) {
            logger.log(Level.INFO,
                 "exception encoding multicast announcement", e);
View Full Code Here


        disco = getDiscovery(multicastAnnouncementConstraints
           .chooseProtocolVersion());
          } catch (DiscoveryProtocolException e) {
        throw new AssertionError(e);
          }
          EncodeIterator ei = disco.encodeMulticastAnnouncement(
        new MulticastAnnouncement(announcementSeqNo++,
            myLocator.getHost(),
            myLocator.getPort(),
            groups,
            myServiceID),
        multicastAnnouncementConstraints
        .getMulticastMaxPacketSize(DEFAULT_MAX_PACKET_SIZE),
        multicastAnnouncementConstraints
        .getUnfulfilledConstraints());
          while (ei.hasNext()) {
        try {
            packets.addAll(Arrays.asList(ei.next()));
        } catch (Exception e) {
      logger.log( (e instanceof
             UnsupportedConstraintException)
            ? Levels.HANDLED : Level.INFO,
            "exception encoding multicast"
View Full Code Here

      multicastRequestConstraints.chooseProtocolVersion());
  final List packets = new ArrayList();
  AccessController.doPrivileged(
      securityContext.wrap(new PrivilegedAction() {
    public Object run() {
        EncodeIterator ei = disco.encodeMulticastRequest(
      req,
      multicastRequestConstraints.getMulticastMaxPacketSize(
          DEFAULT_MAX_PACKET_SIZE),
      multicastRequestConstraints.getUnfulfilledConstraints()
        );
        while (ei.hasNext()) {
      try {
          packets.addAll(Arrays.asList(ei.next()));
      } catch (Exception e) {
          logger.log(
        (e instanceof UnsupportedConstraintException) ?
            Levels.HANDLED : Level.INFO,
        "exception encoding multicast request", e);
View Full Code Here

      multicastRequestConstraints.chooseProtocolVersion());
  final List packets = new ArrayList();
  AccessController.doPrivileged(
      securityContext.wrap(new PrivilegedAction() {
    public Object run() {
        EncodeIterator ei = disco.encodeMulticastRequest(
      req,
      multicastRequestConstraints.getMulticastMaxPacketSize(
          DEFAULT_MAX_PACKET_SIZE),
      multicastRequestConstraints.getUnfulfilledConstraints()
        );
        while (ei.hasNext()) {
      try {
          packets.addAll(Arrays.asList(ei.next()));
      } catch (Exception e) {
          logger.log(
        (e instanceof UnsupportedConstraintException) ?
            Levels.HANDLED : Level.INFO,
        "exception encoding multicast request", e);
View Full Code Here

        disco = getDiscovery(multicastAnnouncementConstraints
           .chooseProtocolVersion());
          } catch (DiscoveryProtocolException e) {
        throw new AssertionError(e);
          }
          EncodeIterator ei = disco.encodeMulticastAnnouncement(
        new MulticastAnnouncement(announcementSeqNo++,
            myLocator.getHost(),
            myLocator.getPort(),
            groups,
            myServiceID),
        multicastAnnouncementConstraints
        .getMulticastMaxPacketSize(DEFAULT_MAX_PACKET_SIZE),
        multicastAnnouncementConstraints
        .getUnfulfilledConstraints());
          while (ei.hasNext()) {
        try {
            packets.addAll(Arrays.asList(ei.next()));
        } catch (Exception e) {
      logger.log( (e instanceof
             UnsupportedConstraintException)
            ? Levels.HANDLED : Level.INFO,
            "exception encoding multicast"
View Full Code Here

      multicastRequestConstraints.chooseProtocolVersion());
  final List packets = new ArrayList();
  AccessController.doPrivileged(
      securityContext.wrap(new PrivilegedAction() {
    public Object run() {
        EncodeIterator ei = disco.encodeMulticastRequest(
      req,
      multicastRequestConstraints.getMulticastMaxPacketSize(
          DEFAULT_MAX_PACKET_SIZE),
      multicastRequestConstraints.getUnfulfilledConstraints()
        );
        while (ei.hasNext()) {
      try {
          packets.addAll(Arrays.asList(ei.next()));
      } catch (Exception e) {
          logger.log(
        (e instanceof UnsupportedConstraintException) ?
            Levels.HANDLED : Level.INFO,
        "exception encoding multicast request", e);
View Full Code Here

    disco = getDiscovery(
        multicastAnnouncementConstraints.chooseProtocolVersion());
      } catch (DiscoveryProtocolException e) {
    throw new AssertionError(e);
      }
      EncodeIterator ei = disco.encodeMulticastAnnouncement(
    new MulticastAnnouncement(System.currentTimeMillis(),
            lookupLocator.getHost(),
            lookupLocator.getPort(),
            groups,
            lookupServiceID),
    multicastAnnouncementConstraints.getMulticastMaxPacketSize(
            DEFAULT_MAX_PACKET_SIZE),
    multicastAnnouncementConstraints.getUnfulfilledConstraints());
      while (ei.hasNext()) {
    try {
        packets.addAll(Arrays.asList(ei.next()));
    } catch (Exception e) {
    // UnsupportedConstraintException is expected and normal
                    if (! (e instanceof UnsupportedConstraintException)) {
            logger.log(Level.INFO,
                 "exception encoding multicast announcement", e);
View Full Code Here

        disco = getDiscovery(multicastAnnouncementConstraints
           .chooseProtocolVersion());
          } catch (DiscoveryProtocolException e) {
        throw new AssertionError(e);
          }
          EncodeIterator ei = disco.encodeMulticastAnnouncement(
        new MulticastAnnouncement(announcementSeqNo++,
            myLocator.getHost(),
            myLocator.getPort(),
            groups,
            myServiceID),
        multicastAnnouncementConstraints
        .getMulticastMaxPacketSize(DEFAULT_MAX_PACKET_SIZE),
        multicastAnnouncementConstraints
        .getUnfulfilledConstraints());
          while (ei.hasNext()) {
        try {
            packets.addAll(Arrays.asList(ei.next()));
        } catch (Exception e) {
      logger.log( (e instanceof
             UnsupportedConstraintException)
            ? Levels.HANDLED : Level.INFO,
            "exception encoding multicast"
View Full Code Here

            DISCOVERYPORT,
            groups,
            sid);
                  
  final List packets = new ArrayList();
  EncodeIterator ei = d.encodeMulticastAnnouncement(ma, 1024, null);
  while (ei.hasNext()) {
      packets.addAll(Arrays.asList(ei.next()));
  }
  DatagramPacket[] pArray = (DatagramPacket[]) packets.toArray(
            new DatagramPacket[packets.size()]);
  for(int i=0; i<pArray.length; i++) {
      mcSocket.send(pArray[i]);
View Full Code Here

TOP

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

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.