Package org.jboss.metatype.api.types

Examples of org.jboss.metatype.api.types.CompositeMetaType


  @Override
  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


  @Override
  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()));
View Full Code Here

  @Override
  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()));
View Full Code Here

  @Override
  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()));
View Full Code Here

  @Override
  public MetaValue createMetaValue(MetaType metaType, CacheStatisticsMetadata object) {
    if (object == null)
      return null;
    if (metaType instanceof CompositeMetaType) {
      CompositeMetaType composite = (CompositeMetaType) metaType;
      CompositeValueSupport cache = new CompositeValueSupport(composite);
     
      cache.set(TOTAL_ENTRIES, SimpleValueSupport.wrap(object.getTotalEntries()));
      cache.set(HITRATIO, SimpleValueSupport.wrap(object.getHitRatio()));
      cache.set(REQUEST_COUNT, SimpleValueSupport.wrap(object.getRequestCount()));
View Full Code Here

      assertEquals("type-mapping", SimpleValueSupport.wrap("Hypersonic SQL"), p.getValue());
*/
      p = props.get("security-domain");
      assertNotNull("security-domain", p);

      CompositeMetaType secType = (CompositeMetaType) p.getMetaType();
      assertNotNull(secType);
      assertTrue(secType.containsItem("domain"));
      assertTrue(secType.containsItem("securityDeploymentType"));

      log.info("security-domain: "+secType);
   }
View Full Code Here

      {
         return (MapCompositeValueSupport) toClone.clone();
      }
      else
      {
         CompositeMetaType type = toClone.getMetaType();
         Map<String, MetaValue> map = new HashMap<String, MetaValue>();
         for (String key : type.keySet())
         {
            map.put(key, toClone.get(key));
         }
         return new MapCompositeValueSupport(map, type);
      }
View Full Code Here

      {
         return (MapCompositeValueSupport) toClone.clone();
      }
      else
      {
         CompositeMetaType type = toClone.getMetaType();
         Map<String, MetaValue> map = new HashMap<String, MetaValue>();
         for (String key : type.keySet())
         {
            map.put(key, toClone.get(key));
         }
         return new MapCompositeValueSupport(map, type);
      }
View Full Code Here

      String driverClassName = lds.getDriverClass();
      assertEquals("org.jboss.jdbc.ClusteredDriver", driverClassName);
      // Validate the security-domain
      ManagedProperty secDomain = mo.getProperty("security-domain");
      assertNotNull("security-domain", secDomain);
      CompositeMetaType compType = (CompositeMetaType) secDomain.getMetaType();
      assertNotNull(compType);
      CompositeValue sdCV = (CompositeValue) secDomain.getValue();
      assertNotNull("security-domain.CV", sdCV);

      SimpleValue domainName = (SimpleValue) sdCV.get("domain");
      assertNotNull("security-domain.domain", domainName);
      assertEquals(SimpleValueSupport.wrap("java:/jaas/SomeDomain"), domainName);
      assertNotNull("security-domain.deploymentType", sdCV.get("securityDeploymentType"));
      assertEquals("APPLICATION", ((EnumValue) sdCV.get("securityDeploymentType")).getValue());
      assertFalse(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
     
      // Set a new security domain and check if the metaType changed
      CompositeValueSupport newSecDomain = new CompositeValueSupport(compType);
      newSecDomain.set("domain", SimpleValueSupport.wrap("test"));
      newSecDomain.set("securityDeploymentType", new EnumValueSupport(
            (EnumMetaType) compType.getType("securityDeploymentType"),
            SecurityDeploymentType.DOMAIN_AND_APPLICATION));
      secDomain.setValue(newSecDomain);
     
      assertTrue(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
   }
View Full Code Here

      {
         return (MapCompositeValueSupport) toClone.clone();
      }
      else
      {
         CompositeMetaType type = toClone.getMetaType();
         Map<String, MetaValue> map = new HashMap<String, MetaValue>();
         for (String key : type.keySet())
         {
            map.put(key, toClone.get(key));
         }
         return new MapCompositeValueSupport(map, type);
      }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.types.CompositeMetaType

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.