|
||||||||
| 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 |
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
ComponentPoolcontextFor(component).getRuntime().configure().
configure in interface ComponentPoolcomponent - 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 ComponentPoolcomponent - or it's proxy.
ComponentPersistException
public void remove(Object either)
throws ComponentPersistException
ComponentPool
remove in interface ComponentPoolComponentPersistExceptionpublic ArooaContext contextFor(Object either)
ComponentPoolArooaContext.
contextFor in interface ComponentPooleither - The component or the proxy.
public ComponentTrinity trinityForId(String id)
ComponentPoolComponentTrinity for a given id, if possible.
trinityForId in interface ComponentPoolid - The id.
public String getIdFor(Object either)
ComponentPool
getIdFor in interface ComponentPooleither - Either a component or it's proxy.
public Iterable<ComponentTrinity> allTrinities()
ComponentPool
allTrinities in interface ComponentPool
public void registerComponent(ComponentTrinity componentTrinity,
String id)
ComponentPoolComponentTrinity.
registerComponent in interface ComponentPoolcomponentTrinity - The trinity.id - The id. May be null.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||