Class BundleDescriptor

    • Constructor Detail

      • BundleDescriptor

        public BundleDescriptor()
        Construct a new BundleDescriptor
      • BundleDescriptor

        public BundleDescriptor​(String name,
                                String description)
        Construct a new BundleDescriptor with a name and description
    • Method Detail

      • setApplication

        public void setApplication​(Application a)
        Sets the application to which I belong.
      • addBundleDescriptor

        public void addBundleDescriptor​(BundleDescriptor bundleDescriptor)
      • isPackagedAsSingleModule

        public boolean isPackagedAsSingleModule​(BundleDescriptor other)
        Return true if the other bundle descriptor comes from the same module
        Parameters:
        other - the other bundle descriptor
        Returns:
        true if co-packaged in the same module
      • isStandalone

        public boolean isStandalone()
        Returns:
        true if this module is a standalone deployment unit
      • getApplication

        public Application getApplication()
        The application to which I belong, or none if I am standalone.
      • addEntityManagerFactory

        public void addEntityManagerFactory​(String unitName,
                                            jakarta.persistence.EntityManagerFactory emf)
        Set the physical entity manager factory for a persistence unit within this module.
      • getEntityManagerFactory

        public jakarta.persistence.EntityManagerFactory getEntityManagerFactory​(String unitName)
        Retrieve the physical entity manager factory associated with the unitName of a persistence unit within this module. Returns null if no matching entry is found.
      • getEntityManagerFactories

        public Set<jakarta.persistence.EntityManagerFactory> getEntityManagerFactories()
        Returns the set of physical entity manager factories associated with persistence units in this module.
      • hasManagedBeanByBeanClass

        public boolean hasManagedBeanByBeanClass​(String beanClassName)
      • getWebServices

        public WebServicesDescriptor getWebServices()
        Return web services defined for this module. Not applicable for application clients.
      • hasWebServiceClients

        public boolean hasWebServiceClients()
        Returns:
        true if this bundle descriptor defines web service clients
      • hasWebServices

        public boolean hasWebServices()
        Returns:
        true if this bundle descriptor defines web services
      • hasMessageDestinationByName

        public boolean hasMessageDestinationByName​(String name)
        Returns true if I have an message destiation by that name.
      • getMessageDestinationByName

        public MessageDestinationDescriptor getMessageDestinationByName​(String name)
        Returns a message destination descriptor that I have by the same name, or throws an IllegalArgumentException
      • addMessageDestination

        public void addMessageDestination​(MessageDestinationDescriptor messageDestination)
        Add a message destination to me.
      • removeMessageDestination

        public void removeMessageDestination​(MessageDestinationDescriptor msgDest)
        Remove the given message destination descriptor from my (by equality).
      • getRoles

        public Set<Role> getRoles()
        Return the set of com.sun.enterprise.deployment.Role objects I have plus the ones from application
        Specified by:
        getRoles in interface Roles
        Returns:
        the set of roles.
      • addRole

        public void addRole​(Role role)
        Adds a role object to me.
        Specified by:
        addRole in interface Roles
      • addRole

        public void addRole​(SecurityRoleDescriptor descriptor)
        Adds a Role object based on the supplied SecurityRoleDescriptor.

        A change in SecurityRoleNode to fix bug 4933385 causes the DOL to use SecurityRoleDescriptor, rather than Role, to contain information about security roles. To minimize the impact on BundleDescriptor, this method has been added for use by the DOL as it processes security-role elements.

        This method creates a new Role object based on the characteristics of the SecurityRoleDescriptor and then delegates to addRole(Role) to preserve the rest of the behavior of this class.

        Parameters:
        descriptor - SecurityRoleDescriptor that describes the username and description of the role
      • removeRole

        public void removeRole​(Role role)
        Removes a role object from me.
        Specified by:
        removeRole in interface Roles
      • getNamedDescriptorsFrom

        protected Collection<NamedDescriptor> getNamedDescriptorsFrom​(JndiNameEnvironment nameEnvironment)
        Utility method for iterating the set of named descriptors in the supplied nameEnvironment
      • getNamedReferencePairsFrom

        protected Vector<NamedReferencePair> getNamedReferencePairsFrom​(JndiNameEnvironment nameEnvironment)
        Utility method for iterating the set of NameReference pairs in the supplied nameEnvironment
      • getInjectableResourcesByClass

        protected List<InjectionCapable> getInjectableResourcesByClass​(String className,
                                                                       JndiNameEnvironment jndiNameEnv)
        Define implementation of getInjectableResourceByClass here so it isn't replicated across appclient, web, ejb descriptors.
      • getBundleVisitor

        public ComponentVisitor getBundleVisitor()
        Returns:
        the visitor for this bundle descriptor
      • visit

        public void visit​(ComponentVisitor aVisitor)
        visitor API implementation
      • getDeploymentDescriptorDir

        public String getDeploymentDescriptorDir()
        Returns:
        the deployment descriptor directory location inside the archive file
      • getRawModuleID

        public String getRawModuleID()
      • getWsdlDir

        public String getWsdlDir()
        Returns:
        the wsdl directory location inside the archive file
      • findReferencedPUs

        public Collection<? extends PersistenceUnitDescriptor> findReferencedPUs()
        This method returns all the persistence units that are referenced by this module. Depending on the type of component, a PU can be referenced by one of the four following ways: , @PersistenceContext, and @PersistenceUnit Only EjbBundleDescriptor, ApplicationClientDescriptor and WebBundleDescriptor have useful implementation of this method.
        Returns:
        persistence units that are referenced by this module
      • findReferencedPU

        public PersistenceUnitDescriptor findReferencedPU​(String unitName)
        It accepts both a quailified (e.g.) "lib/a.jar#FooPU" as well as unqualified name (e.g.) "FooPU". It then searched all the PersistenceUnits that are defined in the scope of this bundle descriptor to see which one matches the give name.
        Parameters:
        unitName - as used in @PersistenceUnit, @PersistenceContext or . If null, this method returns the default PU, if available. The reason it accepts null for default PU is because "" gets converted to null in EntityManagerReferenceHandler.processNewEmRefAnnotation.
        Returns:
        PersistenceUnitDescriptor that this unitName resolves to. Returns null, if unitName could not be resolved.
      • findDefaultPU

        public PersistenceUnitDescriptor findDefaultPU()
        This method is responsible for finding default persistence unit for a bundle descriptor.
        Returns:
        the default persistence unit for this bundle. returns null, if there isno PU defined or default can not be calculated because there are more than 1 PUs defined.
      • getVisiblePUs

        public Map<String,​PersistenceUnitDescriptor> getVisiblePUs()
        This method returns all the PUs that are defined in this bundle as well as the PUs defined in the ear level. e.g. for the following ear: ear/lib/a.jar#defines FooPU /lib/b.jar#defines FooPU ejb.jar#defines FooPU for the EjbBundleDescriptor (ejb.jar), the map will contain {(lib/a.jar#FooPU, PU1), (lib/b.jar#FooPU, PU2), (FooPU, PU3)}.
        Returns:
        a map of names to PUDescriptors that are visbible to this bundle descriptor. The name is a qualified name for ear scoped PUs where as it is in unqualified form for local PUs.
      • getModuleName

        public String getModuleName()
      • getUniqueFriendlyId

        public String getUniqueFriendlyId()
      • isPolicyModified

        public boolean isPolicyModified()
      • setPolicyModified

        public void setPolicyModified​(boolean policyModified)
      • getCompatibility

        public String getCompatibility()
      • setCompatibility

        public void setCompatibility​(String compatValue)
      • getKeepState

        public boolean getKeepState()
      • setKeepState

        public void setKeepState​(String keepStateVal)
      • isDefaultGroupPrincipalMapping

        public boolean isDefaultGroupPrincipalMapping()
      • setDefaultGroupPrincipalMapping

        public void setDefaultGroupPrincipalMapping​(boolean defaultGroupPrincipalMapping)
      • setFullFlag

        public void setFullFlag​(boolean flag)
        Sets the full flag of the bundle descriptor. Once set, the annotations of the classes contained in the archive described by this bundle descriptor will be ignored.
        Parameters:
        flag - a boolean to set or unset the flag
      • setFullAttribute

        public void setFullAttribute​(String value)
        Sets the full attribute of the deployment descriptor
        Parameters:
        value - the full attribute
      • isFullAttribute

        public boolean isFullAttribute()
        Get the full attribute of the deployment descriptor
        Returns:
        the full attribute
      • isFullFlag

        public boolean isFullFlag()
      • isDDWithNoAnnotationAllowed

        public boolean isDDWithNoAnnotationAllowed()