com.sun.hk2.component
Class InhabitantsFile

java.lang.Object
  extended by com.sun.hk2.component.InhabitantsFile

public class InhabitantsFile
extends java.lang.Object

Inhabitants file.

Inhabitants file describe inhabitants (objects) that are to be placed into the habitat. This file is generated by the APT processor, which is integrated transparently into the build process by the HK2 maven plugin.

The file is by convention placed into /"META-INF/inhabitants"/xyz where 'xyz' portion is the identifier of the habitat. This allows multiple different habitats to be created over the same set of classes. For example, there can be one habitat for the whole GF, then there are smaller habitats for each JAX-WS deployment.

Format of the inhabitants file

The file is a UTF-8 encoded text file, and processing is line-based. A line that starts with '#' is treated as a comment and ignored. Other lines are assumed to be in key=value,key=value,... format. =value portion is optional, and this can be used to design keys that are conceptually boolean. The same key can appear multiple times.s

The following keys are defined:

Author:
Kohsuke Kawaguchi

Key Value
"class" The fully qualified class name of the inhabitant.
"index" The index under which the inhabitant is registered. Multiple values allowed. A value is of the form: PRIMARYNAME[:SUBNAME]. This is used for all kinds of indexing needs, including Contract (where PRIMARYNAME is the FQCN of the contract name and SUBNAME is the component name.)
Field Summary
static java.lang.String CAGE_BUILDER_KEY
          Used to point to CageBuilder for this component.
static java.lang.String CLASS_KEY
           
static java.lang.String COMPANION_CLASS_KEY
          Used as a metadata for inhabitants of CompanionSeed, to indicate what is the actual companion class.
static java.lang.String COMPANION_CLASS_METADATA_KEY
          Used as metadafa for inhabitants of CompanionSeed to capture metadata of the actual companioin class.
static java.lang.String INDEX_KEY
           
static java.lang.String PATH
           
static java.lang.String TARGET_TYPE
          Used as metadata for indentifying the type on which a InhabitantAnnotation was annotated.
 
Constructor Summary
InhabitantsFile()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH

public static final java.lang.String PATH
See Also:
Constant Field Values

CLASS_KEY

public static final java.lang.String CLASS_KEY
See Also:
Constant Field Values

INDEX_KEY

public static final java.lang.String INDEX_KEY
See Also:
Constant Field Values

COMPANION_CLASS_KEY

public static final java.lang.String COMPANION_CLASS_KEY
Used as a metadata for inhabitants of CompanionSeed, to indicate what is the actual companion class.

See Also:
Constant Field Values

CAGE_BUILDER_KEY

public static final java.lang.String CAGE_BUILDER_KEY
Used to point to CageBuilder for this component.

See Also:
Constant Field Values

COMPANION_CLASS_METADATA_KEY

public static final java.lang.String COMPANION_CLASS_METADATA_KEY
Used as metadafa for inhabitants of CompanionSeed to capture metadata of the actual companioin class.

See Also:
Constant Field Values

TARGET_TYPE

public static final java.lang.String TARGET_TYPE
Used as metadata for indentifying the type on which a InhabitantAnnotation was annotated.

See Also:
Constant Field Values
Constructor Detail

InhabitantsFile

public InhabitantsFile()


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