Package javax.management.openmbean

Examples of javax.management.openmbean.CompositeType.keySet()


        if (propertyPrefix == null)
            propertyPrefix = "";
        if (result instanceof CompositeDataSupport) {
            CompositeDataSupport data = (CompositeDataSupport) result;
            CompositeType compositeType = data.getCompositeType();
            Set keys = compositeType.keySet();
            for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key = (String) iter.next();
                Object value = data.get(key);
                OpenType type = compositeType.getType(key);
                if (type instanceof SimpleType) {
View Full Code Here


    assert( testMap.getValue( "Foo" ).equals( new Integer( test.getFoo() ) ) );
    assert( testMap.getValue( "Bar" ).equalstest.getBar() ) );
   
      final CompositeData  d  = J2EEUtil.statisticToCompositeData( testMap );
      final CompositeType  t  = d.getCompositeType();
      final Set<String> values  = TypeCast.asSet( t.keySet() );
      assert( values.contains( "Name" ) );
      assert( values.contains( "Foo" ) );
      assert( values.contains( "Bar" ) );
     
      final MapStatisticImpl  roundTrip  = (MapStatisticImpl)StatisticFactory.create( d );
View Full Code Here

                contentType = (CompositeType)((ArrayType<CompositeType>)((OpenMBeanParameterInfo)op.getSignature()[2]).getOpenType()).getElementOpenType();
                break;
            }
        }
        Map<String, Object> values = new HashMap<String, Object>();
        for (String key : contentType.keySet()) {
            values.put(key, null);
        }
        values.put("hash", hash);
        CompositeData contents = new CompositeDataSupport(contentType, values);
View Full Code Here

 
    private static Map<String,Statistic>
  createStatisticsMap( final CompositeData compositeData )
  {
    final CompositeType  compositeType  = compositeData.getCompositeType();
    final Set    keySet  = compositeType.keySet();
    final Iterator  iter  = keySet.iterator();
   
    final Map<String,Statistic>  map  = new HashMap<String,Statistic>();
   
    while ( iter.hasNext() )
View Full Code Here

    buf.append( "Composite data:\n" );
   
    final CompositeData  data  = (CompositeData)o;
    final CompositeType  type  = data.getCompositeType();
   
    final Set    keySet  = type.keySet();
    final Iterator  iter  = keySet.iterator();
    while ( iter.hasNext() )
    {
      final String  key  = (String)iter.next();
      final Object  item  = data.get( key );
View Full Code Here

    public static Map<String,Serializable>
  compositeDataToMap( final CompositeData data )
  {
    final Map<String,Serializable>    map  = new HashMap<String,Serializable>();
    final CompositeType    type  = data.getCompositeType();
    final Set<String>   keySet  = TypeCast.asSet( type.keySet() );
   
    for( String name : keySet )
    {
      map.put( name, (Serializable)data.get( name ) );
    }
View Full Code Here

         // assert hashcodes are equal
         assertEquals(type.hashCode(), tShirtType.hashCode());
         assertTrue(type.getType("price").equals(SimpleType.FLOAT));
         assertEquals(type.getType("size"), tShirtType.getType("size"));
         assertEquals(type.getDescription("model"), tShirtType.getDescription("model"));
         assertEquals(type.keySet(), tShirtType.keySet());
      }
      catch (IOException e)
      {
         e.printStackTrace();
      }
View Full Code Here

     */
    public static Map<String, Serializable> compositeDataToMap(final CompositeData data)
    {
        final Map<String, Serializable> map = new HashMap<String, Serializable>();
        final CompositeType type = data.getCompositeType();
        final Set<String> keySet = TypeCast.asSet(type.keySet());

        for (String name : keySet)
        {
            map.put(name, (Serializable) data.get(name));
        }
View Full Code Here

  @SuppressWarnings("unchecked")
  private void report(CompositeDataSupport data, PrintStream out) {
    CompositeType type = data.getCompositeType();
    out.print(",");
    for(Iterator it = type.keySet().iterator();it.hasNext();){
      String key = (String) it.next();
      if(data.containsKey(key))
        out.print(key+'='+data.get(key));
      if(it.hasNext())
        out.print(';');
View Full Code Here

            }

            if (max == null) {
                final String msg =
                    "No constructor has a @ConstructorProperties for this set of " +
                    "items: " + ct.keySet();
                throw new InvalidObjectException(msg);
            }

            Object[] params = new Object[max.presentParams.cardinality()];
            for (int i = 0; i < itemNames.length; i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.