FileDocCategorySizeDatePackage
AssemblyDescriptor.javaAPI DocJBoss 4.2.16732Fri Jul 13 20:53:58 BST 2007org.jboss.ejb3.metamodel

AssemblyDescriptor

public class AssemblyDescriptor extends Object
Represents elements of the ejb-jar.xml deployment descriptor for the 1.4 schema
author
William DeCoste
author
Anil.Saldhana@jboss.org
version
$Revision: 60373 $

Fields Summary
private static final Logger
log
private List
securityRoles
private Map
securityRoleMetaData
private List
methodPermissions
private List
containerTransactions
private HashMap
messageDestinations
private ExcludeList
excludeList
private List
applicationExceptions
private InitList
initList
private List
injects
private List
interceptorBindings
Constructors Summary
Methods Summary
public voidaddApplicationException(ApplicationException applicationException)

      applicationExceptions.add(applicationException);
   
public voidaddContainerTransaction(ContainerTransaction containerTransaction)

      containerTransactions.add(containerTransaction);
   
public voidaddInject(Inject inject)

      injects.add(inject);
   
public voidaddInterceptorBinding(InterceptorBinding binding)

      interceptorBindings.add(binding);
   
public voidaddMessageDestination(MessageDestination messageDestination)

      messageDestinations.put(messageDestination.getMessageDestinationName(), messageDestination);
   
public voidaddMethodPermission(MethodPermission methodPermission)

      methodPermissions.add(methodPermission);
   
public voidaddSecurityRole(org.jboss.metamodel.descriptor.SecurityRole securityRole)

      securityRoles.add(securityRole);
   
public voidaddSecurityRoleMetaData(org.jboss.security.SecurityRoleMetaData srm)

      this.securityRoleMetaData.put(srm.getRoleName(), srm);
   
public MessageDestinationfindMessageDestination(java.lang.String name)

      return messageDestinations.get(name);
   
public java.util.ListgetApplicationExceptions()

      return applicationExceptions;
   
public java.util.ListgetContainerTransactions()

      return containerTransactions;
   
public ExcludeListgetExcludeList()

      return excludeList;
   
public InitListgetInitList()


     
   
      return initList;
   
public java.util.ListgetInjects()

      return injects;
   
public java.util.ListgetInterceptorBindings()

      return interceptorBindings;
   
public java.util.CollectiongetMessageDestinations()

   
     
   
      return messageDestinations.values();
   
public java.util.ListgetMethodPermissions()

      return methodPermissions;
   
public java.util.MapgetPrincipalVersusRolesMap()
Get a map of principals versus set of roles that may be configured by the user at the deployment level

return

      Map principalRolesMap = null;
      
      Iterator iter = securityRoleMetaData.keySet().iterator();
      while(iter.hasNext())
      {
         if(principalRolesMap == null)
            principalRolesMap = new HashMap(); 
         String rolename = (String)iter.next();
         SecurityRoleMetaData srm = (SecurityRoleMetaData) securityRoleMetaData.get(rolename);
         Iterator principalIter = srm.getPrincipals().iterator();
         while(principalIter.hasNext())
         {
            String pr = (String)principalIter.next(); 
            Set roleset = (Set)principalRolesMap.get(pr);
            if(roleset == null)
               roleset = new HashSet();
            if(!roleset.contains(rolename))
               roleset.add(rolename);
            principalRolesMap.put(pr, roleset);
         } 
      } 
      return principalRolesMap;
   
public java.util.MapgetSecurityRoleMetaData()

      return this.securityRoleMetaData;
   
public java.util.ListgetSecurityRoles()

      return securityRoles;
   
public java.util.SetgetSecurityRolesGivenPrincipal(java.lang.String userName)

      HashSet roleNames = new HashSet();
      Iterator it = securityRoleMetaData.values().iterator();
      while (it.hasNext())
      {
         SecurityRoleMetaData srMetaData = (SecurityRoleMetaData) it.next();
         if (srMetaData.getPrincipals().contains(userName))
            roleNames.add(srMetaData.getRoleName());
      }
      return roleNames;
   
public voidsetContainerTransactions(java.util.List containerTransactions)

      this.containerTransactions = containerTransactions;
   
public voidsetExcludeList(ExcludeList excludeList)

      this.excludeList = excludeList;
   
public voidsetInitList(InitList initList)

      this.initList = initList;
   
public voidsetMethodPermissions(java.util.List methodPermissions)

      this.methodPermissions = methodPermissions;
   
public voidsetSecurityRoles(java.util.List securityRoles)

      this.securityRoles = securityRoles;
   
public java.lang.StringtoString()

      StringBuffer sb = new StringBuffer(100);
      sb.append("[");
      sb.append("securityRoles=").append(securityRoles);
      sb.append(", applicationExceptions=").append(applicationExceptions);
      sb.append("]");
      return sb.toString();