Package org.jboss.mx.server

Examples of org.jboss.mx.server.InvocationContext


     
      for (int i = 0; i < operations.length; ++i)
      {
         OperationKey key = new OperationKey(operations[i]);
        
         InvocationContext ctx = (InvocationContext)operationContextMap.get(key);
        
         ctx.setDescriptor(((ModelMBeanOperationInfo)operations[i]).getDescriptor());     
      }
   }
View Full Code Here


   {
      super.initAttributeContexts(attributes);
     
      for (int i = 0; i < attributes.length; ++i)
      {
         InvocationContext ctx = (InvocationContext)attributeContextMap.get(attributes[i].getName());
        
         ctx.setDescriptor(((ModelMBeanAttributeInfo)attributes[i]).getDescriptor());
      }
   }
View Full Code Here

     
      while (it.hasNext())
      {
         String key = (String)it.next();
        
         InvocationContext ctx = (InvocationContext)attributeContextMap.get(key);
         List list = (List)ctx.getInterceptors();
        
         // at minimum all model mbeans have this interceptor
         Interceptor interceptor = new ModelMBeanAttributeInterceptor();
         //interceptor.setLogger(log);
        
View Full Code Here

     
      assertTrue(server.isRegistered(new ObjectName(
            JBOSSMX_DOMAIN + ":" + "type=Interceptor,name=MySharedInterceptor,ID=0"
      )));
     
      InvocationContext ic = new InvocationContext();
      Invocation i = new Invocation();

      i.addContext(ic);
      i.setType("bloopah");
     
View Full Code Here

      }

      // Set the mbean descriptor on the info context for use by interceptor config
      final ModelMBeanInfo minfo = (ModelMBeanInfo) info;
      Descriptor mbeanDescriptor = minfo.getMBeanDescriptor();
      getMBeanInfoCtx = new InvocationContext();
      getMBeanInfoCtx.setInvoker(this);
      getMBeanInfoCtx.setDescriptor(mbeanDescriptor);
      getMBeanInfoCtx.setDispatcher(new AbstractInterceptor("MBeanInfo Dispatcher")
      {
         public Object invoke(Invocation invocation) throws Throwable
         {
            return minfo;
         }
      });
      // JBAS-33 - No need to register the "getMBeanInfo" context to the operationsContextMap,
      // this is only accessible through AbstractMBeanInvoker.getMBeanInfo().
      // Registering it will result in duplicate interceptor construction.

      // Need to install the setManagedResource op
      // TODO, this is probably uneccessary now so revisit this
      String[] signature = new String[]{"java.lang.Object", "java.lang.String"};
      OperationKey opKey = new OperationKey("setManagedResource", signature);
      InvocationContext ctx = new InvocationContext();
      ctx.setInvoker(this);
      ctx.setDispatcher(new AbstractInterceptor("SetMangedResource Dispatcher")
      {
         public Object invoke(Invocation invocation) throws Throwable
         {
            Object[] args = invocation.getArgs();
            setManagedResource(args[0], (String) args[1]);
View Full Code Here

      for (int i = 0; i < operations.length; ++i)
      {
         OperationKey key = new OperationKey(operations[i]);

         InvocationContext ctx = (InvocationContext) operationContextMap.get(key);
         ModelMBeanOperationInfo info = (ModelMBeanOperationInfo) operations[i];
         ctx.setDescriptor(info.getDescriptor());
      }
   }
View Full Code Here

      for (int i = 0; i < attributes.length; ++i)
      {
         ModelMBeanAttributeInfo info = (ModelMBeanAttributeInfo) attributes[i];
         String name = info.getName();
         InvocationContext ctx = (InvocationContext) attributeContextMap.get(name);
         ctx.setDescriptor(info.getDescriptor());
         ctx.setReadable(info.isReadable());
         ctx.setWritable(info.isWritable());
      }
   }
View Full Code Here

      // Get any custom interceptors specified at the attribute level
      for (Iterator it = attributeContextMap.entrySet().iterator(); it.hasNext();)
      {
         Map.Entry entry = (Map.Entry) it.next();

         InvocationContext ctx = (InvocationContext) entry.getValue();
         List list = getInterceptors(ctx.getDescriptor());
         if (list == null)
         {
            // Use the mbean inteceptors if sepecified
            if (defaultInterceptors != null)
            {
               list = new ArrayList(defaultInterceptors);
            }
            else
            {
               list = new ArrayList();
            }
         }
         // Add the attribute accessor semantic interceptors
         list.add(new PersistenceInterceptor());
         list.add(new ModelMBeanAttributeInterceptor());
         ctx.setInterceptors(list);
      }

      // Get any custom interceptors specified at the operation level
      for (Iterator it = operationContextMap.entrySet().iterator(); it.hasNext();)
      {
         Map.Entry entry = (Map.Entry) it.next();

         InvocationContext ctx = (InvocationContext) entry.getValue();
         List list = getInterceptors(ctx.getDescriptor());
         if (list == null && defaultInterceptors != null)
            list = new ArrayList(defaultInterceptors);
        
         // Add operation caching (not for standard mbeans)
         if (dynamicResource)
         {
            if (list == null)
            {
               list = new ArrayList();
            }
            list.add(new ModelMBeanOperationInterceptor());
         }
           
         if (list != null)
         {
            // Add a noop interceptor since the 3.2.3- interceptors always had
            // to delegate to the next in order to dispatch the operation. Now
            // there is no interceptor for this so this prevents NPEs.
           
            list.add(new NullInterceptor());
            ctx.setInterceptors(list);
         }
      }
   }
