Class BaseProxyFactory

    • Constructor Detail

      • BaseProxyFactory

        public BaseProxyFactory()
        Default constructor with no preferred class loader.
      • BaseProxyFactory

        public BaseProxyFactory​(ClassLoader preferredClassLoader)
        Constructor that takes the preferred class loader for loading proxy interfaces.
        Parameters:
        preferredClassLoader - The class loader for proxy interfaces
    • Method Detail

      • getNamingStrategy

        protected NamingPolicy getNamingStrategy()
        Returns a NamingPolicy that can be used to create proxy class names.
        Returns:
        The naming strategy
      • setNamingStrategy

        @Inject
        public void setNamingStrategy​(NamingPolicy namingPolicy)
        Sets the naming policy used to determine the proxy class name.
        Parameters:
        namingPolicy - The naming policy to set
      • getPreferredClassLoader

        protected ClassLoader getPreferredClassLoader()
        Returns the specified ClassLoader that is used to define any proxy interfaces.
        Returns:
        The ClassLoader used to define proxy interfaces
      • getProxyClassLoader

        protected ClassLoader getProxyClassLoader​(Class<?> proxyType)
        Returns the ClassLoader that should be used to load the proxy.
        Parameters:
        proxyType - The class of the proxy
        Returns:
        The ClassLoader
      • assertClassVisible

        protected void assertClassVisible​(ClassLoader loader,
                                          Class<?> type)
                                   throws GenerationException
        Verifies that the given class is visible from the given class loader.
        Parameters:
        loader - The class loader that needs visibility to the class
        type - The class to verity
        Throws:
        GenerationException - If type is not visible from the class loader
      • assertInterfaces

        protected void assertInterfaces​(Class<?>... types)
                                 throws GenerationException
        Verifies that all the given classes are interfaces.
        Parameters:
        types - The classes to test
        Throws:
        GenerationException - If at least one class is not an interface