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: /**
21: * A {@link Container} which must be informed when either one of its
22: * subcomponents gets {@link #subcomponentRemoved removed} or a new one was
23: * {@link #subcomponentAdded added}.
24: */
25: public interface ObservingContainer extends Container {
26:
27: /**
28: * Gets called by the Contelligent system whenever a new subcomponent should
29: * be added to this container. If the container does not allow the addition
30: * of the given component a <code>ModificationVetoException</code> must be
31: * thrown.
32: *
33: * @param callData
34: * a <code>CallData</code> value
35: * @param newSubcomponent
36: * a <code>Component</code> value
37: * @return true if the container changed because of this call.
38: * @exception ModificationVetoException
39: * if the container does not allow the addition of the given
40: * component.
41: */
42: boolean subcomponentAdded(CallData callData,
43: Component newSubcomponent) throws ModificationVetoException;
44:
45: /**
46: * Gets called by the Contelligent system whenever any subcomponent of this
47: * container should be removed. If the container does not allow the deletion
48: * of the given component a <code>ModificationVetoException</code> must be
49: * thrown.
50: *
51: * @param callData
52: * a <code>CallData</code> value
53: * @param name
54: * a non-empty <code>String</code> value - the name of the
55: * subcomponent which was removed
56: * @return true if the container changed because of this call.
57: * @exception ModificationVetoException
58: * if the container does not allow the deletion of the given
59: * component.
60: */
61: boolean subcomponentRemoved(CallData callData,
62: Component subComponent) throws ModificationVetoException;
63:
64: boolean subcomponentChanged(CallData callData,
65: Component subComponent) throws ModificationVetoException;
66: }
|