groovyx.gpars.remote
Class LocalHost

java.lang.Object
  extended by groovyx.gpars.serial.SerialHandles
      extended by groovyx.gpars.remote.LocalHost
Direct Known Subclasses:
NettyTransportProvider

public class LocalHost
extends SerialHandles

Represents communication point with other local hosts. Usually it is enough to have one LocalHost per JVM but it is possible to have several.

It can be one or several local nodes hosted on local host. For most applications one should be enough but sometimes several can be useful as well.

Local host contains - remote hosts connected with this one - remote nodes known to this host - local nodes available on this host

Author:
Alex Tkachman

Field Summary
protected  java.util.Map<java.util.UUID,LocalNode> localNodes
          Local nodes known to the provider
protected  java.util.Map<java.util.UUID,RemoteHost> remoteHosts
          Hosts known to the provider
protected  java.util.HashMap<java.util.UUID,RemoteNode> remoteNodes
          Registry of remote nodes known to the provider
 
Fields inherited from class groovyx.gpars.serial.SerialHandles
id
 
Constructor Summary
LocalHost()
           
 
Method Summary
 void connect(LocalNode node)
          Connect local node to the provider
 void connectRemoteNode(java.util.UUID nodeId, SerialContext host, Actor mainActor)
           
 void disconnect()
           
 void disconnect(LocalNode node)
          Disconnect local node from the provider
 void disconnectRemoteNode(java.util.UUID nodeId)
           
 SerialContext getSerialHost(java.util.UUID hostId, java.lang.Object attachment)
           
 void onDisconnect(SerialContext host)
           
private  void onDisconnectForLocalNodes(RemoteNode t)
           
 
Methods inherited from class groovyx.gpars.serial.SerialHandles
add, finalizeHandle, get, getId, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

remoteNodes

protected final java.util.HashMap<java.util.UUID,RemoteNode> remoteNodes
Registry of remote nodes known to the provider


remoteHosts

protected final java.util.Map<java.util.UUID,RemoteHost> remoteHosts
Hosts known to the provider


localNodes

protected final java.util.Map<java.util.UUID,LocalNode> localNodes
Local nodes known to the provider

Constructor Detail

LocalHost

public LocalHost()
Method Detail

connect

public void connect(LocalNode node)
Connect local node to the provider

Parameters:
node - local node

disconnect

public void disconnect(LocalNode node)
Disconnect local node from the provider

Parameters:
node - local node

disconnect

public void disconnect()

getSerialHost

public SerialContext getSerialHost(java.util.UUID hostId,
                                   java.lang.Object attachment)
Specified by:
getSerialHost in class SerialHandles

connectRemoteNode

public void connectRemoteNode(java.util.UUID nodeId,
                              SerialContext host,
                              Actor mainActor)

disconnectRemoteNode

public void disconnectRemoteNode(java.util.UUID nodeId)

onDisconnect

public void onDisconnect(SerialContext host)

onDisconnectForLocalNodes

private void onDisconnectForLocalNodes(RemoteNode t)

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