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, and possibly,
021 * implementing new Java interfaces. The primary use of class enhancement is to automate the
022 * creation of transient and persistant properties.
023 * <p>
024 * Implementations of this interface must be threadsafe.
025 *
026 * @author Howard Lewis Ship
027 * @since 3.0
028 * @deprecated To be removed in 4.1
029 * @see org.apache.tapestry.services.ComponentConstructorFactory
030 */
031
032 public interface IComponentClassEnhancer
033 {
034 /**
035 * Used to access the class for a given component (or page). Returns the specified class, or an
036 * enhanced version of the class if the component requires enhancement.
037 *
038 * @param specification
039 * the specification for the component
040 * @param className
041 * the name of base class to enhance, as extracted from the specification (or
042 * possibly, from a default).
043 * @throws org.apache.tapestry.ApplicationRuntimeException
044 * if the class does not exist, is invalid, or may not be enhanced.
045 */
046
047 public Class getEnhancedClass(IComponentSpecification specification, String className);
048 }