Class WeldActivator

  • All Implemented Interfaces:
    org.osgi.framework.BundleActivator

    public class WeldActivator
    extends Object
    implements org.osgi.framework.BundleActivator
    This is a bundle activator which is responsible for configuring Weld bundle to be used in GlassFish. As part of configuration, it configures the the SingletonProvider in Weld. It sets different SingletonProvider for different profiles. e.g., in WebProfile, it sets TCCLSingletonProvider, where as for full-javaee profile, it uses ACLSingletonProvider. It tests profile by testing existence of EarClassLoader. Since Weld 1.1, an implementation of the ProxyServices SPI is used to provide a classloader to load javassist defined proxies. This classloader ensures that they can load not only application defined classes but also classes exported by any OSGi bundle as long as the operation is happening in the context of a Java EE app. The bundle activator resets the SingletonProvicer in stop().
    Author:
    [email protected]
    • Constructor Detail

      • WeldActivator

        public WeldActivator()
    • Method Detail

      • start

        public void start​(org.osgi.framework.BundleContext context)
                   throws Exception
        Specified by:
        start in interface org.osgi.framework.BundleActivator
        Throws:
        Exception
      • stop

        public void stop​(org.osgi.framework.BundleContext context)
                  throws Exception
        Specified by:
        stop in interface org.osgi.framework.BundleActivator
        Throws:
        Exception