Spring for Apache Hadoop

org.springframework.data.hadoop.config.common.annotation
Class AnnotationConfigurerAdapter<O,I,B extends AnnotationBuilder<O>>

java.lang.Object
  extended by org.springframework.data.hadoop.config.common.annotation.AnnotationConfigurerAdapter<O,I,B>
Type Parameters:
O - The Object being built by B
I -
B - The Builder that is building O and is configured by AnnotationConfigurerAdapter
All Implemented Interfaces:
AnnotationConfigurer<O,B>
Direct Known Subclasses:
DefaultClientMasterRunnerConfigurer, DefaultEnvironmentClasspathConfigurer, DefaultLocalResourcesCopyConfigurer, DefaultLocalResourcesHdfsConfigurer, DefaultMasterContainerAllocatorConfigurer, DefaultMasterContainerRunnerConfigurer, DefaultPropertiesConfigurer, DefaultResourceConfigurer

public abstract class AnnotationConfigurerAdapter<O,I,B extends AnnotationBuilder<O>>
extends java.lang.Object
implements AnnotationConfigurer<O,B>

A base class for AnnotationConfigurer that allows subclasses to only implement the methods they are interested in. It also provides a mechanism for using the AnnotationConfigurer and when done gaining access to the AnnotationBuilder that is being configured.

Author:
Rob Winch, Janne Valkealahti

Constructor Summary
AnnotationConfigurerAdapter()
           
 
Method Summary
 void addObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
          Adds an ObjectPostProcessor to be used for this SecurityConfigurerAdapter.
 I and()
          Return the AnnotationBuilder when done using the AnnotationConfigurer.
 void configure(B builder)
          Configure the AnnotationBuilder by setting the necessary properties on the AnnotationBuilder.
protected  B getBuilder()
          Gets the AnnotationBuilder.
 void init(B builder)
          Initialise the AnnotationBuilder.
 boolean isAssignable(AnnotationBuilder<O> builder)
           
 void setBuilder(B builder)
          Sets the AnnotationBuilder to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationConfigurerAdapter

public AnnotationConfigurerAdapter()
Method Detail

init

public void init(B builder)
          throws java.lang.Exception
Description copied from interface: AnnotationConfigurer
Initialise the AnnotationBuilder. Here only shared state should be created and modified, but not properties on the AnnotationBuilder used for building the object. This ensures that the AnnotationConfigurer.configure(AnnotationBuilder) method uses the correct shared objects when building.

Specified by:
init in interface AnnotationConfigurer<O,B extends AnnotationBuilder<O>>
Parameters:
builder - the builder
Throws:
java.lang.Exception - if error occurred

configure

public void configure(B builder)
               throws java.lang.Exception
Description copied from interface: AnnotationConfigurer
Configure the AnnotationBuilder by setting the necessary properties on the AnnotationBuilder.

Specified by:
configure in interface AnnotationConfigurer<O,B extends AnnotationBuilder<O>>
Parameters:
builder - the builder
Throws:
java.lang.Exception - if error occurred

and

public I and()
Return the AnnotationBuilder when done using the AnnotationConfigurer. This is useful for method chaining.

Returns:
the AnnotationBuilder

getBuilder

protected final B getBuilder()
Gets the AnnotationBuilder. Cannot be null.

Returns:
the AnnotationBuilder

addObjectPostProcessor

public void addObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
Adds an ObjectPostProcessor to be used for this SecurityConfigurerAdapter. The default implementation does nothing to the object.

Parameters:
objectPostProcessor - the ObjectPostProcessor to use

setBuilder

public void setBuilder(B builder)
Sets the AnnotationBuilder to be used. This is automatically set when using AbstractConfiguredAnnotationBuilder.apply(AnnotationConfigurerAdapter)

Parameters:
builder - the AnnotationBuilder to set

isAssignable

public boolean isAssignable(AnnotationBuilder<O> builder)
Specified by:
isAssignable in interface AnnotationConfigurer<O,B extends AnnotationBuilder<O>>

Spring for Apache Hadoop