@Retention(value=CLASS)
@Target(value=TYPE)
public @interface AspectService
Here, the AspectService is registered into the OSGI registry each time an InterceptedService is found from the registry. The AspectService class intercepts the InterceptedService, and decorates its "doWork()" method. This aspect uses a rank with value "10", meaning that it will intercept some other eventual aspects with lower ranks. The Aspect also uses a service property (param=value), and include eventual service properties found from the InterceptedService:
@AspectService(ranking=10), properties={@Property(name="param", value="value")}) class AspectService implements InterceptedService { // The service we are intercepting (injected by reflection) protected InterceptedService intercepted; public void doWork() { intercepted.doWork(); } }
Modifier and Type | Required Element and Description |
---|---|
int |
ranking
Sets the ranking of this aspect.
|
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
added
The callback method to be invoked when the original service is available.
|
java.lang.String |
changed
The callback method to be invoked when the original service properties have changed.
|
java.lang.String |
factoryMethod
Sets the static method used to create the AspectService implementation instance.
|
java.lang.String |
field
Sets the field name where to inject the original service.
|
java.lang.String |
filter
Sets the filter condition to use with the service interface this aspect is applying to.
|
Property[] |
properties
Sets Additional properties to use with the aspect service registration
|
java.lang.String |
removed
The callback method to invoke when the service is lost.
|
java.lang.Class<?> |
service
Sets the service interface to apply the aspect to.
|
java.lang.String |
swap
name of the callback method to invoke on swap.
|
public abstract int ranking
public abstract java.lang.Class<?> service
public abstract java.lang.String filter
public abstract Property[] properties
public abstract java.lang.String field
public abstract java.lang.String added
public abstract java.lang.String changed
public abstract java.lang.String removed
public abstract java.lang.String swap
public abstract java.lang.String factoryMethod