:  » EJB-Server » JBoss-6.0.0 » org » jboss » profileservice » management » Java Open Source

Java Open Source » EJB Server » JBoss 6.0.0 
JBoss 6.0.0 » org » jboss » profileservice » management »
 * JBoss, Home of Professional Open Source
 * Copyright 2009, Red Hat Middleware LLC, and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site:


import org.jboss.dependency.spi.ControllerState;
import org.jboss.dependency.spi.dispatch.InvokeDispatchContext;
import org.jboss.kernel.plugins.registry.AbstractKernelRegistryEntry;

 * An extension of AbstractKernelRegistryEntry that implements InvokeDispatchContext
 * to handle access to the platform mbeans.
 * @author
 * @version $Revision: 97699 $
public class PlatformMBeanIDC extends AbstractKernelRegistryEntry
   implements InvokeDispatchContext
   private MBeanServer server;
   private ObjectName objectName;

   public PlatformMBeanIDC(MBeanServer server, ObjectName objectName,
         Object mbean)
      super(objectName.getCanonicalName(), mbean);
      this.server = server;
      this.objectName = objectName;

   public ClassLoader getClassLoader() throws Throwable
      return server.getClassLoaderFor(objectName);

   public Object invoke(String operationName, Object[] parameters, String[] signature)
         throws Throwable
      return server.invoke(objectName, operationName, parameters, signature);

   public Object get(String name) throws Throwable
      return server.getAttribute(objectName, name);

   public void set(String name, Object value) throws Throwable
      Attribute attribute = new Attribute(name, value);
      server.setAttribute(objectName, attribute);

   public ControllerState getState()
      return ControllerState.INSTALLED;
}  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.