Package javax.management.modelmbean

Examples of javax.management.modelmbean.InvalidTargetObjectTypeException


            throw new RuntimeOperationsException
                (new IllegalArgumentException("Managed resource is null"),
                 "Managed resource is null");

        if (!"objectreference".equalsIgnoreCase(type))
            throw new InvalidTargetObjectTypeException(type);

        this.resource = resource;
        this.resourceType = resource.getClass().getName();
       
        // Make the resource aware of the model mbean.
View Full Code Here


            throw new RuntimeOperationsException
                (new IllegalArgumentException("Managed resource is null"),
                 "Managed resource is null");

        if (!"objectreference".equalsIgnoreCase(type))
            throw new InvalidTargetObjectTypeException(type);

        this.resource = resource;
        this.resourceType = resource.getClass().getName();
       
        // Make the resource aware of the model mbean.
View Full Code Here

   {
      if (ref == null)
         throw new IllegalArgumentException("Resource reference cannot be null.");

      if (!isSupportedResourceType(ref, resourceType))
         throw new InvalidTargetObjectTypeException("Unsupported resource type: " + resourceType);

      setResource(ref);
      this.resourceType = resourceType;
   }
View Full Code Here

            throw new RuntimeOperationsException
                (new IllegalArgumentException("Managed resource is null"),
                 "Managed resource is null");

        if (!"objectreference".equalsIgnoreCase(type))
            throw new InvalidTargetObjectTypeException(type);

        this.resource = resource;
        this.resourceType = resource.getClass().getName();
       
        // Make the resource aware of the model mbean.
View Full Code Here

            throw new RuntimeOperationsException
                (new IllegalArgumentException("Managed resource is null"),
                 "Managed resource is null");

        if (!"objectreference".equalsIgnoreCase(type))
            throw new InvalidTargetObjectTypeException(type);

        this.resource = resource;
        this.resourceType = resource.getClass().getName();
       
        // Make the resource aware of the model mbean.
View Full Code Here

            throw new RuntimeOperationsException
                (new IllegalArgumentException("Managed resource is null"),
                 "Managed resource is null");

        if (!"objectreference".equalsIgnoreCase(type))
            throw new InvalidTargetObjectTypeException(type);

        this.resource = resource;

    }
View Full Code Here

            throw new RuntimeOperationsException
                (new IllegalArgumentException("Managed resource is null"),
                 "Managed resource is null");

        if (!"objectreference".equalsIgnoreCase(type))
            throw new InvalidTargetObjectTypeException(type);

        this.resource = resource;
        this.resourceType = resource.getClass().getName();
       
        // Make the resource aware of the model mbean.
View Full Code Here

    */
   public void setManagedResource(Object ref, String resourceType)
      throws MBeanException, InstanceNotFoundException, InvalidTargetObjectTypeException
   {
      if (!isSupportedResourceType(ref, resourceType))
         throw new InvalidTargetObjectTypeException("Unsupported resource type: " + resourceType);

      setResource(ref);
      this.resourceType = resourceType;

      if (getServer() != null)
View Full Code Here

            Object descriptorTarget = descriptor.getFieldValue(ModelMBeanConstants.TARGET_OBJECT);
            if (descriptorTarget != null)
            {
               String targetType = (String) descriptor.getFieldValue(ModelMBeanConstants.TARGET_TYPE);
               if (ModelMBeanConstants.OBJECT_REF.equalsIgnoreCase(targetType) == false)
                  throw new InvalidTargetObjectTypeException("Target type is " + targetType);
               target = descriptorTarget;

               // Determine the method
               Class clazz = null;
               String className = (String) descriptor.getFieldValue(ModelMBeanConstants.CLASS);
View Full Code Here

               Object descriptorTarget = d.getFieldValue(ModelMBeanConstants.TARGET_OBJECT);
               if (descriptorTarget != null)
               {
                  String targetType = (String) d.getFieldValue(ModelMBeanConstants.TARGET_TYPE);
                  if (ModelMBeanConstants.OBJECT_REF.equalsIgnoreCase(targetType) == false)
                     throw new InvalidTargetObjectTypeException("Target type is " + targetType);
                  target = descriptorTarget;
               }
               String getMethodString = (String) d.getFieldValue(ModelMBeanConstants.GET_METHOD);
               if (getMethodString != null && (getMethod == null || getMethodString.equals(getMethod.getName()) == false))
               {
                  MBeanInvoker invoker = invocation.getInvoker();
                  Object object = invoker.invoke(getMethodString, new Object[0], new String[0]);
                  checkAssignable(getMethodString, invocation.getAttributeTypeClass(), object);
                  return object;
               }
            }
         }
         if (target == null)
            throw new MBeanException(new ServiceNotFoundException("No Target"));
         try
         {
            value = getMethod.invoke(target, args);
         }
         catch (Throwable t)
         {
            handleInvocationExceptions(t);
            return null;
         }
      }
      // Setter
      else
      {
         Method setMethod = setter;
         if (dynamic)
         {
            Descriptor d = invocation.getDescriptor();
            if (d != null)
            {
               Object descriptorTarget = d.getFieldValue(ModelMBeanConstants.TARGET_OBJECT);
               if (descriptorTarget != null)
               {
                  String targetType = (String) d.getFieldValue(ModelMBeanConstants.TARGET_TYPE);
                  if (ModelMBeanConstants.OBJECT_REF.equalsIgnoreCase(targetType) == false)
                     throw new InvalidTargetObjectTypeException("Target type is " + targetType);
                  target = descriptorTarget;
               }
               String setMethodString = (String) d.getFieldValue(ModelMBeanConstants.SET_METHOD);
               if (setMethodString != null && (setMethod == null || setMethodString.equals(setMethod.getName()) == false))
               {
View Full Code Here

TOP

Related Classes of javax.management.modelmbean.InvalidTargetObjectTypeException

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.