KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > net > jmx > adaptor > MBeanParameterInfoSer


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 // $Id: MBeanParameterInfoSer.java,v 1.4.8.1 2005/03/02 14:19:55 tdiesler Exp $
9

10 package org.jboss.net.jmx.adaptor;
11
12 import org.jboss.axis.Constants;
13 import org.jboss.axis.encoding.SerializationContext;
14 import org.jboss.axis.encoding.Serializer;
15 import org.jboss.axis.wsdl.fromJava.Types;
16 import org.w3c.dom.Element JavaDoc;
17 import org.xml.sax.Attributes JavaDoc;
18
19 import javax.management.MBeanParameterInfo JavaDoc;
20 import javax.xml.namespace.QName JavaDoc;
21 import java.io.IOException JavaDoc;
22
23
24 /**
25  * An <code>MBeanParameterInfoSer</code> is be used to serialize
26  * MBeanParameterInfo using the <code>SOAP-ENC</code>
27  * encoding style.<p>
28  *
29  * @author <a HREF="mailto:a_taherkordi@users.sourceforge.net">Alireza Taherkordi</a>
30  * @version $Revision: 1.4.8.1 $
31  */

32 public class MBeanParameterInfoSer
33         implements Serializer
34 {
35
36    public void serialize(QName JavaDoc name,
37                          Attributes JavaDoc attributes,
38                          Object JavaDoc value,
39                          SerializationContext context)
40            throws IOException JavaDoc
41    {
42       if (!(value instanceof MBeanParameterInfo JavaDoc))
43          throw new IOException JavaDoc("Can't serialize a " + value.getClass().getName() + " instance with a MBeanParameterInfo Serializer.");
44       context.startElement(name, attributes);
45
46       context.serialize(new QName JavaDoc("", "name"), null, ((MBeanParameterInfo JavaDoc)value).getName());
47       context.serialize(new QName JavaDoc("", "type"), null, ((MBeanParameterInfo JavaDoc)value).getType());
48       context.serialize(new QName JavaDoc("", "description"), null, ((MBeanParameterInfo JavaDoc)value).getDescription());
49
50       context.endElement();
51       return;
52
53
54    }
55
56    public Element JavaDoc writeSchema(Class JavaDoc aClass, Types types) throws Exception JavaDoc
57    {
58       return null;
59    }
60
61    public String JavaDoc getMechanismType()
62    {
63       return Constants.AXIS_SAX;
64    }
65
66 }
Popular Tags