View Full Code Here

      for (Iterator it = attributeContextMap.entrySet().iterator(); it.hasNext();)
      {
         Map.Entry entry = (Map.Entry) it.next();
         String key = (String) entry.getKey();

         InvocationContext ctx = (InvocationContext) entry.getValue();
         //Initialize value from descriptor.
         Object value = ctx.getDescriptor().getFieldValue(XMBeanConstants.CACHED_VALUE);
         if (value != null)
         {
            setAttribute(new Attribute(key, value));
         } // end of if ()
      }
View Full Code Here

/* 442 */       throw new RuntimeErrorException(new Error("MBeanInfo has not been set."));
/*     */     }
/*     */
/* 447 */     ModelMBeanInfo minfo = (ModelMBeanInfo)this.info;
/* 448 */     Descriptor mbeanDescriptor = minfo.getMBeanDescriptor();
/* 449 */     this.getMBeanInfoCtx = new InvocationContext();
/* 450 */     this.getMBeanInfoCtx.setInvoker(this);
/* 451 */     this.getMBeanInfoCtx.setDescriptor(mbeanDescriptor);
/* 452 */     this.getMBeanInfoCtx.setDispatcher(new AbstractInterceptor("MBeanInfo Dispatcher", minfo)
/*     */     {
/*     */       public Object invoke(Invocation invocation) throws Throwable
/*     */       {
/* 456 */         return this.val$minfo;
/*     */       }
/*     */     });
/* 465 */     String[] signature = { "java.lang.Object", "java.lang.String" };
/* 466 */     AbstractMBeanInvoker.OperationKey opKey = new AbstractMBeanInvoker.OperationKey(this, "setManagedResource", signature);
/* 467 */     InvocationContext ctx = new InvocationContext();
/* 468 */     ctx.setInvoker(this);
/* 469 */     ctx.setDispatcher(new AbstractInterceptor("SetMangedResource Dispatcher")
/*     */     {
/*     */       public Object invoke(Invocation invocation) throws Throwable
/*     */       {
/* 473 */         Object[] args = invocation.getArgs();
/* 474 */         ModelMBeanInvoker.this.setManagedResource(args[0], (String)args[1]);
View Full Code Here

TOP

Related Classes of org.jboss.mx.server.InvocationContext

Copyright © 2018 www.massapicom. 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.