|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.hk2.component.InhabitantsParser
@Deprecated public class InhabitantsParser
Parses /META-INF/inhabitants and populate ServiceLocator
.
This class can be subclasses to customize the parsing behavior, which is useful for ignoring some components.
Field Summary | |
---|---|
ServiceLocator |
serviceLocator
Deprecated. |
Constructor Summary | |
---|---|
InhabitantsParser(ServiceLocator serviceLocator)
Deprecated. |
Method Summary | |
---|---|
void |
add(Inhabitant<?> i)
Deprecated. Adds the given inhabitant to the serviceLocator |
protected void |
add(Inhabitant<?> i,
InhabitantParser parser)
Deprecated. Adds the given inhabitant to the serviceLocator, with all its indices. |
void |
addIndex(Inhabitant<?> i,
String typeName,
String name)
Deprecated. Adds the given inhabitant index to the serviceLocator |
void |
drop(Class<?> component)
Deprecated. Tells InhabitantsParser that if it encounters the specified component
while parsing inhabitants file,
simply drop it and pretend that such an inhabitant had never existed. |
void |
drop(String fullyQualifiedClassName)
Deprecated. |
protected boolean |
isFilteredInhabitant(InhabitantParser inhabitantParser)
Deprecated. Returns true if this inhabitant should be ignored. |
protected boolean |
isFilteredInhabitant(String typeName)
Deprecated. Returns true if this inhabitant should be ignored. |
void |
parse(Iterable<InhabitantParser> scanner,
Holder<ClassLoader> classLoader)
Deprecated. Parses the inhabitants file (which is represented by InhabitantsParser ). |
static String |
parseIndex(String v,
StringBuilder name)
Deprecated. Returns the contract name given a raw index entry. |
boolean |
remove(Inhabitant<?> i)
Deprecated. Removes an inhabitant |
boolean |
removeIndex(String index,
Object serviceOrInhabitant)
Deprecated. Removes an Inhabitant index for a specific service or inhabitant |
boolean |
removeIndex(String index,
String name)
Deprecated. Removes a named Inhabitant index for a specific contract and name |
void |
replace(Class<?> oldComponent,
Class<?> newComponent)
Deprecated. Tells InhabitantsParser that if it encounters the specified component
while parsing inhabitants file,
ignore the one in the inhabitants file and instead insert the specified 'new' component. |
void |
replace(String oldComponentFullyQualifiedClassName,
Class<?> newComponent)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final ServiceLocator serviceLocator
Constructor Detail |
---|
public InhabitantsParser(ServiceLocator serviceLocator)
Method Detail |
---|
public void drop(Class<?> component)
InhabitantsParser
that if it encounters the specified component
while parsing inhabitants file,
simply drop it and pretend that such an inhabitant had never existed.
This is useful when the application that's hosting an HK2 environment wants to tweak the inhabitant population at sub-module level.
public void drop(String fullyQualifiedClassName)
public void replace(Class<?> oldComponent, Class<?> newComponent)
InhabitantsParser
that if it encounters the specified component
while parsing inhabitants file,
ignore the one in the inhabitants file and instead insert the specified 'new' component.
This is useful when the application that's hosting an HK2 environment wants to tweak the inhabitant population at sub-module level.
public void replace(String oldComponentFullyQualifiedClassName, Class<?> newComponent)
public void parse(Iterable<InhabitantParser> scanner, Holder<ClassLoader> classLoader) throws IOException
InhabitantsParser
).
All the earlier drop/replace commands will be honored during this process.
IOException
protected boolean isFilteredInhabitant(InhabitantParser inhabitantParser)
inhabitantParser
-
protected boolean isFilteredInhabitant(String typeName)
typeName
-
protected void add(Inhabitant<?> i, InhabitantParser parser)
public static String parseIndex(String v, StringBuilder name)
v
- the raw index entry in the format of contract[:name]name
- a StringBuilder used to optionally store the service name
public void add(Inhabitant<?> i)
add
in interface InhabitantStore
i
- public void addIndex(Inhabitant<?> i, String typeName, String name)
addIndex
in interface InhabitantStore
public boolean remove(Inhabitant<?> i)
InhabitantStore
remove
in interface InhabitantStore
i
- inhabitant to be removed
public boolean removeIndex(String index, String name)
InhabitantStore
removeIndex
in interface InhabitantStore
index
- the contract namename
- the instance name, optionally provided
public boolean removeIndex(String index, Object serviceOrInhabitant)
InhabitantStore
removeIndex
in interface InhabitantStore
index
- the contract nameserviceOrInhabitant
- the service instance, or inhabitant instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |