|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ops4j.net.ConnectionCache
public final class ConnectionCache
This class is to be used to cache URLConnections.
Method Summary | |
---|---|
URLConnection |
get(Object key)
Returns the URLConnection associated with the given key. |
List<ExceptionMonitor> |
getExceptionMonitors()
Returns all ExceptionMonitors that are registered. |
static ConnectionCache |
getInstance()
Returns the singleton instance. |
void |
put(Object key,
URLConnection conn)
Stores a URLConnection in association with a key. |
void |
registerExceptionMonitor(ExceptionMonitor monitor)
Register a ExceptionMonitor with the source. |
void |
run()
When an object implementing interface Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread. |
void |
unregisterExceptionMonitor(ExceptionMonitor monitor)
Unregister a ExceptionMonitor with the source. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ConnectionCache getInstance()
public URLConnection get(Object key)
key
- The key that is associated to the URL.
public void put(Object key, URLConnection conn)
key
- The key that is associated to the URLConnection.conn
- The URLConnection that should be stored in association with the key.public void run()
Runnable
is used
to create a thread, starting the thread causes the object's
run
method to be called in that separately executing
thread.
The general contract of the method run
is that it may
take any action whatsoever.
run
in interface Runnable
Thread.run()
public void registerExceptionMonitor(ExceptionMonitor monitor) throws TooManyMonitorsException
registerExceptionMonitor
in interface ExceptionSource
monitor
- The ExceptionMonitor to be notified.
TooManyMonitorsException
- If more than one monitor is registered.public void unregisterExceptionMonitor(ExceptionMonitor monitor)
unregisterExceptionMonitor
in interface ExceptionSource
monitor
- The ExceptionMonitor to be unregistered.public List<ExceptionMonitor> getExceptionMonitors()
getExceptionMonitors
in interface ExceptionSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |