Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.opensolaris.os.dtrace
Class ConsumerException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              org.opensolaris.os.dtrace.ConsumerException

All Implemented Interfaces:
  java.io.Serializable

    public class ConsumerException

extends java.lang.Exception

Exception thrown by a `ConsumerListener` to terminate a running `Consumer`.

See Also:
  Serialized Form

Constructor Summary
`ConsumerException(java.lang.String message)` Creates a consumer exception with the given message.
`ConsumerException(java.lang.String message, java.lang.Object notification)` Creates an exception thrown by a `ConsumerListener` implementation to terminate a running `Consumer`, usually in response to a drop or an error reported by the native DTrace library.

Method Summary
`java.lang.Object` | `getNotificationObject()` Gets the optional object from the `ConsumerListener` that communicates to the `ExceptionHandler` why the listener threw this exception.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ConsumerException

    public ConsumerException(java.lang.String message)

  Creates a consumer exception with the given message.

  See Also:
    `ConsumerException(String message, Object dtraceNotificationObject)`

### ConsumerException

    public ConsumerException(java.lang.String message,
                             java.lang.Object notification)

  Creates an exception thrown by a `ConsumerListener` implementation to terminate a running `Consumer`, usually in response to a drop or an error reported by the native DTrace library. Optionally includes the object reported by the native DTrace library so it can be used by an `ExceptionHandler` to display details about why the consumer terminated.

  Parameters:
    `message` - default display message explaining why the consumer was terminated.
    `notification` - usually the object passed to a `ConsumerListener` from DTrace that prompted this exception. The notification could be any of the following:
    - a `Drop` passed to `dataDropped()`
    - an `Error` passed to `errorEncountered()`
    - a `ProcessState` passed to `processStateChanged()`
    or it could be a user-defined object that describes anything unexpected in `dataReceived()` or that defines an arbitrary error threshold. An `ExceptionHandler` should be defined to handle any type of notification object set by user code. May be `null`.
  See Also:
    `Consumer.go(ExceptionHandler h)`

Method Detail

### getNotificationObject

    public java.lang.Object getNotificationObject()

  Gets the optional object from the `ConsumerListener` that communicates to the `ExceptionHandler` why the listener threw this exception. Usually this is the object from DTrace (such as an `Error`) that prompted the exception, simply forwarded to the exception handler.

  Returns:
    an object that communicates to the `ExceptionHandler` why the `ConsumerListener` threw this exception, may be `null`
  See Also:
    `Consumer.go(ExceptionHandler h)`, `ConsumerException(String message, Object dtraceNotificationObject)`

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD