com.netflix.karyon.spi
Annotation Type Component


@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface Component

Annotations to indicate that a class is a component.
All components will be created by karyon using governator at startup before initializing Application.

Karyon initializes all components discovered by governator's classpath scanning at startup. See disableProperty() for details on how to disable a component from being initialized.
If you want to hand-pick the components to be initialized, set a property PropertyNames.EXPLICIT_COMPONENT_CLASSES_PROP_NAME with the comma separated classnames of the components.


Optional Element Summary
 java.lang.String disableProperty
          Name of the property accessible to Archaius which if set to true, this component will not be initialized.
 

disableProperty

public abstract java.lang.String disableProperty
Name of the property accessible to Archaius which if set to true, this component will not be initialized. All components are initialized by default and have to be "opted-out" on purpose.
If this property is not set, karyon will also look at a property PropertyNames.COMPONENT_DISABLE_PROP_PEFIX.[classname of the component], which if set to true, will disable the component. eg: If your component is defined as:
     package foo.bar;

     @Component
     public class MyComponent {
     }
     
The above component can be disabled setting a property "com.netflix.karyon.component.disable.foo.bar.MyComponent" to true. On the other hand, if the component was defined as:
     package foo.bar;

     @Component(disableProperty="mycomp.disable")
     public class MyComponent {
     }
     
The above component can be disabled setting a property "mycomp.disable" to true.

Returns:
Name of the property which if set to true will disable this component.
Default:
""