groovyx.gpars.serial
Class SerialContext

java.lang.Object
  extended by groovyx.gpars.serial.SerialContext
Direct Known Subclasses:
RemoteHost

public abstract class SerialContext
extends java.lang.Object

Author:
Alex Tkachman

Field Summary
protected  java.util.UUID hostId
           
protected  SerialHandles localHost
           
private static java.lang.ThreadLocal<SerialContext> threadContext
           
 
Constructor Summary
SerialContext(SerialHandles localHost, java.util.UUID hostId)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threadContext

private static final java.lang.ThreadLocal<SerialContext> threadContext

localHost

protected final SerialHandles localHost

hostId

protected final java.util.UUID hostId
Constructor Detail

SerialContext

public SerialContext(SerialHandles localHost,
                     java.util.UUID hostId)
Method Detail

get

public static SerialContext get()

getHostId

public java.util.UUID getHostId()

enter

public final void enter()
Enter to the context


leave

public final void leave()
Leave this context


getLocalHostId

public java.util.UUID getLocalHostId()

add

public void add(SerialHandle serialHandle)

remove

public void remove(SerialHandle serialHandle)

get

public SerialHandle get(java.util.UUID id)

finalizeHandle

public void finalizeHandle(SerialHandle handle)

getSerialHost

public SerialContext getSerialHost(java.util.UUID hostId,
                                   java.lang.Object attachment)

write

public abstract void write(SerialMsg msg)

Copyright © 2008–2010 Václav Pech. All Rights Reserved.