Class WeldDecorator


  • public class WeldDecorator
    extends Object
    Jetty Eclipse Weld support for jetty >=9.4.20

    This Decorator has no hard dependencies on Jetty APIs, rather it relies on the server to be configured so that an object set as the "org.eclipse.jetty.cdi.decorator" is introspected for methods that match the decorate(Object) and destroy(Object) signatures, which are then invoked dynamically.

    Author:
    Greg Wilkins
    • Constructor Detail

      • WeldDecorator

        protected WeldDecorator​(jakarta.servlet.ServletContext servletContext)
    • Method Detail

      • decorate

        public <T> T decorate​(T o)
        Decorate an object.

        The signature of this method must match what is introspected for by the Jetty DecoratingListener class. It is invoked dynamically.

        Type Parameters:
        T - The type of the object to be decorated
        Parameters:
        o - The object to be decorated
        Returns:
        The decorated object
      • destroy

        public void destroy​(Object o)
        Destroy a decorated object.

        The signature of this method must match what is introspected for by the Jetty DecoratingListener class. It is invoked dynamically.

        Parameters:
        o - The object to be destroyed