Package javax.management

Examples of javax.management.JMException


  public static long extractNumberTag(Tag tag) throws JMException {
    if (tag instanceof NumberTag) {
      NumberTag ntag = (NumberTag) tag;
      return ntag.getNumber();
    }
    throw new JMException("Tag is not number tag\n"+tag);
  }
View Full Code Here


      {
         throw new MalformedObjectNameException("Provider must not be null");
      }
    synchronized (mProviders) {
     if (mProviders.contains(pProviderObjectName))
      throw new JMException("Already registered: " + pProviderObjectName);
     mProviders.add(pProviderObjectName);
    }
    server.invoke(
        pProviderObjectName,
        "startProviding",
View Full Code Here

            for (int i = 0; i < bindings.length; i++)
            {
                final String[] keyAndValue = bindings[i].split("=");
                if (keyAndValue == null || keyAndValue.length == 0 || keyAndValue.length > 2 || keyAndValue[0].length() == 0)
                {
                    throw new JMException("Format for headers binding should be \"<attribute1>=<value1>,<attribute2>=<value2>\"");
                }

                if(keyAndValue.length == 1)
                {
                    //no value was given, only a key. Use an empty value to signal match on key presence alone
View Full Code Here

            getConfiguredObject().createExchange(name, State.ACTIVE, durable,
                                            LifetimePolicy.PERMANENT, 0l, type, Collections.EMPTY_MAP);
        }
        catch (IllegalArgumentException iae)
        {
            JMException jme = new JMException(iae.toString());
            throw new MBeanException(jme, "Error in creating exchange " + name);
        }

    }
View Full Code Here

        {
            theExchange.delete();
        }
        catch (IllegalStateException ex)
        {
            final JMException jme = new JMException(ex.toString());
            throw new MBeanException(jme, "Error in unregistering exchange " + exchangeName);
        }
    }
View Full Code Here

            RequiredModelMBean mbean = (RequiredModelMBean)server.instantiate(RequiredModelMBean.class.getName());
            mbean.setModelMBeanInfo(mbi);
            try {
              mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
                throw new JMException(itotex.getMessage());
            }
            registerMBeanWithServer(mbean, name, forceRegistration);
        }               
  }
View Full Code Here

                .getName());
            mbean.setModelMBeanInfo(mbi);
            try {
                mbean.setManagedResource(obj, "ObjectReference");
            } catch (InvalidTargetObjectTypeException itotex) {
                throw new JMException(itotex.getMessage());
            }
            registerMBeanWithServer(mbean, name, forceRegistration);
        }
    }
View Full Code Here

        mbean.setModelMBeanInfo(mbi);

        try {
            mbean.setManagedResource(obj, "ObjectReference");
        } catch (InvalidTargetObjectTypeException e) {
            throw new JMException(e.getMessage());
        }
       
        // Allows the managed object to send notifications
        if (obj instanceof NotificationSenderAware) {
            ((NotificationSenderAware)obj).setNotificationSender(new NotificationSenderAdapter(mbean));
View Full Code Here

            getConfiguredObject().createExchange(name, State.ACTIVE, durable,
                                            LifetimePolicy.PERMANENT, 0l, type, Collections.EMPTY_MAP);
        }
        catch (IllegalArgumentException iae)
        {
            JMException jme = new JMException(iae.toString());
            throw new MBeanException(jme, "Error in creating exchange " + name);
        }

    }
View Full Code Here

        {
            theExchange.delete();
        }
        catch (IllegalStateException ex)
        {
            final JMException jme = new JMException(ex.toString());
            throw new MBeanException(jme, "Error in unregistering exchange " + exchangeName);
        }
    }
View Full Code Here

TOP

Related Classes of javax.management.JMException

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.