ComponentLink.java :  » Content-Management-System » contelligent » de » finix » contelligent » Java Open Source

Java Open Source » Content Management System » contelligent 
contelligent » de » finix » contelligent » ComponentLink.java
/*
 * Copyright 2001-2006 C:1 Financial Services GmbH
 *
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License Version 2.1, as published by the Free Software Foundation.
 *
 * This software 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 library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
 */

package de.finix.contelligent;

import de.finix.contelligent.render.ParameterDescription;

/**
 * A <code>ComponentLink</code> holds the path to a {@link Component} and acts
 * as an {@link InvocationHandler} for {@link Proxy} instances. <BR>
 * 
 * Components implementing this interface are treated by the component-manager
 * in a special way:<BR>
 * 
 * If the component-manager loads a component from the database and recognizes
 * that this component implements the ComponentLink interface it produces a
 * proxy instance for the target-component
 * {@link #getTargetPath() this link points to} and returns this proxy instance
 * instead of the component.
 * 
 * The proxy then delegates every call to its invocation-handler which will
 * normally be the same instance implementing this interface and finally the
 * call is delegated to the target component.
 */
public interface ComponentLink extends Component {

    /**
     * Returns the path of the component the links points to.
     * 
     * @return a <code>String</code> value
     */
    public ComponentPath getTargetPath();

    /**
     * Sets the name of the component the links points to. <BR>
     * Note that some implementations may not support the modification of their
     * link target, in this case this method should silently return.
     * 
     * @param targetPath
     *            a <code>String</code> value
     */
    public void setTargetPath(ComponentPath targetPath);

    /**
     * This method is kind of deprecated ... we don't generate dynamic proxies
     * for links but return the real target instead of a proxy. Therefor this
     * method calls {@link #getTargetComponent} and may throw an
     * <code>ComponentNotFoundException</code>.
     * 
     * @return a <code>Component</code> value
     */
    public Component getProxyInstance() throws ComponentNotFoundException;

    public ParameterDescription[] getParameterDescription();

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.