Package org.jboss.mx.interceptor

Source Code of org.jboss.mx.interceptor.StandardMBeanInfoInterceptor

/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/

package org.jboss.mx.interceptor;

import java.util.List;

import javax.management.MBeanException;
import javax.management.MBeanInfo;
import javax.management.modelmbean.ModelMBeanInfo;

import org.jboss.mx.metadata.MBeanInfoConversion;

import org.jboss.mx.server.Invocation;
import org.jboss.mx.server.InvocationException;
import org.jboss.mx.server.MBeanInvoker;

/**
*
* @author  <a href="mailto:juha@jboss.org">Juha Lindfors</a>.
* @version $Revision: 1.2 $
*/  
public class StandardMBeanInfoInterceptor extends AbstractInterceptor
{
   // cached info
   MBeanInfo standardInfo = null;
  
   public StandardMBeanInfoInterceptor()
   {
      // FIXME: xxx
      super("Standard MBeanInfo Interceptor for XXX");
   }
  
   public Object invoke(Invocation invocation) throws InvocationException
   {

      MBeanInfo info = null;
     
      try
      {
         info = (MBeanInfo)super.invoke(invocation);
      }
      finally
      {
         if (standardInfo == null)
         {
            try
            {
      //         MBeanInvoker invoker = invocation.getInvoker();
      //         MBeanInfo info       = invoker.getMetaData();
              
               standardInfo = MBeanInfoConversion.stripAttributeOperations(
                     MBeanInfoConversion.toModelMBeanInfo(info), false);
            }
            catch (MBeanException e)
            {
               throw new InvocationException(e);
            }
         }
        
         return standardInfo;
      }
   }
}

TOP

Related Classes of org.jboss.mx.interceptor.StandardMBeanInfoInterceptor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.