Package org.jboss.mx.server

Examples of org.jboss.mx.server.InvocationException


            callback.store();
         }
         catch (Throwable t)
         {
            // FIXME: check the exception handling
            throw new InvocationException(t, "Cannot persist the MBean data.");
         }

         return returnValue;
      }
View Full Code Here


               standardInfo = MBeanInfoConversion.stripAttributeOperations(
                     MBeanInfoConversion.toModelMBeanInfo(info), false);
            }
            catch (MBeanException e)
            {
               throw new InvocationException(e);
            }
         }
        
         return standardInfo;
      }
View Full Code Here

            // check if already wrapping an invocation exception
            if (e.getTargetException() instanceof InvocationException)
               throw (InvocationException)e.getTargetException();
              
            // otherwise wrap as invocation exception
            throw new InvocationException(e);
         }
        
         // anything else is an unforeseen exception, just wrap it and let
         // the invoker deal with it
         catch (Throwable t)
         {
            throw new InvocationException(t);
         }
      }
     
      // invoke non-shared interceptor directly via Java reference
      else
View Full Code Here

            {
               invoker.invoke(setMethod, new Object[] { value }, new String[] { invocation.getAttributeType() });
            }
            catch (Throwable t)
            {
               throw new InvocationException(t);
            }
         }

         // get the currency time limit value
         String timeLimit = (String)d.getFieldValue(CURRENCY_TIME_LIMIT);
         long limit = (timeLimit == null) ? 0 : Long.parseLong(timeLimit);
           
         // if caching is not disabled, update the descriptor fields
         if (limit != 0)
         {
            d.setField(VALUE, value);
            d.setField(LAST_UPDATED_TIME_STAMP, "" + System.currentTimeMillis() / 1000);
            invocation.setDescriptor(d);
         }
        
         // send notification
         try
         {
            ((ModelMBeanInvoker)invoker).sendAttributeChangeNotification(
               new Attribute(invocation.getName(), oldValue),
               new Attribute(invocation.getName(), value)
            );        
         }
         catch (MBeanException e)
         {
            throw new InvocationException(e, "attribute change notification error");
         }
      }
        
      else if (invocation.getType().equals(Invocation.OP_GETATTRIBUTE))
      {  
         // get the attribute's descriptor
         String getMethod = (String)d.getFieldValue(GET_METHOD);
        
         if (getMethod != null)
         {
            String timeLimit = (String)d.getFieldValue(CURRENCY_TIME_LIMIT);
            long limit = (timeLimit == null) ? 0 : Long.parseLong(timeLimit);

            if (limit == -1)
               return d.getFieldValue(VALUE);
 
            // if >0 caching is enabled
            if (limit > 0)
            {
               String timeStamp = (String)d.getFieldValue(LAST_UPDATED_TIME_STAMP);
               long lastUpdate = (timeStamp == null) ? 0 : Long.parseLong(timeStamp);
          
               // if the value hasn't gone stale, return from the descriptor
               if (System.currentTimeMillis() < lastUpdate * 1000 + limit * 1000)
                  return d.getFieldValue(VALUE);
            }

            // we got here means either stale value in descriptior, or zero time limit
            MBeanInvoker invoker = invocation.getInvoker();
            Object value = null;
           
            try
            {
               value = invoker.invoke(getMethod, new Object[0], new String[0]);
            }
            catch (Throwable t)
            {
               throw new InvocationException(t);
            }
           
            // update the descriptor
            d.setField(VALUE, value);
            d.setField(LAST_UPDATED_TIME_STAMP, "" + System.currentTimeMillis() / 1000);
View Full Code Here

TOP

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

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.