|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openharbor.beck.map.DefaultMapperPool
A source of mappers that's thread-safe and can track changes in the underlying configuration.
| Constructor Summary | |
DefaultMapperPool(java.lang.ClassLoader loader,
java.lang.String resourceName)
Configure the mappers from a Configuration mapped from a PollableResource. |
|
DefaultMapperPool(Configuration configuration)
Configure the mappers from the given Configuration. |
|
| Method Summary | |
MapFromXML |
allocateMapFromXML()
Obtain a current mapper. |
DefaultMapper |
allocateMapper()
|
MapToXML |
allocateMapToXML()
Obtain a current mapper. |
protected DefaultMapper |
newMapper(Configuration configuration)
|
void |
pollSoon()
Check for a change in the configuration next time allocateMapFromXML() is called,
regardless of the currently acceptable staleness. |
void |
releaseMapFromXML(MapFromXML toRelease)
Make a mapper available for re-use. |
void |
releaseMapper(DefaultMapper toRelease)
|
void |
releaseMapToXML(MapToXML toRelease)
Make a mapper available for use by other threads. |
protected void |
removeDeadKeys()
Remove entries from configuration2mappers whose key has been garbage collected. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultMapperPool(Configuration configuration)
public DefaultMapperPool(java.lang.ClassLoader loader,
java.lang.String resourceName)
PollableResource.
After a change to the resource is detected by polling,
allocated mappers will have a correspondingly changed Configuration.
| Method Detail |
public MapFromXML allocateMapFromXML()
throws java.lang.Exception
MapFromXML.SourceMapFromXML.Source.releaseMapFromXML(com.openharbor.beck.map.MapFromXML) after the caller has done using it.
For best performance, this method should return the same object repeatedly,
switching to a new object only when necessary
(e.g. when the old object is intolerably stale).
allocateMapFromXML in interface MapFromXML.Sourcejava.lang.Exception
public MapToXML allocateMapToXML()
throws java.lang.Exception
MapToXML.SourceMapToXML.Source.releaseMapToXML(com.openharbor.beck.map.MapToXML) after the caller has done using it.
For best performance, this method should return the same object repeatedly,
switching to a new object only when necessary
(e.g. when the old object is intolerably stale).
allocateMapToXML in interface MapToXML.Sourcejava.lang.Exceptionpublic void releaseMapFromXML(MapFromXML toRelease)
MapFromXML.SourceMapFromXML.Source.allocateMapFromXML()).
This Source may allocate the mapper to another thread, which might
result in erroneous concurrent use of the mapper by both threads
if a previous releaser cheats.
releaseMapFromXML in interface MapFromXML.Sourcepublic void releaseMapToXML(MapToXML toRelease)
MapToXML.SourceMapToXML.Source.allocateMapToXML()).
This source may allocate the mapper to another thread, which might
result in erroneous concurrent use of the mapper by both threads.
releaseMapToXML in interface MapToXML.Sourcepublic void pollSoon()
MapFromXML.SourceMapFromXML.Source.allocateMapFromXML() is called,
regardless of the currently acceptable staleness.
pollSoon in interface MapFromXML.Source
public DefaultMapper allocateMapper()
throws java.lang.Exception
java.lang.Exception
protected DefaultMapper newMapper(Configuration configuration)
throws java.lang.Exception
java.lang.Exceptionpublic void releaseMapper(DefaultMapper toRelease)
protected void removeDeadKeys()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||