[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-cvs-commits
Subject:    [jboss-cvs] jmx/src/main/test/implementation/util/support ExtendedResource.java MyInterface2.java Re
From:       Juha Lindfors <juhalindfors () users ! sourceforge ! net>
Date:       2003-03-31 21:18:12
[Download RAW message or body]

  User: juhalindfors
  Date: 03/03/31 13:18:12

  Added:       src/main/test/implementation/util/support
                        ExtendedResource.java MyInterface2.java
                        ResourceIncorrectInfo.java ResourceOverride.java
  Log:
  
  
  Revision  Changes    Path
  1.1                  jmx/src/main/test/implementation/util/support/ExtendedResource.java
  
  Index: ExtendedResource.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package test.implementation.util.support;
  
  import javax.management.*;
  import javax.management.modelmbean.*;
  
  /**
   * @author  <a href="mailto:juha@jboss.org">Juha Lindfors</a>.
   * @version $Revision: 1.1 $
   */
  public class ExtendedResource implements MyInterface2 
  {
     private String attr  =  null;
     private String attr2 =  null;
     private Object arg   =  null;
     
     public void setAttributeName(String attr)
     {
        this.attr = attr;   
     }
     
     public void setAttributeName2(String attr)
     {
        this.attr2 = attr;   
     }
     
     public String getAttributeName2()
     {
        return attr2;
     }
     
     public void setAttribute3(Object arg)
     {
        this.arg = arg;
     }
     
     public Object getAttribute3()
     {
        return arg.toString();
     }
     
     public Object doOperation()
     {
        return "doOperation";
     }
     
     public String executeThis(Object arg)
     {
        return arg.toString();
     }      
     
     public Object runMe(String str)
     {
        return str;
     }
     
     public ModelMBeanInfo getMBeanInfo() 
     {
        ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[] 
        {
           new ModelMBeanAttributeInfo(
                 "AttributeName", "java.lang.String", "description",
                 false, true, false
           ),
           new ModelMBeanAttributeInfo(
                 "AttributeName2", "java.lang.String", "description",
                 true, true, false
           ),
           new ModelMBeanAttributeInfo(
                 "Attribute3", "java.lang.Object", "description",
                 true, true, false
           )
        };
        
        ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
        {
           new ModelMBeanOperationInfo(
                 "doOperation", "description", null, "java.lang.Object", 1
           ),
           new ModelMBeanOperationInfo(
                 "executeThis", "description", 
                       
                       new MBeanParameterInfo[] {
                          new MBeanParameterInfo(
                             "arg", "java.lang.Object", "description"
                          )
                       },
                       "java.lang.Object", 1
           ),
           new ModelMBeanOperationInfo(
                 "runMe", "description",
                 
                       new MBeanParameterInfo[] {
                          new MBeanParameterInfo(
                             "arg", "java.lang.String", "description"
                          )
                       },
                       "java.lang.Object", 1
            )
        };
        
        ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
              "test.implementation.util.support.Resource", "description",
              attributes, null, operations, null
        );
        
        return info;
     }
     
  }
  
  
  
  1.1                  jmx/src/main/test/implementation/util/support/MyInterface2.java
  
  Index: MyInterface2.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package test.implementation.util.support;
  
  /**
   * @author  <a href="mailto:juha@jboss.org">Juha Lindfors</a>.
   * @version $Revision: 1.1 $
   */
  public interface MyInterface2
  {
     void setAttributeName(String attr);
     void setAttributeName2(String attr);
     String getAttributeName2();
     
     void setAttribute3(Object attr);
     Object getAttribute3();
     
     Object doOperation();
     String executeThis(Object arg);
     Object runMe(String str);
  }
        
  
  
  
  
  
  
  1.1                  jmx/src/main/test/implementation/util/support/ResourceIncorrectInfo.java
  
  Index: ResourceIncorrectInfo.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package test.implementation.util.support;
  
  import javax.management.modelmbean.ModelMBeanInfo;
  import javax.management.modelmbean.ModelMBeanInfoSupport;
  import javax.management.modelmbean.ModelMBeanAttributeInfo;
  import javax.management.modelmbean.ModelMBeanOperationInfo;
  
  /**
   * @author  <a href="mailto:juha@jboss.org">Juha Lindfors</a>.
   * @version $Revision: 1.1 $
   */
  public class ResourceIncorrectInfo
  {
     public ModelMBeanInfo getMBeanInfo() 
     {
        ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[] 
        {
           new ModelMBeanAttributeInfo(
                 "AttributeName", "java.lang.String", "description",
                 false, true, false
           )
        };
        
        ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
        {
           new ModelMBeanOperationInfo(
                 "doOperation", "description", null, "java.lang.Object", 1
           )
        };
        
        ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
              "test.implementation.util.support.Resource", "description",
              attributes, null, operations, null
        );
        
        return info;
     }
  
  
  }
        
  
  
  
  
  
  
  1.1                  jmx/src/main/test/implementation/util/support/ResourceOverride.java
  
  Index: ResourceOverride.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
   
  package test.implementation.util.support;
  
  import javax.management.modelmbean.ModelMBeanInfo;
  import javax.management.modelmbean.ModelMBeanInfoSupport;
  import javax.management.modelmbean.ModelMBeanAttributeInfo;
  import javax.management.modelmbean.ModelMBeanOperationInfo;
  import javax.management.MBeanParameterInfo;
  
  /**
   * Overrides and exposes java.lang.Object methods in the management
   * interface.
   *
   * @author  <a href="mailto:juha@jboss.org">Juha Lindfors</a>.
   * @version $Revision: 1.1 $
   */
  public class ResourceOverride
  {
     
     // Attributes ----------------------------------------------------
     
     private String state = null;
     
     
     // Constructors --------------------------------------------------
     public ResourceOverride(String state)
     {
        this.state = state;
     }
     
     public ResourceOverride() {}
     
     
     // Public --------------------------------------------------------
     
     public ModelMBeanInfo getMBeanInfo() 
     {
        ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[] 
        {
           new ModelMBeanAttributeInfo(
                 "AttributeName", "java.lang.String", "description",
                 false, true, false
           ),
           new ModelMBeanAttributeInfo(
                 "AttributeName2", "java.lang.String", "description",
                 true, true, false
           )
        };
        
        ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[]
        {
           new ModelMBeanOperationInfo(
                 "doOperation", "description", null, "java.lang.Object", 1
           ),
           
           new ModelMBeanOperationInfo(
                 "toString", "toString override", null, "java.lang.String", 1
           ),
           
           new ModelMBeanOperationInfo(
                 "equals", "equals override",
                 new MBeanParameterInfo[] 
                 {
                    new MBeanParameterInfo("object", "java.lang.Object", "object to compare to")
                 },
                 "boolean", 1
           ),
           
           new ModelMBeanOperationInfo(
                 "hashCode", "hashCode override in resource", null, Integer.TYPE.getName(), 1
           )
        };
        
        ModelMBeanInfoSupport info = new ModelMBeanInfoSupport(
              "test.implementation.util.support.Resource", "description",
              attributes, null, operations, null
        );
        
        return info;
     }
  
  
     public Object doOperation() 
     {
        return "tamppi";
     }
  
     
     // Object overrides ----------------------------------------------
     
     public String toString()
     {
        return "Resource";
     }
     
     public boolean equals(Object o)
     {
        return true;
     }
     
     public int hashCode()
     {
        return 10;
     }
  }
        
  
  
  
  
  
  


-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic