KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > descriptor > componentassembly > ccm > deployer > base > BaseHandlerResolver


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Briclet Frédéric.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base;
28
29 //Package dependencies.
30
import java.util.Hashtable JavaDoc;
31 import org.objectweb.apollon.framework.Bean;
32
33 /**
34  * The BaseHandlerResolver is a basic implementation to resolve the binding between
35  * an appolon bean and the package where is the deployer in charge to manage it.
36  *
37  * @author <a HREF="mailto:briclet@lifl.fr">Frederic Briclet</a>
38  *
39  * @version 0.1
40  */

41 public class BaseHandlerResolver
42     implements HandlerResolver
43 {
44     // ==================================================================
45
//
46
// Internal state.
47
//
48
// ==================================================================
49
//Internal table to memorise the binding
50
private Hashtable JavaDoc convertion;
51
52     // ==================================================================
53
//
54
// Constructors.
55
//
56
// ==================================================================
57
/**
58      * BaseHandlerResolver which initialize the resolution table.
59      */

60     public BaseHandlerResolver() {
61         convertion = new Hashtable JavaDoc();
62
63         convertion.put(
64             "org.objectweb.openccm.descriptor.componentassembly.beans.ComponentsupportedinterfaceBeanImpl",
65             "ccm.deployer.binder.Deployer");
66         convertion.put(
67             "org.objectweb.openccm.descriptor.componentassembly.beans.ConnecteventBeanImpl",
68             "ccm.deployer.binder.Deployer");
69         convertion.put(
70             "org.objectweb.openccm.descriptor.componentassembly.beans.ConnectinterfaceBeanImpl",
71             "ccm.deployer.binder.Deployer");
72         convertion.put(
73             "org.objectweb.openccm.descriptor.componentassembly.beans.ConnectionsBeanImpl",
74             "ccm.deployer.binder.Deployer");
75         convertion.put(
76             "org.objectweb.openccm.descriptor.componentassembly.beans.ConsumesportBeanImpl",
77             "ccm.deployer.binder.Deployer");
78         convertion.put(
79             "org.objectweb.openccm.descriptor.componentassembly.beans.EmitsportBeanImpl",
80             "ccm.deployer.binder.Deployer");
81         convertion.put(
82             "org.objectweb.openccm.descriptor.componentassembly.beans.ExistinghomeBeanImpl",
83             "ccm.deployer.installer.Deployer");
84         convertion.put(
85             "org.objectweb.openccm.descriptor.componentassembly.beans.ExistinginterfaceBeanImpl",
86             "ccm.deployer.binder.Deployer");
87         convertion.put(
88             "org.objectweb.openccm.descriptor.componentassembly.beans.HomeinterfaceBeanImpl",
89             "ccm.deployer.binder.Deployer");
90         convertion.put(
91             "org.objectweb.openccm.descriptor.componentassembly.beans.ProvidesportBeanImpl",
92             "ccm.deployer.binder.Deployer");
93         convertion.put(
94             "org.objectweb.openccm.descriptor.componentassembly.beans.PublishesportBeanImpl",
95             "ccm.deployer.binder.Deployer");
96         convertion.put(
97             "org.objectweb.openccm.descriptor.componentassembly.beans.TraderqueryBeanImpl",
98             "ccm.deployer.binder.Deployer");
99         convertion.put(
100             "org.objectweb.openccm.descriptor.componentassembly.beans.UsesportBeanImpl",
101             "ccm.deployer.binder.Deployer");
102         convertion.put(
103             "org.objectweb.openccm.descriptor.componentassembly.beans.ComponentfileBeanImpl",
104             "ccm.deployer.installer.Deployer");
105         convertion.put(
106             "org.objectweb.openccm.descriptor.componentassembly.beans.ComponentfilesBeanImpl",
107             "ccm.deployer.installer.Deployer");
108         convertion.put(
109             "org.objectweb.openccm.descriptor.componentassembly.beans.ComponentinstantiationBeanImpl",
110             "ccm.deployer.installer.Deployer");
111         convertion.put(
112             "org.objectweb.openccm.descriptor.componentassembly.beans.ComponentplacementBeanImpl",
113             "ccm.deployer.installer.Deployer");
114         convertion.put(
115             "org.objectweb.openccm.descriptor.componentassembly.beans.ComponentpropertiesBeanImpl",
116             "ccm.deployer.installer.Deployer");
117         convertion.put(
118             "org.objectweb.openccm.descriptor.componentassembly.beans.DestinationBeanImpl",
119             "ccm.deployer.installer.Deployer");
120         convertion.put(
121             "org.objectweb.openccm.descriptor.componentassembly.beans.HomeplacementBeanImpl",
122             "ccm.deployer.installer.Deployer");
123         convertion.put(
124             "org.objectweb.openccm.descriptor.componentassembly.beans.HostcollocationBeanImpl",
125             "ccm.deployer.installer.Deployer");
126         convertion.put(
127             "org.objectweb.openccm.descriptor.componentassembly.beans.PartitioningBeanImpl",
128             "ccm.deployer.installer.Deployer");
129         convertion.put(
130             "org.objectweb.openccm.descriptor.componentassembly.beans.ProcesscollocationBeanImpl",
131             "ccm.deployer.installer.Deployer");
132         convertion.put(
133             "org.objectweb.openccm.descriptor.componentassembly.beans.NodeBeanImpl",
134             "ccm.deployer.installer.Deployer");
135         convertion.put(
136             "org.objectweb.openccm.descriptor.componentassembly.beans.RegistercomponentBeanImpl",
137             "ccm.deployer.registrar.Deployer");
138         convertion.put(
139             "org.objectweb.openccm.descriptor.componentassembly.beans.RegisterwithhomefinderBeanImpl",
140             "ccm.deployer.registrar.Deployer");
141         convertion.put(
142             "org.objectweb.openccm.descriptor.componentassembly.beans.RegisterwithnamingBeanImpl",
143             "ccm.deployer.registrar.Deployer");
144         convertion.put(
145             "org.objectweb.openccm.descriptor.componentassembly.beans.RegisterwithtraderBeanImpl",
146             "ccm.deployer.registrar.Deployer");
147         convertion.put(
148             "org.objectweb.openccm.descriptor.componentassembly.beans.ComponentassemblyBeanImpl",
149             "ccm.deployer.root.Deployer");
150         convertion.put(
151             "org.objectweb.openccm.descriptor.componentassembly.beans.FileinarchiveBeanImpl",
152             "ccm.deployer.util.Deployer");
153         convertion.put(
154             "org.objectweb.openccm.descriptor.componentassembly.beans.FindbyBeanImpl",
155             "ccm.deployer.util.Deployer");
156         convertion.put(
157             "org.objectweb.openccm.descriptor.componentassembly.beans.LinkBeanImpl",
158             "ccm.deployer.util.Deployer");
159         convertion.put(
160             "org.objectweb.openccm.descriptor.softpkg.beans.CodeBeanImpl",
161             "ccm.Deployer");
162         convertion.put(
163             "org.objectweb.openccm.descriptor.softpkg.beans.DependencyBeanImpl",
164             "ccm.Deployer");
165         convertion.put(
166             "org.objectweb.openccm.descriptor.softpkg.beans.FileinarchiveBeanImpl",
167             "ccm.Deployer");
168         convertion.put(
169             "org.objectweb.openccm.descriptor.softpkg.beans.ImplementationBeanImpl",
170             "ccm.Deployer");
171         convertion.put(
172             "org.objectweb.openccm.descriptor.softpkg.beans.SoftpkgBeanImpl",
173             "ccm.Deployer");
174         convertion.put(
175             "org.objectweb.openccm.descriptor.softpkg.beans.DescriptorBeanImpl",
176             "ccm.Deployer");
177         convertion.put(
178             "org.objectweb.openccm.descriptor.softpkg.beans.LinkBeanImpl",
179             "ccm.Deployer");
180         convertion.put(
181             "org.objectweb.openccm.descriptor.corbacomponent.beans.CorbacomponentBeanImpl",
182             "ccm.Deployer");
183
184     }
185     // ==================================================================
186
//
187
// Internal methods.
188
//
189
// ==================================================================
190
// ==================================================================
191
//
192
// Public methods for AN_INTERFACE.
193
//
194
// ==================================================================
195

196     /**
197      * The getExtension method provided the relative package path of the
198      * deployer in charge of the @param bean element kind. The root of this
199      * relative path is the org.objectweb.descriptor package.
200      * Note: This method is usefull to use the appollon handler mecanisme.
201      *
202      * @param bean The bean kind which requires the deployer.
203      * @return The relative path needed to find the deployer with the extension
204      * manager mechanism
205      */

206     public String JavaDoc
207     getExtension(Bean bean)
208     {
209         return (String JavaDoc) convertion.get(bean.getClass().getName());
210     }
211
212 }
213
Popular Tags