KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.lang.reflect.InvocationHandler JavaDoc;
21
22 import org.sape.carbon.core.component.FunctionalInterface;
23 import org.sape.carbon.core.util.thread.ReadWriteLock;
24
25
26 /**
27  * <P>This interface will be implemented by objects wishing to be
28  * <code>InvocationHandler</code>s for a component's proxy object. The
29  * ComponentProxy is the object that aggregates all of a component's parts.</p>
30  *
31  * Copyright 2002 Sapient
32  * @since carbon 1.0
33  * @author Greg Hinkle, January 2002
34  * @version $Revision: 1.20 $($Author: dvoet $ / $Date: 2003/05/05 21:21:14 $)
35  */

36 public interface ComponentProxyInvocationHandler extends InvocationHandler JavaDoc {
37
38     /**
39      * Method used during creation of the proxy object to add Assistants
40      * to the component. This mehtod should be called only from the
41      * ComponentFactory when it is creating a new component.
42      *
43      * @see org.sape.carbon.core.component.factory.ComponentFactory
44      * @since carbon 2.0
45      */

46     void addDecorator(Decorator decorator);
47
48     /**
49      * Method used during creation of the proxy object to add the
50      * functional implementation
51      * to the component. This mehtod should be called only from the
52      * ComponentFactory when it is creating a new component.
53      *
54      * @see org.sape.carbon.core.component.factory.ComponentFactory
55      *
56      * @param implementedInterfaces all the interfaces (including
57      * super interfaces) implemented by functionalImplementation's
58      * FunctionalInterface
59      * @param functionalImplementation the object that implements the
60      * components FunctionalInterface
61      */

62     void setFunctionalImplementation(
63             Class JavaDoc[] implementedInterfaces,
64             FunctionalInterface functionalImplementation);
65
66
67
68     /**
69      * Retrieves the delegate class that will be invoked for calls to the
70      * provide interface class.
71      *
72      * @param delegateInterface the interface to look for the delegate of
73      * @return Object the instance of the delegate
74      */

75     Object JavaDoc getDelegate(Class JavaDoc delegateInterface);
76
77     /**
78      * Retrieves the monitor object for the component represented by the
79      * proxy object implemented through this invocation handler.
80      *
81      * @return a read write lock for this component
82      */

83     ReadWriteLock getMonitor();
84
85     /**
86      * Returns the name of the wrapped component.
87      * @return String
88      */

89     String JavaDoc getComponentName();
90
91     /**
92      * Sets the name of wrapped component.
93      *
94      * @param name the name of the component
95      */

96     void setComponentName(String JavaDoc name);
97 }
98
Popular Tags