org.chromattic.api
Class ChromatticBuilder

java.lang.Object
  extended by org.chromattic.api.ChromatticBuilder

public abstract class ChromatticBuilder
extends Object

Version:
$Revision$
Author:
Julien Viet

Nested Class Summary
static class ChromatticBuilder.Option<T>
          A configuration option.
protected static class ChromatticBuilder.OptionInstance<T>
           
 
Field Summary
static ChromatticBuilder.Option<Boolean> CACHE_STATE_ENABLED
          The boolean indicating if caching is performed.
protected  Set<Class<?>> classes
          .
static ChromatticBuilder.Option<String> INSTRUMENTOR_CLASSNAME
          The instrumentor class name for Chromattic's objects.
static ChromatticBuilder.Option<Boolean> JCR_OPTIMIZE_ENABLED
          Enable / disable all JCR optimizations.
static ChromatticBuilder.Option<Boolean> JCR_OPTIMIZE_HAS_NODE_ENABLED
          Enable / disable access to JCR has property.
static ChromatticBuilder.Option<Boolean> JCR_OPTIMIZE_HAS_PROPERTY_ENABLED
          Enable / disable access to JCR has property.
static ChromatticBuilder.Option<String> OBJECT_FORMATTER_CLASSNAME
          The object name formatter class name.
protected  Map<String,ChromatticBuilder.OptionInstance<?>> options
          .
static ChromatticBuilder.Option<String> ROOT_NODE_PATH
          The path of the root node.
static ChromatticBuilder.Option<String> SESSION_LIFECYCLE_CLASSNAME
          The JCR session life cycle class name.
 
Constructor Summary
ChromatticBuilder()
           
 
Method Summary
 void add(Class<?> clazz)
           
protected abstract  Chromattic boot()
           
 Chromattic build()
           
protected abstract
<T> void
configure(ChromatticBuilder.OptionInstance<T> option)
           
static ChromatticBuilder create()
           
 ChromatticBuilder.OptionInstance<?> getOption(String name)
           
static Set<ChromatticBuilder.Option> getSystemOptions()
           
<T> void
setOption(ChromatticBuilder.Option<T> option, T value)
           
<T> void
setOption(ChromatticBuilder.Option<T> option, T value, boolean overwrite)
           
<T> void
setOption(ChromatticBuilder.OptionInstance<T> optionInstance, boolean overwrite)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTRUMENTOR_CLASSNAME

public static final ChromatticBuilder.Option<String> INSTRUMENTOR_CLASSNAME
The instrumentor class name for Chromattic's objects. The specified class must implement the org.chromattic.spi.instrument.Intrumentor class.


SESSION_LIFECYCLE_CLASSNAME

public static final ChromatticBuilder.Option<String> SESSION_LIFECYCLE_CLASSNAME
The JCR session life cycle class name. The specified class must implement the org.chromattic.spi.jcr.SessionLifeCycle class.


OBJECT_FORMATTER_CLASSNAME

public static final ChromatticBuilder.Option<String> OBJECT_FORMATTER_CLASSNAME
The object name formatter class name. The specified class must implement the org.chromattic.api.format.ObjectFormatter class.


CACHE_STATE_ENABLED

public static final ChromatticBuilder.Option<Boolean> CACHE_STATE_ENABLED
The boolean indicating if caching is performed. When cache is enabled each session maintains a cache that avoids to use the underlying JCR session. As a consequence any change made directly to the JCR session will not be visible in the object domain.


JCR_OPTIMIZE_ENABLED

public static final ChromatticBuilder.Option<Boolean> JCR_OPTIMIZE_ENABLED
Enable / disable all JCR optimizations.


JCR_OPTIMIZE_HAS_PROPERTY_ENABLED

public static final ChromatticBuilder.Option<Boolean> JCR_OPTIMIZE_HAS_PROPERTY_ENABLED
Enable / disable access to JCR has property.


JCR_OPTIMIZE_HAS_NODE_ENABLED

public static final ChromatticBuilder.Option<Boolean> JCR_OPTIMIZE_HAS_NODE_ENABLED
Enable / disable access to JCR has property.


ROOT_NODE_PATH

public static final ChromatticBuilder.Option<String> ROOT_NODE_PATH
The path of the root node. The default value is the path of the JCR workspace root node.


classes

protected final Set<Class<?>> classes
.


options

protected final Map<String,ChromatticBuilder.OptionInstance<?>> options
.

Constructor Detail

ChromatticBuilder

public ChromatticBuilder()
Method Detail

getSystemOptions

public static Set<ChromatticBuilder.Option> getSystemOptions()

create

public static ChromatticBuilder create()

getOption

public ChromatticBuilder.OptionInstance<?> getOption(String name)

setOption

public <T> void setOption(ChromatticBuilder.Option<T> option,
                          T value)

setOption

public <T> void setOption(ChromatticBuilder.OptionInstance<T> optionInstance,
                          boolean overwrite)

setOption

public <T> void setOption(ChromatticBuilder.Option<T> option,
                          T value,
                          boolean overwrite)

add

public void add(Class<?> clazz)

build

public Chromattic build()
                 throws Exception
Throws:
Exception

boot

protected abstract Chromattic boot()
                            throws Exception
Throws:
Exception

configure

protected abstract <T> void configure(ChromatticBuilder.OptionInstance<T> option)


Copyright © 2009 eXo Platform SAS. All Rights Reserved.