01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent;
19:
20: import de.finix.contelligent.render.ParameterDescription;
21:
22: /**
23: * A <code>ComponentLink</code> holds the path to a {@link Component} and acts
24: * as an {@link InvocationHandler} for {@link Proxy} instances. <BR>
25: *
26: * Components implementing this interface are treated by the component-manager
27: * in a special way:<BR>
28: *
29: * If the component-manager loads a component from the database and recognizes
30: * that this component implements the ComponentLink interface it produces a
31: * proxy instance for the target-component
32: * {@link #getTargetPath() this link points to} and returns this proxy instance
33: * instead of the component.
34: *
35: * The proxy then delegates every call to its invocation-handler which will
36: * normally be the same instance implementing this interface and finally the
37: * call is delegated to the target component.
38: */
39: public interface ComponentLink extends Component {
40:
41: /**
42: * Returns the path of the component the links points to.
43: *
44: * @return a <code>String</code> value
45: */
46: public ComponentPath getTargetPath();
47:
48: /**
49: * Sets the name of the component the links points to. <BR>
50: * Note that some implementations may not support the modification of their
51: * link target, in this case this method should silently return.
52: *
53: * @param targetPath
54: * a <code>String</code> value
55: */
56: public void setTargetPath(ComponentPath targetPath);
57:
58: /**
59: * This method is kind of deprecated ... we don't generate dynamic proxies
60: * for links but return the real target instead of a proxy. Therefor this
61: * method calls {@link #getTargetComponent} and may throw an
62: * <code>ComponentNotFoundException</code>.
63: *
64: * @return a <code>Component</code> value
65: */
66: public Component getProxyInstance()
67: throws ComponentNotFoundException;
68:
69: public ParameterDescription[] getParameterDescription();
70:
71: }
|