KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > component > ProActiveInterface


1 /*
2  * ################################################################
3  *
4  * ProActive: The Java(TM) library for Parallel, Distributed,
5  * Concurrent computing with Security and Mobility
6  *
7  * Copyright (C) 1997-2004 INRIA/University of Nice-Sophia Antipolis
8  * Contact: proactive-support@inria.fr
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23  * USA
24  *
25  * Initial developer(s): The ProActive Team
26  * http://www.inria.fr/oasis/ProActive/contacts.html
27  * Contributor(s):
28  *
29  * ################################################################
30  */

31 package org.objectweb.proactive.core.component;
32
33 import org.objectweb.fractal.api.Component;
34 import org.objectweb.fractal.api.Interface;
35 import org.objectweb.fractal.api.Type;
36
37 /**
38  * Abstract implementation of the Interface interface of the Fractal api.
39  * As functional interfaces are specified for each component, they are generated at
40  * instantiation time (bytecode generation), by subclassing this class.
41  *
42  * @author Matthieu Morel
43  */

44 public abstract class ProActiveInterface implements Interface, java.io.Serializable JavaDoc {
45     private Component owner;
46     private String JavaDoc name;
47     private Type type;
48     private boolean isInternal;
49
50     public ProActiveInterface() {
51     }
52
53     /**
54      * see {@link Interface#getFcItfOwner()}
55      */

56     public Component getFcItfOwner() {
57         return owner;
58     }
59
60     /**
61      * see {@link Interface#getFcItfName()}
62      */

63     public String JavaDoc getFcItfName() {
64         return name;
65     }
66
67     /**
68      * see {@link Interface#getFcItfType()}
69      */

70     public Type getFcItfType() {
71         return type;
72     }
73
74     /**
75      * see {@link org.objectweb.fractal.api.Interface#isFcInternalItf()}
76      */

77     public boolean isFcInternalItf() {
78         return isInternal;
79     }
80
81     /**
82      * Returns the isInternal.
83      * @return boolean
84      */

85     public boolean isInternal() {
86         return isInternal;
87     }
88
89     /**
90      * Returns the name.
91      * @return String
92      */

93     public String JavaDoc getName() {
94         return name;
95     }
96
97     /**
98      * Returns the owner.
99      * @return Component
100      */

101     public Component getOwner() {
102         return owner;
103     }
104
105     /**
106      * Returns the type.
107      * @return Type
108      */

109     public Type getType() {
110         return type;
111     }
112
113     /**
114      * Sets the isInternal.
115      * @param isInternal The isInternal to set
116      */

117     public void setIsInternal(boolean isInternal) {
118         this.isInternal = isInternal;
119     }
120
121     /**
122      * Sets the name.
123      * @param name The name to set
124      */

125     public void setName(String JavaDoc name) {
126         this.name = name;
127     }
128
129     /**
130      * Sets the owner.
131      * @param owner The owner to set
132      */

133     public void setOwner(Component owner) {
134         this.owner = owner;
135     }
136
137     /**
138      * Sets the type.
139      * @param type The type to set
140      */

141     public void setType(Type type) {
142         this.type = type;
143     }
144
145     /**
146      * getter
147      * @return the delegatee
148      */

149     public abstract Object JavaDoc getFcItfImpl();
150
151     /**
152      * Sets the object to which this interface reference object should delegate
153      * method calls.
154      *
155      * @param impl the object to which this interface reference object should
156      * delegate method calls.
157      * @see #getFcItfImpl getFcItfImpl
158      */

159     public abstract void setFcItfImpl(final Object JavaDoc impl);
160
161     
162     public String JavaDoc toString() {
163         String JavaDoc string =
164             "name : "
165                 + getFcItfName()
166                 + "\n"
167                 + "componentIdentity : "
168                 + getFcItfOwner()
169                 + "\n"
170                 + "type : "
171                 + getFcItfType()
172                 + "\n"
173                 + "isInternal : "
174                 + isFcInternalItf()
175                 + "\n";
176         return string;
177     }
178     
179
180 }
Popular Tags