|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object service.Service service.ProxyCommunication
public class ProxyCommunication
Basic communication service for point to point communication between processes.
The communication element embedded in an instance of the DistributedServicesMiddleware
class is already implementing this basic communication service. However, it is not possible to directly
call its operations as this will interfere with management of messages for others services
(all messages for all services are received by this communication element). The goal of the
ProxyCommunication
class is then to offer the same operations by being a proxy
avoiding interferences with other services.
Field Summary |
---|
Fields inherited from class service.Service |
---|
buffer, commElt, dispatcher, myType |
Constructor Summary | |
---|---|
ProxyCommunication()
|
Method Summary | |
---|---|
Message |
asynchReceiveMessage()
Return a received message coming from any remote process. |
boolean |
availableMessage()
Check if there is unread received messages |
void |
crashProcess()
Depending of the crash level and a random value generated, crash the process or not |
void |
sendMessage(Message msg)
Send a message, tagged with the type of the service, to a given process (more precisely, to the service of the same type on this process) |
void |
sendMessage(ProcessIdentifier id,
java.lang.Object data)
Send a message to a remote process. |
Message |
synchReceiveMessage()
Return a received message coming from any remote process. |
Methods inherited from class service.Service |
---|
initialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProxyCommunication()
Method Detail |
---|
public void sendMessage(Message msg) throws CommunicationException
Service
sendMessage
in interface ICommunication
sendMessage
in class Service
msg
- the message to send
CommunicationException
- in case of communication errorpublic void sendMessage(ProcessIdentifier id, java.lang.Object data) throws CommunicationException
ICommunication
sendMessage
in interface ICommunication
id
- the identifier, including its physical address, of the remote processdata
- the data to send to the remote process
CommunicationException
- in case of communication errorpublic Message synchReceiveMessage()
ICommunication
synchReceiveMessage
in interface ICommunication
public Message asynchReceiveMessage()
ICommunication
null
value.
asynchReceiveMessage
in interface ICommunication
null
if nonepublic boolean availableMessage()
ICommunication
availableMessage
in interface ICommunication
true
if there is at least one unread received message,
false
otherwisepublic void crashProcess()
ICommunication
crashProcess
in interface ICommunication
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |