Package javax.management

Examples of javax.management.MalformedObjectNameException


    protected ObjectName createObjectName(StringBuilder buffer) throws MalformedObjectNameException {
        String text = buffer.toString();
        try {
            return new ObjectName(text);
        } catch (MalformedObjectNameException e) {
            throw new MalformedObjectNameException("Could not create ObjectName from: " + text + ". Reason: " + e);
        }
    }
View Full Code Here


  public static ObjectName getInstance(Object objectName) throws MalformedObjectNameException {
    if (objectName instanceof ObjectName) {
      return (ObjectName) objectName;
    }
    if (!(objectName instanceof String)) {
      throw new MalformedObjectNameException("Invalid ObjectName value type [" +
          objectName.getClass().getName() + "]: only ObjectName and String supported.");
    }
    return getInstance((String) objectName);
  }
View Full Code Here

    Class managedClass = JmxUtils.getClassToExpose(managedBean);
    ManagedResource mr = this.attributeSource.getManagedResource(managedClass);

    // Check that the managed resource attribute has been specified.
    if (mr == null) {
      throw new MalformedObjectNameException("Your bean class [" + managedBean.getClass().getName() +
          "] must be marked with a valid ManagedResource attribute when using MetadataNamingStrategy");
    }

    // Check that an object name has been specified.
    String objectName = mr.getObjectName();

    if (!StringUtils.hasText(objectName)) {
      throw new MalformedObjectNameException(
          "You must specify an ObjectName for class [" + managedBean.getClass().getName() + "]");
    }

    // Now try to parse the name.
    return ObjectNameManager.getInstance(objectName);
View Full Code Here

    protected ObjectName createObjectName(StringBuffer buffer) throws MalformedObjectNameException {
        String text = buffer.toString();
        try {
            return new ObjectName(text);
        } catch (MalformedObjectNameException e) {
            throw new MalformedObjectNameException("Could not create ObjectName from: " + text + ". Reason: " + e);
        }
    }
View Full Code Here

                                      ",service=" + serviceName +
                                      ",port=" + port +
                                      ",address=" + address);
                return (name);
            } catch (Exception e) {
                throw new MalformedObjectNameException
                    ("Cannot create object name for " + connector+e);
            }
        } else if ("org.apache.coyote.tomcat4.CoyoteConnector".equals
                   (connector.getClass().getName())) {
            try {
                String address = (String)
                    PropertyUtils.getSimpleProperty(connector, "address");
                Integer port = (Integer)
                    PropertyUtils.getSimpleProperty(connector, "port");
                Service service = connector.getService();
                String serviceName = null;
                if (service != null)
                    serviceName = service.getName();
                name = new ObjectName(domain + ":type=Connector" +
                                      ",service=" + serviceName +
                                      ",port=" + port +
                                      ",address=" + address);
                return (name);
            } catch (Exception e) {
                throw new MalformedObjectNameException
                    ("Cannot create object name for " + connector+e);
            }
        } else {
            throw new MalformedObjectNameException
                ("Cannot create object name for " + connector);
        }

    }
View Full Code Here

        Container container = null;
        if( valve instanceof Contained ) {
            container = ((Contained)valve).getContainer();
        }
        if( container == null ) {
            throw new MalformedObjectNameException(
                               "Cannot create mbean for non-contained valve " +
                               valve);
        }

        if (container instanceof Engine) {
View Full Code Here

                }
            }
            name = new ObjectName(sb.toString());
            return (name);
        } catch (Exception e) {
            MalformedObjectNameException mone =
                new MalformedObjectNameException
                ("Cannot create object name for " + connector);
            mone.initCause(e);
            throw mone;
        }
    }
View Full Code Here

            className = className.substring(period + 1);
        if( valve instanceof Contained ) {
            container = ((Contained)valve).getContainer();
        }
        if( container == null ) {
            throw new MalformedObjectNameException(
                               "Cannot create mbean for non-contained valve " +
                               valve);
        }       
        if (container instanceof Engine) {
            Service service = ((Engine)container).getService();
View Full Code Here

                    sb.append(",address=" + address);
                }
                name = new ObjectName(sb.toString());
                return (name);
            } catch (Exception e) {
                throw new MalformedObjectNameException
                    ("Cannot create object name for " + connector+e);
            }
        } else {
            throw new MalformedObjectNameException
                ("Cannot create object name for " + connector);
        }

    }
View Full Code Here

            className = className.substring(period + 1);
        if( valve instanceof Contained ) {
            container = ((Contained)valve).getContainer();
        }
        if( container == null ) {
            throw new MalformedObjectNameException(
                               "Cannot create mbean for non-contained valve " +
                               valve);
        }       
        if (container instanceof Engine) {
            Service service = ((Engine)container).getService();
View Full Code Here

TOP

Related Classes of javax.management.MalformedObjectNameException

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.