Configuration

com.loopfor.zookeeper.Configuration$
See theConfiguration companion trait

Constructs and deconstructs Configuration values.

A configuration is constructed by first specifying ''required'' attributes via Configuration() and then attaching ''optional'' attributes as necessary. A set of implicit methods conveniently convert between instances of Configuration and Builder.

Example:

val config = Configuration {
 ("foo.server.com", 2181) :: ("bar.server.com", 2181) :: Nil
} withTimeout {
 60 seconds
} withWatcher { (event, session) =>
 // ...
}

The type of config above is Builder since an implicit conversion occurred when attaching optional attributes using the various with methods. An explicit conversion back to Configuration, which can be accomplished using build(), is unnecessary since another implicit will perform this function automatically.

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

class Builder

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(servers: Seq[InetSocketAddress]): Configuration

Constructs a new default configuration using the given servers.

Constructs a new default configuration using the given servers.

Attributes

servers

sequence of socket addresses corresponding to server endpoints

Returns:

a default configuration with the given servers

Used in pattern matching to deconstruct a configuration.

Used in pattern matching to deconstruct a configuration.

Attributes

config

selector value

Returns:

a Some containing configuration attributes if the selector value is not null, otherwise None

Implicits

Implicits

implicit def builderToConfig(builder: Builder): Configuration
implicit def configToBuilder(config: Configuration): Builder