Package com.sun.enterprise.deployment
Class Application
-
- All Implemented Interfaces:
JndiNameEnvironment
,Roles
,EjbReferenceContainer
,MessageDestinationReferenceContainer
,ResourceEnvReferenceContainer
,ResourceReferenceContainer
,RoleMappingContainer
,ServiceReferenceContainer
,WritableJndiNameEnvironment
,Serializable
public class Application extends CommonResourceBundleDescriptor implements RoleMappingContainer, WritableJndiNameEnvironment, EjbReferenceContainer, ResourceEnvReferenceContainer, ResourceReferenceContainer, ServiceReferenceContainer, MessageDestinationReferenceContainer
Objects of this type encapsulate the data and behaviour of a J2EE application.- Author:
- Danny Coward
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.sun.enterprise.deployment.BundleDescriptor
rootNodes
-
Fields inherited from class org.glassfish.deployment.common.RootDeploymentDescriptor
classLoader, deplLogger, extensions, moduleDescriptor, moduleID
-
Fields inherited from class org.glassfish.deployment.common.Descriptor
DESCRIPTION_CHANGED, DESCRIPTOR_CHANGED, docType, LARGE_ICON_CHANGED, NAME_CHANGED, SMALL_ICON_CHANGED
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addApplication(Application application)
Add all the deployment information about the given application to me.void
addApplicationParam(ApplicationParam appParam)
Adds a new context parameter to my list.void
addAppRole(SecurityRoleDescriptor descriptor)
Adds a newRole
to the application based on the descriptorvoid
addBundleDescriptor(BundleDescriptor bundleDescriptor)
Add a bundle descriptor to this application.void
addEjbReferenceDescriptor(EjbReference ejbReference)
Adds a reference to another ejb to me.void
addEntityManagerFactory(String unitName, String persistenceRootUri, jakarta.persistence.EntityManagerFactory emf)
Set the physical entity manager factory for a persistence unit within this application.void
addEntityManagerFactoryReferenceDescriptor(EntityManagerFactoryReferenceDescriptor reference)
void
addEntityManagerReferenceDescriptor(EntityManagerReferenceDescriptor reference)
void
addEnvironmentProperty(EnvironmentProperty environmentProperty)
Adds the specified environment property to the receiver.void
addMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor messageDestRef)
Adds the specified message destination reference to the receiver.void
addModule(ModuleDescriptor<BundleDescriptor> descriptor)
void
addPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc)
Adds the specified post-construct descriptor to the receiver.void
addPreDestroyDescriptor(LifecycleCallbackDescriptor preDestroyDesc)
Adds the specified pre-destroy descriptor to the receiver.void
addResourceAdapter(String raName)
add a resource-adapter to referred resource-adapters listvoid
addResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference)
Adds the specified resource environment reference to the receiver.void
addResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)
Adds a resource reference to me.void
addRole(Role role)
Adds a new abstract rolevoid
addScanningExclusions(List<String> exclusions)
void
addScanningExclusions(List<String> exclusions, String libDir)
void
addScanningInclusions(List<String> inclusions)
void
addScanningInclusions(List<String> inclusions, String libDir)
void
addSecurityRoleMapping(SecurityRoleMapping roleMapping)
void
addServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)
Adds the specified service reference to the receiver.void
addWhitelistPackage(String aPackage)
void
addWLRoleAssignments(SecurityRoleAssignment wlRoleAssignment)
static Application
createApplication()
static Application
createVirtualApplication(String name, ModuleDescriptor<BundleDescriptor> newModule)
Creates a new application to hold a standalone moduleSet<ApplicationParam>
getApplicationParams()
String
getAppName()
Returns the value of the app-name element in the application.xml if it's defined.Set<Role>
getAppRoles()
Return the set ofRole
objects I have (the ones defined in application xml).Set<BundleDescriptor>
getArchivableDescriptors()
Return all my subcomponents that have a file format (EJB, WAR and AppCLient JAR).String
getArchiveName()
Returns the value of the archive-name element in the sun-application.xml When the app-name is not present in application.xml and archive-name is present in sun-application.xml, the value of archive-name minus file extension will be used as the default name of the app-name.Set<BundleDescriptor>
getBundleDescriptors()
Obtain a set of all bundle descriptors, regardless of type<T extends BundleDescriptor>
Set<T>getBundleDescriptors(Class<T> type)
Obtain a full set of bundle descriptors for a particular typeSet<BundleDescriptor>
getBundleDescriptorsOfType(ArchiveType bundleType)
Obtain a full set of bundle descriptors for a particular typeClassLoader
getClassLoader()
String
getClassLoadingDelegate()
String
getCompatibility()
String
getDefaultSpecVersion()
EjbDescriptor
getEjbByName(String ejbName)
Obtain the EJB in this application of the given display name.Vector<EjbDescriptor>
getEjbDescriptors()
Return the Vector of ejb deployment objects.EjbReference
getEjbReference(String name)
Looks up an ejb reference with the given name.EjbReference
getEjbReferenceByName(String name)
Return a reference to another ejb by the same name or throw an IllegalArgumentException.Set<EjbReference>
getEjbReferenceDescriptors()
Returns the generated XML directory return the set of ejb references this ejb declares.Set<jakarta.persistence.EntityManagerFactory>
getEntityManagerFactories()
Returns the set of physical entity manager factories associated with persistence units in this application.jakarta.persistence.EntityManagerFactory
getEntityManagerFactory(String unitName, BundleDescriptor declaringModule)
Retrieve the physical entity manager factory associated with the unitName of an application-level persistence unit.EntityManagerFactoryReferenceDescriptor
getEntityManagerFactoryReferenceByName(String name)
Return the entity manager factory reference descriptor corresponding to the given name.Set<EntityManagerFactoryReferenceDescriptor>
getEntityManagerFactoryReferenceDescriptors()
Return a set of entity manager factory reference descriptors.EntityManagerReferenceDescriptor
getEntityManagerReferenceByName(String name)
Return the entity manager factory reference descriptor corresponding to the given name.Set<EntityManagerReferenceDescriptor>
getEntityManagerReferenceDescriptors()
Return a set of entity manager reference descriptors.Set<EnvironmentProperty>
getEnvironmentProperties()
Return a copy of the structure holding the environment properties.EnvironmentProperty
getEnvironmentPropertyByName(String name)
Returns the environment property object searching on the supplied key.String
getGeneratedXMLDirectory()
List<InjectionCapable>
getInjectableResourcesByClass(String className)
InjectionInfo
getInjectionInfoByClass(Class clazz)
boolean
getKeepState()
boolean
getKeepStateResolved()
Returns the resolved keepstate value.String
getLibraryDirectory()
Returns an "intelligent" value for the library directory setting, meaning the current value if it has been set to a non-null, non-empty value; the default value if the value has never been set, and null if the value has been set to empty.String
getLibraryDirectoryRawValue()
MessageDestinationReferenceDescriptor
getMessageDestinationReferenceByName(String name)
Looks up an message destination reference with the given name.Set<MessageDestinationReferenceDescriptor>
getMessageDestinationReferenceDescriptors()
Return a set of message destination reference descriptors.<T extends BundleDescriptor>
TgetModuleByTypeAndUri(Class<T> type, String uri)
BundleDescriptor
getModuleByUri(String uri)
Lookup module by uri.ModuleDescriptor<BundleDescriptor>
getModuleDescriptorByUri(String uri)
Lookup module by uri.Collection<ModuleDescriptor<BundleDescriptor>>
getModuleDescriptorsByType(ArchiveType type)
Lookup module by uri.String
getModuleID()
Set<ModuleDescriptor<BundleDescriptor>>
getModules()
Obtain a full set of module descriptorsArchiveType
getModuleType()
boolean
getPassByReference()
Gets the value of pass-by-reference property for this application Checks to see if the pass-by-reference property is defined.LifecycleCallbackDescriptor
getPostConstructDescriptorByClass(String className)
Return the post-construct descriptor corresponding to the given name.Set<LifecycleCallbackDescriptor>
getPostConstructDescriptors()
Return a set of post-construct descriptors.LifecycleCallbackDescriptor
getPreDestroyDescriptorByClass(String className)
Return the pre-destroy descriptor corresponding to the given name.Set<LifecycleCallbackDescriptor>
getPreDestroyDescriptors()
Return a set of pre-destroy descriptors.String
getRealm()
String
getRegistrationName()
Returns the registration name of this application.BundleDescriptor
getRelativeBundle(BundleDescriptor origin, String relativeTargetUri)
Get a target bundle descriptor based on an input bundle descriptor and a relative uri from the perspective of the input bundle descriptor.String
getRelativeUri(BundleDescriptor origin, BundleDescriptor target)
Return the relative uri between two modules, from the perspective of the first bundle.Set<String>
getResourceAdapters()
get the list of resource-adapters referred by the applicationResourceEnvReferenceDescriptor
getResourceEnvReferenceByName(String name)
Return a reference to another ejb by the same name or throw an IllegalArgumentException.Set<ResourceEnvReferenceDescriptor>
getResourceEnvReferenceDescriptors()
Return the set of resource environment references this application declares.ResourceReferenceDescriptor
getResourceReferenceByName(String name)
Return the resource object corresponding to the supplied name or throw an illegal argument exception.Set<ResourceReferenceDescriptor>
getResourceReferenceDescriptors()
Return the set of resource references this ejb declares.SecurityRoleMapper
getRoleMapper()
Return my mapping of rolename to users and groups on a particular server.Set<Role>
getRoles()
Return the set of roles used in this application.List<Pattern>
getScanningExclusions()
List<Pattern>
getScanningInclusions()
List<SecurityRoleMapping>
getSecurityRoleMappings()
ServiceReferenceDescriptor
getServiceReferenceByName(String name)
Looks up an service reference with the given name.Set<ServiceReferenceDescriptor>
getServiceReferenceDescriptors()
Return a set of service reference descriptors.EjbDescriptor[]
getSortedEjbDescriptors()
Returns all the ejb descriptor in this application in ordered form.BundleDescriptor
getStandaloneBundleDescriptor()
if this application object is virtual, return the standalone bundle descriptor it is wrapping otherwise return nullString
getTargetUri(BundleDescriptor origin, String relativeTargetUri)
Get the uri of a target based on a source module and a a relative uri from the perspective of that source module.long
getUniqueId()
Returns the unique id used for this application.Set<String>
getWhitelistPackages()
List<SecurityRoleAssignment>
getWlRoleAssignments()
boolean
hasEjbByName(String ejbName)
Return whether the application contains the given ejb by name..boolean
hasRuntimeInformation()
Return true if I have information to do with deployment on a particular operational environment.boolean
isApplication()
boolean
isDirty()
A flag to indicate that my data has changed since the last save.boolean
isEmpty()
Return true if this root deployment descriptor does not describe anythingboolean
isInitializeInOrder()
boolean
isLoadedFromApplicationXml()
boolean
isPassByReferenceDefined()
boolean
isUniqueIdSet()
boolean
isVirtual()
Returns the virtual status of this application.boolean
isWhitelistEnabled()
void
print(StringBuilder toStringBuilder)
A formatted String representing my state.void
removeBundleDescriptor(BundleDescriptor bundleDescriptor)
Remove a web bundle descriptor from this application.void
removeEjbReferenceDescriptor(EjbReference ejbReference)
Removes the specificed ejb reference from the receiver.void
removeEnvironmentProperty(EnvironmentProperty environmentProperty)
Removes the given environment property from me.void
removeMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestRef)
Removes the specified message destination reference from the receiver.void
removeModule(ModuleDescriptor<BundleDescriptor> descriptor)
void
removeResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference)
Removes the specified resource environment reference from the receiver.void
removeResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)
Removes the given resource reference from me.void
removeRole(Role role)
Removes the given role.void
removeServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)
Removes the specified service reference from the receiver.void
setAppName(String appName)
Sets the EE app namevoid
setArchiveName(String archiveName)
Sets the archive name using the archive-name element defined in sun-application.xmlvoid
setClassLoadingDelegate(String classLoadingDelegate)
void
setCompatibility(String compatValue)
void
setGeneratedXMLDirectory(String xmlDir)
void
setInitializeInOrder(boolean initializeInOrder)
Sets the initializeInOrder flagvoid
setKeepStateResolved(String keepStateResolved)
Sets the resolved keepstate value.void
setLibraryDirectory(String value)
void
setLoadedFromApplicationXml(boolean bool)
This method records how this Application object is constructed.void
setName(String name)
Reset the display name of this application.void
setPassByReference(boolean passByReference)
Sets the pass-by-reference property for this application.void
setRealm(String realm)
Sets the realm for this applicationvoid
setRegistrationName(String appId)
Sets the registration name for this application.void
setRoleMapper(SecurityRoleMapper roleMapper)
Sets the mapping of rolename to users and groups on a particular server.void
setUniqueId(long id)
Sets the unique id for this application.void
setVirtual(boolean virtual)
Sets the virtual status of this application.void
visit(DescriptorVisitor aVisitor)
visit the descriptor and all sub descriptors with a DOL visitor implementation-
Methods inherited from class com.sun.enterprise.deployment.CommonResourceBundleDescriptor
addResourceDescriptor, getAllResourcesDescriptors, getAllResourcesDescriptors, getResourceDescriptor, getResourceDescriptors, removeResourceDescriptor
-
Methods inherited from class com.sun.enterprise.deployment.BundleDescriptor
addEntityManagerFactory, addManagedBean, addMessageDestination, addRole, addRootNode, findDefaultPU, findReferencedPU, findReferencedPUs, findReferencedPUsViaPCRefs, findReferencedPUsViaPURefs, findReferencedPUViaEMFRef, findReferencedPUViaEMRef, getApplication, getBundleVisitor, getDeploymentDescriptorDir, getEntityManagerFactory, getInjectableResources, getInjectableResourcesByClass, getInjectionInfoByClass, getManagedBeanByBeanClass, getManagedBeans, getMessageDestinationByName, getMessageDestinations, getModuleName, getNamedDescriptorsFrom, getNamedReferencePairsFrom, getPostConstructDescriptorByClass, getPreDestroyDescriptorByClass, getRawModuleID, getRootNode, getUniqueFriendlyId, getVisiblePUs, getWebServiceEndpointByName, getWebServices, getWsdlDir, hasManagedBeanByBeanClass, hasMessageDestinationByName, hasWebServiceClients, hasWebServices, isDDWithNoAnnotationAllowed, isDefaultGroupPrincipalMapping, isFullAttribute, isFullFlag, isPackagedAsSingleModule, isPolicyModified, isStandalone, removeMessageDestination, setApplication, setDefaultGroupPrincipalMapping, setFullAttribute, setFullFlag, setKeepState, setPolicyModified, visit
-
Methods inherited from class org.glassfish.deployment.common.RootDeploymentDescriptor
addExtensionDescriptor, getDisplayName, getExtensionsDescriptors, getExtensionsDescriptors, getExtensionsDescriptors, getMainDescriptor, getModuleDescriptor, getName, getSchemaLocation, getSpecVersion, getTracerVisitor, isExtensionDescriptor, setClassLoader, setDisplayName, setModuleDescriptor, setModuleID, setSchemaLocation, setSpecVersion
-
Methods inherited from class org.glassfish.deployment.common.Descriptor
addDescriptorExtension, addPrefixMapping, createUniqueFilenameAmongst, createUniqueNameAmongst, createUniqueNameAmongstNamedDescriptors, fillDocType, getDeploymentExtensions, getDescription, getDescriptorExtension, getDescriptorExtensions, getDocType, getLargeIconUri, getLocalizedDescription, getLocalizedDescriptions, getLocalizedDisplayName, getLocalizedDisplayNames, getLocalizedLargeIconUri, getLocalizedLargeIconUris, getLocalizedSmallIconUri, getLocalizedSmallIconUris, getPrefixMapping, getSmallIconUri, isBoundsChecking, setBoundsChecking, setDescription, setLargeIconUri, setLocalizedDescription, setLocalizedDisplayName, setLocalizedLargeIconUri, setLocalizedSmallIconUri, setSmallIconUri
-
Methods inherited from class org.glassfish.deployment.common.DynamicAttributesDescriptor
addExtraAttribute, getExtraAttribute, getExtraAttributes, removeExtraAttribute, toString
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.sun.enterprise.deployment.JndiNameEnvironment
getAllResourcesDescriptors, getAllResourcesDescriptors, getResourceDescriptors
-
Methods inherited from interface com.sun.enterprise.deployment.WritableJndiNameEnvironment
addResourceDescriptor, removeResourceDescriptor
-
-
-
-
Method Detail
-
getDefaultSpecVersion
public String getDefaultSpecVersion()
- Specified by:
getDefaultSpecVersion
in classRootDeploymentDescriptor
- Returns:
- the default version of the deployment descriptor loaded by this descriptor
-
isEmpty
public boolean isEmpty()
Description copied from class:RootDeploymentDescriptor
Return true if this root deployment descriptor does not describe anything- Specified by:
isEmpty
in classRootDeploymentDescriptor
- Returns:
- true if this root descriptor is empty
-
createVirtualApplication
public static Application createVirtualApplication(String name, ModuleDescriptor<BundleDescriptor> newModule)
Creates a new application to hold a standalone module- Parameters:
name
- the application namenewModule
- the standalone module descriptor- Returns:
- the application
-
createApplication
public static Application createApplication()
-
getEjbReferenceDescriptors
public Set<EjbReference> getEjbReferenceDescriptors()
Returns the generated XML directory return the set of ejb references this ejb declares.- Specified by:
getEjbReferenceDescriptors
in interfaceEjbReferenceContainer
- Specified by:
getEjbReferenceDescriptors
in interfaceJndiNameEnvironment
- Returns:
- java.util.Set of EjbReferenceDescriptor objects
-
addEjbReferenceDescriptor
public void addEjbReferenceDescriptor(EjbReference ejbReference)
Adds a reference to another ejb to me.- Specified by:
addEjbReferenceDescriptor
in interfaceEjbReferenceContainer
- Specified by:
addEjbReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
ejbReference
- the EjbReferenceDescriptor to add.
-
removeEjbReferenceDescriptor
public void removeEjbReferenceDescriptor(EjbReference ejbReference)
Description copied from interface:WritableJndiNameEnvironment
Removes the specificed ejb reference from the receiver.- Specified by:
removeEjbReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
ejbReference
- the EjbReferenceDescriptor to remove.
-
getEjbReferenceByName
public EjbReference getEjbReferenceByName(String name)
Return a reference to another ejb by the same name or throw an IllegalArgumentException.- Parameters:
name
-- Returns:
-
getEjbReference
public EjbReference getEjbReference(String name)
Description copied from interface:EjbReferenceContainer
Looks up an ejb reference with the given name. Throws an IllegalArgumentException if it is not found.- Specified by:
getEjbReference
in interfaceEjbReferenceContainer
-
getServiceReferenceDescriptors
public Set<ServiceReferenceDescriptor> getServiceReferenceDescriptors()
Description copied from interface:JndiNameEnvironment
Return a set of service reference descriptors.- Specified by:
getServiceReferenceDescriptors
in interfaceJndiNameEnvironment
- Specified by:
getServiceReferenceDescriptors
in interfaceServiceReferenceContainer
- Returns:
- java.util.Set of ServiceReferenceDescriptor objects
-
addServiceReferenceDescriptor
public void addServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)
Description copied from interface:WritableJndiNameEnvironment
Adds the specified service reference to the receiver.- Specified by:
addServiceReferenceDescriptor
in interfaceServiceReferenceContainer
- Specified by:
addServiceReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
serviceRef
- the ServiceReferenceDescriptor to add.
-
removeServiceReferenceDescriptor
public void removeServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)
Description copied from interface:WritableJndiNameEnvironment
Removes the specified service reference from the receiver.- Specified by:
removeServiceReferenceDescriptor
in interfaceServiceReferenceContainer
- Specified by:
removeServiceReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
serviceRef
- the ServiceReferenceDescriptor to remove.
-
getServiceReferenceByName
public ServiceReferenceDescriptor getServiceReferenceByName(String name)
Looks up an service reference with the given name. Throws an IllegalArgumentException if it is not found.- Specified by:
getServiceReferenceByName
in interfaceJndiNameEnvironment
- Specified by:
getServiceReferenceByName
in interfaceServiceReferenceContainer
- Parameters:
name
-- Returns:
- ServiceReferenceDescriptor object
-
getMessageDestinationReferenceDescriptors
public Set<MessageDestinationReferenceDescriptor> getMessageDestinationReferenceDescriptors()
Description copied from interface:JndiNameEnvironment
Return a set of message destination reference descriptors.- Specified by:
getMessageDestinationReferenceDescriptors
in interfaceJndiNameEnvironment
- Specified by:
getMessageDestinationReferenceDescriptors
in interfaceMessageDestinationReferenceContainer
- Returns:
- java.util.Set of MessageDestinationReferenceDescriptor objects
-
addMessageDestinationReferenceDescriptor
public void addMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor messageDestRef)
Description copied from interface:WritableJndiNameEnvironment
Adds the specified message destination reference to the receiver.- Specified by:
addMessageDestinationReferenceDescriptor
in interfaceMessageDestinationReferenceContainer
- Specified by:
addMessageDestinationReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
messageDestRef
- the MessageDestinationReferenceDescriptor to add.
-
removeMessageDestinationReferenceDescriptor
public void removeMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestRef)
Description copied from interface:WritableJndiNameEnvironment
Removes the specified message destination reference from the receiver.- Specified by:
removeMessageDestinationReferenceDescriptor
in interfaceMessageDestinationReferenceContainer
- Specified by:
removeMessageDestinationReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
msgDestRef
- MessageDestinationReferenceDescriptor to remove.
-
getMessageDestinationReferenceByName
public MessageDestinationReferenceDescriptor getMessageDestinationReferenceByName(String name)
Looks up an message destination reference with the given name. Throws an IllegalArgumentException if it is not found.- Specified by:
getMessageDestinationReferenceByName
in interfaceJndiNameEnvironment
- Specified by:
getMessageDestinationReferenceByName
in interfaceMessageDestinationReferenceContainer
- Parameters:
name
-- Returns:
- MessageDestinationReferenceDescriptor object
-
getResourceEnvReferenceDescriptors
public Set<ResourceEnvReferenceDescriptor> getResourceEnvReferenceDescriptors()
Return the set of resource environment references this application declares.- Specified by:
getResourceEnvReferenceDescriptors
in interfaceJndiNameEnvironment
- Specified by:
getResourceEnvReferenceDescriptors
in interfaceResourceEnvReferenceContainer
- Returns:
- java.util.Set of ResourceEnvReferenceDescriptor objects
-
addResourceEnvReferenceDescriptor
public void addResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference)
Description copied from interface:WritableJndiNameEnvironment
Adds the specified resource environment reference to the receiver.- Specified by:
addResourceEnvReferenceDescriptor
in interfaceResourceEnvReferenceContainer
- Specified by:
addResourceEnvReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
resourceEnvReference
- the ResourceEnvReferenceDescriptor to add.
-
removeResourceEnvReferenceDescriptor
public void removeResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference)
Description copied from interface:WritableJndiNameEnvironment
Removes the specified resource environment reference from the receiver.- Specified by:
removeResourceEnvReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
resourceEnvReference
- the ResourceEnvReferenceDescriptor to remove.
-
getResourceEnvReferenceByName
public ResourceEnvReferenceDescriptor getResourceEnvReferenceByName(String name)
Return a reference to another ejb by the same name or throw an IllegalArgumentException.- Specified by:
getResourceEnvReferenceByName
in interfaceJndiNameEnvironment
- Specified by:
getResourceEnvReferenceByName
in interfaceResourceEnvReferenceContainer
- Parameters:
name
-- Returns:
- ResourceEnvReferenceDescriptor object
-
getResourceReferenceDescriptors
public Set<ResourceReferenceDescriptor> getResourceReferenceDescriptors()
Return the set of resource references this ejb declares.- Specified by:
getResourceReferenceDescriptors
in interfaceJndiNameEnvironment
- Specified by:
getResourceReferenceDescriptors
in interfaceResourceReferenceContainer
- Returns:
- java.util.Set of ResourceReferenceDescriptor objects
-
addResourceReferenceDescriptor
public void addResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)
Adds a resource reference to me.- Specified by:
addResourceReferenceDescriptor
in interfaceResourceReferenceContainer
- Specified by:
addResourceReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
resourceReference
- the ResourceReferenceDescriptor to add.
-
removeResourceReferenceDescriptor
public void removeResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)
Removes the given resource reference from me.- Specified by:
removeResourceReferenceDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
resourceReference
- the ResourceReferenceDescriptor to remove.
-
getResourceReferenceByName
public ResourceReferenceDescriptor getResourceReferenceByName(String name)
Return the resource object corresponding to the supplied name or throw an illegal argument exception.- Specified by:
getResourceReferenceByName
in interfaceResourceReferenceContainer
- Parameters:
name
-- Returns:
-
getEnvironmentPropertyByName
public EnvironmentProperty getEnvironmentPropertyByName(String name)
Returns the environment property object searching on the supplied key. throws an illegal argument exception if no such environment property exists.- Specified by:
getEnvironmentPropertyByName
in interfaceJndiNameEnvironment
- Parameters:
name
-- Returns:
- EnvironmentProperty descriptor
-
getEnvironmentProperties
public Set<EnvironmentProperty> getEnvironmentProperties()
Return a copy of the structure holding the environment properties.- Specified by:
getEnvironmentProperties
in interfaceJndiNameEnvironment
- Returns:
- java.util.Set of EnvironmentProperty objects
-
addEnvironmentProperty
public void addEnvironmentProperty(EnvironmentProperty environmentProperty)
Description copied from interface:WritableJndiNameEnvironment
Adds the specified environment property to the receiver.- Specified by:
addEnvironmentProperty
in interfaceWritableJndiNameEnvironment
- Parameters:
environmentProperty
- the EnvironmentProperty to add.
-
removeEnvironmentProperty
public void removeEnvironmentProperty(EnvironmentProperty environmentProperty)
Removes the given environment property from me.- Specified by:
removeEnvironmentProperty
in interfaceWritableJndiNameEnvironment
- Parameters:
environmentProperty
- the EnvironmentProperty to remove.
-
getEntityManagerFactoryReferenceDescriptors
public Set<EntityManagerFactoryReferenceDescriptor> getEntityManagerFactoryReferenceDescriptors()
Description copied from interface:JndiNameEnvironment
Return a set of entity manager factory reference descriptors.- Specified by:
getEntityManagerFactoryReferenceDescriptors
in interfaceJndiNameEnvironment
-
getEntityManagerFactoryReferenceByName
public EntityManagerFactoryReferenceDescriptor getEntityManagerFactoryReferenceByName(String name)
Return the entity manager factory reference descriptor corresponding to the given name.- Specified by:
getEntityManagerFactoryReferenceByName
in interfaceJndiNameEnvironment
- Parameters:
name
-- Returns:
-
addEntityManagerFactoryReferenceDescriptor
public void addEntityManagerFactoryReferenceDescriptor(EntityManagerFactoryReferenceDescriptor reference)
- Specified by:
addEntityManagerFactoryReferenceDescriptor
in interfaceWritableJndiNameEnvironment
-
getEntityManagerReferenceDescriptors
public Set<EntityManagerReferenceDescriptor> getEntityManagerReferenceDescriptors()
Description copied from interface:JndiNameEnvironment
Return a set of entity manager reference descriptors.- Specified by:
getEntityManagerReferenceDescriptors
in interfaceJndiNameEnvironment
-
getEntityManagerReferenceByName
public EntityManagerReferenceDescriptor getEntityManagerReferenceByName(String name)
Return the entity manager factory reference descriptor corresponding to the given name.- Specified by:
getEntityManagerReferenceByName
in interfaceJndiNameEnvironment
- Parameters:
name
-- Returns:
-
addEntityManagerReferenceDescriptor
public void addEntityManagerReferenceDescriptor(EntityManagerReferenceDescriptor reference)
- Specified by:
addEntityManagerReferenceDescriptor
in interfaceWritableJndiNameEnvironment
-
getPostConstructDescriptors
public Set<LifecycleCallbackDescriptor> getPostConstructDescriptors()
Description copied from interface:JndiNameEnvironment
Return a set of post-construct descriptors.- Specified by:
getPostConstructDescriptors
in interfaceJndiNameEnvironment
- Returns:
- java.util.Set of LifecycleCallbackDescriptor post-construct objects
-
addPostConstructDescriptor
public void addPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc)
Description copied from interface:WritableJndiNameEnvironment
Adds the specified post-construct descriptor to the receiver.- Specified by:
addPostConstructDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
postConstructDesc
- the post-construct LifecycleCallbackDescriptor to add.
-
getPostConstructDescriptorByClass
public LifecycleCallbackDescriptor getPostConstructDescriptorByClass(String className)
Description copied from interface:JndiNameEnvironment
Return the post-construct descriptor corresponding to the given name.- Specified by:
getPostConstructDescriptorByClass
in interfaceJndiNameEnvironment
- Returns:
- LifecycleCallbackDescriptor post-construct object
-
getPreDestroyDescriptors
public Set<LifecycleCallbackDescriptor> getPreDestroyDescriptors()
Description copied from interface:JndiNameEnvironment
Return a set of pre-destroy descriptors.- Specified by:
getPreDestroyDescriptors
in interfaceJndiNameEnvironment
- Returns:
- java.util.Set of LifecycleCallbackDescriptor pre-destroy objects
-
addPreDestroyDescriptor
public void addPreDestroyDescriptor(LifecycleCallbackDescriptor preDestroyDesc)
Description copied from interface:WritableJndiNameEnvironment
Adds the specified pre-destroy descriptor to the receiver.- Specified by:
addPreDestroyDescriptor
in interfaceWritableJndiNameEnvironment
- Parameters:
preDestroyDesc
- the pre-destroy LifecycleCallbackDescriptor to add.
-
getPreDestroyDescriptorByClass
public LifecycleCallbackDescriptor getPreDestroyDescriptorByClass(String className)
Description copied from interface:JndiNameEnvironment
Return the pre-destroy descriptor corresponding to the given name.- Specified by:
getPreDestroyDescriptorByClass
in interfaceJndiNameEnvironment
- Returns:
- LifecycleCallbackDescriptor pre-destroy object
-
getInjectableResourcesByClass
public List<InjectionCapable> getInjectableResourcesByClass(String className)
- Specified by:
getInjectableResourcesByClass
in interfaceJndiNameEnvironment
-
getInjectionInfoByClass
public InjectionInfo getInjectionInfoByClass(Class clazz)
- Specified by:
getInjectionInfoByClass
in interfaceJndiNameEnvironment
-
setGeneratedXMLDirectory
public void setGeneratedXMLDirectory(String xmlDir)
-
getGeneratedXMLDirectory
public String getGeneratedXMLDirectory()
- Returns:
-
setRegistrationName
public void setRegistrationName(String appId)
Sets the registration name for this application. This name is used while deploying the application. The deployment process gurantees that this name is unique.- Parameters:
appId
- the registration name used for this application
-
getRegistrationName
public String getRegistrationName()
Returns the registration name of this application.- Returns:
- the registration name of this application
-
getAppName
public String getAppName()
Returns the value of the app-name element in the application.xml if it's defined. The default EE app name is the unqualified name of the .ear or stand-alone module, minus the file extension.- Returns:
- the EE app name of this application
-
setAppName
public void setAppName(String appName)
Sets the EE app name- Parameters:
appName
- the EE app name of this application
-
getArchiveName
public String getArchiveName()
Returns the value of the archive-name element in the sun-application.xml When the app-name is not present in application.xml and archive-name is present in sun-application.xml, the value of archive-name minus file extension will be used as the default name of the app-name.- Returns:
- the EE app name of this application
-
setArchiveName
public void setArchiveName(String archiveName)
Sets the archive name using the archive-name element defined in sun-application.xml- Parameters:
archiveName
- archiveName to calculate default EE6 app-name
-
getCompatibility
public String getCompatibility()
- Overrides:
getCompatibility
in classBundleDescriptor
-
setCompatibility
public void setCompatibility(String compatValue)
- Overrides:
setCompatibility
in classBundleDescriptor
-
getClassLoadingDelegate
public String getClassLoadingDelegate()
-
setClassLoadingDelegate
public void setClassLoadingDelegate(String classLoadingDelegate)
-
isWhitelistEnabled
public boolean isWhitelistEnabled()
-
addWhitelistPackage
public void addWhitelistPackage(String aPackage)
-
isInitializeInOrder
public boolean isInitializeInOrder()
- Returns:
- the initializeInOrder flag when the return value is true, the modules inside ear will be loaded by their declaration order in application.xml
-
setInitializeInOrder
public void setInitializeInOrder(boolean initializeInOrder)
Sets the initializeInOrder flag- Parameters:
initializeInOrder
-
-
addEntityManagerFactory
public void addEntityManagerFactory(String unitName, String persistenceRootUri, jakarta.persistence.EntityManagerFactory emf)
Set the physical entity manager factory for a persistence unit within this application. This method takes a parameter called persistenceRootUri to support for fully-qualified persistence-unit-name syntax within persistence-unit-refs and persistence-context-refs. The syntax is similar to ejb-link and messge-destination-link. See (EJB 3 core spec: 15.10.2)- Parameters:
unitName
- : Name of the persistence-unitpersistenceRootUri
- : uri of the root of the persistence.xml (excluding META-INF) in which the persistence unit was defined. This uri is relative to the top of the .ear.emf
- : an entity manager factory.
-
getEntityManagerFactory
public jakarta.persistence.EntityManagerFactory getEntityManagerFactory(String unitName, BundleDescriptor declaringModule)
Retrieve the physical entity manager factory associated with the unitName of an application-level persistence unit. Returns null if no matching entry is found.- Parameters:
unitName
-declaringModule
-- Returns:
-
getEntityManagerFactories
public Set<jakarta.persistence.EntityManagerFactory> getEntityManagerFactories()
Returns the set of physical entity manager factories associated with persistence units in this application.- Overrides:
getEntityManagerFactories
in classBundleDescriptor
- Returns:
-
getRoles
public Set<Role> getRoles()
Return the set of roles used in this application. Currently, for release 1.0, it is an * aggregation of all the roles in the sub-modules of the application.- Specified by:
getRoles
in interfaceRoles
- Overrides:
getRoles
in classBundleDescriptor
- Returns:
- the Set of roles in the application.
-
getAppRoles
public Set<Role> getAppRoles()
Return the set ofRole
objects I have (the ones defined in application xml).- Returns:
-
addAppRole
public void addAppRole(SecurityRoleDescriptor descriptor)
Adds a newRole
to the application based on the descriptor- Parameters:
descriptor
-
-
addRole
public void addRole(Role role)
Adds a new abstract role- Specified by:
addRole
in interfaceRoles
- Overrides:
addRole
in classBundleDescriptor
- Parameters:
role
-
-
removeRole
public void removeRole(Role role)
Removes the given role.- Specified by:
removeRole
in interfaceRoles
- Overrides:
removeRole
in classBundleDescriptor
- Parameters:
role
-
-
setName
public void setName(String name)
Reset the display name of this application.- Overrides:
setName
in classRootDeploymentDescriptor
- Parameters:
name
- the display name of the application.
-
setLibraryDirectory
public void setLibraryDirectory(String value)
-
getLibraryDirectory
public String getLibraryDirectory()
Returns an "intelligent" value for the library directory setting, meaning the current value if it has been set to a non-null, non-empty value; the default value if the value has never been set, and null if the value has been set to empty.- Returns:
- String value of the library directory setting
-
getLibraryDirectoryRawValue
public String getLibraryDirectoryRawValue()
-
removeModule
public void removeModule(ModuleDescriptor<BundleDescriptor> descriptor)
-
addModule
public void addModule(ModuleDescriptor<BundleDescriptor> descriptor)
-
getModules
public Set<ModuleDescriptor<BundleDescriptor>> getModules()
Obtain a full set of module descriptors- Returns:
- the set of bundle descriptors
-
getTargetUri
public String getTargetUri(BundleDescriptor origin, String relativeTargetUri)
Get the uri of a target based on a source module and a a relative uri from the perspective of that source module.- Parameters:
origin
- bundle descriptor within this applicationrelativeTargetUri
- relative uri from the given bundle descriptor- Returns:
- target uri
-
getRelativeBundle
public BundleDescriptor getRelativeBundle(BundleDescriptor origin, String relativeTargetUri)
Get a target bundle descriptor based on an input bundle descriptor and a relative uri from the perspective of the input bundle descriptor.- Parameters:
origin
- bundle descriptor within this applicationrelativeTargetUri
- relative uri from the given bundle descriptor to another bundle within the application.- Returns:
- target BundleDescriptor or null if not found.
-
getRelativeUri
public String getRelativeUri(BundleDescriptor origin, BundleDescriptor target)
Return the relative uri between two modules, from the perspective of the first bundle.- Parameters:
origin
-target
-- Returns:
- relative uri or empty string if the two bundles are the same
-
getModuleDescriptorByUri
public ModuleDescriptor<BundleDescriptor> getModuleDescriptorByUri(String uri)
Lookup module by uri.- Parameters:
uri
- the module path in the application archive- Returns:
- a bundle descriptor in this application identified by uri or null if not found.
-
getModuleDescriptorsByType
public Collection<ModuleDescriptor<BundleDescriptor>> getModuleDescriptorsByType(ArchiveType type)
Lookup module by uri.- Returns:
- a bundle descriptor in this application identified by uri or null if not found.
-
getModuleByUri
public BundleDescriptor getModuleByUri(String uri)
Lookup module by uri.- Parameters:
uri
- the module path in the application archive- Returns:
- a bundle descriptor in this application identified by uri or null if not found.
-
getModuleByTypeAndUri
public <T extends BundleDescriptor> T getModuleByTypeAndUri(Class<T> type, String uri)
- Parameters:
type
- the module typeuri
- the module path in the application archive- Returns:
- a bundle descriptor in this application identified by its type and uri
-
getEjbByName
public EjbDescriptor getEjbByName(String ejbName)
Obtain the EJB in this application of the given display name. If the EJB is not present, throw an IllegalArgumentException.- Parameters:
ejbName
- the name of the bean- Returns:
- the EjbDescriptor object with the given display name
-
hasEjbByName
public boolean hasEjbByName(String ejbName)
Return whether the application contains the given ejb by name..- Parameters:
ejbName
- the name of the bean- Returns:
- true if there is a bean matching the given name
-
getStandaloneBundleDescriptor
public BundleDescriptor getStandaloneBundleDescriptor()
if this application object is virtual, return the standalone bundle descriptor it is wrapping otherwise return null- Returns:
- the wrapped standalone bundle descriptor
-
getBundleDescriptors
public <T extends BundleDescriptor> Set<T> getBundleDescriptors(Class<T> type)
Obtain a full set of bundle descriptors for a particular type- Parameters:
type
- the bundle descriptor type requested- Returns:
- the set of bundle descriptors
-
getBundleDescriptorsOfType
public Set<BundleDescriptor> getBundleDescriptorsOfType(ArchiveType bundleType)
Obtain a full set of bundle descriptors for a particular type- Parameters:
bundleType
- the bundle descriptor type requested- Returns:
- the set of bundle descriptors
-
getBundleDescriptors
public Set<BundleDescriptor> getBundleDescriptors()
Obtain a set of all bundle descriptors, regardless of type- Returns:
- the set of bundle descriptors
-
addBundleDescriptor
public void addBundleDescriptor(BundleDescriptor bundleDescriptor)
Add a bundle descriptor to this application.- Overrides:
addBundleDescriptor
in classBundleDescriptor
- Parameters:
bundleDescriptor
- the bundle descriptor to add
-
removeBundleDescriptor
public void removeBundleDescriptor(BundleDescriptor bundleDescriptor)
Remove a web bundle descriptor from this application.- Parameters:
bundleDescriptor
- the web bundle descriptor to remove
-
getEjbDescriptors
public Vector<EjbDescriptor> getEjbDescriptors()
Return the Vector of ejb deployment objects.
-
getSortedEjbDescriptors
public EjbDescriptor[] getSortedEjbDescriptors()
Returns all the ejb descriptor in this application in ordered form. The comparison is done based on the descriptor's name.- Returns:
- all ejb descriptors in ordered form
-
setVirtual
public void setVirtual(boolean virtual)
Sets the virtual status of this application. If this application object represents a stand alone module, virtaul status should be true; else false.- Parameters:
virtual
- new value of this application's virtaul status
-
isVirtual
public boolean isVirtual()
Returns the virtual status of this application.- Returns:
- true if this application obj represents a stand alone module
-
isUniqueIdSet
public boolean isUniqueIdSet()
-
setUniqueId
public void setUniqueId(long id)
Sets the unique id for this application. It traverses through all the ejbs in the application and sets the unique id for each of them. The traversal is done in ascending element order. NOTE : assumption is that the id has already been left shifted 16 bits to allow space for the component ids.- Parameters:
id
- unique id for this application
-
getUniqueId
public long getUniqueId()
Returns the unique id used for this application.- Returns:
- unique id used for this application
-
setPassByReference
public void setPassByReference(boolean passByReference)
Sets the pass-by-reference property for this application. EJB spec requires pass-by-value (false) which is the default. This can be set to true for non-compliant operation and possibly higher performance. For a stand-alone server, this can be used. By setting pass-by-reference in sun-application.xml, it can apply to all the enclosed ejb modules.- Parameters:
passByReference
- boolean true or false - pass-by-reference property of application. true - application is pass-by-reference false - application is pass-by-value
-
getPassByReference
public boolean getPassByReference()
Gets the value of pass-by-reference property for this application Checks to see if the pass-by-reference property is defined. If this application's pass-by-reference property is defined, this method returns the value of the application's pass-by-reference property. Otherwise, if the application's pass-by-reference property is undefined, this method returns a default value of false.- Returns:
- boolean pass-by-reference property for this application
-
isPassByReferenceDefined
public boolean isPassByReferenceDefined()
-
addApplication
public void addApplication(Application application)
Add all the deployment information about the given application to me.- Parameters:
application
-
-
getArchivableDescriptors
public Set<BundleDescriptor> getArchivableDescriptors()
Return all my subcomponents that have a file format (EJB, WAR and AppCLient JAR).- Returns:
-
setRoleMapper
public void setRoleMapper(SecurityRoleMapper roleMapper)
Sets the mapping of rolename to users and groups on a particular server.- Parameters:
roleMapper
-
-
hasRuntimeInformation
public boolean hasRuntimeInformation()
Return true if I have information to do with deployment on a particular operational environment.- Returns:
-
getRoleMapper
public SecurityRoleMapper getRoleMapper()
Return my mapping of rolename to users and groups on a particular server.- Specified by:
getRoleMapper
in interfaceRoleMappingContainer
- Returns:
-
setRealm
public void setRealm(String realm)
Sets the realm for this application- Parameters:
realm
-
-
getRealm
public String getRealm()
- Returns:
- the realm for this application
-
isDirty
public boolean isDirty()
A flag to indicate that my data has changed since the last save.- Returns:
-
getClassLoader
public ClassLoader getClassLoader()
- Overrides:
getClassLoader
in classBundleDescriptor
- Returns:
- the class loader associated with this application
-
print
public void print(StringBuilder toStringBuilder)
A formatted String representing my state.- Overrides:
print
in classBundleDescriptor
-
visit
public void visit(DescriptorVisitor aVisitor)
visit the descriptor and all sub descriptors with a DOL visitor implementation- Overrides:
visit
in classDescriptor
- Parameters:
aVisitor
- visitor to traverse the descriptors
-
getModuleID
public String getModuleID()
- Overrides:
getModuleID
in classBundleDescriptor
- Returns:
- the module ID for this module descriptor
-
isApplication
public boolean isApplication()
- Overrides:
isApplication
in classBundleDescriptor
- Returns:
- true if this module is an application object
-
getModuleType
public ArchiveType getModuleType()
- Specified by:
getModuleType
in classBundleDescriptor
- Returns:
- the module type for this bundle descriptor
-
addSecurityRoleMapping
public void addSecurityRoleMapping(SecurityRoleMapping roleMapping)
-
getSecurityRoleMappings
public List<SecurityRoleMapping> getSecurityRoleMappings()
-
getWlRoleAssignments
public List<SecurityRoleAssignment> getWlRoleAssignments()
-
addWLRoleAssignments
public void addWLRoleAssignments(SecurityRoleAssignment wlRoleAssignment)
-
setLoadedFromApplicationXml
public void setLoadedFromApplicationXml(boolean bool)
This method records how this Application object is constructed. We keep this information to avoid additional disk access in DescriptorArchivist.write() when deciding if the application.xml should be copied or written to the generated/xml directory.- Parameters:
bool
-
-
isLoadedFromApplicationXml
public boolean isLoadedFromApplicationXml()
- Returns:
- true if this Application is from reading application.xml from disk; false if this Application object is derived from the content of the ear file.
-
addResourceAdapter
public void addResourceAdapter(String raName)
add a resource-adapter to referred resource-adapters list- Parameters:
raName
- resource-adapter name
-
getResourceAdapters
public Set<String> getResourceAdapters()
get the list of resource-adapters referred by the application- Returns:
- resource-adapters list
-
getApplicationParams
public Set<ApplicationParam> getApplicationParams()
- Returns:
- the Set of application paramaters.
-
addApplicationParam
public void addApplicationParam(ApplicationParam appParam)
Adds a new context parameter to my list.- Parameters:
appParam
-
-
getKeepState
public boolean getKeepState()
- Overrides:
getKeepState
in classBundleDescriptor
-
getKeepStateResolved
public boolean getKeepStateResolved()
Returns the resolved keepstate value.- Returns:
- keepStateResolved
-
setKeepStateResolved
public void setKeepStateResolved(String keepStateResolved)
Sets the resolved keepstate value.- Parameters:
keepStateResolved
-
-
-