User: juhalindfors
  Date: 01/12/02 18:01:30

  Added:       src/main/javax/management Attribute.java AttributeList.java
                        DescriptorAccess.java MBeanAttributeInfo.java
                        MBeanConstructorInfo.java MBeanFeatureInfo.java
                        MBeanInfo.java MBeanNotificationInfo.java
                        MBeanOperationInfo.java MBeanParameterInfo.java
                        ObjectName.java
  Log:
  metadata classes
  
  Revision  Changes    Path
  1.1                  jmx/src/main/javax/management/Attribute.java
  
  Index: Attribute.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class Attribute extends Object implements java.io.Serializable {
  
     private String name = null;
     private Object value = null;
     
     public Attribute(String name, Object value) {
        this.name = name;
        this.value = value;
     }
  
  
     public java.lang.String getName() {
        return name;
     }
  
     public java.lang.Object getValue() {
        return value;
     }
  
     public boolean equals(java.lang.Object object) {
        if (!(object instanceof Attribute))
           return false;
          
        Attribute attr = (Attribute)object;
        
        return (name.equals(attr.getName()) && value.equals(attr.getValue()));
     }
  
  }
  
  
  
  1.1                  jmx/src/main/javax/management/AttributeList.java
  
  Index: AttributeList.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class AttributeList
     extends java.util.ArrayList {
  
     public AttributeList() {
        super();
     }
  
     public AttributeList(int initialCapacity) {
        super(initialCapacity);
     }
  
     public AttributeList(AttributeList list) {
        super(list);
     }
  
     public void add(Attribute object) {
        super.add(object);
     }
  
     public void add(int index, Attribute object) {
        super.add(index, object);
     }
  
     public void set(int index, Attribute object) {
        super.set(index, object);
     }
  
     public boolean addAll(AttributeList list) {
        return super.addAll(list);
     }
  
     public boolean addAll(int index, AttributeList list) {
        return super.addAll(index, list);
     }
  
  
  }
  
  
  
  
  1.1                  jmx/src/main/javax/management/DescriptorAccess.java
  
  Index: DescriptorAccess.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public interface DescriptorAccess {
  
     public Descriptor getDescriptor();
  
     public void setDescriptor(Descriptor inDescriptor);
  
  
  
  }
  
  
  
  1.1                  jmx/src/main/javax/management/MBeanAttributeInfo.java
  
  Index: MBeanAttributeInfo.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class MBeanAttributeInfo
           extends MBeanFeatureInfo
     implements java.io.Serializable, java.lang.Cloneable {
  
     protected String type = null;
     protected boolean isReadable = false;
     protected boolean isWritable = false;
     protected boolean isIs = false;
     
     public MBeanAttributeInfo(java.lang.String name,
                               java.lang.String type,
                               java.lang.String description,
                               boolean isReadable,
                               boolean isWritable,
                               boolean isIs) {
        super(name, description);
        this.type = type;
        this.isReadable = isReadable;
        this.isWritable = isWritable;
        this.isIs = isIs;
     }
  
     public MBeanAttributeInfo(java.lang.String name,
                               java.lang.String description,
                               java.lang.reflect.Method getter,
                               java.lang.reflect.Method setter)
     throws IntrospectionException {
        super(name, description);
        throw new Error("NYI");
     }
  
     public java.lang.Object clone() throws CloneNotSupportedException {
        MBeanAttributeInfo clone = (MBeanAttributeInfo)super.clone();
        clone.type = getType();
        clone.isReadable = isReadable();
        clone.isWritable = isWritable();
        clone.isIs = isIs();
        
        return clone;
     }
  
     public java.lang.String getType() {
        return type;
     }
     public boolean isReadable() {
        return isReadable;
     }
  
     public boolean isWritable() {
        return isWritable;
     }
  
     public boolean isIs() {
        return isIs;
     }
  
  
  
  }
  
  
  
  1.1                  jmx/src/main/javax/management/MBeanConstructorInfo.java
  
  Index: MBeanConstructorInfo.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class MBeanConstructorInfo extends MBeanFeatureInfo
     implements java.io.Serializable, java.lang.Cloneable {
  
     protected MBeanParameterInfo[] signature = null;
     
     public MBeanConstructorInfo(java.lang.String description,
                                 java.lang.reflect.Constructor constructor) {
        super(constructor.getName(), description);
        throw new Error("NYI");
     }
     public MBeanConstructorInfo(java.lang.String name,
                                 java.lang.String description,
                                 MBeanParameterInfo[] signature) {
        super(name, description);
        this.signature = signature;
     }
  
     public java.lang.Object clone() throws CloneNotSupportedException {
        MBeanConstructorInfo clone = (MBeanConstructorInfo)super.clone();
        clone.signature = getSignature();   
        return clone;
     }
  
     public MBeanParameterInfo[] getSignature() {
        return signature;
     }
  
  
  
  }
  
  
  
  1.1                  jmx/src/main/javax/management/MBeanFeatureInfo.java
  
  Index: MBeanFeatureInfo.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class MBeanFeatureInfo extends java.lang.Object implements 
