Class JavassistAspectPlugin
java.lang.Object
io.vertigo.core.plugins.component.aop.javassist.JavassistAspectPlugin
- All Implemented Interfaces:
AspectPlugin,CoreComponent,Plugin
This class implements the aspects using the javassist library.
- Author:
- pchretien
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<C extends CoreComponent>
Cunwrap(C component) Retrieves the original component instance from a proxy reference.<C extends CoreComponent>
CCreates a proxy reference for a component instance, applying the specified aspects at defined join points.
-
Constructor Details
-
JavassistAspectPlugin
public JavassistAspectPlugin()
-
-
Method Details
-
wrap
Creates a proxy reference for a component instance, applying the specified aspects at defined join points. The proxy wraps the provided component instance, intercepting method calls as defined by the join points and their associated aspects. This enables the implementation of cross-cutting concerns such as logging, security, or performance monitoring.- Specified by:
wrapin interfaceAspectPlugin- Type Parameters:
C- the type of the component, which must extend CoreComponent- Parameters:
instance- the component instance to be wrapped by the proxyjoinPoints- a map associating methods to lists of Aspect objects defining the interception logic- Returns:
- a proxy reference implementing the same interface as the provided component instance
-
unwrap
Description copied from interface:AspectPluginRetrieves the original component instance from a proxy reference. This method unwraps the proxy to return the underlying component instance, removing any aspect-related interception logic. If the provided component is not a proxy, the original instance is returned unchanged.- Specified by:
unwrapin interfaceAspectPlugin- Type Parameters:
C- the type of the component, which must extend CoreComponent- Parameters:
component- the proxy or component instance to unwrap- Returns:
- the underlying component instance
-