01: /*
02: * The contents of this file are subject to the Sapient Public License
03: * Version 1.0 (the "License"); you may not use this file except in compliance
04: * with the License. You may obtain a copy of the License at
05: * http://carbon.sf.net/License.html.
06: *
07: * Software distributed under the License is distributed on an "AS IS" basis,
08: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
09: * the specific language governing rights and limitations under the License.
10: *
11: * The Original Code is The Carbon Component Framework.
12: *
13: * The Initial Developer of the Original Code is Sapient Corporation
14: *
15: * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16: */
17:
18: package org.sape.carbon.core.component.proxy;
19:
20: import org.sape.carbon.core.component.Component;
21:
22: /**
23: * <p>Instances of this interface are used to expose additional capabilities
24: * onto a carbon component by being represented in the component facade. The
25: * classes that are exposed are defined through the
26: * <code>getExposedInterfaces</code> method. Those classes are then recognized
27: * by the component facade to be implemented by the decorator object that
28: * declared them. All calls to those interfaces are targeted for execution
29: * by that decorator.</p>
30: *
31: *
32: * Copyright 2002 Sapient
33: * @since carbon 2.0
34: * @author Greg Hinkle, March 2003
35: * @version $Revision: 1.4 $($Author: dvoet $ / $Date: 2003/05/05 21:21:14 $)
36: */
37: public interface Decorator {
38:
39: /**
40: * This should return the list of interfaces that a decorator wishes to
41: * expose through the component proxy. This is used by the
42: * component factory to determine what interfaces the component proxy will
43: * implement.
44: *
45: * @return Class[] an array of interfaces
46: */
47: Class[] getExposedInterfaces();
48:
49: /**
50: * Called after creation to pass a reference to the component to each of
51: * its decorators. The component reference should not be used within
52: * this method because not all other interceptors have this reference yet
53: * and they may rely on this reference thus leading to null pointer
54: * exceptions.
55: *
56: * @param component a reference to the component that this interceptor is
57: * assisting
58: */
59: void setComponentReference(Component component);
60: }
|