urv.machannel
Class ChannelGenerator

java.lang.Object
  extended by urv.machannel.ChannelGenerator

public class ChannelGenerator
extends java.lang.Object

This class is responsible of create MChannel instances. In Emulation mode also generates and registrates some test applications in the same JVM, emulating a network where the peer share the channel and are running the test application.

Author:
Gerard Paris Aixala, Raul Gracia Tinedo

Constructor Summary
ChannelGenerator(boolean emulated)
           
 
Method Summary
 MChannel createMChannel(MulticastAddress mcastAddr)
          This method returns and initiates a MChannel instance when the channel is used in a not emulated environment.
 MChannel createMChannel(MulticastAddress mcastAddr, Application application, EmulationController controller)
          This method returns and initiates a MChannel instance.
 MChannel createMChannel(MulticastAddress mcastAddr, java.lang.String groupId)
          This method returns and initiates a MChannel instance when the channel is used in a not emulated environment.
 MChannel createMChannel(java.lang.String mcastAddr, java.lang.String groupId)
          This method returns and initiates a MChannel instance when the channel is used in a not emulated environment.
 void registerApplicationId(Application app, java.lang.Integer id)
          Inserts into the applicationIds attribute the new application instance created
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelGenerator

public ChannelGenerator(boolean emulated)
Method Detail

createMChannel

public MChannel createMChannel(MulticastAddress mcastAddr,
                               Application application,
                               EmulationController controller)
This method returns and initiates a MChannel instance. It has a default group name.

Parameters:
mcastAddr -
application -
notif -
Returns:
MChannel

createMChannel

public MChannel createMChannel(MulticastAddress mcastAddr)
This method returns and initiates a MChannel instance when the channel is used in a not emulated environment. You only need to know the mcastAddress to start up the group.

Parameters:
mcastAddr -
application -
notif -
Returns:
MChannel

createMChannel

public MChannel createMChannel(MulticastAddress mcastAddr,
                               java.lang.String groupId)
This method returns and initiates a MChannel instance when the channel is used in a not emulated environment. You need to set the mcastAddress (MulticastAddress) and the group ID to start up the group.

Parameters:
mcastAddr -
application -
notif -
Returns:
MChannel

createMChannel

public MChannel createMChannel(java.lang.String mcastAddr,
                               java.lang.String groupId)
This method returns and initiates a MChannel instance when the channel is used in a not emulated environment. You need to set the mcastAddress (String) and the group ID to start up the group.

Parameters:
mcastAddr -
application -
notif -
Returns:
MChannel

registerApplicationId

public void registerApplicationId(Application app,
                                  java.lang.Integer id)
Inserts into the applicationIds attribute the new application instance created