java.io.Serializable {
        
     private String name        = null;
     private String description = null;
     
     public MBeanFeatureInfo(java.lang.String name,
                             java.lang.String description) {
        this.name = name;
        this.description = description;
     }
  
     public java.lang.String getName()
     {
        return name;
     }
  
     public java.lang.String getDescription()
     {
        return description;
     }
  
  
  
  
  }
  
  
  
  
  1.1                  jmx/src/main/javax/management/MBeanInfo.java
  
  Index: MBeanInfo.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class MBeanInfo implements Cloneable, java.io.Serializable {
  
     protected String className = null;
     protected String description = null;
     protected MBeanAttributeInfo[] attributes = null;
     protected MBeanConstructorInfo[] constructors = null;
     protected MBeanOperationInfo[] operations = null;
     protected MBeanNotificationInfo[] notifications = null;
     
     public MBeanInfo(java.lang.String className,
                      java.lang.String description,
                      MBeanAttributeInfo[] attributes,
                      MBeanConstructorInfo[] constructors,
                      MBeanOperationInfo[] operations,
                      MBeanNotificationInfo[] notifications) {
        this.className = className;
        this.description = description;
        this.attributes = attributes;
        this.constructors = constructors;
        this.operations = operations;
        this.notifications = notifications;
     }
     
     public java.lang.Object clone() throws CloneNotSupportedException {
        MBeanInfo clone = (MBeanInfo)super.clone();
        
        // FIXME
        throw new CloneNotSupportedException("NYI");
     }
  
     public java.lang.String getClassName() {
        return className;
     }
     
     public java.lang.String getDescription() {
        return description;
     }
  
     public MBeanAttributeInfo[] getAttributes() {
        return attributes;
     }
  
     public MBeanOperationInfo[] getOperations() {
        return operations;
     }
     public MBeanConstructorInfo[] getConstructors() {
        return constructors;
     }
  
     public MBeanNotificationInfo[] getNotifications() {
        return notifications;
     }
  
  }
  
  
  
  
  1.1                  jmx/src/main/javax/management/MBeanNotificationInfo.java
  
  Index: MBeanNotificationInfo.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class MBeanNotificationInfo extends MBeanFeatureInfo
     implements Cloneable, java.io.Serializable {
  
     protected String[] notifsType = null;
  
     public MBeanNotificationInfo(String[] notifsType,
                                  String name,
                                  String description) {
  
        super(name, description);
        this.notifsType = notifsType;
     }
  
     public Object clone() throws CloneNotSupportedException {
        MBeanNotificationInfo clone = (MBeanNotificationInfo)super.clone();
        clone.notifsType = getNotifTypes();
  
        return clone;
     }
  
     public String[] getNotifTypes()
     {
        return notifsType;
     }
  
  
  }
  
  
  
  1.1                  jmx/src/main/javax/management/MBeanOperationInfo.java
  
  Index: MBeanOperationInfo.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class MBeanOperationInfo
           extends MBeanFeatureInfo
     implements java.io.Serializable, java.lang.Cloneable {
  
  
     public static final int INFO = 0x1234;
  
     public static final int ACTION = 0x332;
  
     public static final int ACTION_INFO = 0xabcd;
  
     public static final int UNKNOWN = 0xdead;
  
  
     public MBeanOperationInfo(java.lang.String description,
                               java.lang.reflect.Method method) {super("", "");}
     public MBeanOperationInfo(java.lang.String name,
                               java.lang.String description,
                               MBeanParameterInfo[] signature,
                               java.lang.String type,
                               int impact) {super("", "");}
  
     public java.lang.Object clone() {
        return null;
     }
  
     public java.lang.String getReturnType() {
        return null;
     }
  
     public MBeanParameterInfo[] getSignature() {
        return null;
     }
  
     public int getImpact() {
        return 0;
     }
  
  }
  
  
  
  1.1                  jmx/src/main/javax/management/MBeanParameterInfo.java
  
  Index: MBeanParameterInfo.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  public class MBeanParameterInfo extends MBeanFeatureInfo implements 
