/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.bytecode.spi; import org.hibernate.proxy.ProxyFactory; /** * An interface for factories of {@link ProxyFactory proxy factory} instances. * <p/> * Currently used to abstract from the tupizer whether we are using CGLIB or * Javassist for lazy proxy generation. * * @author Steve Ebersole */ public interface ProxyFactoryFactory { /** * Build a proxy factory specifically for handling runtime * lazy loading. * * @return The lazy-load proxy factory. */ public ProxyFactory buildProxyFactory(); /** * Build a proxy factory for basic proxy concerns. The return * should be capable of properly handling newInstance() calls. * <p/> * Should build basic proxies essentially equivalent to JDK proxies in * terms of capabilities, but should be able to deal with abstract super * classes in addition to proxy interfaces. * <p/> * Must pass in either superClass or interfaces (or both). * * @param superClass The abstract super class (or null if none). * @param interfaces Interfaces to be proxied (or null if none). * @return The proxy class */ public BasicProxyFactory buildBasicProxyFactory(Class superClass, Class[] interfaces); }