7 import java.util.HashMap;
8 import org.apache.axis2.engine.MessageReceiver;
9 import javax.jws.WebService;
10 import javax.jws.WebMethod;
11 import javax.jws.soap.SOAPBinding;
12 import javax.xml.namespace.QName;
14 import org.apache.axis2.description.WSDL2Constants;
20 @WebService(name =
"targetListener",
21 serviceName=
"targetListener",
22 targetNamespace =
"http://anathema.flux.utah.edu/schema/vmi/1")
24 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
25 use = SOAPBinding.Use.LITERAL,
26 parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
28 public class SimpleTargetListener extends TargetListenerSkeleton
31 protected static final String tns =
32 "http://anathema.flux.utah.edu/schema/vmi/1";
33 protected static final String sns =
34 "http://anathema.flux.utah.edu/schema/vmi/1";
35 protected static final String snsPrefix =
"vmi1";
36 protected static Map<String,MessageReceiver> messageReceiverClassMap = null;
37 protected static final String schemaResourcePath =
38 "targetListener.wsdl";
39 protected static Map<String,QName> typeMapping = null;
40 protected static Map<String,String> methodClassNameMapping = null;
41 protected static Map<String,QName> dynamicTypeMapping = null;
43 @WebMethod(exclude =
true)
44 public Map<String,MessageReceiver> getMessageReceiverClassMap() {
45 if (SimpleTargetListener.messageReceiverClassMap == null) {
46 SimpleTargetListener.messageReceiverClassMap =
47 new HashMap<String,MessageReceiver>();
49 SimpleTargetListener.messageReceiverClassMap.
50 put(WSDL2Constants.MEP_URI_IN_OUT,
51 new vmi1.TargetListenerMessageReceiverInOut());
53 return SimpleTargetListener.messageReceiverClassMap;
56 @WebMethod(exclude =
true)
57 public String getTargetNamespace() {
58 return SimpleTargetListener.tns;
61 @WebMethod(exclude =
true)
62 public String getSchemaNamespace() {
63 return SimpleTargetListener.sns;
66 @WebMethod(exclude =
true)
67 public String getSchemaNamespacePrefix() {
68 return SimpleTargetListener.snsPrefix;
71 @WebMethod(exclude =
true)
72 public String getSchemaResourcePath() {
73 return SimpleTargetListener.schemaResourcePath;
76 @WebMethod(exclude =
true)
77 public Map<String,QName> getStaticTypeMapping() {
78 if (SimpleTargetListener.typeMapping == null) {
79 SimpleTargetListener.typeMapping =
new HashMap<String,QName>();
99 @WebMethod(exclude =
true)
100 public Map<String,String> getMethodClassNameMapping() {
101 if (SimpleTargetListener.methodClassNameMapping == null) {
102 SimpleTargetListener.methodClassNameMapping =
103 new HashMap<String,String>();
105 SimpleTargetListener.methodClassNameMapping
106 .put(
"targetEventNotification",
"vmi.TargetEventNotification");
107 SimpleTargetListener.methodClassNameMapping
108 .put(
"probeEventNotification",
"vmi.ProbeEventNotification");
109 SimpleTargetListener.methodClassNameMapping
110 .put(
"actionEventNotification",
"vmi.ActionEventNotification");
112 return methodClassNameMapping;
115 @WebMethod(exclude =
true)
116 public Map<String,QName> getDynamicTypeMapping() {
117 if (SimpleTargetListener.dynamicTypeMapping == null) {
118 SimpleTargetListener.dynamicTypeMapping =
119 new HashMap<String,QName>();
121 SimpleTargetListener.dynamicTypeMapping
122 .put(
"targetEventNotification",
123 new QName(SimpleTargetListener.sns,
"TargetEventNotification"));
124 SimpleTargetListener.dynamicTypeMapping
125 .put(
"probeEventNotification",
126 new QName(SimpleTargetListener.sns,
"ProbeEventNotification"));
127 SimpleTargetListener.dynamicTypeMapping
128 .put(
"actionEventNotification",
129 new QName(SimpleTargetListener.sns,
"ActionEventNotification"));
131 return dynamicTypeMapping;
134 @WebMethod(exclude =
true)
135 public
boolean isRootService() {
139 @WebMethod(exclude =
true)
140 public String getServiceName() {
141 return "targetListener";
144 @WebMethod(exclude =
true)
145 public String getServicePath() {
146 return "/vmi1/targetListener";
154 public vmi1.TargetEventNotificationResponse targetEventNotification
155 (
vmi1.TargetEventNotification targetEventNotification) {
156 TargetEventT te = targetEventNotification.getTargetEvent();
158 System.out.printf(
"TargetEvent(%s tid=%d thid=%d status=%s)\n"
159 +
" msg: \"%s\"\n\n",
160 te.getTargetEventType(),te.getTid().getTargetIdT(),
161 te.getThid().getThreadIdT(),te.getTargetStatus(),
164 vmi1.TargetEventNotificationResponse retval =
165 new vmi1.TargetEventNotificationResponse();
166 retval.setResult(
vmi1.ResultT.success);
175 public vmi1.ProbeEventNotificationResponse probeEventNotification
176 (
vmi1.ProbeEventNotification probeEventNotification) {
177 ProbeEventT pe = probeEventNotification.getProbeEvent();
178 ProbeT
probe = pe.getProbe();
179 ThreadT thread = pe.getThread();
180 RegisterValueT[] rva = pe.getRegisterValues().getRegisterValue();
182 System.out.printf(
"ProbeEvent(%s name=%s id=%d addr=0x%x,type=%s,"
183 +
"style=%s,whence=%s,size=%s)\n",
184 pe.getProbeEventType(),probe.getName(),
185 probe.getPid().getProbeIdT(),
186 probe.getAddr().getADDR().longValue(),
187 probe.getType(),probe.getStyle(),probe.getWhence(),
190 System.out.printf(
" thread: %d %s\n",
191 thread.getThid().getThreadIdT(),
192 thread.getThreadStatus());
194 System.out.printf(
" registers:\n");
195 for (
int i = 0;
i < rva.length; ++
i) {
196 System.out.printf(
" %7.7s 0x%x\n",
197 rva[
i].getName(),rva[
i].getValue().longValue());
199 System.out.println(
"");
201 vmi1.ProbeEventNotificationResponse retval =
202 new vmi1.ProbeEventNotificationResponse();
203 retval.setResult(
vmi1.ResultT.success);
212 public vmi1.ActionEventNotificationResponse actionEventNotification
213 (
vmi1.ActionEventNotification actionEventNotification) {
214 System.out.println(
"ActionEventNotification " + actionEventNotification);
215 vmi1.ActionEventNotificationResponse retval =
216 new vmi1.ActionEventNotificationResponse();
217 retval.setResult(
vmi1.ResultT.success);
static uint64_t unsigned int i