java.io.Serializable, Cloneable {
  
     protected String type = null;
     
     public MBeanParameterInfo(java.lang.String name,
                               java.lang.String type,
                               java.lang.String description) {
        super(name, description);
        this.type = type;
     }
  
  
  
     public java.lang.Object clone() throws CloneNotSupportedException {
        MBeanParameterInfo clone = (MBeanParameterInfo)super.clone();
        clone.type = getType();
        return clone;
     }
  
     public java.lang.String getType() {
        return type;
     }
  
  
  }
  
  
  
  
  1.1                  jmx/src/main/javax/management/ObjectName.java
  
  Index: ObjectName.java
  ===================================================================
  /*
   * LGPL
   */
  package javax.management;
  
  import java.util.Map;
  import java.util.Hashtable;
  import java.util.HashMap;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.List;
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.StringTokenizer;
  
  public class ObjectName extends java.lang.Object implements java.io.Serializable {
  
     private boolean isPattern  = false;
     private boolean isPropertyPattern = false;
     private Map keyMap = new HashMap();
     private String domain = "DefaultDomain";
  // FIXME: get the real default domain name
     private String canonicalName = null;
     private int hashCode;
     
     public ObjectName(String name) throws MalformedObjectNameException {
        
        if (name.indexOf(':') == -1)
           throw new MalformedObjectNameException("missing domain");
           
        if (name.startsWith(":"))
           this.domain = "DefaultDomain";
        else
           this.domain = name.substring(0, name.indexOf(':'));
           
        String keys = name.substring(name.indexOf(':') + 1, name.length());
        
        StringTokenizer tokenizer = new StringTokenizer(keys, ",");
        
        while(tokenizer.hasMoreTokens()) {
           String key = tokenizer.nextToken();
           keyMap.put(key.substring(0, key.indexOf('=')),
                      key.substring(key.indexOf('=') + 1, key.length()));
        }
        
        this.canonicalName = getDomain() + ":" + getCanonicalKeyPropertyListString();
        this.hashCode = canonicalName.hashCode();
     }
  
     public ObjectName(java.lang.String domain,
                       java.lang.String key,
                       java.lang.String value)
     throws MalformedObjectNameException {
        this.domain = domain;
        this.keyMap.put(key, value);
     }
  
     public ObjectName(String domain, Hashtable table) throws 
MalformedObjectNameException {
        this.domain = domain;
        this.keyMap.putAll(table);
     }
  
     public boolean equals(Object object) {
        if (!(object instanceof ObjectName))
           return false;
           
        ObjectName oname = (ObjectName)object;
        
        return (oname.getCanonicalName().equals(getCanonicalName()));
     }
  
     public int hashCode() {
        return canonicalName.hashCode();
     }
  
     public String toString() {
        return canonicalName;
     }
  
     public boolean isPattern() {
        return isPattern;
     }
  
     public String getCanonicalName() {
        return canonicalName;
     }
     
     public String getDomain() {
        return domain;
     }
  
     public String getKeyProperty(String property) {
        return (String)keyMap.get(property);
     }
  
     public Hashtable getKeyPropertyList() {
        return new Hashtable(keyMap);
     }
  
     public String getKeyPropertyListString() {
        Iterator it = keyMap.keySet().iterator();
        StringBuffer strBuffer = new StringBuffer(1000);
        
        while(it.hasNext()) {
           String key = (String)it.next();
           strBuffer.append(key);
           strBuffer.append('=');
           strBuffer.append(keyMap.get(key));
           strBuffer.append(',');
        }
        strBuffer.deleteCharAt(strBuffer.length() - 1);
        return strBuffer.toString();
     }
  
  
     public String getCanonicalKeyPropertyListString() {
        Iterator it = keyMap.keySet().iterator();
        ArrayList list = new ArrayList();
        
        while(it.hasNext()) {
           String key = (String)it.next();
           list.add(new String(key + "=" + keyMap.get(key)));   
        }
        
        Collections.sort(list);
        StringBuffer strBuffer = new StringBuffer();
        
        it = list.iterator();
        while(it.hasNext()) {
           strBuffer.append(it.next());
           strBuffer.append(',');
        }
        strBuffer.deleteCharAt(strBuffer.length() -1);
        return strBuffer.toString();
     }
  
     public boolean isPropertyPattern() {
        return isPropertyPattern;
     }
  
  
  
  
  }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to