User: juhalindfors
  Date: 02/01/16 03:34:09

  Modified:    src/main/org/jboss/mx/modelmbean XMBean.java
                        XMBeanConstants.java
  Log:
  some stuff from last year
  
  Revision  Changes    Path
  1.2       +42 -91    jmx/src/main/org/jboss/mx/modelmbean/XMBean.java
  
  Index: XMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMBean.java       2001/12/13 00:02:21     1.1
  +++ XMBean.java       2002/01/16 11:34:09     1.2
  @@ -45,12 +45,17 @@
         super(info);
      }
   
  -   public XMBean(Object resource, String resourceType) throws MBeanException, 
NotCompliantMBeanException
  +   public XMBean(Object resource, String resourceType/*, Object resourceInfo*/)
  +   throws MBeanException, NotCompliantMBeanException
      {
         try
         {
  +         //if (resourceType.startsWith("CLASS_NAME")) 
  +         //{
  +         //   String    
            setManagedResource(resource, resourceType);   
         
  +         
            if (resourceType.equals(STANDARD_INTERFACE))
               metadata = new ModelMBeanInfoSupport((ModelMBeanInfo)new 
StandardMetaData(resource, true).build());
            if (resourceType.endsWith(".xml"))
  @@ -72,106 +77,30 @@
            throw new MBeanException(e, "Malformed URL: " + resourceType);
         }         
      }
  -   
  -   // MBeanRegistration implementation ------------------------------
  -   public ObjectName preRegister(MBeanServer server, ObjectName name) throws 
Exception
  -   {
  -      /*
  -      // store the server reference
  -         this.server = server;
  -         this.name    = name;
  -     
  -         // create attribute and operation maps
  -         operationMap = createOperationMap(metadata.getOperations());
  -         attributeMap = createAttributeMap(metadata.getAttributes());
  -    
  -         return name;
  -      */
  -      
  -      // FIXME: this should be in the base
  -      this.stack = new ModelMBeanInterceptor(resource, metadata);
  -      
  -      return name;
  -   }
  -   
  -   public void postRegister(Boolean registrationSuccessful) { }
  -   public void preDeregister() throws Exception { }
  -   public void postDeregister() { }
   
  -   // DynamicMBean implementation -----------------------------------
  -/*
  -   public Object getAttribute(String attribute)
  -   throws AttributeNotFoundException, MBeanException, ReflectionException
  +   public XMBean(String resourceClass, String resourceType, Object resourceInfo) 
  +   throws MBeanException, NotCompliantMBeanException
      {
  -      /*
  -       XMBeanAttribute attr = (XMBeanAttribute)attributeMap.get(attribute);
  -           
  -       if (attr == null)
  -         throw new AttributeNotFoundException();
  -         
  -       return attr.getValue();
         
  -   }
  -
  -   public void setAttribute(Attribute attribute)
  -   throws AttributeNotFoundException, InvalidAttributeValueException, 
MBeanException, ReflectionException
  -   {
         
  -       String attrName  = attribute.getName();
  -       Object attrValue = attribute.getValue();
  -    
  -       XMBeanAttribute attr = (XMBeanAttribute)attributeMap.get(attrName);
  -       
  -       if (attr == null)
  -         throw new AttributeNotFoundException();
  -       
  -       try {
  -         attr.setValue(attrValue);
  -       }
  -       catch (InstanceNotFoundException e) {
  -         
  -         // may be thrown by PersistentMBean.store()
  -           
  -         throw new MBeanException(e);
  -       }              
  -      
  -   }
  -
  -   public Object invoke(String actionName, Object[] params, String[] signature)
  -   throws MBeanException, ReflectionException
  -   {
  -       String method = actionName;
  -       
  -       if (signature != null) {
  -         for (int i = 0; i < signature.length; ++i)
  -           method += signature[i];
  -       }
  -       
  -       
  -       XMBeanOperation operation =
  -           (XMBeanOperation)operationMap.get(method);
  -       
  -       if (operation == null) {
  -         throw new ReflectionException(
  -            new IllegalArgumentException("unknown operation")
  -         );
  -       }
  -         
  -       return operation.invoke(params);
  -     
  -   }
  -*/
  -   public MBeanInfo getMBeanInfo()
  -   {
  -      return (MBeanInfo)metadata;
      }
  -
      
  +   // Public --------------------------------------------------------
      public boolean isSupportedResourceType(String resourceType)
      {
  +      return true;
  +      
  +      /*
         if (resourceType == null)
            return false;
  -         
  +      
  +      StringTokenizer strTokenizer = new StringTokenizer(resourceType, "/");
  +      String referenceType = strTokenizer.nextToken();
  +      String interfaceType = "/" + strTokenizer.nextToken();
  +      String resourceInfo  = strTokenizer.nextToken();
  +      
  +      if (referenceType.equals(OBJET_REF))
  +         return true;
         if (resourceType.equals(OBJECT_REF))
            return true;
         if (resourceType.equals(STANDARD_INTERFACE))
  @@ -189,7 +118,29 @@
            }
            
         return false;
  +      */
      }
  +   
  +   // MBeanRegistration implementation ------------------------------
  +   public ObjectName preRegister(MBeanServer server, ObjectName name) throws 
Exception
  +   {      
  +      // FIXME: this should be in the base
  +      this.stack = new ModelMBeanInterceptor(resource, metadata);
  +      
  +      return name;
  +   }
  +   
  +   public void postRegister(Boolean registrationSuccessful) { }
  +   public void preDeregister() throws Exception { }
  +   public void postDeregister() { }
  +
  +   // DynamicMBean implementation -----------------------------------
  +   public MBeanInfo getMBeanInfo()
  +   {
  +      return (MBeanInfo)metadata;
  +   }
  +
  +   
   
      
   /*
  
  
  
  1.2       +6 -2      jmx/src/main/org/jboss/mx/modelmbean/XMBeanConstants.java
  
  Index: XMBeanConstants.java
  ===================================================================
  RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBeanConstants.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMBeanConstants.java      2001/12/13 00:02:21     1.1
  +++ XMBeanConstants.java      2002/01/16 11:34:09     1.2
  @@ -9,6 +9,10 @@
   public interface XMBeanConstants extends ModelMBeanConstants
   {
   
  -   //   final static String XML_DEFINITION_URL = "xml.definition.url";
  -   final static String STANDARD_INTERFACE = OBJECT_REF + "/Standard";
  +   final static String STANDARD_INTERFACE = "/StandardInterface";
  +   final static String EXTENDED_INTERFACE = "/ExtendedInterface";
  +   final static String XMBEAN_DTD         = "/XMBean_DTD"; 
  +   
  +   final static String XML_DEFINITION_URL = "xml.definition.url";
  +   
   }
  
  
  

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

Reply via email to