KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > servicemix > jbi > deployment > impl > JbiNamespaceProcessor


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.servicemix.jbi.deployment.impl;
18
19 import org.apache.servicemix.jbi.config.spring.BeanElementProcessor;
20 import org.apache.servicemix.jbi.config.spring.CompositeElementProcessor;
21 import org.apache.servicemix.jbi.deployment.ClassPath;
22 import org.apache.servicemix.jbi.deployment.Connection;
23 import org.apache.servicemix.jbi.deployment.Connections;
24 import org.apache.servicemix.jbi.deployment.Consumer;
25 import org.apache.servicemix.jbi.deployment.Consumes;
26 import org.apache.servicemix.jbi.deployment.Descriptor;
27 import org.apache.servicemix.jbi.deployment.Identification;
28 import org.apache.servicemix.jbi.deployment.Provider;
29 import org.apache.servicemix.jbi.deployment.Provides;
30 import org.apache.servicemix.jbi.deployment.ServiceAssembly;
31 import org.apache.servicemix.jbi.deployment.ServiceUnit;
32 import org.apache.servicemix.jbi.deployment.Services;
33 import org.apache.servicemix.jbi.deployment.SharedLibrary;
34 import org.apache.servicemix.jbi.deployment.SharedLibraryList;
35 import org.apache.servicemix.jbi.deployment.Target;
36
37 /**
38  * @version $Revision: 426415 $
39  */

40 public class JbiNamespaceProcessor extends CompositeElementProcessor {
41     public static final String JavaDoc JBI_NAMESPACE = "http://java.sun.com/xml/ns/jbi";
42
43     private BeanElementProcessor sharedListProcessor;
44
45     public JbiNamespaceProcessor() {
46         super(JBI_NAMESPACE);
47     }
48
49     protected void loadLocalNameToProcessorMap() {
50
51         // TODO we can hopefully code generate this one day using annotations
52
// etc?
53
registerBeanPropertyProcessor("bootstrap-class-path", ClassPath.class);
54         registerBeanPropertyProcessor("component-class-path", ClassPath.class);
55         registerProcessor("component", new ComponentElementProcessor(this));
56         registerBeanProcessor("connection", Connection.class);
57         registerBeanPropertyProcessor("connections", Connections.class);
58         registerBeanPropertyProcessor("consumer", Consumer.class);
59         registerBeanProcessor("consumes", Consumes.class);
60         registerBeanPropertyProcessor("identification", Identification.class);
61         registerBeanProcessor("jbi", Descriptor.class);
62         registerValueAlias("path-element");
63         registerBeanPropertyProcessor("provider", Provider.class);
64         registerBeanProcessor("provides", Provides.class);
65         registerBeanPropertyProcessor("service-assembly", ServiceAssembly.class);
66         registerBeanPropertyProcessor("services", Services.class);
67         registerBeanProcessor("service-unit", ServiceUnit.class);
68         registerBeanPropertyProcessor("target", Target.class);
69         registerBeanPropertyProcessor("shared-library", SharedLibrary.class);
70         registerBeanPropertyProcessor("shared-library-class-path", ClassPath.class);
71         
72         sharedListProcessor = registerBeanProcessor("shared-library-list",
73                 SharedLibraryList.class, "name");
74     }
75
76     public BeanElementProcessor getSharedListProcessor() {
77         return sharedListProcessor;
78     }
79 }
80
Popular Tags