|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infoservice.agreement.multicast.AbstractEMCAdapter infoservice.agreement.multicast.InfoserviceEMCAdapter
public class InfoserviceEMCAdapter
Field Summary | |
---|---|
protected java.lang.Thread |
m_agreementStarter
A thread which executes the agreement logic. |
private DynamicCascadeConfigurator |
m_dynamicMixConfigurator
A cascade configurator which holds logic for wireing mixes to cascades. |
(package private) java.util.Hashtable |
m_infoServiceSnapshot
Holds an freeze the infoservice object which are current existing as long as the agreement runs. |
private MessageHandlerThread |
m_messageHandler
A thread which handles messages for performance reasons. |
protected int |
m_numberOfAllActiveInfoservices
Holds the number of all infoservices and freeze it as long as the agreement runs. |
private FifoQueue |
m_queue
A data stack which implements fifo logic used for holding messages. |
(package private) InfoServiceDBEntry |
m_self
The database entry representation for this infoservice. |
Fields inherited from class infoservice.agreement.multicast.AbstractEMCAdapter |
---|
m_activeAgreementStarted, m_agreementHandler, m_log |
Constructor Summary | |
---|---|
InfoserviceEMCAdapter()
Creates a new InfoserviceAgreementAdapter . |
Method Summary | |
---|---|
protected void |
buildCascades(long l)
Starts the cascade building process. |
protected void |
evangelizeThisInfoservice()
Takes care that all infoservices know each other. |
(package private) InfoServiceDBEntry |
generateInfoServiceSelf()
Generates an InfoServiceDBEntry for this InfoService |
java.lang.String |
getIdentifier()
Returns a unique identifer for this infoservice. |
int |
getNumberOfAllInfoservices()
Returns the freezed number of all infoservices which take part on the agreement protocol. |
HttpResponseStructure |
handleMessage(byte[] a_postData)
Handles the messages coming in through the /agreement-command. |
void |
multicastMessage(IAgreementMessage a_message)
Sends a message to all known infoservices. |
protected void |
prepareStart()
Make sure we have "real" information about our neighbours (and they about us) once. |
void |
sendMessageTo(java.lang.String a_id,
IAgreementMessage a_message)
Sends a message to a specified infoservice. |
(package private) boolean |
sendToInfoService(InfoServiceDBEntry a_infoservice,
IDistributable a_message)
Encapsulates logic for sending a message to a infoservice. |
private boolean |
sendToInterface(ListenerInterface a_listener,
IDistributable a_message)
Encapsulates logic for sending a message to a specified listenere interface. |
void |
startListening()
Stops the running message handler if necessary and creates a new one. |
Methods inherited from class infoservice.agreement.multicast.AbstractEMCAdapter |
---|
debug, error, fatal, getLog, handleMessage, info, notifyAgreement, setIAgreementHandler, setLog, startAdapter, startAgreementCommitmentProtocol, startListeningMode, startProtocolByOperator, tryToStartAgreementHour, tryToStartAgreementMinute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface infoservice.agreement.IInfoServiceAgreementAdapter |
---|
startProtocolByOperator |
Field Detail |
---|
private DynamicCascadeConfigurator m_dynamicMixConfigurator
protected int m_numberOfAllActiveInfoservices
java.util.Hashtable m_infoServiceSnapshot
private FifoQueue m_queue
InfoServiceDBEntry m_self
protected java.lang.Thread m_agreementStarter
private MessageHandlerThread m_messageHandler
Constructor Detail |
---|
public InfoserviceEMCAdapter()
InfoserviceAgreementAdapter
. This adapter
is used to connect the real InfoService to the agreement extension.
a_cmds
- The connection object to serve network and communication.Method Detail |
---|
InfoServiceDBEntry generateInfoServiceSelf()
InfoServiceDBEntry
for this InfoService
InfoServiceDBEntry
protected void evangelizeThisInfoservice()
public HttpResponseStructure handleMessage(byte[] a_postData)
handleMessage
in interface IInfoServiceAgreementAdapter
a_postData
- The post data of the request containing an XML encoded
IAgreementMessage
protected void buildCascades(long l)
buildCascades
in class AbstractEMCAdapter
l
- A long value which represents the common random number.protected void prepareStart()
prepareStart
in class AbstractEMCAdapter
public void startListening()
startListening
in class AbstractEMCAdapter
public int getNumberOfAllInfoservices()
getNumberOfAllInfoservices
in interface IInfoService
getNumberOfAllInfoservices
in class AbstractEMCAdapter
public java.lang.String getIdentifier()
getIdentifier
in interface IInfoService
getIdentifier
in class AbstractEMCAdapter
IInfoService
public void sendMessageTo(java.lang.String a_id, IAgreementMessage a_message)
sendMessageTo
in interface IInfoService
sendMessageTo
in class AbstractEMCAdapter
a_id
- The id of the receiver.a_message
- The message to send.public void multicastMessage(IAgreementMessage a_message)
multicastMessage
in interface IInfoService
multicastMessage
in class AbstractEMCAdapter
a_message
- The message to send.boolean sendToInfoService(InfoServiceDBEntry a_infoservice, IDistributable a_message)
a_infoservice
- The target infoservice.postFile
- postData
-
true
.private boolean sendToInterface(ListenerInterface a_listener, IDistributable a_message)
a_listener
- The network interface.postFile
- postData
-
true
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |