Java 8 MalformedObjectNameException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 MalformedObjectNameException class.

This code example shows how to use the following methods:
	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);
	} 
 
	/** 
	 * Retrieve the {@code ObjectName} instance corresponding to the supplied name. 
	 * @param objectName the {@code ObjectName} in {@code String} format 
	 * @return the {@code ObjectName} instance 
	 * @throws MalformedObjectNameException in case of an invalid object name specification 
	 * @see ObjectName#ObjectName(String) 
	 * @see ObjectName#getInstance(String) 
	 */ 
	public static ObjectName getInstance(String objectName) throws MalformedObjectNameException {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage, printStackTrace
            logger.error(e.getMessage());
        } catch (NotCompliantMBeanException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        } catch (MalformedObjectNameException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        } 
    } 
 
    /** 
     * Constructor 
     */ 
    private FacebookAPIMonitor() { 
    } 
 
    public static FacebookAPIMonitor getInstance() { 
        return SINGLETON;
    } 
 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
    ObjectName name = null;
    try { 
      name = new ObjectName("hadoop:" +
                  "service=" + serviceName + ",name=" + nameName);
    } catch (MalformedObjectNameException e) {
      e.printStackTrace();
    } 
    return name;
  } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	} 
 
	@Test public void testDynamicMBeansWithMalformedObjectName() 
			throws NotCompliantMBeanException, MalformedObjectNameException { 
		final DynamicMBeanPerson person = new DynamicMBeanPerson(); 
		final Exception exception = new MalformedObjectNameException("JUnit"); 
 
		final ObjectNameFactory objectNameFactory = mockery 
				.mock(ObjectNameFactory.class); 
		mockery.checking(new Expectations() { 
			{ 
				one(objectNameFactory).create(with(equal("JUnit")), 
						with(same(person))); 
				will(throwException(exception)); 
			} 
		}); 
 
		final DynamicMBeanProvider provider = new DynamicMBeanComponentProvider( 
				objectNameFactory); 
		try { 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
        try { 
            ProcessingParameters paramsMerged = pProcessingParams.mergedParams((Map<String,String>) pRequestMap.get("config"));
            RequestType type = RequestType.getTypeByName((String) pRequestMap.get("type"));
            return (R) getCreator(type).create(pRequestMap, paramsMerged);
        } catch (MalformedObjectNameException e) {
            throw new IllegalArgumentException("Invalid object name. " + e.getMessage(),e);
        } 
    } 
 
    /** 
     * Create a list of {@link JmxRequest}s from a JSON list representing jmx requests 
     * 
     * @param pJsonRequests JSON representation of a list of {@link JmxRequest} 
     * @param pProcessingParams processing options. Must not be null. 
     * @return list with one or more {@link JmxRequest} 
     */ 
    public static List<JmxRequest> createPostRequests(List pJsonRequests, ProcessingParameters pProcessingParams) {
        List<JmxRequest> ret = new ArrayList<JmxRequest>();
        for (Object o : pJsonRequests) {
            if (!(o instanceof Map)) {
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
    { 
        try { 
            return new ObjectName(getAsText());
        } 
        catch (MalformedObjectNameException e) {
            throw new PropertyEditorException(e.getMessage(), e);
        } 
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
    ObjectName name = null;
    try { 
      name = new ObjectName("org.cloudata:" + "service=" + serviceName + ",name="
          + nameName);
    } catch (MalformedObjectNameException e) {
      e.printStackTrace();
    } 
    return name;
  } 
   
  private void setAttributes() throws IOException {
    InputStream is = getClass().getResourceAsStream(PROPERTIES_FILE);
    if (is != null) {
      try { 
        Properties properties = new Properties();
        properties.load(is);
        Iterator it = properties.keySet().iterator();
        while (it.hasNext()) {
          String propertyName = (String) it.next();
          String propertyValue = properties.getProperty(propertyName);
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
        this.objName = objName;
        try { 
            this.object = new ObjectName(objName);
            suffix = objName.substring(objName.lastIndexOf("=") + 1);
        } catch (MalformedObjectNameException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
        } 
    } 
 
    public void setAttrName(String attrName) {
        assert (attrName != null && !attrName.isEmpty());
        this.attrName = attrName;
    } 
 
    public void setInterval(long interval) {
        assert (interval > 1);
        this.interval = interval;
    } 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
    protected void onSetUp() throws Exception {
         
        try { 
            ton = new ObjectName("org.apache.cxf:Type=testInstrumentation");
        } catch (MalformedObjectNameException e) {            
            e.printStackTrace();
        } catch (NullPointerException e) {            
            e.printStackTrace();
        } 
        
         
        //create the mbean and register it 
        ModelMBeanInfo mbi = getMBeanInfoFromAssembler();
         
        RequiredModelMBean rtMBean;
         
        rtMBean = (RequiredModelMBean)server.instantiate(
            "javax.management.modelmbean.RequiredModelMBean"); 
                        
        rtMBean.setModelMBeanInfo(mbi);
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
	enum BatchJobAction { 
		start,stop,restart,next,abandon
	} 
 
	private final J4pClient j4pClient;
	private final MBeanOps mbeanOps;
 
	private static int jobCount;
 
	public AdminCommands() { 
		j4pClient = new J4pClient("http://localhost:8778/jolokia/");
		mbeanOps = new MBeanOps(j4pClient);
		try { 
			PropertyUtil.setTargetUrl("http://localhost:8081"); 
		} catch (ConfigurationException e) {}
	} 
 
 
	@CliAvailabilityIndicator({"admin list-jobs", "admin list-executions", "admin list-input-adapters", 
			"admin list-output-adapters", "admin list-components", "admin adapter"}) 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 MalformedObjectNameException Methods: