All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.deltaspike.proxy.spi.ProxyClassGenerator Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.deltaspike.proxy.spi;

public interface ProxyClassGenerator
{
    /**
     * Generates a proxy class from the given source class.
     * The proxy class will be generated in the same package as the original class
     * and the suffix will be appended to the name of the class.
     * 
     * @param  The target class.
     * @param classLoader The {@link ClassLoader} to be used to define the proxy class.
     * @param targetClass The class to proxy.
     * @param suffix The classname suffix.
     * @param superAccessorMethodSuffix It's required to generate methods which just invokes the original method.
     *                                  We generate them with the same name as the original method
     *                                  and append the suffix.
     * @param additionalInterfaces Additional interfaces which should be implemented.
     * @param delegateMethods Methods which should be delegated to the {@code delegateInvocationHandlerClass}
     *                        instead of invoking the original method.
     * @param interceptMethods Methods which should be intercepted (to call interceptors or decorators)
     *                         before invoking the original method.
     * @return The generated proxy class.
     */
     Class generateProxyClass(ClassLoader classLoader,
                                    Class targetClass,
                                    String suffix,
                                    String superAccessorMethodSuffix,
                                    Class[] additionalInterfaces,
                                    java.lang.reflect.Method[] delegateMethods,
                                    java.lang.reflect.Method[] interceptMethods);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy