001 // Copyright 2004, 2005 The Apache Software Foundation
002 //
003 // Licensed under the Apache License, Version 2.0 (the "License");
004 // you may not use this file except in compliance with the License.
005 // You may obtain a copy of the License at
006 //
007 // http://www.apache.org/licenses/LICENSE-2.0
008 //
009 // Unless required by applicable law or agreed to in writing, software
010 // distributed under the License is distributed on an "AS IS" BASIS,
011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 // See the License for the specific language governing permissions and
013 // limitations under the License.
014
015 package org.apache.tapestry.engine;
016
017 import org.apache.tapestry.spec.IComponentSpecification;
018
019 /**
020 * A provider of enhanced classes, classes with new methods and new attributes,
021 * and possibly, implementing new Java interfaces. The primary use of class
022 * enhancement is to automate the creation of transient and persistant
023 * properties.
024 * <p>
025 * Implementations of this interface must be threadsafe.
026 *
027 * @author Howard Lewis Ship
028 * @since 3.0
029 * @deprecated To be removed in 4.1
030 * @see org.apache.tapestry.services.ComponentConstructorFactory
031 */
032
033 public interface IComponentClassEnhancer
034 {
035
036 /**
037 * Used to access the class for a given component (or page). Returns the
038 * specified class, or an enhanced version of the class if the component
039 * requires enhancement.
040 *
041 * @param specification
042 * the specification for the component
043 * @param className
044 * the name of base class to enhance, as extracted from the
045 * specification (or possibly, from a default).
046 * @throws org.apache.tapestry.ApplicationRuntimeException
047 * if the class does not exist, is invalid, or may not be
048 * enhanced.
049 */
050
051 Class getEnhancedClass(IComponentSpecification specification,
052 String className);
053 }