org.codehaus.wadi.location.partitionmanager
Interface Partition

All Known Subinterfaces:
LocalPartition, PartitionFacade
All Known Implementing Classes:
AbstractPartition, BasicLocalPartition, RemotePartition, UnknownPartition, VersionAwarePartitionFacade

public interface Partition

A Partition represents a 'bucket' in the Key:Location that is shared between Cluster members.

Version:
$Revision: 2308 $
Author:
Jules Gosnell

Method Summary
 Envelope exchange(SessionRequestMessage request, long timeout)
          Send a message/request to the Partition and wait for a message/response...
 int getKey()
           
 boolean isLocal()
           
 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...
 

Method Detail

isLocal

boolean isLocal()
Returns:
whether or not this is a LocalPartition

getKey

int getKey()
Returns:
the Partition 'key' - a number between '0' and 'numPartitions-1'

onMessage

void onMessage(Envelope message,
               InsertIMToPM request)
A Peer has created a Session...

Parameters:
message -
request -

onMessage

void onMessage(Envelope message,
               DeleteIMToPM request)
A Peer has destroyed a Session...

Parameters:
message -
request -

onMessage

void onMessage(Envelope message,
               EvacuateIMToPM request)
A Peer wishes to evacuate a Session...

Parameters:
message -
request -

onMessage

void onMessage(Envelope message,
               MoveIMToPM request)
A Peer has an Invocation for a Session of which it is not the owner...

Parameters:
message -
request -

exchange

Envelope exchange(SessionRequestMessage request,
                  long timeout)
                  throws MessageExchangeException,
                         PartitionFacadeException
Send a message/request to the Partition and wait for a message/response...

Parameters:
request - The request
timeout - The number of milliseconds to wait for a response
Returns:
the response
Throws:
MessageExchangeException
PartitionFacadeException


Copyright © 2011. All Rights Reserved.