|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.hammurapi.util.VisitableBase biz.hammurapi.config.GenericContainer
public class GenericContainer
Constructor Summary | |
---|---|
GenericContainer()
|
Method Summary | |
---|---|
protected void |
acceptChildren(Visitor visitor)
Override this method to navigate visitor through object constituents. |
void |
addComponent(java.lang.String name,
java.lang.Object component)
Adds component and starts it. |
void |
addMeasurement(java.lang.String name,
double value,
long time)
Adds measurement |
void |
execute(java.lang.Object executionContext)
Invokes execute() of executable components sequentially. |
java.lang.Object |
get(java.lang.String name)
Looks up component in component tree. |
java.lang.Object |
getAttribute(java.lang.Object key)
|
protected java.util.Map |
getComponentMap()
|
java.util.Set |
getComponentNames()
|
protected java.util.Collection |
getComponents()
|
MeasurementConsumer |
getMeasurementConsumer()
|
java.lang.Object |
getOwner(java.lang.Class ownerType)
Finds component owner of particular type. |
java.lang.Object |
removeAttribute(java.lang.Object key)
|
void |
setAttribute(java.lang.Object key,
java.lang.Object value)
|
void |
setMeasurementConsumer(MeasurementConsumer measurementConsumer)
Sets measurement consumer to pass measurements to. |
void |
setOwner(java.lang.Object owner)
Plugs the component into container and naming bus. |
void |
start()
Invoked by container before the first use. |
void |
stop()
Invoked by container when component is not needed anymore. |
Methods inherited from class biz.hammurapi.util.VisitableBase |
---|
accept, convert2searchable, find, findAll, object2visitor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericContainer()
Method Detail |
---|
protected java.util.Map getComponentMap()
public java.lang.Object get(java.lang.String name)
get
in interface Context
name
-
public void addComponent(java.lang.String name, java.lang.Object component) throws ConfigurationException
name
- component
-
ConfigurationException
public void start() throws ConfigurationException
Component
start
in interface Component
ConfigurationException
public void stop() throws ConfigurationException
Component
stop
in interface Component
ConfigurationException
public void setOwner(java.lang.Object owner)
Component
setOwner
in interface Component
public void execute(java.lang.Object executionContext)
execute
in interface Command
protected void acceptChildren(Visitor visitor)
VisitableBase
acceptChildren
in class VisitableBase
protected java.util.Collection getComponents()
public java.util.Set getComponentNames()
public void setAttribute(java.lang.Object key, java.lang.Object value)
setAttribute
in interface Attributable
public java.lang.Object getAttribute(java.lang.Object key)
getAttribute
in interface Attributable
public java.lang.Object removeAttribute(java.lang.Object key)
removeAttribute
in interface Attributable
public void setMeasurementConsumer(MeasurementConsumer measurementConsumer)
MeasurementCollector
setMeasurementConsumer
in interface MeasurementCollector
public MeasurementConsumer getMeasurementConsumer()
public void addMeasurement(java.lang.String name, double value, long time)
MeasurementConsumer
addMeasurement
in interface MeasurementConsumer
name
- Metric namevalue
- Measurement valuetime
- Time when metric was collected. If this
parameter is 0 then metric subsystem uses
System.currentTimeMillis() to provide correct value if
needed.public java.lang.Object getOwner(java.lang.Class ownerType)
ownerType
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |