|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.omg.PortableServer.Servant kaos.core.service.transport.corba.CorbaReceiverPOA kaos.core.service.transport.corba.CorbaMessageReceiver
public class CorbaMessageReceiver
MessageReceiver is an endpoint created by a transport service. It is used as the means by which messages enter the agent. The agent can either receive message synchronously (via polling getMessage) or asynchronously (via the MessageListener callback). Prior to messaging use, the MessageReceiver must be bound to a local locator.
When using the MessageReceiver in a polling fashion the number of messages present (awaiting delivery) can be myEnumerated (count). The waiting message can be received by invoking one of the getMessage() methods.
MessageTransportService
,
TransportSystem
,
Serialized FormConstructor Summary | |
---|---|
CorbaMessageReceiver(MessageTransportService ts)
|
Method Summary | |
---|---|
void |
acceptMessage(byte[] msg)
Implements the CorbaReceiver interface function. |
void |
addMessageListener(MessageListener ml)
Adds a MessageListener to the MessageReceiver for asynchronous message delivery. |
void |
bindToLocalLocator(Locator l)
The method which binds the MessageReceiver to a local locator. |
Locator |
getLocalLocator()
Returns a local locator depending upon binding status. |
TransportMessage |
getMessage()
A blocking read operation. |
TransportMessage |
getMessage(long wait_millis)
A timed blocking read operation. |
MessageTransportService |
getMessageTransportService()
|
int |
getNumberOfMessages()
The number returned does not guarantee the actual number of messages available instantaneously. |
void |
removeMessageListener(MessageListener ml)
Removes a MessageListener from the MessageReceiver. |
Methods inherited from class kaos.core.service.transport.corba.CorbaReceiverPOA |
---|
_all_interfaces, _invoke, _this, _this |
Methods inherited from class org.omg.PortableServer.Servant |
---|
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CorbaMessageReceiver(MessageTransportService ts)
Method Detail |
---|
public void bindToLocalLocator(Locator l) throws NotLocatableException, TransportFailure
l
- the local Locator.
NotLocatableException
- if l is not a local locator.
TransportFailure
- if the binding process fails.public Locator getLocalLocator() throws TransportFailure
TransportFailure
- if any transport related failure occurs.public MessageTransportService getMessageTransportService() throws TransportFailure
TransportFailure
public void acceptMessage(byte[] msg)
acceptMessage
in interface CorbaReceiverOperations
msg
- the byte array that the remote object needs to send.public int getNumberOfMessages() throws TransportFailure
TransportFailure
- if any transport related failure occurs.public TransportMessage getMessage() throws java.lang.InterruptedException, TransportFailure
java.lang.InterruptedException
- if the waiting thread is interrupted.
TransportFailure
- if any transport related failure occurs.public TransportMessage getMessage(long wait_millis) throws java.lang.InterruptedException, TransportFailure
wait_millis
- the most the current thread should block for a message.
java.lang.InterruptedException
- if the waiting thread is interrupted.
TransportFailure
- if any transport related failure occurs.public void addMessageListener(MessageListener ml) throws TransportFailure
ml
- the MessageListener to callback with the incoming message.
TransportFailure
- if any transport related failure occurs.public void removeMessageListener(MessageListener ml) throws TransportFailure
ml
- the MessageListener to remove from the MessageReceiver.
TransportFailure
- if any transport related failure occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |