public abstract class I2PTunnelTask extends EventDispatcherImpl
Use caution when extending externally. Should be maintained as stable API, but confirm before use. No startRunning() method; all extending classes implement one.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
open |
I2PTunnel |
tunnel |
| Modifier | Constructor and Description |
|---|---|
protected |
I2PTunnelTask(String name,
EventDispatcher notifyThis,
I2PTunnel tunnel) |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
close(boolean forced)
Note that the tunnel can be reopened after this by calling startRunning().
|
void |
connected(I2PSession session)
For tasks that don't call I2PTunnel.addSession() directly
|
boolean |
destroy()
Note that the tunnel cannot be reopened after this by calling startRunning(),
as it may destroy the underlying socket manager, depending on implementation.
|
void |
disconnected(I2PSession session)
Called when a session is disconnected.
|
void |
errorOccurred(I2PSession session,
String message,
Throwable error)
Does nothing here.
|
protected boolean |
getBooleanOption(String opt,
boolean dflt) |
int |
getId() |
I2PTunnel |
getTunnel() |
boolean |
isOpen() |
void |
optionsUpdated(I2PTunnel tunnel)
Notify the task that I2PTunnel's options have been updated.
|
void |
reportAbuse(I2PSession session,
int severity)
Does nothing here.
|
protected void |
routerDisconnected() |
void |
setId(int id) |
protected void |
setName(String name) |
void |
setTunnel(I2PTunnel pTunnel)
for apps that use multiple I2PTunnel instances
|
String |
toString() |
attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValueprotected volatile boolean open
public I2PTunnel tunnel
protected I2PTunnelTask(String name, EventDispatcher notifyThis, I2PTunnel tunnel)
public abstract boolean close(boolean forced)
public void connected(I2PSession session)
public boolean destroy()
public void disconnected(I2PSession session)
This method removes the session from the tunnel and notifies the router that disconnection occurred.
session - the session that was disconnectedpublic void errorOccurred(I2PSession session, String message, Throwable error)
protected boolean getBooleanOption(String opt, boolean dflt)
public int getId()
public I2PTunnel getTunnel()
public boolean isOpen()
public void optionsUpdated(I2PTunnel tunnel)
public void reportAbuse(I2PSession session, int severity)
protected void routerDisconnected()
public void setId(int id)
protected void setName(String name)
public void setTunnel(I2PTunnel pTunnel)