Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*    */ package org.jboss.ejb3;
 /*    */ 
 /*    */ import java.lang.reflect.Field;
 /*    */ import java.lang.reflect.Method;
 /*    */ import javax.management.ObjectName;
 /*    */ import org.jboss.kernel.Kernel;
/*    */ import org.jboss.logging.Logger;
/*    */ 
/*    */ public class MCClientKernelAbstraction
/*    */   implements ClientKernelAbstraction
/*    */ {
/* 38 */   private static final Logger log = Logger.getLogger(MCClientKernelAbstraction.class);
/*    */   protected Kernel kernel;
/*    */ 
/*    */   public MCClientKernelAbstraction(Kernel kernel)
/*    */   {
/* 44 */     this. = kernel;
/*    */   }
/*    */ 
/*    */   public Object invoke(ObjectName objectNameString operationNameObject[] paramsString[] signaturethrows Exception
/*    */   {
/* 49 */     String name = objectName.getCanonicalName();
/* 50 */     KernelRegistryEntry entry = this..getRegistry().getEntry(name);
/* 51 */     if (entry != null)
/*    */     {
/* 53 */       Object target = entry.getTarget();
/* 54 */       if ((target instanceof RARDeployment))
/*    */       {
/* 56 */         RARDeployment deployment = (RARDeployment)target;
/* 57 */         return deployment.invoke(operationNameparamssignature);
/*    */       }
/*    */ 
/* 61 */       Class[] types = new Class[signature.length];
/* 62 */       for (int i = 0; i < signature.lengthi++)
/*    */       {
/* 64 */         types[i] = Thread.currentThread().getContextClassLoader().loadClass(signature[i]);
/*    */       }
/* 66 */       Method method = target.getClass().getMethod(operationNametypes);
/* 67 */       return method.invoke(targetparams);
/*    */     }
/*    */ 
/* 70 */     return null;
/*    */   }
/*    */ 
/*    */   public Object getAttribute(ObjectName objectNameString attributethrows Exception
/*    */   {
/* 75 */     String name = objectName.getCanonicalName();
/* 76 */     KernelRegistryEntry entry = this..getRegistry().getEntry(name);
/* 77 */     if (entry != null)
/*    */     {
/* 79 */       Object target = entry.getTarget();
/* 80 */       Field field = target.getClass().getField(attribute);
/* 81 */       return field.get(target);
/*    */     }
/* 83 */     return null;
/*    */   }
/*    */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/jboss-embedded-all.jar
 * Qualified Name:     org.jboss.ejb3.MCClientKernelAbstraction
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X