org.modeshape.jcr.bus

## Interface ChangeBus

- All Superinterfaces:
    ChangeSetListener, Observable
  All Known Implementing Classes:
    ClusteredChangeBus, RepositoryChangeBus

      public interface ChangeBus
      extends ChangeSetListener, Observable

  A generic interface for an event bus which handles changes.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasObservers()` Checks if there are any observers registered with the bus.
    `boolean` | `registerInThread(ChangeSetListener observer)` Register the supplied observer which will be always notified in the same thread as the bus instance.
    `void` | `shutdown()` Shuts down the change bus, closing and clearing resources created during `start()`
    `void` | `start()` Starts up the change bus.

    - ### Methods inherited from interface org.modeshape.jcr.cache.change.ChangeSetListener

      `notify`

    - ### Methods inherited from interface org.modeshape.jcr.cache.change.Observable

      `register, unregister`

- - ### Method Detail

    - #### start

          void start()
                     throws Exception

      Starts up the change bus.
      Throws:
        `Exception` - if anything unexpected fails during startup.

    - #### shutdown

          void shutdown()

      Shuts down the change bus, closing and clearing resources created during `start()`

    - #### hasObservers

          boolean hasObservers()

      Checks if there are any observers registered with the bus.
      Returns:
        `true` if there are any registered observers, `false` otherwise

    - #### registerInThread

          boolean registerInThread(ChangeSetListener observer)

      Register the supplied observer which will be always notified in the same thread as the bus instance. This method does nothing if the observer reference is null.
      Parameters:
        `observer` - the observer to be added; may be null
      Returns:
        true if the observer was added, or false if the observer was null, if the observer was already registered, or if the observer could not be added

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.