|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Retention(value=RUNTIME) @Target(value=TYPE) @Documented @InhabitantAnnotation(value="default") public @interface Service
Marker interface for service implementation. A service is defined by
an interface marked with the Contract annotation. Each service
implementation must be marked with the @Service interface and
implement the service interface.
Factory| Optional Element Summary | |
|---|---|
String |
metadata
Additional metadata that goes into the inhabitants file. |
String |
name
Name of the service. |
@Index public abstract String name
Habitat#getComponent(Class, String) and similar methods can be used
to obtain a service with a particular name. All the named services
are still available through Habitat#getAllByContract(Class).
The default value "" indicates that the inhabitant is anonymous.
public abstract String metadata
InhabitantsFile
for more details.
This information is accessible from Inhabitant#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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
Copyright © 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.
Generated on 12-March-2010 04:35