|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.oddjob.arooa.registry.SimpleComponentPool
public class SimpleComponentPool
An simple implementation of a ComponentPool
.
This class is thread safe for the addition an removal of components. It is not thread safe for configuration an saving. This is left to the calling code. Oddjob for instance achieves thread safety for for these operations by locking on State.
Constructor Summary | |
---|---|
SimpleComponentPool()
|
Method Summary | |
---|---|
Iterable<ComponentTrinity> |
allTrinities()
Provide a way of iterating over all trinities. |
void |
configure(Object component)
Configure the component. |
ArooaContext |
contextFor(Object either)
Get the components ArooaContext . |
String |
getIdFor(Object either)
Provide the Id for either a component or it's proxy. |
void |
registerComponent(ComponentTrinity componentTrinity,
String id)
Register a ComponentTrinity . |
void |
remove(Object either)
Remove a component. |
void |
save(Object component)
Possibly save the component to a persistent store, if everything is in place for this to happen. |
ComponentTrinity |
trinityFor(Object either)
Get the ComponentTrinity for either the component or
proxy. |
ComponentTrinity |
trinityForContext(ArooaContext context)
Get the ComponentTrinity for the given ArooaContext . |
ComponentTrinity |
trinityForId(String id)
Provide the ComponentTrinity for a given id, if possible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleComponentPool()
Method Detail |
---|
public void configure(Object component) throws ArooaConfigurationException
ComponentPool
contextFor(component).getRuntime().configure().
configure
in interface ComponentPool
component
- The component or it's proxy.
ArooaConfigurationException
public void save(Object component) throws ComponentPersistException
ComponentPool
If a ComponentPersister
is in operation and the component
was registered with an id then the ComponentPersister is
invoked with the component.
save
in interface ComponentPool
component
- A component or it's proxy.
ComponentPersistException
public void remove(Object either) throws ComponentPersistException
ComponentPool
remove
in interface ComponentPool
either
- A component or it's proxy.
ComponentPersistException
public ArooaContext contextFor(Object either)
ComponentPool
ArooaContext
.
contextFor
in interface ComponentPool
either
- The component or the proxy.
public ComponentTrinity trinityForContext(ArooaContext context)
ComponentPool
ComponentTrinity
for the given ArooaContext
.
This is required for ContextHierarchyServiceFinder
.
trinityForContext
in interface ComponentPool
context
- A context;
public ComponentTrinity trinityFor(Object either)
ComponentPool
ComponentTrinity
for either the component or
proxy.
trinityFor
in interface ComponentPool
either
- Either the component or the proxy.
public ComponentTrinity trinityForId(String id)
ComponentPool
ComponentTrinity
for a given id, if possible.
trinityForId
in interface ComponentPool
id
- The id.
public String getIdFor(Object either)
ComponentPool
getIdFor
in interface ComponentPool
either
- Either a component or it's proxy.
public Iterable<ComponentTrinity> allTrinities()
ComponentPool
allTrinities
in interface ComponentPool
public void registerComponent(ComponentTrinity componentTrinity, String id)
ComponentPool
ComponentTrinity
.
registerComponent
in interface ComponentPool
componentTrinity
- The trinity.id
- The id. May be null.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |