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 java.lang.reflect.InvocationHandler;
21:
22: import org.sape.carbon.core.component.FunctionalInterface;
23: import org.sape.carbon.core.util.thread.ReadWriteLock;
24:
25: /**
26: * <P>This interface will be implemented by objects wishing to be
27: * <code>InvocationHandler</code>s for a component's proxy object. The
28: * ComponentProxy is the object that aggregates all of a component's parts.</p>
29: *
30: * Copyright 2002 Sapient
31: * @since carbon 1.0
32: * @author Greg Hinkle, January 2002
33: * @version $Revision: 1.20 $($Author: dvoet $ / $Date: 2003/05/05 21:21:14 $)
34: */
35: public interface ComponentProxyInvocationHandler extends
36: InvocationHandler {
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(Class[] implementedInterfaces,
63: FunctionalInterface functionalImplementation);
64:
65: /**
66: * Retrieves the delegate class that will be invoked for calls to the
67: * provide interface class.
68: *
69: * @param delegateInterface the interface to look for the delegate of
70: * @return Object the instance of the delegate
71: */
72: Object getDelegate(Class delegateInterface);
73:
74: /**
75: * Retrieves the monitor object for the component represented by the
76: * proxy object implemented through this invocation handler.
77: *
78: * @return a read write lock for this component
79: */
80: ReadWriteLock getMonitor();
81:
82: /**
83: * Returns the name of the wrapped component.
84: * @return String
85: */
86: String getComponentName();
87:
88: /**
89: * Sets the name of wrapped component.
90: *
91: * @param name the name of the component
92: */
93: void setComponentName(String name);
94: }
|