User: chirino 
  Date: 02/03/27 19:13:35

  Modified:    src/main/org/jboss/system ServiceConfigurator.java
  Log:
  Added support for setting mbean attributes that are of the ObjectName or Property 
type.
  
  Revision  Changes    Path
  1.5       +27 -1     jboss-system/src/main/org/jboss/system/ServiceConfigurator.java
  
  Index: ServiceConfigurator.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/ServiceConfigurator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ServiceConfigurator.java  24 Mar 2002 05:35:01 -0000      1.4
  +++ ServiceConfigurator.java  28 Mar 2002 03:13:35 -0000      1.5
  @@ -15,10 +15,14 @@
   
   import java.beans.PropertyEditor;
   import java.beans.PropertyEditorManager;
  +import java.io.ByteArrayInputStream;
   import java.io.StringWriter;
   import java.io.Writer;
   import java.lang.reflect.Method;
   import java.lang.reflect.Modifier;
  +import java.util.Properties;
  +import java.util.StringTokenizer;
  +import java.util.LinkedList;
   import java.util.ArrayList;
   import java.util.Hashtable;
   import java.util.LinkedList;
  @@ -56,7 +60,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Hiram Chirino</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    *
    * <p><b>20010830 marc fleury:</b>
    * <ul>
  @@ -295,6 +299,28 @@
                              }
                           }
                        }
  +                     
  +                     // HRC: Is the attribute type a JMX ObjectName??
  +                     if (typeClass.equals(ObjectName.class)) {
  +                        try {
  +                           value = new ObjectName(attributeText);
  +                        } catch ( Exception e ) {
  +                                    throw new DeploymentException(e.getMessage());
  +                        }
  +                     }
  +                     
  +                     // HRC: Is the attribute type a Properties object??
  +                     if (typeClass.equals(Properties.class)) {
  +                        try {
  +                                    ByteArrayInputStream is= new 
ByteArrayInputStream(attributeText.getBytes());
  +                                    Properties p = new Properties();
  +                                    p.load(is);
  +                                    value = p;
  +                        } catch ( Exception e ) {
  +                                    throw new DeploymentException(e.getMessage());
  +                        }
  +                     }
  +                     
                        
                        if (value == null)
                        {
  
  
  

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

Reply via email to