uk.co.bigbeeconsultants.bconfig

Reloader

class Reloader extends AnyRef

Wraps uk.co.bigbeeconsultants.bconfig.Config loading so that changes to the source can be reloaded dynamically. All subsequent access to the configuration should be via the config method, which will ensure that changes are automatically reloaded from disk (or wherever) in a timely way.

It is safe to share reloaders between multiple calling threads.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Reloader
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Reloader(source: ConfigSourceJ, fallback: Option[Reloader], maxAgeSeconds: Int, changed: (Config) ⇒ Unit = (c) => {})

    source

    the configuration source

    fallback

    the optional fallback reloader

    maxAgeSeconds

    the period of time during which changes will be ignored. Use zero for detecting every external change immediately; this may be expensive because a lock has to be acquired and released. Use a much larger number to reduce the frequency of checking and hence the amount of thread locking.

    changed

    a callback that is invoked as a side-effect of calling config whenever a reload happens. It happens on first-time initialisation and again on every subsequent reload. The callback may have been called from any of the reloaders in the chain. It is passed the source, to identify which reloader changed, and the new config from that source (if the reloader in question is not at the head of then reloader chain, the new config will not be the same as would be returned from that reloader).

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def config: Config

    Gets the current configuration.

    Gets the current configuration. On occasions, the underlying file (if any) will be checked and may be reloaded.

    Do not store the result of this method in a long-lived val because that is likely to defeat the reloading.

  7. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  17. def toString(): String

    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped