infoservice.agreement.paxos.integration
Class InfoServicePaxosAdapter
java.lang.Object
infoservice.agreement.paxos.PaxosObject
infoservice.agreement.paxos.PaxosCommunicator
infoservice.agreement.paxos.PaxosProposer
infoservice.agreement.paxos.PaxosAcceptor
infoservice.agreement.paxos.integration.PaxosAdapter
infoservice.agreement.paxos.integration.InfoServicePaxosAdapter
- All Implemented Interfaces:
- TimeoutListener, IInfoServiceAgreementAdapter
public class InfoServicePaxosAdapter
- extends PaxosAdapter
- implements IInfoServiceAgreementAdapter
- Author:
- ss1
Constructor Summary |
InfoServicePaxosAdapter()
Creates a new InfoServicePaxosAdapter and prepares for the first
agreement |
Methods inherited from class infoservice.agreement.paxos.integration.PaxosAdapter |
handleIncommingMessage, handleMessage, notifyAgreement, notifyReject, roundNrAcceptable, senderNotInSnapshot, sendReject, startAgreement, startPassivePhase, startProtocolByOperator, startRound |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_dynamicMixConfigurator
private DynamicCascadeConfigurator m_dynamicMixConfigurator
- A cascade configurator which holds logic for wireing mixes to cascades.
He uses the agreement result, the common random number, to do that.
m_self
InfoServiceDBEntry m_self
InfoServicePaxosAdapter
public InfoServicePaxosAdapter()
- Creates a new InfoServicePaxosAdapter and prepares for the first
agreement
prepareTargets
protected void prepareTargets()
- Specified by:
prepareTargets
in class PaxosAdapter
generateInfoServiceSelf
InfoServiceDBEntry generateInfoServiceSelf()
- Generates an
InfoServiceDBEntry
for this InfoService
- Returns:
- The
InfoServiceDBEntry
handleMessage
public HttpResponseStructure handleMessage(byte[] a_postData)
- Handles the given POST data
- Specified by:
handleMessage
in interface IInfoServiceAgreementAdapter
- Parameters:
a_postData
- The POST data to be handled
- Returns:
- OK every time
getIdentifier
protected java.lang.String getIdentifier()
- Description copied from class:
PaxosCommunicator
- Returns the unique identifier for this PaxosCommunicator
- Specified by:
getIdentifier
in class PaxosCommunicator
- Returns:
- The unique identifier for this PaxosCommunicator
sendMessage
public void sendMessage(PaxosMessage a_msg,
IPaxosTarget a_target)
- Description copied from class:
PaxosCommunicator
- Sends the given message to the given target.
- Specified by:
sendMessage
in class PaxosCommunicator
sendToInfoService
protected boolean sendToInfoService(InfoServiceDBEntry a_infoservice,
IDistributable a_message)
- Encapsulates logic for sending a message to a infoservice.
- Parameters:
a_infoservice
- The target infoservice.postFile
- postData
-
- Returns:
- Success if
true
.
sendToInterface
private boolean sendToInterface(ListenerInterface a_listener,
IDistributable a_message)
- Encapsulates logic for sending a message to a specified listenere
interface.
- Parameters:
a_listener
- The network interface.postFile
- postData
-
- Returns:
- Success if
true
.
useAgreement
protected void useAgreement(long a_agreement)
- Description copied from class:
PaxosAdapter
- What shall we do with an agreement? You can define it here
- Specified by:
useAgreement
in class PaxosAdapter
multicast
public void multicast(PaxosMessage a_msg)
- Description copied from class:
PaxosCommunicator
- Multicasts the given message to all known IPaxosTargets. Uses
sendMessage
- Overrides:
multicast
in class PaxosCommunicator
- Parameters:
a_msg
- The message to multicast