You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by co...@apache.org on 2003/04/07 08:45:02 UTC

cvs commit: jakarta-commons/modeler/src/java/org/apache/commons/modeler ManagedBean.java

costin      2003/04/06 23:45:02

  Modified:    modeler/src/java/org/apache/commons/modeler ManagedBean.java
  Log:
  Add a default attribute for modeled mbeans - the type of the managed
  resource. This is needed since no other consistent mechanism exists
  ( "code" would return BaseModelMBean ). This info is needed for remoting
  and probably other applications
  
  Revision  Changes    Path
  1.7       +16 -4     jakarta-commons/modeler/src/java/org/apache/commons/modeler/ManagedBean.java
  
  Index: ManagedBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/ManagedBean.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ManagedBean.java	27 Jan 2003 19:00:22 -0000	1.6
  +++ ManagedBean.java	7 Apr 2003 06:45:02 -0000	1.7
  @@ -113,6 +113,17 @@
       protected OperationInfo operations[] = new OperationInfo[0];
       protected String type = null;
   
  +    /** Constructor. Will add default attributes. 
  +     *  
  +     */ 
  +    public ManagedBean() {
  +        AttributeInfo ai=new AttributeInfo();
  +        ai.setName("modelerType");
  +        ai.setDescription("Type of the modeled resource. Can be set only once");
  +        ai.setType("java.lang.String");
  +        addAttribute(ai);
  +    }
  +    
       // ------------------------------------------------------------- Properties
   
   
  @@ -435,6 +446,7 @@
               new ModelMBeanAttributeInfo[attrs.length];
           for (int i = 0; i < attrs.length; i++)
               attributes[i] = attrs[i].createAttributeInfo();
  +        
           ConstructorInfo consts[] = getConstructors();
           ModelMBeanConstructorInfo constructors[] =
               new ModelMBeanConstructorInfo[consts.length];
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org