DPML
DPML Metro Parts Annotation
HomeUtilitiesStationMetro
Parts Annotation

The Parts annotation is used to mark an interface as compliant with the DPML Metro Parts contract. During runtime evaluation of a class, the Metro system evaluates constructor arguments and builds solutions based on supplied deployment directives. During this process a constructor parameter may be evaluated to determin if it is a part-compliant interface. If no supporting annotation is present and the interface is an inner class of the component named Parts, the runtime will assume that the interface is a parts definition. While this pattern-based approach covers the majority of needs, there are circumstances where it is convinient to declare some other interface as the parts definition. The Parts annotation provides this additional flexibility.

Sample Code

The following code declares that an interface is parts-compliant.

import net.dpml.annotation.Parts;
    
@Parts
public interface SecurityServices
{
    Vault getVault();
    Keystore[] getTrustStores();
    Realm[] getRealms();
}