org.objectweb.proactive.core.process
Interface MessageSink

All Known Implementing Classes:
AbstractExternalProcess.SimpleMessageSink, AbstractExternalProcessDecorator.CompositeMessageSink

public interface MessageSink


Method Summary
 java.lang.String getMessage()
          Returns a new message.
 boolean hasMessage()
          Returns true is and only if a message is ready to be consumed (the call to getMessage() won't block).
 boolean isActive()
          Returns true is and only if messages are still expected to be produced.
 void setMessage(java.lang.String message)
          Set a new message to be consumed be getMessage.
 

Method Detail

getMessage

public java.lang.String getMessage()
Returns a new message. The method should block until a message is ready. null is returned when no more messages are to be produced.

Returns:
the new message

setMessage

public void setMessage(java.lang.String message)
Set a new message to be consumed be getMessage. The method may block if one or several message(s) have been set before and not yet consumed. This is up to the implementation. Setting a null message is the signal that no more message will be produced.

Parameters:
message - the message to be consumed or null to signal the end of the production

hasMessage

public boolean hasMessage()
Returns true is and only if a message is ready to be consumed (the call to getMessage() won't block). If several threads share this ressource, there is a clear race condition on the consumption of the message.

Returns:
true is and only if a message is ready to be consumed

isActive

public boolean isActive()
Returns true is and only if messages are still expected to be produced. It is false after a setMessage is done with a null message.

Returns:
true is and only if messages are still expected to be produced


Copyright © April 2004 INRIA All Rights Reserved.