Examples of EntityMetadata


Examples of com.tll.model.EntityMetadata

    final Interface intf = dao.load(Interface.class, accountInterface.getInterfaceKey());

    // remove existing account subscribed options
    IBusinessKey<InterfaceOptionAccount> bk;
    try {
      BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
      bk = bkf.create(InterfaceOptionAccount.class, "Option Id and Account Id");
    }
    catch(final BusinessKeyNotDefinedException e) {
      throw new IllegalStateException(e);
    }
View Full Code Here

Examples of com.tll.model.EntityMetadata

      return;
    }

    IBusinessKey<InterfaceOptionAccount> bk;
    try {
      BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
      bk = bkf.create(InterfaceOptionAccount.class, "Option Id and Account Id");
    }
    catch(final BusinessKeyNotDefinedException e) {
      throw new IllegalStateException(e);
    }
View Full Code Here

Examples of com.tll.model.EntityMetadata

    final Account a = stub(Asp.class, true);
    final AccountInterface ai = stubAccountInterface(intf, a, false);

    getInterfaceService().setAccountInterface(ai);

    BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
    final IBusinessKey<InterfaceOptionAccount> bk = bkf.create(InterfaceOptionAccount.class, "Option Id and Account Id");
    bk.setPropertyValue("option.id", io.getId());
    bk.setPropertyValue("account.id", a.getId());
    final InterfaceOptionAccount ioa = getDao().load(bk);
    Assert.assertNotNull(ioa);
View Full Code Here

