Package org.jboss.metadata.ejb.jboss

Examples of org.jboss.metadata.ejb.jboss.JBossEntityBeanMetaData


               if(trace)
                  log.trace("mapEjbs: "+ejbCompID+", mappings: "+mappings);
            }
            else if(bean instanceof JBossEntityBeanMetaData)
            {
               JBossEntityBeanMetaData ebean = (JBossEntityBeanMetaData) bean;
               EntityBeanJNDINameResolver entityBeanJNDINameResolver = JNDIPolicyBasedJNDINameResolverFactory.getJNDINameResolver(ebean, this.defaultJNDIBindingPolicy);
               String ejbName = ebean.getEjbName();
               // home
               if(ebean.getHome() != null && ebean.getHome().length() > 0)
               {
                  String homeJNDIName = entityBeanJNDINameResolver.resolveRemoteHomeJNDIName(ebean);
                  cdmd.addJndiName(homeJNDIName);
                  // Add ejb/vfsPath@iface
                  String home = ebean.getHome();
                  String ifacePath = prefix + "@" + home;
                  if(endpointAlternateMap.containsKey(ifacePath))
                     log.debug(ejbName+" duplicates home: "+home+", existing: "+endpointAlternateMap.get(ifacePath));
                  else
                  {
                     endpointAlternateMap.put(ifacePath, ejbCompID);
                     mappings.add(ifacePath);
                     if(trace)
                        log.trace("mapEjbs, local-home: "+ifacePath+", ejbName: "+ejbName);
                  }
                  // Add ejb/iface
                  ifacePath = "ejb@" + home;
                  if(endpointMap.containsKey(ifacePath))
                  {
                     // TODO: may need to track the duplicates to create an error
                     log.debug(ejbName+" duplicates home: "+home+", existing: "+endpointMap.get(ifacePath));
                  }
                  else
                  {
                     endpointAlternateMap.put(ifacePath, ejbCompID);
                     mappings.add(ifacePath);
                     if(trace)
                        log.trace("mapEjbs, home: "+ifacePath+", ejbName: "+ejbName);
                  }
               }
               // remote
               if(ebean.getRemote() != null && ebean.getRemote().length() > 0)
               {
                  // Add ejb/vfsPath@iface
                  String remote = ebean.getRemote();
                  String ifacePath = prefix + "@" + remote;
                  if(endpointAlternateMap.containsKey(ifacePath))
                     log.debug(ejbName+" duplicates remote: "+remote+", existing: "+endpointAlternateMap.get(ifacePath));
                  else
                  {
                     endpointAlternateMap.put(ifacePath, ejbCompID);
                     mappings.add(ifacePath);
                     if(trace)
                        log.trace("mapEjbs, remote: "+ifacePath+", ejbName: "+ejbName);
                  }
                  // Add ejb/iface
                  ifacePath = "ejb@" + remote;
                  if(endpointMap.containsKey(ifacePath))
                  {
                     // TODO: may need to track the duplicates to create an error
                     log.debug(ejbName+" duplicates remote: "+remote+", existing: "+endpointMap.get(ifacePath));
                  }
                  else
                  {
                     endpointAlternateMap.put(ifacePath, ejbCompID);
                     mappings.add(ifacePath);
                     if(trace)
                        log.trace("mapEjbs, local: "+ifacePath+", ejbName: "+ejbName);
                  }
               }
               // local-home
               if(ebean.getLocalHome() != null && ebean.getLocalHome().length() > 0)
               {
                  String localHomeJNDIName = entityBeanJNDINameResolver.resolveLocalHomeJNDIName(ebean);
                  cdmd.addJndiName(localHomeJNDIName);
                  // Add ejb/vfsPath@iface
                  String local = ebean.getLocalHome();
                  String ifacePath = prefix + "@" + local;
                  if(endpointAlternateMap.containsKey(ifacePath))
                     log.debug(ejbName+" duplicates local-home: "+local+", existing: "+endpointAlternateMap.get(ifacePath));
                  else
                  {
                     endpointAlternateMap.put(ifacePath, ejbCompID);
                     mappings.add(ifacePath);
                     if(trace)
                        log.trace("mapEjbs, local-home: "+ifacePath+", ejbName: "+ejbName);
                  }
                  // Add ejb/iface
                  ifacePath = "ejb@" + local;
                  if(endpointMap.containsKey(ifacePath))
                  {
                     // TODO: may need to track the duplicates to create an error
                     log.debug(ejbName+" duplicates local-home: "+local+", existing: "+endpointMap.get(ifacePath));
                  }
                  else
                  {
                     endpointAlternateMap.put(ifacePath, ejbCompID);
                     mappings.add(ifacePath);
                     if(trace)
                        log.trace("mapEjbs, local-home: "+ifacePath+", ejbName: "+ejbName);
                  }
               }
               // local
               if(ebean.getLocal() != null && ebean.getLocal().length() > 0)
               {
                  // Add ejb/vfsPath@iface
                  String local = ebean.getLocal();
                  String ifacePath = prefix + "@" + local;
                  if(endpointAlternateMap.containsKey(ifacePath))
                     log.debug(ejbName+" duplicates local: "+local+", existing: "+endpointAlternateMap.get(ifacePath));
                  else
                  {
View Full Code Here


      {
         // FIXME the session.getHomeJndiName should be moved to the JBossSessionMetaData.determineJndiName()
         // and these if statements replaced with md.determineJndiName()
         if( beanMD.isEntity() )
         {
            JBossEntityBeanMetaData md = (JBossEntityBeanMetaData) beanMD;
            jndiName = md.determineJndiName();
         }
         else if( beanMD.isSession())
         {
            JBossSessionBeanMetaData md = (JBossSessionBeanMetaData) beanMD;
            jndiName = md.getHomeJndiName();
            if(jndiName == null)
               jndiName = md.determineJndiName();
         }
      }
      return jndiName;
   }
View Full Code Here

      }
      else
      {
         if( beanMD.isEntity() )
         {
            JBossEntityBeanMetaData md = (JBossEntityBeanMetaData) beanMD;
            jndiName = md.determineJndiName();
         }
         else if( beanMD.isSession())
         {
            JBossSessionBeanMetaData md = (JBossSessionBeanMetaData) beanMD;
            jndiName = md.determineJndiName();
         }
      }
      return jndiName;
   }
