com.ibm.carma.ui
Class CarmaRegistry

java.lang.Object
  extended by com.ibm.carma.ui.CarmaRegistry

public class CarmaRegistry
extends java.lang.Object

This class registers the CARMA Connections. When a CARMA connection is created through a Wizard or another method it should be added via the addCarma method. Objects that want to keep track of when CARMAs are added or removed can register as a CarmaRegistryListener

See Also:
CarmaRegistryListener

Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 void addCarma(CARMA carma)
          Add carma to the CarmaRegistry.
 void addCarmaRegistryListener(CarmaRegistryListener listener)
          Adds listener to the list of CarmaRegistryListeners to be notified of additions and subtracts of CARMAs to the CarmaRegistry.
 CARMA getCarma(java.lang.String name)
          Method used to retrieve a specific CARMA by name
 CARMA[] getCarmas()
          Used to get a List of CARMAs in the CarmaRegistry
static CarmaRegistry getRegistry()
          Static method to get the singleton CarmaRegistry
 void load(java.net.URL url)
          This method is used to load CarmaRegistries from a specified URL.
 void removeCarma(CARMA carma)
          Remove carma from the CarmaRegistry.
 void removeCarmaRegistryListener(CarmaRegistryListener listener)
          Removes listener from the list of CarmaRegistryListeners to be notified of additions and subtracts of CARMAs to the CarmaRegistry.
 void save(java.net.URL url)
          This method is used to store CarmaRegistries to a specified URL.
 int size()
          Return the number of CARMA connections in the registry
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

addCarmaRegistryListener

public void addCarmaRegistryListener(CarmaRegistryListener listener)
Adds listener to the list of CarmaRegistryListeners to be notified of additions and subtracts of CARMAs to the CarmaRegistry.

Parameters:
listener - listener object to notify of registry changes

removeCarmaRegistryListener

public void removeCarmaRegistryListener(CarmaRegistryListener listener)
Removes listener from the list of CarmaRegistryListeners to be notified of additions and subtracts of CARMAs to the CarmaRegistry.

Parameters:
listener - listener object to remove from the notification list

getRegistry

public static CarmaRegistry getRegistry()
Static method to get the singleton CarmaRegistry

Returns:
the CarmaRegistry

addCarma

public void addCarma(CARMA carma)
Add carma to the CarmaRegistry. Listeners will be notified

Parameters:
carma - CARMA to add to CarmaRegistry

removeCarma

public void removeCarma(CARMA carma)
Remove carma from the CarmaRegistry. Listeners will be notified.

Parameters:
carma - CARMA to remove from CarmaRegistry

load

public void load(java.net.URL url)
          throws java.io.IOException
This method is used to load CarmaRegistries from a specified URL. Typically this is called on Plugin initialization.

Parameters:
url - the location of the file (ending in .model) to populate this from.
Throws:
java.io.IOException

save

public void save(java.net.URL url)
          throws java.io.IOException
This method is used to store CarmaRegistries to a specified URL. Typically this is called on Plugin deactivation.

Parameters:
url - the location of the file (ending in .model) to populate this from.
Throws:
java.io.IOException

getCarmas

public CARMA[] getCarmas()
Used to get a List of CARMAs in the CarmaRegistry

Returns:
list of CARMAs in the CarmaRegistry

getCarma

public CARMA getCarma(java.lang.String name)
Method used to retrieve a specific CARMA by name

Parameters:
name - the name of the CARMA to retrieve from CarmaRegistry
Returns:
CARMA instance with name

size

public int size()
Return the number of CARMA connections in the registry

Returns:
the number of CARMA connections in the registry