1. Introduction to the Development Environment for Enterprise Server Add-On Components
Services in the HK2 Component Model
Instantiation of Components in HK2
Instantiation Cascading in HK2
Identifying a Class as an Add-On Component
3. Extending the Administration Console
4. Extending the asadmin Utility
5. Adding Container Capabilities
6. Packaging, Integrating, and Delivering an Add-On Component
If you are using Maven 2 to build HK2 components, invoke the auto-depends plug-in for Maven so that the META-INF/services files are generated automatically during build time.
<plugin>
<groupId>com.sun.enterprise</groupId>
<artifactId>hk2-maven-plugin</artifactId>
<configuration>
<includes>
<include>com/sun/enterprise/v3/**</include>
</includes>
</configuration>
</plugin>This example shows how to use @Contract and @Service and the resulting META-INF/services files.
The interfaces and classes in this example are as follows:
package com.sun.v3.annotations;
@Contract
public interface Startup {...}
package com.wombat;
@Contract
public interface RandomContract {...}
package com.sun.v3;
@Service
public class MyService implements Startup, RandomContract, PropertyChangeListener {
...
}
These interfaces and classes generate this META-INF/services file with the MyService content:
com.sun.v3.annotations.Startup com.wombat.RandomContract