KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > component > proxy > Decorator


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * 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 JavaDoc[] getExposedInterfaces();
48
49
50     /**
51      * Called after creation to pass a reference to the component to each of
52      * its decorators. The component reference should not be used within
53      * this method because not all other interceptors have this reference yet
54      * and they may rely on this reference thus leading to null pointer
55      * exceptions.
56      *
57      * @param component a reference to the component that this interceptor is
58      * assisting
59      */

60     void setComponentReference(Component component);
61 }
62
Popular Tags