ANTS v2.0 API

apps.multicast
Class MulticastApplication

java.lang.Object
  |
  +--ants.core.Entity
        |
        +--ants.core.Application
              |
              +--apps.multicast.MulticastApplication

public class MulticastApplication
extends Application

The Multicast test application for ANTSR(R). Input: -delay n Number of milliseconds to wait between multicast subscriptions or number of milliseconds to wait between multicasts. -target a Address of multicast sender (target for subscriptions). -group a Multicast group "address". Output: This program generates output indicating when capsules are received.

Author:
David Wetherall

Fields inherited from class ants.core.Application
defaults
 
Constructor Summary
MulticastApplication()
           
 
Method Summary
 void receive(Capsule cap)
          Callback for packets that are delivered to this application.
 void setArgs(KeyArgs k)
          Parse command line arguments for this application.
 void start()
          Start this Application rolling.
 
Methods inherited from class ants.core.Application
getDefaultResources, getDefaultTTL, getNode, getNodeAddress, getPort, getPrincipal, send, send, setDefaultResources, setDefaultTTL, thisNode, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MulticastApplication

public MulticastApplication()
Method Detail

receive

public void receive(Capsule cap)
Description copied from class: Application
Callback for packets that are delivered to this application. This does nothing, so the default behavior for the application is to drop delivered packets on the floor.
Overrides:
receive in class Application
Tags copied from class: Application
Parameters:
cap - the Capsule that got delivered. XXX state of Xdr?

setArgs

public void setArgs(KeyArgs k)
             throws InvalidKeyArgsException
Description copied from class: Application
Parse command line arguments for this application. Understands the -port option and the -principal option.

It is guaranteed that this method will be invoked before the application starts running (i.e. shortly after the constructor is invoked).

XXX A security issue related to this method is that a mallicious application could change its parameters by invoking this method after startup. For example, the application could change its principal to "Administrator". To avoid any pitfalls, the local copies of the argument variables should be ignored once control is given over to the application's start method

Overrides:
setArgs in class Application
Tags copied from class: Application
See Also:
#port, KeyArgs

start

public void start()
           throws java.lang.Exception
Description copied from class: Application
Start this Application rolling. This is invoked once by the Node after it has been initialized.

Note that implementations of start should just set things up. If the application wants to do things like send packets, this function should start a new thread to do that. Creating a GUI and associating callbacks is a good thing to do here.

XXX mostly stuff that could just be done in the no-arg constructor, no?

Overrides:
start in class Application

ANTS v2.0 API

This documentation is Copyright (C) 1998-2001 The University of Utah and the University of Washington. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for ANTS v2.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/