All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.habanero.NewCollobjectAction

java.lang.Object
   |
   +----ncsa.habanero.HabaneroAction
           |
           +----ncsa.habanero.NewCollobjectAction

public class NewCollobjectAction
extends HabaneroAction
implements ArbitratorAction
The NewCollobjectAction is generated by a client when a user adds a new Collobject to a session. It is sent to the Arbitrator, which, because the NewCollobjectAction implements the ArbitratorAction interface, calls actAtArbitrator on it.


Variable Index

 o collobCounter
 o nextAction
 o props

Constructor Index

 o NewCollobjectAction()
 o NewCollobjectAction(Properties)
 o NewCollobjectAction(String, ComponentAction)
Initialize the NewCollobjectAction with the name of the Collobject it should initiate and a CentralArbitrator.

Method Index

 o act(Targetable)
Since this particular action is supposed to act only at the Arbitrator, this method should not be called.
 o actAtArbitrator(Arbitrator, Specifiable)
At the Arbitrator, we make a Collobject of the specified type with an Arbitrator of the specified type.
 o announce(Arbitrator, Specifiable, boolean, String)
 o createArbitrator(Arbitrator, String)
 o createPort(Collobject, CentralArbitrator)
 o describe()
 o getProperty(String)
 o sendToEveryone()
 o setProperties(Properties)
 o setProperty(String, String)

Variables

 o props
 protected Properties props
 o nextAction
 protected ComponentAction nextAction
 o collobCounter
 protected static int collobCounter

Constructors

 o NewCollobjectAction
 public NewCollobjectAction(Properties p)
Parameters:
collobName - the name of the new collobject
arbitratorName - the name of the arbitrator
add - whether this needs a specific stream
Returns:
Initialize the NewCollobjectAction with the name of the Collobject it should initiate and the type of Arbitrator the Collobject should have.
 o NewCollobjectAction
 public NewCollobjectAction(String collobName,
                            ComponentAction next)
Initialize the NewCollobjectAction with the name of the Collobject it should initiate and a CentralArbitrator.

 o NewCollobjectAction
 public NewCollobjectAction()

Methods

 o setProperties
 public void setProperties(Properties p)
 o setProperty
 public void setProperty(String key,
                         String property)
 o getProperty
 public String getProperty(String key)
 o act
 public void act(Targetable target)
Since this particular action is supposed to act only at the Arbitrator, this method should not be called.

Overrides:
act in class HabaneroAction
 o actAtArbitrator
 public void actAtArbitrator(Arbitrator arb,
                             Specifiable target)
At the Arbitrator, we make a Collobject of the specified type with an Arbitrator of the specified type. Since this is on a server, the Arbitrator must be of type CentralArbitrator. This is still kind of a HACK - we also need to specify whether a new Router should be created. Then we create a new action request, with an Action which asks the clients to create the same Collobject, and tells their DistributedArbitrators where to connect to. * NOTE: This code is identical to that in * ncsa.habanero.replay.DistributedReplayEngine, should this change, * that code should too!!

 o sendToEveryone
 public boolean sendToEveryone()
 o describe
 public String describe()
Returns:
a description of NewCollobjectAction
Overrides:
describe in class HabaneroAction
 o createArbitrator
 protected CentralArbitrator createArbitrator(Arbitrator arb,
                                              String arbitratorName) throws InstantiationException, IllegalAccessException, IOException, ClassNotFoundException
Parameters:
arb - the arbitrator handling this request
arbitratorName - the name of the arbitrator
Returns:
creates the arbitrator
Throws: InstantiationException
can't create the arbitrator
Throws: IllegalAccessException
can't create the arbitrator
Throws: IOException
can't create a replay arbitrator
Throws: ClassNotFoundException
file isn't compiled
 o createPort
 protected boolean createPort(Collobject c,
                              CentralArbitrator collarb) throws IOException
Parameters:
c - the collobject
collarb - the new arbitrator
Returns:
creates the connection and returns the port number
Throws: can't
create a multicast server
 o announce
 protected void announce(Arbitrator arb,
                         Specifiable target,
                         boolean newListener,
                         String uniqueName)
Parameters:
arb - the arbitrator that is handling this request
target - the target
portNum - the number of the port
Returns:
announces to the world that a new collobject is created

All Packages  Class Hierarchy  This Package  Previous  Next  Index