FileDocCategorySizeDatePackage
MCClientKernelAbstraction.javaAPI DocJBoss 4.2.13133Fri Jul 13 20:53:58 BST 2007org.jboss.ejb3

MCClientKernelAbstraction

public class MCClientKernelAbstraction extends Object implements ClientKernelAbstraction
author
William DeCoste

Fields Summary
private static final Logger
log
protected org.jboss.kernel.Kernel
kernel
Constructors Summary
public MCClientKernelAbstraction(org.jboss.kernel.Kernel kernel)


     
   
      this.kernel = kernel;
   
Methods Summary
public java.lang.ObjectgetAttribute(javax.management.ObjectName objectName, java.lang.String attribute)

      String name = objectName.getCanonicalName();
      KernelRegistryEntry entry = kernel.getRegistry().getEntry(name);
      if (entry != null)
      {
         Object target = entry.getTarget();
         Field field = target.getClass().getField(attribute);
         return field.get(target);
      }
      return null;
   
public java.lang.Objectinvoke(javax.management.ObjectName objectName, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)

      String name = objectName.getCanonicalName();
      KernelRegistryEntry entry = kernel.getRegistry().getEntry(name);
      if (entry != null)
      {
         Object target = entry.getTarget();
         if (target instanceof RARDeployment)
         {
            RARDeployment deployment = (RARDeployment) target;
            return deployment.invoke(operationName, params, signature);
         }
         else
         {
            Class[] types = new Class[signature.length];
            for (int i = 0; i < signature.length; ++i)
            {
               types[i] = Thread.currentThread().getContextClassLoader().loadClass(signature[i]);
            }
            Method method = target.getClass().getMethod(operationName, types);
            return method.invoke(target, params);
         }
      }
      return null;