View Full Code Here

    *
    * @return true for version 2.x
    */
   public boolean isCMP2x()
   {
      JBossEntityBeanMetaData entity = getDelegate();
      boolean isCMP2x = false;
      if(entity.getCmpVersion() != null)
         isCMP2x = entity.getCmpVersion().equals("2.x");
      else
         isCMP2x = entity.getEjbJarMetaData().isEJB2x();
      return isCMP2x;
   }
View Full Code Here

    *
    * @return true for version 2.x
    */
   public boolean isCMP2x()
   {
      JBossEntityBeanMetaData entity = getDelegate();
      boolean isCMP2x = false;
      if(entity.getCmpVersion() != null)
         isCMP2x = entity.getCmpVersion().equals("2.x");
      else
         isCMP2x = entity.getEjbJarMetaData().isEJB2x();
      return isCMP2x;
   }
View Full Code Here

      // TODO DOM pool-config
   }
  
   private void assertNullEntityBean(String prefix, JBossMetaData jbossMetaData)
   {
      JBossEntityBeanMetaData entity = assertJBossEntityBean(prefix, jbossMetaData);
      assertNull(entity.getId());
      assertNull(entity.getDescriptionGroup());
     
      assertNull(entity.getJndiName());
      assertNull(entity.getLocalJndiName());
      assertNull(entity.getConfigurationName());
      assertNull(entity.getSecurityProxy());
      assertNull(entity.getSecurityDomain());

      assertFalse(entity.isCallByValue());
      assertFalse(entity.isReadOnly());
      assertFalse(entity.isExceptionOnRollback());
      assertTrue(entity.isTimerPersistence());
      assertFalse(entity.isClustered());
      assertFalse(entity.isCacheInvalidation());
     
      assertNull(entity.getInvokerBindings());

      assertNullEnvironment(entity.getJndiEnvironmentRefsGroup());

      assertNull(entity.getMethodAttributes());
     
      assertNull(entity.getSecurityIdentity());
     
      assertNull(entity.getClusterConfig());

      assertNull(entity.getCacheInvalidationConfig());

      assertNull(entity.getDepends());

      assertNull(entity.getIorSecurityConfig());

      assertNull(entity.getAnnotations());
      assertNull(entity.getIgnoreDependency());
      assertNull(entity.getAopDomainName());
      assertNull(entity.getJndiRefs());
   }
