Class PlasticManager

    • Method Detail

      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Returns the ClassLoader that is used to instantiate transformed classes. The parent class loader of the returned class loader is the context class loader, or the class loader specified by withClassLoader(ClassLoader).
        Returns:
        class loader used to load classes in controlled packages
      • getClassInstantiator

        public <T> ClassInstantiator<T> getClassInstantiator​(java.lang.String className)
        Gets the ClassInstantiator for the indicated class, which must be in a transformed package.
        Parameters:
        className - fully qualified class name
        Returns:
        instantiator (configured via the delegate for the class
        Throws:
        java.lang.IllegalArgumentException - if the class is not a transformed class
      • createClass

        public <T> ClassInstantiator<T> createClass​(java.lang.Class<T> baseClass,
                                                    PlasticClassTransformer callback)
        Creates an entirely new class, extending from the provided base class.
        Parameters:
        baseClass - class to extend from, which must be a class, not an interface
        callback - used to configure the new class
        Returns:
        the instantiator, which allows instances of the new class to be created
      • createProxy

        public <T> ClassInstantiator<T> createProxy​(java.lang.Class<T> interfaceType,
                                                    PlasticClassTransformer callback)
        Creates an entirely new class. The class extends from Object and implements the provided interface.
        Parameters:
        interfaceType - class to extend from, which must be a class, not an interface
        callback - used to configure the new class
        Returns:
        the instantiator, which allows instances of the new class to be created
        See Also:
        createProxyTransformation(Class, Class)
      • createProxy

        public <T> ClassInstantiator<T> createProxy​(java.lang.Class<T> interfaceType,
                                                    PlasticClassTransformer callback,
                                                    boolean introduceInterface)
        Creates an entirely new class. The class extends from Object and implements the provided interface.
        Parameters:
        interfaceType - class to extend from, which must be a class, not an interface
        callback - used to configure the new class
        Returns:
        the instantiator, which allows instances of the new class to be created
        See Also:
        createProxyTransformation(Class, Class)
      • createProxy

        public <T> ClassInstantiator<T> createProxy​(java.lang.Class<T> interfaceType,
                                                    java.lang.Class<? extends T> implementationType,
                                                    PlasticClassTransformer callback)
        Creates an entirely new class. The class extends from Object and implements the provided interface.
        Parameters:
        interfaceType - class to extend from, which must be a class, not an interface
        implementationType - class that implements interfaceType. It can be null.
        callback - used to configure the new class
        Returns:
        the instantiator, which allows instances of the new class to be created
        Since:
        5.4
        See Also:
        createProxyTransformation(Class, Class)
      • createProxy

        public <T> ClassInstantiator<T> createProxy​(java.lang.Class<T> interfaceType,
                                                    java.lang.Class<? extends T> implementationType,
                                                    PlasticClassTransformer callback,
                                                    boolean introduceInterface)
        Creates an entirely new class. The class extends from Object and implements the provided interface.
        Parameters:
        interfaceType - class to extend from, which must be a class, not an interface
        implementationType - class that implements interfaceType. It can be null.
        callback - used to configure the new class
        introduceInterface - whether to introduce the interface to the Plastic class or not.
        Returns:
        the instantiator, which allows instances of the new class to be created
        Since:
        5.4.5
        See Also:
        createProxyTransformation(Class, Class)
      • createProxyTransformation

        public <T> PlasticClassTransformation<T> createProxyTransformation​(java.lang.Class interfaceType,
                                                                           java.lang.Class implementationType,
                                                                           boolean introduceInterface)
        Creates the underlying PlasticClassTransformation for an interface proxy. This should only be used in the cases where encapsulating the PlasticClass construction into a callback is not feasible (which is the case for some of the older APIs inside Tapestry IoC).
        Parameters:
        interfaceType - class proxy will extend from
        implementationType - class that implements interfaceType. It can be null.
        introduceInterface - whether result.getPlasticClass().introduceInterface(interfaceType); should be called or not.
        Returns:
        transformation from which an instantiator may be created
      • shouldInterceptClassLoading

        public boolean shouldInterceptClassLoading​(java.lang.String className)
        Returns whether a given class will have it classloading intercepted for live class reloading.
        Since:
        5.8.3