Interface AspectPlugin

All Superinterfaces:
CoreComponent, Plugin
All Known Implementing Classes:
JavassistAspectPlugin

public interface AspectPlugin extends Plugin
An interface for creating and managing proxy references for components with Aspect-Oriented Programming (AOP) support. This plugin enables the creation of proxy references that implement aspects, allowing for the injection of cross-cutting concerns (e.g., logging, security, transaction management) into a component's lifecycle. It extends the Plugin interface to integrate with the plugin ecosystem.
Author:
pchretien
  • Method Summary

    Modifier and Type
    Method
    Description
    <C extends CoreComponent>
    C
    unwrap(C component)
    Retrieves the original component instance from a proxy reference.
    <C extends CoreComponent>
    C
    wrap(C instance, Map<Method,List<Aspect>> joinPoints)
    Creates a proxy reference for a component instance, applying the specified aspects at defined join points.
  • Method Details

    • wrap

      <C extends CoreComponent> C wrap(C instance, Map<Method,List<Aspect>> joinPoints)
      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.
      Type Parameters:
      C - the type of the component, which must extend CoreComponent
      Parameters:
      instance - the component instance to be wrapped by the proxy
      joinPoints - 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

      <C extends CoreComponent> C unwrap(C component)
      Retrieves 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.
      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