commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-commons/modeler/src/java/org/apache/commons/modeler/modules ModelerSource.java
Date Mon, 07 Apr 2003 06:49:33 GMT
costin      2003/04/06 23:49:33

  Modified:    modeler/src/java/org/apache/commons/modeler/modules
                        ModelerSource.java
  Log:
  A bit of refactoring - the method to convert was duplicated in the ant tasks
  and few other places. Now it's in Registry - I'll add the other types
  that are common ( OpenMBean level at least ).
  
  Added first bits of code for mbean persistence. The "source" will be notified
  of changes. We'll probably need to seaparate metadata source from mbeans
  source too.
  
  Revision  Changes    Path
  1.4       +24 -13    jakarta-commons/modeler/src/java/org/apache/commons/modeler/modules/ModelerSource.java
  
  Index: ModelerSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/modeler/src/java/org/apache/commons/modeler/modules/ModelerSource.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ModelerSource.java	27 Mar 2003 06:18:47 -0000	1.3
  +++ ModelerSource.java	7 Apr 2003 06:49:33 -0000	1.4
  @@ -10,6 +10,15 @@
    */
   public class ModelerSource {
   
  +    /** Load data, returns a list of items. 
  +     * 
  +     * @param registry
  +     * @param location
  +     * @param type
  +     * @param source Introspected object or some other source
  +     * @return
  +     * @throws Exception
  +     */ 
       public List loadDescriptors( Registry registry, String location,
                                    String type, Object source)
               throws Exception
  @@ -18,18 +27,20 @@
           return null;
       }
       
  -    // XXX We should know the type from the mbean metadata
  -    protected Object getValueObject( String valueS, String type )
  -            throws MalformedObjectNameException
  -    {
  -        if( type==null )
  -            return valueS;
  -        if( "int".equals( type ) || "java.lang.Integer".equals(type) ) {
  -            return new Integer( valueS);
  -        }
  -        if( "ObjectName".equals( type ) || "javax.management.ObjectName".equals(type) )
{
  -            return new ObjectName( valueS);
  -        }
  -        return valueS;
  +    /** Callback from the BaseMBean to notify that an attribute has changed.
  +     * Can be used to implement persistence.
  +     * 
  +     * @param oname
  +     * @param name
  +     * @param value
  +     */ 
  +    public void updateField( ObjectName oname, String name, 
  +                             Object value ) {
  +        // nothing by default 
  +    }
  +
  +    public void store() {
  +        // nothing
       }
  +    
   }
  
  
  

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


Mime
View raw message