org.apache.felix.dm.annotation.api
Annotation Type Destroy


@Retention(value=CLASS)
@Target(value=METHOD)
public @interface Destroy

Annotates a method which is invoked when the component is destroyed. The method is called when the component's bundle is stopped, or when one of its required dependency is lost (unless the dependency has been defined as an "instance bound" dependency using the Dependency Manager API).

Usage Examples

 @Component
 class MyComponent {
     @ServiceDependency
     private LogService logService; // Required dependency over the log service.
     
     @Destroy
     void destroyed() {} // called if bundle is stopped or if we have lost some required dependencies.     
 }
 



Copyright © 2011 Apache Software Foundation. All Rights Reserved.