|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.i2ptunnel.I2PTunnelTask
public abstract class I2PTunnelTask
Either a Server or a Client.
Field Summary | |
---|---|
protected boolean |
open
|
Constructor Summary | |
---|---|
protected |
I2PTunnelTask(java.lang.String name,
EventDispatcher notifyThis,
I2PTunnel tunnel)
|
Method Summary | |
---|---|
void |
attachEventDispatcher(EventDispatcher e)
Attach an EventDispatcher object to the events dispatching chain. |
abstract boolean |
close(boolean forced)
|
void |
detachEventDispatcher(EventDispatcher e)
Detach the specified EventDispatcher object from the events dispatching chain. |
void |
disconnected(I2PSession session)
|
void |
errorOccurred(I2PSession session,
java.lang.String message,
java.lang.Throwable error)
|
EventDispatcher |
getEventDispatcher()
Get an object to be used to deliver events (usually this , but YMMV). |
java.util.Set |
getEvents()
Retrieve the names of all the events that have been received |
java.lang.Object |
getEventValue(java.lang.String n)
Retrieve the value currently associated with the specified event value |
int |
getId()
|
I2PTunnel |
getTunnel()
|
void |
ignoreEvents()
Ignore further event notifications |
boolean |
isOpen()
|
void |
notifyEvent(java.lang.String e,
java.lang.Object a)
Deliver an event |
void |
reportAbuse(I2PSession session,
int severity)
|
protected void |
routerDisconnected()
|
void |
setId(int id)
|
protected void |
setName(java.lang.String name)
|
void |
setTunnel(I2PTunnel pTunnel)
for apps that use multiple I2PTunnel instances |
java.lang.String |
toString()
|
void |
unIgnoreEvents()
Almost like the method above :-) |
java.lang.Object |
waitEventValue(java.lang.String n)
Wait until the given event has received a value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean open
Constructor Detail |
---|
protected I2PTunnelTask(java.lang.String name, EventDispatcher notifyThis, I2PTunnel tunnel)
Method Detail |
---|
public void setTunnel(I2PTunnel pTunnel)
public I2PTunnel getTunnel()
public int getId()
public boolean isOpen()
public void setId(int id)
protected void setName(java.lang.String name)
protected void routerDisconnected()
public abstract boolean close(boolean forced)
public void disconnected(I2PSession session)
public void errorOccurred(I2PSession session, java.lang.String message, java.lang.Throwable error)
public void reportAbuse(I2PSession session, int severity)
public java.lang.String toString()
toString
in class java.lang.Object
public EventDispatcher getEventDispatcher()
EventDispatcher
this
, but YMMV).
getEventDispatcher
in interface EventDispatcher
public void attachEventDispatcher(EventDispatcher e)
EventDispatcher
ev
won't reach the object calling this method).
Good luck, and beware of notification loops! :-)
attachEventDispatcher
in interface EventDispatcher
e
- Event object to be attachedpublic void detachEventDispatcher(EventDispatcher e)
EventDispatcher
detachEventDispatcher
in interface EventDispatcher
e
- Event object to be detachedpublic void notifyEvent(java.lang.String e, java.lang.Object a)
EventDispatcher
notifyEvent
in interface EventDispatcher
e
- name of the eventa
- data being stored for that eventpublic java.lang.Object getEventValue(java.lang.String n)
EventDispatcher
getEventValue
in interface EventDispatcher
n
- name of the event to query for
public java.util.Set getEvents()
EventDispatcher
getEvents
in interface EventDispatcher
public void ignoreEvents()
EventDispatcher
ignoreEvents
in interface EventDispatcher
public void unIgnoreEvents()
EventDispatcher
unIgnoreEvents
in interface EventDispatcher
public java.lang.Object waitEventValue(java.lang.String n)
EventDispatcher
waitEventValue
in interface EventDispatcher
n
- name of the event to wait for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |