Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.CompositeValueSupport


  private Object getCacheProperty(ProfileServiceConnection connection,String metric) {
    int dotIndex = metric.indexOf('.');
    String cacheType = metric.substring(0, dotIndex);
    String property = metric.substring(dotIndex + 1);
    CompositeValueSupport mv = (CompositeValueSupport) getCacheStats(connection, cacheType);
    MetaValue v = mv.get(property);
    return ((SimpleValue) v).getValue();
  }
View Full Code Here


  public SessionMetadata unwrapSessionMetaValue(MetaValue metaValue) throws Exception {
    if (metaValue == null)
      return null;

    if (metaValue instanceof CompositeValue) {
      CompositeValueSupport compositeValue = (CompositeValueSupport) metaValue;
     
      SessionMetadata session = new SessionMetadata();
      session.setApplicationName((String) ProfileServiceUtil.stringValue(compositeValue.get(APPLICATION_NAME)));
      session.setCreatedTime((Long) ProfileServiceUtil.longValue(compositeValue.get(CREATED_TIME)));
      session.setClientHostName((String) ProfileServiceUtil.stringValue(compositeValue.get(CLIENT_HOST_NAME)));
      session.setIPAddress((String) ProfileServiceUtil.stringValue(compositeValue.get(IP_ADDRESS)));
      session.setLastPingTime((Long) ProfileServiceUtil.longValue(compositeValue.get(LAST_PING_TIME)));
      session.setSessionId((String) ProfileServiceUtil.stringValue(compositeValue.get(SESSION_ID)));
      session.setUserName((String) ProfileServiceUtil.stringValue(compositeValue.get(USER_NAME)));
      session.setVDBName((String) ProfileServiceUtil.stringValue(compositeValue.get(VDB_NAME)));
      session.setVDBVersion((Integer) ProfileServiceUtil.integerValue(compositeValue.get(VDB_VERSION)));
      session.setSecurityDomain((String) ProfileServiceUtil.stringValue(compositeValue.get(SECURITY_DOMAIN)));
      return session;
    }
    throw new IllegalStateException("Unable to unwrap session " + metaValue); //$NON-NLS-1$
  }
View Full Code Here

public class PropertyMapToCompositeValueSupportAdapter extends AbstractPropertyMapToCompositeValueAdapter
        implements PropertyAdapter<PropertyMap, PropertyDefinitionMap>
{
    protected void putValue(CompositeValue compositeValue, String key, MetaValue value)
    {
        CompositeValueSupport compositeValueSupport = (CompositeValueSupport)compositeValue;
        compositeValueSupport.set(key, value);
    }
View Full Code Here

                    MetaType mapMemberMetaType = ProfileServiceUtil.convertPropertyDefinitionToMetaType(mapMemberPropDef);
                    compositeMetaType.addItem(mapMemberPropDef.getName(), mapMemberDesc, mapMemberMetaType);
                }
            }
        }
        return new CompositeValueSupport(compositeMetaType);
    }
View Full Code Here

        {
            TableValueSupport valueSupport = (TableValueSupport)metaValue;
            Collection<CompositeValue> values = valueSupport.values();
            for (CompositeValue value : values)
            {
                CompositeValueSupport support = (CompositeValueSupport)value;
            }
        }
    }
View Full Code Here

  public MetaValue createMetaValue(MetaType metaType, RequestMetadata object) {
    if (object == null)
      return null;
    if (metaType instanceof CompositeMetaType) {
      CompositeMetaType composite = (CompositeMetaType) metaType;
      CompositeValueSupport request = new CompositeValueSupport(composite);
     
      request.set(EXECUTION_ID, SimpleValueSupport.wrap(object.getExecutionId()));
      request.set(SESSION_ID, SimpleValueSupport.wrap(object.getSessionId()));
      request.set(START_TIME, SimpleValueSupport.wrap(object.getStartTime()));
      request.set(COMMAND, SimpleValueSupport.wrap(object.getCommand()));
      request.set(SOURCE_REQUEST, SimpleValueSupport.wrap(object.sourceRequest()));
      request.set(NODE_ID, SimpleValueSupport.wrap(object.getNodeId()));
      request.set(TRANSACTION_ID,SimpleValueSupport.wrap(object.getTransactionId()));
      EnumMetaType emt = (EnumMetaType)composite.getType(STATE);
      request.set(STATE, new EnumValueSupport(emt, object.getState()));
      request.set(THREAD_STATE, new EnumValueSupport((EnumMetaType)composite.getType(THREAD_STATE), object.getThreadState()));
      return request;
    }
    throw new IllegalArgumentException("Cannot convert RequestMetadata " + object); //$NON-NLS-1$
  }
View Full Code Here

  public MetaValue createMetaValue(MetaType metaType, TransactionMetadata object) {
    if (object == null)
      return null;
    if (metaType instanceof CompositeMetaType) {
      CompositeMetaType composite = (CompositeMetaType) metaType;
      CompositeValueSupport transaction = new CompositeValueSupport(composite);
     
      transaction.set(ASSOCIATED_SESSION, SimpleValueSupport.wrap(object.getAssociatedSession()));
      transaction.set(CREATED_TIME, SimpleValueSupport.wrap(object.getCreatedTime()));
      transaction.set(SCOPE, SimpleValueSupport.wrap(object.getScope()));
      transaction.set(ID, SimpleValueSupport.wrap(object.getId()));
     
      return transaction;
    }
    throw new IllegalArgumentException("Cannot convert TransactionMetadata " + object); //$NON-NLS-1$
  }
View Full Code Here

    list.add(map);
    MetaType metaType = pValue.getMetaType();
    if (metaType.isCollection()) {
      for (MetaValue value : ((CollectionValueSupport) pValue)
          .getElements()) {
        CompositeValueSupport compValue = ((CompositeValueSupport) value);
        for (MetaValue propValue : compValue.values()) {
          String propertyName = ((CompositeValueSupport) propValue)
              .get("name").toString();
          String propertyValue = ((CompositeValueSupport) propValue)
              .get("value").toString();
          map.put("name", propertyName);
View Full Code Here

  public MetaValue createMetaValue(MetaType metaType, WorkerPoolStatisticsMetadata object) {
    if (object == null)
      return null;
    if (metaType instanceof CompositeMetaType) {
      CompositeMetaType composite = (CompositeMetaType) metaType;
      CompositeValueSupport transaction = new CompositeValueSupport(composite);
     
      transaction.set(ACTIVE_THREADS, SimpleValueSupport.wrap(object.getActiveThreads()));
      transaction.set(HIGHEST_ACTIVE_THREADS, SimpleValueSupport.wrap(object.getHighestActiveThreads()));
      transaction.set(TOTAL_COMPLETED, SimpleValueSupport.wrap(object.getTotalCompleted()));
      transaction.set(TOTAL_SUBMITTED, SimpleValueSupport.wrap(object.getTotalSubmitted()));
      transaction.set(QUEUE_NAME, SimpleValueSupport.wrap(object.getQueueName()));
      transaction.set(QUEUED, SimpleValueSupport.wrap(object.getQueued()));
      transaction.set(HIGHEST_QUEUED, SimpleValueSupport.wrap(object.getHighestQueued()));
      transaction.set(MAX_THREADS, SimpleValueSupport.wrap(object.getMaxThreads()));
     
      return transaction;
    }
    throw new IllegalArgumentException("Cannot convert Worker Pool Statistics " + object); //$NON-NLS-1$
  }
View Full Code Here

  public MetaValue createMetaValue(MetaType metaType, SessionMetadata object) {
    if (object == null)
      return null;
    if (metaType instanceof CompositeMetaType) {
      CompositeMetaType composite = (CompositeMetaType) metaType;
      CompositeValueSupport session = new CompositeValueSupport(composite);
     
      session.set(APPLICATION_NAME, SimpleValueSupport.wrap(object.getApplicationName()));
      session.set(CREATED_TIME, SimpleValueSupport.wrap(object.getCreatedTime()));
      session.set(CLIENT_HOST_NAME, SimpleValueSupport.wrap(object.getClientHostName()));
      session.set(IP_ADDRESS, SimpleValueSupport.wrap(object.getIPAddress()));
      session.set(LAST_PING_TIME, SimpleValueSupport.wrap(object.getLastPingTime()));
      session.set(SESSION_ID, SimpleValueSupport.wrap(object.getSessionId()));
      session.set(USER_NAME, SimpleValueSupport.wrap(object.getUserName()));
      session.set(VDB_NAME,SimpleValueSupport.wrap(object.getVDBName()));
      session.set(VDB_VERSION, SimpleValueSupport.wrap(object.getVDBVersion()));
      session.set(SECURITY_DOMAIN, SimpleValueSupport.wrap(object.getSecurityDomain()));
     
      return session;
    }
    throw new IllegalArgumentException("Cannot convert session " + object); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.values.CompositeValueSupport

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.