registerForNotification(StreamEventListener n) method

Format

void registerForNotification(StreamEventListener n)

Explanation

Registers a listener object for callback.

Once this method is executed, a polling method (get or getAll method) cannot be executed.

Only one listener object can be registered for each stream. Also, a listener object that is already registered cannot be registered for another stream.

Parameters

n

Specifies a listener object.

Exceptions

The following table shows the exceptions and the conditions for their generation.

ExceptionGeneration condition
NullPointerExceptionnull is specified for the parameter.
SDPClientException
  • The output stream is already closed.
  • A listener object is already registered for a stream.
  • The specified listener object is already registered for another stream.
  • This method is called during RMI connection.
SDPClientQueryGroupNotExistExceptionThe query group was deleted.

Return value

None.