org.codehaus.wadi.location.partitionmanager.local
Class BasicLocalPartition

java.lang.Object
  extended by org.codehaus.wadi.location.partitionmanager.local.BasicLocalPartition
All Implemented Interfaces:
java.io.Serializable, LocalPartition, Partition

public class BasicLocalPartition
extends java.lang.Object
implements LocalPartition

Version:
$Revision:1815 $
Author:
Jules Gosnell
See Also:
Serialized Form

Constructor Summary
protected BasicLocalPartition()
           
  BasicLocalPartition(Dispatcher dispatcher, int key)
           
  BasicLocalPartition(Dispatcher dispatcher, LocalPartition prototype)
           
 
Method Summary
 Envelope exchange(SessionRequestMessage request, long timeout)
          Send a message/request to the Partition and wait for a message/response...
 int getKey()
           
 java.util.Map<java.lang.Object,Location> getNameToLocation()
           
 boolean isLocal()
           
 void merge(LocalPartition content)
           
 void onMessage(Envelope message, DeleteIMToPM request)
          A Peer has destroyed a Session...
 void onMessage(Envelope message, EvacuateIMToPM request)
          A Peer wishes to evacuate a Session...
 void onMessage(Envelope message, InsertIMToPM request)
          A Peer has created a Session...
 void onMessage(Envelope message, MoveIMToPM request)
          A Peer has an Invocation for a Session of which it is not the owner...
 void put(java.util.Collection<java.lang.Object> names, Peer peer)
           
 java.lang.String toString()
           
 void waitForClientCompletion()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicLocalPartition

protected BasicLocalPartition()

BasicLocalPartition

public BasicLocalPartition(Dispatcher dispatcher,
                           int key)

BasicLocalPartition

public BasicLocalPartition(Dispatcher dispatcher,
                           LocalPartition prototype)
Method Detail

getKey

public int getKey()
Specified by:
getKey in interface Partition
Returns:
the Partition 'key' - a number between '0' and 'numPartitions-1'

isLocal

public boolean isLocal()
Specified by:
isLocal in interface Partition
Returns:
whether or not this is a LocalPartition

onMessage

public void onMessage(Envelope message,
                      InsertIMToPM request)
Description copied from interface: Partition
A Peer has created a Session...

Specified by:
onMessage in interface Partition

onMessage

public void onMessage(Envelope message,
                      DeleteIMToPM request)
Description copied from interface: Partition
A Peer has destroyed a Session...

Specified by:
onMessage in interface Partition

onMessage

public void onMessage(Envelope message,
                      MoveIMToPM request)
Description copied from interface: Partition
A Peer has an Invocation for a Session of which it is not the owner...

Specified by:
onMessage in interface Partition

onMessage

public void onMessage(Envelope message,
                      EvacuateIMToPM request)
Description copied from interface: Partition
A Peer wishes to evacuate a Session...

Specified by:
onMessage in interface Partition

exchange

public Envelope exchange(SessionRequestMessage request,
                         long timeout)
                  throws MessageExchangeException
Description copied from interface: Partition
Send a message/request to the Partition and wait for a message/response...

Specified by:
exchange in interface Partition
Parameters:
request - The request
timeout - The number of milliseconds to wait for a response
Returns:
the response
Throws:
MessageExchangeException

waitForClientCompletion

public void waitForClientCompletion()
Specified by:
waitForClientCompletion in interface LocalPartition

put

public void put(java.util.Collection<java.lang.Object> names,
                Peer peer)
Specified by:
put in interface LocalPartition

getNameToLocation

public java.util.Map<java.lang.Object,Location> getNameToLocation()
Specified by:
getNameToLocation in interface LocalPartition

merge

public void merge(LocalPartition content)
Specified by:
merge in interface LocalPartition

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.