Examples of com.wyn.rest.server.data.EntityMetadata

  public static EntityFieldsExtractor getInstance() {
    return instance;
  }

  public Map<String, Object> extractFields(Object owner) throws Exception {
    EntityMetadata metadata = cache.get(owner.getClass());
    List<Field> fields = metadata.getFields();

    Map<String, Object> fieldsMap = new HashMap<String, Object>();

    for(Field field : fields) {
      Object val = field.get(owner);
View Full Code Here

Examples of org.jboss.metadata.EntityMetaData

    * @jmx:managed-operation
    */
   public void remove(String id)
      throws Exception
   {
      EntityMetaData metaData = (EntityMetaData) m_container.getBeanMetaData();
      String primKeyClass = metaData.getPrimaryKeyClass();
      Object key = PropertyEditors.convertValue(id, primKeyClass);
      remove(key);
   }
View Full Code Here

Examples of org.jboss.metadata.EntityMetaData

      Object instance = ctx.getInstance();
      Class ejbClass = instance.getClass();
      Field cmpField;
      Class cmpFieldType;

      EntityMetaData metaData = (EntityMetaData)con.getBeanMetaData();
      Iterator i = metaData.getCMPFields();

      while (i.hasNext())
      {
         // get the field declaration
         try
View Full Code Here

Examples of org.jboss.metadata.EntityMetaData

   public void setContainer(Container container)
   {
      super.setContainer(container);
      if (container != null)
      {
         EntityMetaData meta = (EntityMetaData) container.getBeanMetaData();
         reentrant = meta.isReentrant();
      }
   }
View Full Code Here

Examples of org.jboss.metadata.EntityMetaData

         // This is an entity bean (lifespan: persistent)
         beanServantRegistry =
            servantRegistries.getServantRegistry(registryWithPersistentPOA);

         Class pkClass;
         EntityMetaData metaData = (EntityMetaData)container.getBeanMetaData();
         String pkClassName = metaData.getPrimaryKeyClass();
         try {
            if (pkClassName != null)
               pkClass = container.getClassLoader().loadClass(pkClassName);
            else
               pkClass = container.getClassLoader().loadClass(
                     metaData.getEjbClass()).getField(
                           metaData.getPrimKeyField()).getClass();
         }
         catch (NoSuchFieldException e) {
            logger.error("Unable to identify Bean's Primary Key class! "
                         + "Did you specify a primary key class and/or field? "
                         + "Does that field exist?");
View Full Code Here

Examples of org.jboss.metadata.EntityMetaData

      log = Logger.getLogger(getClass().getName() + "." + tableName);

      this.schema = schema;
      this.tableId = tableId;

      final EntityMetaData entityMetaData = ((EntityMetaData)entity.getContainer().getBeanMetaData());
      final ConfigurationMetaData containerConf = entityMetaData.getContainerConfiguration();
      dontFlushCreated = containerConf.isInsertAfterEjbPostCreate();

      // create cache
      final Element cacheConf = containerConf.getContainerCacheConf();
      final Element cachePolicy = cacheConf == null ? null : MetaData.getOptionalChild(cacheConf, "cache-policy-conf");

      int minCapacity;
      int maxCapacity;
      if(cachePolicy != null)
      {
         String str = MetaData.getOptionalChildContent(cachePolicy, "min-capacity");
         minCapacity = (str == null ? 1000 : Integer.parseInt(str));
         str = MetaData.getOptionalChildContent(cachePolicy, "max-capacity");
         maxCapacity = (str == null ? 10000 : Integer.parseInt(str));
      }
      else
      {
         minCapacity = 1000;
         maxCapacity = 10000;
      }

      final Element otherConf = cacheConf == null ? null : MetaData.getOptionalChild(cacheConf, "cache-policy-conf-other");

      int partitionsTotal;
      final boolean invalidable;
      final Element batchCommitStrategy;
      if(otherConf != null)
      {
         String str = MetaData.getOptionalChildContent(otherConf, "partitions");
         partitionsTotal = (str == null ? 10 : Integer.parseInt(str));
         batchCommitStrategy = MetaData.getOptionalChild(otherConf, "batch-commit-strategy");
         invalidable = MetaData.getOptionalChild(otherConf, "invalidable") == null ? false : true;
      }
      else
      {
         partitionsTotal = 10;
         batchCommitStrategy = null;
         invalidable = false;
      }

      if(cachePolicy != null)
      {
         cache = new PartitionedTableCache(minCapacity, maxCapacity, partitionsTotal);

         String periodStr = MetaData.getOptionalChildContent(cachePolicy, "overager-period");
         String maxAgeStr = MetaData.getOptionalChildContent(cachePolicy, "max-bean-age");
         if(periodStr != null && maxAgeStr == null || maxAgeStr != null && periodStr == null)
         {
            throw new DeploymentException(
               "Failed to initialize age-out thread for entity " + entity.getEntityName() +
               ": overager-period or max-bean-age is missing!");
         }
         else if(periodStr != null && maxAgeStr != null)
         {
            long period = Long.parseLong(periodStr);
            long maxAge = Long.parseLong(maxAgeStr);
            ((PartitionedTableCache)cache).initOverager(period, maxAge, entity.getEntityName() + " overager");

            if(log.isTraceEnabled())
            {
               log.trace("initialized age-out thread for " + entity.getEntityName() +
                  ": overager-period=" + period + ", max-bean-age=" + maxAge);
            }
         }

         final MBeanServer server = MBeanServerLocator.locateJBoss();
         serviceController = (ServiceControllerMBean)
            MBeanProxyExt.create(ServiceControllerMBean.class,
               ServiceControllerMBean.OBJECT_NAME,
               server);
         try
         {
            cacheName =
               new ObjectName("jboss.cmp:service=tablecache,ejbname=" + metadata.getName() + ",table=" + tableName);
            server.registerMBean(cache, cacheName);
            serviceController.create(cacheName);
         }
         catch(Exception e)
         {
            throw new DeploymentException("Failed to register table cache for " + tableName, e);
         }
      }
      else
      {
         cache = Cache.NONE;
      }

      if(invalidable)
      {
         String groupName = entityMetaData.getDistributedCacheInvalidationConfig().getInvalidationGroupName();
         String imName = entityMetaData.getDistributedCacheInvalidationConfig().getInvalidationManagerName();

         InvalidationManagerMBean im = (InvalidationManagerMBean) Registry.lookup(imName);
         InvalidationGroup invalidationGroup = im.getInvalidationGroup(groupName);

         cacheInvalidator = new CacheInvalidator(cache, entity.getContainer().getTransactionManager(), invalidationGroup);
View Full Code Here

Examples of org.jboss.metadata.EntityMetaData

     
      EntityBeanMetaData entity = (EntityBeanMetaData) specMetaData.getEnterpriseBean("EjbName");
      assertNotNull(entity);
      assertTrue(entity.isCMP1x());
     
      EntityMetaData emd = (EntityMetaData) old.getBeanByEjbName("EjbName");
      assertNotNull(emd);
      assertTrue(emd.isCMP1x());

      JBossMetaData jbossMetaData = unmarshal("JBoss30_entityConfig.xml", JBossMetaData.class, null);
      JBossMetaData mergedMetaData = new JBossMetaData();
      mergedMetaData.merge(jbossMetaData, specMetaData);
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.