KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > jaxws > DynamicDataBindingCallback


1 package org.objectweb.celtix.bus.jaxws;
2
3 import java.util.logging.Level JavaDoc;
4 import java.util.logging.Logger JavaDoc;
5
6 import javax.jws.WebParam;
7 import javax.jws.WebResult;
8 import javax.jws.WebService;
9 import javax.jws.soap.SOAPBinding.ParameterStyle;
10 import javax.jws.soap.SOAPBinding.Style;
11 import javax.jws.soap.SOAPBinding.Use;
12 import javax.xml.bind.JAXBContext;
13 import javax.xml.namespace.QName JavaDoc;
14 import javax.xml.soap.SOAPBody JavaDoc;
15
16 import org.objectweb.celtix.bindings.DataBindingCallback;
17 import org.objectweb.celtix.bindings.DataReader;
18 import org.objectweb.celtix.bindings.DataWriter;
19 import org.objectweb.celtix.bus.jaxws.io.SOAPBodyDataReader;
20 import org.objectweb.celtix.bus.jaxws.io.SOAPBodyDataWriter;
21 import org.objectweb.celtix.bus.jaxws.io.SOAPMessageDataReader;
22 import org.objectweb.celtix.bus.jaxws.io.SOAPMessageDataWriter;
23 import org.objectweb.celtix.common.logging.LogUtils;
24 import org.objectweb.celtix.context.ObjectMessageContext;
25
26 public class DynamicDataBindingCallback implements DataBindingCallback {
27     
28     private static final Logger JavaDoc LOG = LogUtils.getL7dLogger(DynamicDataBindingCallback.class);
29     
30     protected final Mode mode;
31     protected final Class JavaDoc<?>[] clazz;
32     protected final JAXBContext context;
33     
34     public DynamicDataBindingCallback(Class JavaDoc<?> cls, Mode md) {
35         mode = md;
36         clazz = new Class JavaDoc<?>[] {cls};
37         context = null;
38     }
39     
40     public DynamicDataBindingCallback(JAXBContext ctx, Mode md) {
41         mode = md;
42         context = ctx;
43         clazz = new Class JavaDoc<?>[] {Object JavaDoc.class};
44     }
45
46     public Mode getMode() {
47         return mode;
48     }
49     
50     public JAXBContext getJAXBContext() {
51         return context;
52     }
53
54     public Class JavaDoc<?>[] getSupportedFormats() {
55         return clazz;
56     }
57
58     public <T> DataWriter<T> createWriter(Class JavaDoc<T> cls) {
59         if (getMode() == Mode.MESSAGE) {
60             return new SOAPMessageDataWriter<T>(this);
61         } else if ((getMode() == Mode.PAYLOAD) && (cls.isAssignableFrom(SOAPBody JavaDoc.class))) {
62             return new SOAPBodyDataWriter<T>(this);
63         }
64         LOG.log(Level.SEVERE, "No DataWriter for class: " + cls.getName());
65         return null;
66     }
67
68     public <T> DataReader<T> createReader(Class JavaDoc<T> cls) {
69         if (getMode() == Mode.MESSAGE) {
70             return new SOAPMessageDataReader<T>(this);
71         } else if ((getMode() == Mode.PAYLOAD) && (cls.isAssignableFrom(SOAPBody JavaDoc.class))) {
72             return new SOAPBodyDataReader<T>(this);
73         }
74         LOG.log(Level.SEVERE, "No DataReader for class: " + cls.getName());
75         return null;
76     }
77
78     public Style getSOAPStyle() {
79         // TODO Auto-generated method stub
80
return null;
81     }
82
83     public Use getSOAPUse() {
84         // TODO Auto-generated method stub
85
return null;
86     }
87
88     public ParameterStyle getSOAPParameterStyle() {
89         // TODO Auto-generated method stub
90
return null;
91     }
92
93     public String JavaDoc getOperationName() {
94         // TODO Auto-generated method stub
95
return null;
96     }
97
98     public String JavaDoc getTargetNamespace() {
99         // TODO Auto-generated method stub
100
return null;
101     }
102
103     public String JavaDoc getSOAPAction() {
104         // TODO Auto-generated method stub
105
return null;
106     }
107
108     public WebResult getWebResult() {
109         // TODO Auto-generated method stub
110
return null;
111     }
112
113     public QName JavaDoc getWebResultQName() {
114         // TODO Auto-generated method stub
115
return null;
116     }
117
118     public WebParam getWebParam(int index) {
119         // TODO Auto-generated method stub
120
return null;
121     }
122
123     public int getParamsLength() {
124         // TODO Auto-generated method stub
125
return 0;
126     }
127
128     public WebResult getWebResultAnnotation() {
129         // TODO Auto-generated method stub
130
return null;
131     }
132
133     public WebService getWebService() {
134         // TODO Auto-generated method stub
135
return null;
136     }
137
138     public QName JavaDoc getRequestWrapperQName() {
139         // TODO Auto-generated method stub
140
return null;
141     }
142
143     public String JavaDoc getRequestWrapperType() {
144         // TODO Auto-generated method stub
145
return null;
146     }
147
148     public QName JavaDoc getResponseWrapperQName() {
149         // TODO Auto-generated method stub
150
return null;
151     }
152
153     public String JavaDoc getResponseWrapperType() {
154         // TODO Auto-generated method stub
155
return null;
156     }
157
158     public boolean isOneWay() {
159         // TODO Auto-generated method stub
160
return false;
161     }
162
163     public void initObjectContext(ObjectMessageContext octx) {
164         // TODO Auto-generated method stub
165
//REVISIT
166
}
167
168
169 }
170
Popular Tags