Package javax.management.openmbean

Examples of javax.management.openmbean.OpenDataException


                    ((SortedSet) valueCollection).comparator();
                if (comparator != null) {
                    final String msg =
                        "Cannot convert SortedSet with non-null comparator: " +
                        comparator;
                    throw new OpenDataException(msg);
                }
            }
            final Object[] openArray = (Object[])
                Array.newInstance(getOpenClass().getComponentType(),
                                  valueCollection.size());
View Full Code Here


        final Object toNonNullOpenValue(MXBeanLookup lookup, Object value)
                throws OpenDataException {
            lookupNotNull(lookup, OpenDataException.class);
            ObjectName name = lookup.mxbeanToObjectName(value);
            if (name == null)
                throw new OpenDataException("No name for object: " + value);
            return name;
        }
View Full Code Here

                Comparator comparator = ((SortedMap) valueMap).comparator();
                if (comparator != null) {
                    final String msg =
                        "Cannot convert SortedMap with non-null comparator: " +
                        comparator;
                    throw new OpenDataException(msg);
                }
            }
            final TabularType tabularType = (TabularType) getOpenType();
            final TabularData table = new TabularDataSupport(tabularType);
            final CompositeType rowType = tabularType.getRowType();
View Full Code Here

    }

    public static CompositeData convert(Object message) throws OpenDataException {
        OpenTypeFactory f = getFactory(message.getClass());
        if (f == null) {
            throw new OpenDataException("Cannot create a CompositeData for type: " + message.getClass().getName());
        }
        CompositeType ct = f.getCompositeType();
        Map<String, Object> fields = f.getFields(message);
        return new CompositeDataSupport(ct, fields);
    }
View Full Code Here

    }

    public static CompositeData convert(Object message) throws OpenDataException {
        OpenTypeFactory f = getFactory(message.getClass());
        if (f == null) {
            throw new OpenDataException("Cannot create a CompositeData for type: " + message.getClass().getName());
        }
        CompositeType ct = f.getCompositeType();
        Map<String, Object> fields = f.getFields(message);
        return new CompositeDataSupport(ct, fields);
    }
View Full Code Here

    }

    public static CompositeData convert(Message message) throws OpenDataException {
        OpenTypeFactory f = getFactory(message.getClass());
        if (f == null) {
            throw new OpenDataException("Cannot create a CompositeData for type: " + message.getClass().getName());
        }
        CompositeType ct = f.getCompositeType();
        Map<String, Object> fields = f.getFields(message);
        return new CompositeDataSupport(ct, fields);
    }
View Full Code Here

            ObjectToJsonConverter converter = converters.getToJsonConverter();
            result = converter.convertToJson(value, null, JsonConvertOptions.DEFAULT);
        } catch (RuntimeException rte) {
            throw rte;
        } catch (Exception ex) {
            OpenDataException odex = new OpenDataException("Cannot convert value: " + value.getClass().getName());
            odex.initCause(ex);
            throw odex;
        }
        return result;
    }
View Full Code Here

            } else if (otype instanceof ArrayType) {
                result = toArrayData((ArrayType<?>) otype, value);
            } else if (otype == SimpleType.BYTE && value instanceof Number) {
                result = Byte.parseByte(value.toString());
            } else {
                throw new OpenDataException("Unsupported open type: " + otype);
            }
        } else {
            result = value;
        }
        boolean isAssignable = result == null || otype.isValue(result);
View Full Code Here

                }
            }
            IllegalStateAssertion.assertNotNull(method, "Cannot find getter: " + beanClass.getName() + "." + methodName);
            return method.invoke(bean, (Object[]) null);
        } catch (Exception ex) {
            OpenDataException odex = new OpenDataException("Cannot invoke getter for: " + itemName);
            odex.initCause(ex);
            throw odex;
        }
    }
View Full Code Here

        } else if (otype instanceof ArrayType) {
            result = fromArrayData((ArrayType<?>) otype, classLoader, value);
        } else if (otype instanceof SimpleType) {
            result = value;
        } else {
            throw new OpenDataException("Unsupported open type: " + otype);
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of javax.management.openmbean.OpenDataException

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.