FileDocCategorySizeDatePackage
EnterpriseBeans.javaAPI DocJBoss 4.2.19506Fri Jul 13 20:53:56 BST 2007org.jboss.ejb3.metamodel

EnterpriseBeans

public class EnterpriseBeans extends Object
Represents EJB elements of the ejb-jar.xml deployment descriptor for the 1.4 schema
author
William DeCoste ejbs.setCurrentEjbName(value); } else if (localName.equals("jndi-name")){ ejbs.setJndiName(value);
version
$Revision: 61248 $

Fields Summary
private static final Logger
log
private HashMap
enterpriseBeans
private EnterpriseBean
currentEjb
Constructors Summary
Methods Summary
public voidaddDependency(java.lang.String depends)

      currentEjb.addDependency(depends);
   
public voidaddEnterpriseBean(EnterpriseBean ejb)

      enterpriseBeans.put(ejb.getEjbName(), ejb);
   
public voidaddIgnoreDependency(org.jboss.metamodel.descriptor.InjectionTarget ignore)

      currentEjb.addIgnoreDependency(ignore);
   
public voidaddJndiRef(org.jboss.metamodel.descriptor.JndiRef ref)

      currentEjb.addJndiRef(ref);
   
public voidaddMessageDestinationRef(org.jboss.metamodel.descriptor.MessageDestinationRef ref)

      currentEjb.mergeMessageDestinationRef(ref);
   
public voidaddRemoteBinding(RemoteBinding binding)

      currentEjb.addRemoteBinding(binding);
   
public voidaddResourceEnvRef(org.jboss.metamodel.descriptor.ResourceEnvRef ref)

      currentEjb.mergeResourceEnvRef(ref);
   
public voidaddResourceRef(org.jboss.metamodel.descriptor.ResourceRef ref)

      currentEjb.mergeResourceRef(ref);
   
public voidaddServiceRef(org.jboss.ws.integration.ServiceRefMetaData ref)

      currentEjb.addServiceRef(ref);
   
public voidaddXmlAnnotation(XmlAnnotation xmlAnnotation)

      currentEjb.addXmlAnnotation(xmlAnnotation);
   
public EnterpriseBeancreateEjbByEjbName(java.lang.String ejbName, java.lang.Class ejbClass)

      EnterpriseBean ejb = (EnterpriseBean) enterpriseBeans.get(ejbName);
      if (ejb != null)
         return ejb;
      
      try 
      {
         ejb = (EnterpriseBean)ejbClass.newInstance();
         ejb.setEjbName(ejbName);
         enterpriseBeans.put(ejbName, ejb);
      }
      catch (Exception e){}
      
      return ejb;
   
public booleanequals(java.lang.Object o)

      if (this == o)
         return true;
      if (!(o instanceof EnterpriseBeans))
         return false;

      final EnterpriseBeans ejbs = (EnterpriseBeans) o;

      if (enterpriseBeans != null ? !enterpriseBeans
              .equals(ejbs.enterpriseBeans) : ejbs.enterpriseBeans != null)
         return false;

      return true;
   
public EnterpriseBeanfindEjbByEjbName(java.lang.String ejbName)

      return enterpriseBeans.get(ejbName);
   
public EnterpriseBeanfindEjbByLocal(java.lang.String local)

      Iterator ejbs = enterpriseBeans.values().iterator();
      while (ejbs.hasNext())
      {
         EnterpriseBean ejb = (EnterpriseBean) ejbs.next();
         if (ejb.getLocal() != null && ejb.getLocal().equals(local))
            return ejb;
      }
      return null;
   
public EnterpriseBeanfindEjbByRemote(java.lang.String remote)

      Iterator ejbs = enterpriseBeans.values().iterator();
      while (ejbs.hasNext())
      {
         EnterpriseBean ejb = (EnterpriseBean) ejbs.next();
         if (ejb.getRemote() != null && ejb.getRemote().equals(remote))
            return ejb;
      }
      return null;
   
public java.util.ListfindEjbs()

      ArrayList<EnterpriseBean> result = new ArrayList<EnterpriseBean>(enterpriseBeans.values().size());

      Iterator<EnterpriseBean> ejbs = enterpriseBeans.values().iterator();
      while (ejbs.hasNext())
      {
         result.add(ejbs.next());
      }
      return result;
   
public java.util.ListfindEjbsByClass(java.lang.String className)

      ArrayList<EnterpriseBean> result = new ArrayList<EnterpriseBean>();

      Iterator ejbs = enterpriseBeans.values().iterator();
      while (ejbs.hasNext())
      {
         EnterpriseBean ejb = (EnterpriseBean) ejbs.next();
         String ejbClassName = ejb.getEjbClass();
         if (ejbClassName != null && ejbClassName.equals(className))
            result.add(ejb);
      }
      return result;
   
public java.util.CollectiongetEnterpriseBeans()

      return enterpriseBeans.values();
   
public inthashCode()

      int result;
      result = (enterpriseBeans != null ? enterpriseBeans.hashCode() : 0);
      // result = 29 * result + (version != null ? version.hashCode() : 0);
      return result;
   
public voidsetAopDomainName(java.lang.String aopDomainName)

      currentEjb.setAopDomainName(aopDomainName);
   
public voidsetCacheConfig(CacheConfig config)

      ((SessionEnterpriseBean)currentEjb).setCacheConfig(config);
   
public voidsetCallByValue(boolean callByValue)

      currentEjb.setCallByValue(callByValue);
   
public voidsetClusterConfig(ClusterConfig config)

      ((SessionEnterpriseBean)currentEjb).setClusterConfig(config);
   
public voidsetClustered(java.lang.String clustered)

      ((SessionEnterpriseBean)currentEjb).setClustered(clustered);
   
public voidsetConcurrent(java.lang.String concurrent)

      ((SessionEnterpriseBean)currentEjb).setConcurrent(concurrent);
   
public voidsetCurrentEjbName(java.lang.String currentEjbName, java.lang.Class ejbClass)

      currentEjb = createEjbByEjbName(currentEjbName, ejbClass);
   
public voidsetDefaultActivationConfig(ActivationConfig config)

      ((MessageDrivenBean)currentEjb).setDefaultActivationConfig(config);
   
public voidsetDestinationJndiName(java.lang.String name)

      ((MessageDrivenBean)currentEjb).setDestinationJndiName(name);
   
public voidsetHomeJndiName(java.lang.String homeJndiName)

      currentEjb.setHomeJndiName(homeJndiName);
   
public voidsetJndiName(java.lang.String jndiName)

      currentEjb.setJndiName(jndiName);
   
public voidsetLocalHomeJndiName(java.lang.String homeJndiName)

      currentEjb.setLocalHomeJndiName(homeJndiName);
   
public voidsetLocalJndiName(java.lang.String jndiName)

      currentEjb.setLocalJndiName(jndiName);
   
public voidsetMdbPassword(java.lang.String name)

      ((MessageDrivenBean)currentEjb).setMdbPassword(name);
   
public voidsetMdbSubscriptionId(java.lang.String id)

      ((MessageDrivenBean)currentEjb).setMdbSubscriptionId(id);
   
public voidsetMdbUser(java.lang.String name)

      ((MessageDrivenBean)currentEjb).setMdbUser(name);
   
public voidsetMethodAttributes(MethodAttributes attributes)

      currentEjb.setMethodAttributes(attributes);
   
public voidsetPoolConfig(PoolConfig config)

   
      
   
      currentEjb.setPoolConfig(config);
   
public voidsetResourceAdapterName(java.lang.String name)

      ((MessageDrivenBean)currentEjb).setResourceAdaptorName(name);
   
public voidsetRunAsPrincipal(java.lang.String principal)

      currentEjb.setRunAsPrincipal(principal);
   
public voidsetSecurityDomain(java.lang.String securityDomain)

      currentEjb.setSecurityDomain(securityDomain);
   
public java.lang.StringtoString()

      StringBuffer sb = new StringBuffer(100);
      sb.append("[");
      sb.append("enterpriseBeans=").append(enterpriseBeans);
      sb.append("]");
      return sb.toString();
   
public voidupdateEjbLocalRef(org.jboss.metamodel.descriptor.EjbLocalRef ref)

      currentEjb.updateEjbLocalRef(ref);
   
public voidupdateEjbRef(org.jboss.metamodel.descriptor.EjbRef ref)

      currentEjb.updateEjbRef(ref);
   
public voidupdateMessageDestinationRef(org.jboss.metamodel.descriptor.MessageDestinationRef ref)

      currentEjb.updateMessageDestinationRef(ref);
   
public voidupdateResourceEnvRef(org.jboss.metamodel.descriptor.ResourceEnvRef ref)

      currentEjb.updateResourceEnvRef(ref);
   
public voidupdateResourceRef(org.jboss.metamodel.descriptor.ResourceRef ref)

      currentEjb.updateResourceRef(ref);