public class MamaSourceGroup extends java.lang.Object implements MamaSourceGroupListener
Constructor and Description |
---|
MamaSourceGroup(java.lang.String name)
Create a mamaSourceGroup object.
|
Modifier and Type | Method and Description |
---|---|
void |
addSource(MamaSource source,
long weight)
Add a mamaSource to the specified group with the specified weighting.
|
void |
addSourceWithName(MamaSource source,
java.lang.String sourceName,
long weight)
Add a mamaSource to the specified group
with the specified weighting and
string name identifier.
|
void |
disableLogging() |
void |
enableLogging(java.util.logging.Level level) |
MamaSource |
findSource(java.lang.String sourceName)
Find a source with the given name in the group.
|
java.lang.String |
getName()
Return the name string identifier for the specified
source group.
|
MamaSource |
getTopWeightSource()
Return the top weighted source for this source group
|
boolean |
reevaluate()
Re-evaluate the group by checking all of the relative weights
and changing the state of each MamaSource in the group as
appropriate.
|
void |
registerStateChangeListener(MamaSourceStateChangeListener event)
Applications interested in event notifications can register
for events.
|
void |
setSourceWeight(java.lang.String sourceName,
long weight)
Set the weight for an existing mamaSource
in the specified group.
|
java.util.Iterator |
sourceIterator() |
void |
unregisterStateChangeListener(MamaSourceStateChangeListener event)
Applications interested in event notifications can unregister
for events.
|
public MamaSourceGroup(java.lang.String name)
public void enableLogging(java.util.logging.Level level)
public void disableLogging()
public java.lang.String getName()
public MamaSource findSource(java.lang.String sourceName)
sourceName
- The name identifier for the source
being located.public void addSource(MamaSource source, long weight)
source
- The mamaSource being added to the mamaSourceGroup.weight
- The weighing to apply to the source being added.public void addSourceWithName(MamaSource source, java.lang.String sourceName, long weight)
source
- The mamaSource being added
to the mamaSourceGroup.sourceName
- The unique identifier for this
source in this group.weight
- The weighing to apply to the source being added.public void setSourceWeight(java.lang.String sourceName, long weight)
sourceName
- The name of the source whose
weight is being updated.weight
- The new weight value for the specified source.public boolean reevaluate()
public MamaSource getTopWeightSource()
public void registerStateChangeListener(MamaSourceStateChangeListener event)
registerStateChangeListener
in interface MamaSourceGroupListener
event
- to registerpublic void unregisterStateChangeListener(MamaSourceStateChangeListener event)
unregisterStateChangeListener
in interface MamaSourceGroupListener
event
- to unregisterpublic java.util.Iterator sourceIterator()
Copyright 2011 NYSE Technologies