1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.axis.message.addressing.handler;
17
18 import org.apache.axis.AxisFault;
19 import org.apache.axis.handlers.BasicHandler;
20 import org.apache.ws.addressing.uuid.AxisUUIdGenerator;
21 import org.apache.ws.addressing.uuid.UUIdGeneratorFactory;
22
23 import javax.xml.namespace.QName;
24 import javax.xml.rpc.JAXRPCException;
25 import javax.xml.rpc.handler.Handler;
26 import javax.xml.rpc.handler.HandlerInfo;
27
28
29
30
31
32
33
34
35
36
37 class GenericAxisHandler extends BasicHandler {
38
39
40
41
42 private static final long serialVersionUID = 8224510670209322980L;
43
44
45
46
47 private transient Handler jaxRpcHandler;
48
49
50
51
52
53
54 public GenericAxisHandler(Handler handler) {
55 jaxRpcHandler = handler;
56 }
57
58
59
60
61 @Override
62 public void init() {
63 jaxRpcHandler.init(new HandlerInfo(jaxRpcHandler.getClass(), getOptions(),
64 new QName[0]));
65 }
66
67
68
69
70 public void invoke(org.apache.axis.MessageContext msgContext) throws AxisFault {
71 if (!msgContext.getPastPivot()) {
72 jaxRpcHandler.handleRequest(msgContext);
73 } else {
74 jaxRpcHandler.handleResponse(msgContext);
75 }
76 }
77
78
79
80
81 @Override
82 public void onFault(org.apache.axis.MessageContext msgContext) {
83 jaxRpcHandler.handleFault(msgContext);
84 }
85
86
87
88
89
90
91 String generateUUId() {
92 try {
93 return UUIdGeneratorFactory.getGenerator().generateUUId();
94 } catch (RuntimeException re) {
95 throw new JAXRPCException("Failed to generate UUId using Axis UUId generator "
96 + AxisUUIdGenerator.class.getName() + ".", re);
97 }
98 }
99
100 }