View Full Code Here

   }

   public void testResolvedJndiNamesWithKnownIfacesEntity()
   {
      JBossEnterpriseBeanMetaData beanMD = getEntityMetaData();
      JBossEntityBeanMetaData sbeanMD = (JBossEntityBeanMetaData) beanMD;
      sbeanMD.setLocal("org.jboss.ifaces.LocalIF");
      sbeanMD.setLocalHome("org.jboss.ifaces.LocalHomeIF");
      sbeanMD.setHome("org.jboss.ifaces.HomeIF");
      sbeanMD.setRemote("org.jboss.ifaces.RemoteIF");

      String resolvedJndiName = beanMD.determineResolvedJndiName(null, null);
      assertEquals("base/testResolvedJndiNamesWithKnownIfacesEntity-jndi-name", resolvedJndiName);     
      String resolvedJndiNameHome = beanMD.determineResolvedJndiName("org.jboss.ifaces.HomeIF", null);
      assertEquals("base/testResolvedJndiNamesWithKnownIfacesEntity-jndi-name/home", resolvedJndiNameHome);     
View Full Code Here

      DeploymentSummary deploymentSummary = new DeploymentSummary();
      deploymentSummary.setDeploymentName(name);
      deploymentSummary.setDeploymentScopeBaseName("base");
      deploymentSummary.setPackagingType(PackagingType.EAR);
      jbossMetaData.setDeploymentSummary(deploymentSummary);
      JBossEntityBeanMetaData sbeanMD = new JBossEntityBeanMetaData();
      sbeanMD.setEjbName(name+"-ejb");
      sbeanMD.setEjbClass("org.jboss.ejb."+name);
      sbeanMD.setJndiName(name+"-jndi-name");
      JBossEnterpriseBeansMetaData beans = new JBossEnterpriseBeansMetaData();
      beans.setEjbJarMetaData(jbossMetaData);
      beans.add(sbeanMD);
      jbossMetaData.setEnterpriseBeans(beans);
      return sbeanMD;
View Full Code Here

      JBossMetaData jbossMetaData = unmarshal("JBoss30_entityConfig.xml", JBossMetaData.class, null);
      JBossMetaData mergedMetaData = new JBossMetaData();
      mergedMetaData.merge(jbossMetaData, specMetaData);

      JBossEntityBeanMetaData jbe = (JBossEntityBeanMetaData) mergedMetaData.getEnterpriseBean("EjbName");
      assertNotNull(jbe);
      assertTrue(jbe.isCMP1x());
   }
View Full Code Here

      assertNotNull(enterpriseBeans);
      assertEquals(2, enterpriseBeans.size());
     
      // Test that we get a proper default config when there is no
      // <cache-invalidation-config> block in jboss.xml
      JBossEntityBeanMetaData bean = (JBossEntityBeanMetaData) enterpriseBeans.get("TestEntity1");
      assertNotNull(bean);
      CacheInvalidationConfigMetaData cicmd = bean.getCacheInvalidationConfig();
      assertNull(cicmd);
      cicmd = bean.determineCacheInvalidationConfig();
      assertNotNull(cicmd);
      assertNull(cicmd.getInvalidationGroupName());
      assertNull(cicmd.getInvalidationManagerName());
      assertEquals("TestEntity1", cicmd.determineInvalidationGroupName());
      assertEquals(CacheInvalidationConfigMetaData.DEFAULT_INVALIDATION_MANAGER_NAME,
                   cicmd.determineInvalidationManagerName());
     
      // Test that a <cache-invalidation-config> block in jboss.xml
      // is respected
      bean = (JBossEntityBeanMetaData) enterpriseBeans.get("TestEntity2");
      assertNotNull(bean);
      cicmd = bean.getCacheInvalidationConfig();
      assertNotNull(cicmd);
      CacheInvalidationConfigMetaData gotten = cicmd;
      cicmd = bean.determineCacheInvalidationConfig();
      assertEquals(gotten, cicmd);
      assertEquals("TestEntityGroup2", cicmd.getInvalidationGroupName());
      assertEquals("TestInvalidationManager", cicmd.getInvalidationManagerName());
      assertEquals("TestEntityGroup2", cicmd.determineInvalidationGroupName());
      assertEquals("TestInvalidationManager", cicmd.determineInvalidationManagerName());
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.jboss.JBossEntityBeanMetaData

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.