org.jvnet.hk2.annotations
Annotation Type CagedBy


@Contract
@Documented
@Retention(value=RUNTIME)
@Target(value={ANNOTATION_TYPE,TYPE})
@Inherited
public @interface CagedBy

Annotation indicating that additional processing is performed when the component goes into a habitat.

This annotation can be used either as a normal annotation on a component or a meta-annotation. A common usage of this is to put this along with Contract annotation so that all the implementations of a contract receives some infrastructure service.

If used as a normal annotation on the contract type, all the services of this contract is subject to the registration hook processing — that is, the specified CageBuilder is invoked whenever those services are entered into the habitat, to be given an opportunity to perform additional work.

This can be also used as a meta-annotation. Suppose this annotation is placed on annotation X, which in turn is placed on class Y. In this case, CageBuilder is invoked for every Ys entered into habitat (again, the common case is where X also has Contract annotation.)

This is the interception point for providing additional infrastructure service for certain kinds of inhabitants.

Author:
Kohsuke Kawaguchi
See Also:
CageBuilder

Required Element Summary
 java.lang.Class<? extends CageBuilder> value
          Designates the CageBuilder that intercepts incoming inhabitants.
 

Element Detail

value

@InhabitantMetadata(value="cageBuilder")
@Index
public abstract java.lang.Class<? extends CageBuilder> value
Designates the CageBuilder that intercepts incoming inhabitants.



Copyright © 2008 Sun Microsystems, Inc.. All Rights Reserved.