01: /**
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: * ConfigExtensionRegistry
22: * LPS
23: * Sep 14, 2007
24: */package com.bostechcorp.cbesb.common.util.generators.wsdl.extensions;
25:
26: import javax.wsdl.Binding;
27: import javax.wsdl.Port;
28: import javax.xml.namespace.QName;
29:
30: import com.ibm.wsdl.extensions.PopulatedExtensionRegistry;
31:
32: /**
33: * @author LPS
34: *
35: */
36: public class ConfigExtensionRegistry extends PopulatedExtensionRegistry {
37: private static final long serialVersionUID = -859531542921699088L;
38:
39: /**
40: *
41: */
42: public ConfigExtensionRegistry(String componentType, String prefix,
43: String componentURI) {
44: super ();
45: ConfigSerializer serializer = new ConfigSerializer();
46: //registering serializer
47: registerSerializer(Port.class, ConfigConstants.Q_ELEM_CONFIG(
48: componentType, prefix, componentURI), serializer);
49: //register deserializer
50: registerDeserializer(Port.class, ConfigConstants.Q_ELEM_CONFIG(
51: componentType, prefix, componentURI), serializer);
52: //registerig extention type
53: mapExtensionTypes(Port.class, ConfigConstants.Q_ELEM_CONFIG(
54: componentType, prefix, componentURI),
55: ConfigExtension.class);
56: //Reigistering Binding element
57: BindingSerializer bindingSerializer = new BindingSerializer();
58: //registering serializer
59: registerSerializer(Binding.class, ConfigConstants
60: .Q_ELEM_BINDING(componentType, prefix, componentURI),
61: bindingSerializer);
62: //register deserializer
63: registerDeserializer(Binding.class, ConfigConstants
64: .Q_ELEM_BINDING(componentType, prefix, componentURI),
65: bindingSerializer);
66: //registerig extention type
67: mapExtensionTypes(Binding.class, ConfigConstants
68: .Q_ELEM_BINDING(componentType, prefix, componentURI),
69: BindingExtension.class);
70:
71: }
72:
73: public void customTagRegister(QName qname) {
74: CustomTagSerializer serializer = new CustomTagSerializer();
75: //registering serializer
76: registerSerializer(Port.class, qname, serializer);
77: //register deserializer
78: registerDeserializer(Port.class, qname, serializer);
79: //registerig extention type
80: mapExtensionTypes(Port.class, qname, CustomTagExtension.class);
81: }
82:
83: public void trxIdTagRegister() {
84: TrxIdSerializer serializer = new TrxIdSerializer();
85:
86: //registering serializer
87: registerSerializer(ConfigExtension.class,
88: TrxIdConstants.Q_ELEM_TRX_ID, serializer);
89: //register deserializer
90: registerDeserializer(ConfigExtension.class,
91: TrxIdConstants.Q_ELEM_TRX_ID, serializer);
92: //registerig extention type
93: mapExtensionTypes(ConfigExtension.class,
94: TrxIdConstants.Q_ELEM_TRX_ID, TrxIdExtension.class);
95: }
96: }
|