@Retention(value=RUNTIME) @Target(value=TYPE) @Documented @InhabitantAnnotation(value="default") public @interface Service
Contract
annotation. Each service
implementation must be marked with the @Service interface and
implement the service interface.Factory
@Index public abstract String name
org.glassfish.hk2.ContractLocator#named(String)
and similar methods can be used
to obtain a service with a particular name. All the named services
are still available through org.glassfish.hk2.Services#byType(Class)
.
The default value "" indicates that the inhabitant is anonymous.
public abstract String metadata
org.glassfish.hk2.Descriptor#metadata()
.
While this is limited in expressiveness, metadata has a performance advantage in it that it can be read without even creating a classloader for this class. For example, this feature is used by the configuration module so that the config file can be read without actually loading the classes.
public abstract String analyzer
ClassAnalyzer
service that should be used
to analyze this classClassAnalyzer
service that should
be used to analyze this classCopyright © 2017 Oracle Corporation. All rights reserved.