public abstract class SerialContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.UUID |
hostId |
protected SerialHandles |
localHost |
private static java.lang.ThreadLocal<SerialContext> |
threadContext |
Constructor and Description |
---|
SerialContext(SerialHandles localHost,
java.util.UUID hostId) |
Modifier and Type | Method and Description |
---|---|
void |
add(SerialHandle serialHandle) |
void |
enter()
Enter to the context
|
void |
finalizeHandle(SerialHandle handle) |
static SerialContext |
get() |
SerialHandle |
get(java.util.UUID id) |
java.util.UUID |
getHostId() |
java.util.UUID |
getLocalHostId() |
SerialContext |
getSerialHost(java.util.UUID hostId,
java.lang.Object attachment) |
void |
leave()
Leave this context
|
void |
remove(SerialHandle serialHandle) |
abstract void |
write(SerialMsg msg) |
private static final java.lang.ThreadLocal<SerialContext> threadContext
protected final SerialHandles localHost
protected final java.util.UUID hostId
public SerialContext(SerialHandles localHost, java.util.UUID hostId)
public static SerialContext get()
public java.util.UUID getHostId()
public final void enter()
public final void leave()
public java.util.UUID getLocalHostId()
public void add(SerialHandle serialHandle)
public void remove(SerialHandle serialHandle)
public SerialHandle get(java.util.UUID id)
public void finalizeHandle(SerialHandle handle)
public SerialContext getSerialHost(java.util.UUID hostId, java.lang.Object attachment)
public abstract void write(SerialMsg msg)