|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.thinger.kernel.ResourceManager
public class ResourceManager
A resource manager. It will manage a single resource.
Note that the resource listeners will be given a chance to respond to resource revocation. However, the Kernel may interrupt the thread at its whim. This manager will catch the interruptions.
Version History
EPG - Initial - 26 FEB 06
Constructor Summary | |
---|---|
ResourceManager(ResourceInterface resource)
Constructor. |
Method Summary | |
---|---|
void |
addListener(ResourceListener listener)
Add listener for this resource. |
void |
dispose()
Dispose the resource. |
WhoAmI |
getId()
Get the id. |
ResourceInterface |
getResource()
Get the resource. |
boolean |
isVerbose()
Is it set to verbose? |
void |
revokeListener(ResourceListener listener)
Remove listener for this resource. |
void |
screech(java.lang.String message)
Post a verbose message if verbose mode is on. |
void |
set(int threshold)
It will set the threshold for reporting. |
void |
verboseOff()
Turn it off |
void |
verboseOn(StringPoster poster)
Turn on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceManager(ResourceInterface resource) throws SystemException
resource
- The resource to put under management.
SystemException
ResourceInterface
Method Detail |
---|
public ResourceInterface getResource()
public WhoAmI getId()
public void addListener(ResourceListener listener) throws SystemException
listener
- A listener implementation.
SystemException
public void revokeListener(ResourceListener listener) throws SystemException
listener
- A listener implementation.
SystemException
public void dispose() throws SystemException
SystemException
public void verboseOn(StringPoster poster) throws ThingsException
verboseOn
in interface Verbose
poster
- StringPoster where to put the debug info
ThingsException
public void verboseOff()
verboseOff
in interface Verbose
public void screech(java.lang.String message)
screech
in interface Verbose
message
- The message.public boolean isVerbose()
isVerbose
in interface Verbose
public void set(int threshold)
set
in interface ThingsReportingThreshold
threshold
- Threshold level. This should be a numeric value from ThingsCodes. The one word levels should be good enough, such as WARNING, ERROR, etc.ThingsCodes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |