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


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

Annotates a method which is invoked when the Service is being unregistered from the OSGi registry. The method is called when the component's bundle is stopped, or when one of its required dependency is lost, or when a LifecycleController is programatically used to stop a service.

Usage Examples

 @Component
 class MyComponent implements MyService {
     @ServiceDependency
     private LogService logService; // Required dependency over the log service.
     
     @Stop
     void stop() {} // We are unregistering from the OSGi registry.     
 }
 



Copyright © 2013 The Apache Software Foundation. All Rights Reserved.