|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.hk2.api.ServiceLocatorFactory
org.glassfish.hk2.internal.ServiceLocatorFactoryImpl
public class ServiceLocatorFactoryImpl
The implementation of the ServiceLocatorFactory
that looks
in the OSGi service registry or the META-INF/services for the implementation
to use. Failing those things, it uses the standard default locator
generator, which is found in auto-depends, which is the 99.9% case
Constructor Summary | |
---|---|
ServiceLocatorFactoryImpl()
This will create a new set of name to locator mappings |
Method Summary | |
---|---|
ServiceLocator |
create(String name)
Creates (or finds) a ServiceLocator. |
ServiceLocator |
create(String name,
ServiceLocator parent)
Creates or finds a ServiceLocator. |
ServiceLocator |
create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator)
Creates or finds a ServiceLocator. |
void |
destroy(ServiceLocator locator)
Removes the given ServiceLocator |
void |
destroy(String name)
Removes the ServiceLocator with this name |
ServiceLocator |
find(String name)
Finds the ServiceLocator with this name |
Methods inherited from class org.glassfish.hk2.api.ServiceLocatorFactory |
---|
getInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceLocatorFactoryImpl()
Method Detail |
---|
public ServiceLocator create(String name)
ServiceLocatorFactory
If there is already a ServiceLocator with the given name then this method will return null.
create
in class ServiceLocatorFactory
name
- The name of this service locator. May not be null
public ServiceLocator find(String name)
ServiceLocatorFactory
find
in class ServiceLocatorFactory
name
- May not be null, is the name of the ServiceLocator to find
public void destroy(String name)
ServiceLocatorFactory
All services associated with this ServiceLocator will be shutdown
destroy
in class ServiceLocatorFactory
name
- The name of the ServiceLocator to destroypublic void destroy(ServiceLocator locator)
ServiceLocatorFactory
All services associated with this ServiceLocator will be shutdown
destroy
in class ServiceLocatorFactory
public ServiceLocator create(String name, ServiceLocator parent)
ServiceLocatorFactory
If there is already a ServiceLocator with the given name then this method will that ServiceLocator. The parent argument will be ignored in that case
create
in class ServiceLocatorFactory
name
- The name of this service locator. May not be nullparent
- The parent of this ServiceLocator. Services can
be found in the parent (and all grand-parents). May be null
if the returned ServiceLocator should not be parented
public ServiceLocator create(String name, ServiceLocator parent, ServiceLocatorGenerator generator)
ServiceLocatorFactory
If there is already a ServiceLocator with the given name then this method will return that ServiceLocator. The parent argument will be ignored in that case. If a null name is given then a new ServiceLocator with a generated name will be returned.
create
in class ServiceLocatorFactory
name
- The name of this service locator. Passing a null
name will result in a newly created service locator with a
generated name.parent
- The parent of this ServiceLocator. Services can
be found in the parent (and all grand-parents). May be null
if the returned ServiceLocator should not be parentedgenerator
- An implementation of the generator interface that
can be used to provide an implementation of ServiceLocator. If
null then the generator used will be discovered from the OSGi
service registry or from META-INF/services
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |