1 8 9 package mx4j.tools.remote.soap.axis.ser; 10 11 import java.io.IOException ; 12 import javax.management.Notification ; 13 import javax.management.timer.TimerNotification ; 14 import javax.xml.namespace.QName ; 15 16 import org.apache.axis.encoding.SerializationContext; 17 import org.apache.axis.encoding.XMLType; 18 import org.apache.axis.wsdl.fromJava.Types; 19 import org.w3c.dom.Element ; 20 21 24 public class TimerNotificationSer extends NotificationSer 25 { 26 static final String NOTIFICATION_ID = "notificationID"; 27 private static final QName NOTIFICATION_ID_QNAME = new QName ("", NOTIFICATION_ID); 28 29 protected void onSerialize(SerializationContext context, Notification notification) throws IOException 30 { 31 super.onSerialize(context, notification); 32 TimerNotification serverNotification = (TimerNotification )notification; 33 context.serialize(NOTIFICATION_ID_QNAME, null, serverNotification.getNotificationID()); 34 } 35 36 public Element writeSchema(Class aClass, Types types) throws Exception 37 { 38 Element elem = super.writeSchema(aClass, types); 39 40 Element notID = types.createElement(SCHEMA_ELEMENT); 41 notID.setAttribute("name", NOTIFICATION_ID); 42 notID.setAttribute("type", XMLType.XSD_INT.getLocalPart()); 43 elem.appendChild(notID); 44 45 return elem; 46 } 47 48 } 49 | Popular Tags |