KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > api > type > TypeFactory


1 /***
2  * Fractal API
3  * Copyright (C) 2001-2002 France Telecom, INRIA
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: fractal@objectweb.org
20  *
21  * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet,
22  * Philippe Merle, Jean-Bernard Stefani.
23  */

24
25 package org.objectweb.fractal.api.type;
26
27 import org.objectweb.fractal.api.factory.InstantiationException;
28
29 /**
30  * A component interface to create component and interface type objects.
31  */

32
33 public interface TypeFactory {
34
35   /**
36    * The <tt>isClient</tt> value to be used in {@link
37    * #createFcItfType createFcItfType} to create a server interface type.
38    */

39
40   boolean SERVER = false;
41
42   /**
43    * The <tt>isClient</tt> value to be used in {@link
44    * #createFcItfType createFcItfType} to create a client interface type.
45    */

46
47   boolean CLIENT = true;
48
49   /**
50    * The <tt>isOptional</tt> value to be used in {@link
51    * #createFcItfType createFcItfType} to create a mandatory interface type.
52    */

53
54   boolean MANDATORY = false;
55
56   /**
57    * The <tt>isOptional</tt> value to be used in {@link
58    * #createFcItfType createFcItfType} to create an optional interface type.
59    */

60
61   boolean OPTIONAL = true;
62
63   /**
64    * The <tt>isCollection</tt> value to be used in {@link
65    * #createFcItfType createFcItfType} to create a singleton interface type.
66    */

67
68   boolean SINGLE = false;
69
70   /**
71    * The <tt>isCollection</tt> value to be used in {@link
72    * #createFcItfType createFcItfType} to create a collection interface type.
73    */

74
75   boolean COLLECTION = true;
76
77   /**
78    * Creates an interface type.
79    *
80    * @param name the name of interfaces of this type (see {@link
81    * InterfaceType#getFcItfName getFcItfName}).
82    * @param signature signatures of the methods of interfaces of this type. In
83    * Java this "signature" is the fully qualified name of a Java interface
84    * corresponding to these method signatures.
85    * @param isClient <tt>true</tt> if component interfaces of this type are
86    * client interfaces.
87    * @param isOptional <tt>true</tt> if component interfaces of this type are
88    * optional interfaces.
89    * @param isCollection <tt>true</tt> if a component may have several
90    * interfaces of this type.
91    * @return an interface type initialized with the given values.
92    * @throws InstantiationException if the interface type cannot be created.
93    */

94
95   InterfaceType createFcItfType (
96     String JavaDoc name,
97     String JavaDoc signature,
98     boolean isClient,
99     boolean isOptional,
100     boolean isCollection) throws InstantiationException JavaDoc;
101
102   /**
103    * Creates a component type.
104    *
105    * @param interfaceTypes the interface types of the component type to be
106    * created.
107    * @return a component type whose {@link ComponentType#getFcInterfaceTypes
108    * getFcInterfaceTypes} method returns an array equal to
109    * <tt>interfaceTypes</tt>.
110    * @throws InstantiationException if the component type cannot be created.
111    */

112
113   ComponentType createFcType (InterfaceType[] interfaceTypes)
114     throws InstantiationException JavaDoc;
115 }
116
Popular Tags