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 voidaddApplication(Application application)Add all the deployment information about the given application to me.voidaddApplicationParam(ApplicationParam appParam)Adds a new context parameter to my list.voidaddAppRole(SecurityRoleDescriptor descriptor)Adds a newRoleto the application based on the descriptorvoidaddBundleDescriptor(BundleDescriptor bundleDescriptor)Add a bundle descriptor to this application.voidaddEjbReferenceDescriptor(EjbReference ejbReference)Adds a reference to another ejb to me.voidaddEntityManagerFactory(String unitName, String persistenceRootUri, jakarta.persistence.EntityManagerFactory emf)Set the physical entity manager factory for a persistence unit within this application.voidaddEntityManagerFactoryReferenceDescriptor(EntityManagerFactoryReferenceDescriptor reference)voidaddEntityManagerReferenceDescriptor(EntityManagerReferenceDescriptor reference)voidaddEnvironmentProperty(EnvironmentProperty environmentProperty)Adds the specified environment property to the receiver.voidaddMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor messageDestRef)Adds the specified message destination reference to the receiver.voidaddModule(ModuleDescriptor<BundleDescriptor> descriptor)voidaddPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc)Adds the specified post-construct descriptor to the receiver.voidaddPreDestroyDescriptor(LifecycleCallbackDescriptor preDestroyDesc)Adds the specified pre-destroy descriptor to the receiver.voidaddResourceAdapter(String raName)add a resource-adapter to referred resource-adapters listvoidaddResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference)Adds the specified resource environment reference to the receiver.voidaddResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)Adds a resource reference to me.voidaddRole(Role role)Adds a new abstract rolevoidaddScanningExclusions(List<String> exclusions)voidaddScanningExclusions(List<String> exclusions, String libDir)voidaddScanningInclusions(List<String> inclusions)voidaddScanningInclusions(List<String> inclusions, String libDir)voidaddSecurityRoleMapping(SecurityRoleMapping roleMapping)voidaddServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)Adds the specified service reference to the receiver.voidaddWhitelistPackage(String aPackage)voidaddWLRoleAssignments(SecurityRoleAssignment wlRoleAssignment)static ApplicationcreateApplication()static ApplicationcreateVirtualApplication(String name, ModuleDescriptor<BundleDescriptor> newModule)Creates a new application to hold a standalone moduleSet<ApplicationParam>getApplicationParams()StringgetAppName()Returns the value of the app-name element in the application.xml if it's defined.Set<Role>getAppRoles()Return the set ofRoleobjects 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).StringgetArchiveName()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 typeClassLoadergetClassLoader()StringgetClassLoadingDelegate()StringgetCompatibility()StringgetDefaultSpecVersion()EjbDescriptorgetEjbByName(String ejbName)Obtain the EJB in this application of the given display name.Vector<EjbDescriptor>getEjbDescriptors()Return the Vector of ejb deployment objects.EjbReferencegetEjbReference(String name)Looks up an ejb reference with the given name.EjbReferencegetEjbReferenceByName(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.EntityManagerFactorygetEntityManagerFactory(String unitName, BundleDescriptor declaringModule)Retrieve the physical entity manager factory associated with the unitName of an application-level persistence unit.EntityManagerFactoryReferenceDescriptorgetEntityManagerFactoryReferenceByName(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.EntityManagerReferenceDescriptorgetEntityManagerReferenceByName(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.EnvironmentPropertygetEnvironmentPropertyByName(String name)Returns the environment property object searching on the supplied key.StringgetGeneratedXMLDirectory()List<InjectionCapable>getInjectableResourcesByClass(String className)InjectionInfogetInjectionInfoByClass(Class clazz)booleangetKeepState()booleangetKeepStateResolved()Returns the resolved keepstate value.StringgetLibraryDirectory()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.StringgetLibraryDirectoryRawValue()MessageDestinationReferenceDescriptorgetMessageDestinationReferenceByName(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)BundleDescriptorgetModuleByUri(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.StringgetModuleID()Set<ModuleDescriptor<BundleDescriptor>>getModules()Obtain a full set of module descriptorsArchiveTypegetModuleType()booleangetPassByReference()Gets the value of pass-by-reference property for this application Checks to see if the pass-by-reference property is defined.LifecycleCallbackDescriptorgetPostConstructDescriptorByClass(String className)Return the post-construct descriptor corresponding to the given name.Set<LifecycleCallbackDescriptor>getPostConstructDescriptors()Return a set of post-construct descriptors.LifecycleCallbackDescriptorgetPreDestroyDescriptorByClass(String className)Return the pre-destroy descriptor corresponding to the given name.Set<LifecycleCallbackDescriptor>getPreDestroyDescriptors()Return a set of pre-destroy descriptors.StringgetRealm()StringgetRegistrationName()Returns the registration name of this application.BundleDescriptorgetRelativeBundle(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.StringgetRelativeUri(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 applicationResourceEnvReferenceDescriptorgetResourceEnvReferenceByName(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.ResourceReferenceDescriptorgetResourceReferenceByName(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.SecurityRoleMappergetRoleMapper()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()ServiceReferenceDescriptorgetServiceReferenceByName(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.BundleDescriptorgetStandaloneBundleDescriptor()if this application object is virtual, return the standalone bundle descriptor it is wrapping otherwise return nullStringgetTargetUri(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.longgetUniqueId()Returns the unique id used for this application.Set<String>getWhitelistPackages()List<SecurityRoleAssignment>getWlRoleAssignments()booleanhasEjbByName(String ejbName)Return whether the application contains the given ejb by name..booleanhasRuntimeInformation()Return true if I have information to do with deployment on a particular operational environment.booleanisApplication()booleanisDirty()A flag to indicate that my data has changed since the last save.booleanisEmpty()Return true if this root deployment descriptor does not describe anythingbooleanisInitializeInOrder()booleanisLoadedFromApplicationXml()booleanisPassByReferenceDefined()booleanisUniqueIdSet()booleanisVirtual()Returns the virtual status of this application.booleanisWhitelistEnabled()voidprint(StringBuilder toStringBuilder)A formatted String representing my state.voidremoveBundleDescriptor(BundleDescriptor bundleDescriptor)Remove a web bundle descriptor from this application.voidremoveEjbReferenceDescriptor(EjbReference ejbReference)Removes the specificed ejb reference from the receiver.voidremoveEnvironmentProperty(EnvironmentProperty environmentProperty)Removes the given environment property from me.voidremoveMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestRef)Removes the specified message destination reference from the receiver.voidremoveModule(ModuleDescriptor<BundleDescriptor> descriptor)voidremoveResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference)Removes the specified resource environment reference from the receiver.voidremoveResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)Removes the given resource reference from me.voidremoveRole(Role role)Removes the given role.voidremoveServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)Removes the specified service reference from the receiver.voidsetAppName(String appName)Sets the EE app namevoidsetArchiveName(String archiveName)Sets the archive name using the archive-name element defined in sun-application.xmlvoidsetClassLoadingDelegate(String classLoadingDelegate)voidsetCompatibility(String compatValue)voidsetGeneratedXMLDirectory(String xmlDir)voidsetInitializeInOrder(boolean initializeInOrder)Sets the initializeInOrder flagvoidsetKeepStateResolved(String keepStateResolved)Sets the resolved keepstate value.voidsetLibraryDirectory(String value)voidsetLoadedFromApplicationXml(boolean bool)This method records how this Application object is constructed.voidsetName(String name)Reset the display name of this application.voidsetPassByReference(boolean passByReference)Sets the pass-by-reference property for this application.voidsetRealm(String realm)Sets the realm for this applicationvoidsetRegistrationName(String appId)Sets the registration name for this application.voidsetRoleMapper(SecurityRoleMapper roleMapper)Sets the mapping of rolename to users and groups on a particular server.voidsetUniqueId(long id)Sets the unique id for this application.voidsetVirtual(boolean virtual)Sets the virtual status of this application.voidvisit(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:
getDefaultSpecVersionin classRootDeploymentDescriptor- Returns:
- the default version of the deployment descriptor loaded by this descriptor
-
isEmpty
public boolean isEmpty()
Description copied from class:RootDeploymentDescriptorReturn true if this root deployment descriptor does not describe anything- Specified by:
isEmptyin 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:
getEjbReferenceDescriptorsin interfaceEjbReferenceContainer- Specified by:
getEjbReferenceDescriptorsin interfaceJndiNameEnvironment- Returns:
- java.util.Set of EjbReferenceDescriptor objects
-
addEjbReferenceDescriptor
public void addEjbReferenceDescriptor(EjbReference ejbReference)
Adds a reference to another ejb to me.- Specified by:
addEjbReferenceDescriptorin interfaceEjbReferenceContainer- Specified by:
addEjbReferenceDescriptorin interfaceWritableJndiNameEnvironment- Parameters:
ejbReference- the EjbReferenceDescriptor to add.
-
removeEjbReferenceDescriptor
public void removeEjbReferenceDescriptor(EjbReference ejbReference)
Description copied from interface:WritableJndiNameEnvironmentRemoves the specificed ejb reference from the receiver.- Specified by:
removeEjbReferenceDescriptorin 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:EjbReferenceContainerLooks up an ejb reference with the given name. Throws an IllegalArgumentException if it is not found.- Specified by:
getEjbReferencein interfaceEjbReferenceContainer
-
getServiceReferenceDescriptors
public Set<ServiceReferenceDescriptor> getServiceReferenceDescriptors()
Description copied from interface:JndiNameEnvironmentReturn a set of service reference descriptors.- Specified by:
getServiceReferenceDescriptorsin interfaceJndiNameEnvironment- Specified by:
getServiceReferenceDescriptorsin interfaceServiceReferenceContainer- Returns:
- java.util.Set of ServiceReferenceDescriptor objects
-
addServiceReferenceDescriptor
public void addServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)
Description copied from interface:WritableJndiNameEnvironmentAdds the specified service reference to the receiver.- Specified by:
addServiceReferenceDescriptorin interfaceServiceReferenceContainer- Specified by:
addServiceReferenceDescriptorin interfaceWritableJndiNameEnvironment- Parameters:
serviceRef- the ServiceReferenceDescriptor to add.
-
removeServiceReferenceDescriptor
public void removeServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)
Description copied from interface:WritableJndiNameEnvironmentRemoves the specified service reference from the receiver.- Specified by:
removeServiceReferenceDescriptorin interfaceServiceReferenceContainer- Specified by:
removeServiceReferenceDescriptorin 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:
getServiceReferenceByNamein interfaceJndiNameEnvironment- Specified by:
getServiceReferenceByNamein interfaceServiceReferenceContainer- Parameters:
name-- Returns:
- ServiceReferenceDescriptor object
-
getMessageDestinationReferenceDescriptors
public Set<MessageDestinationReferenceDescriptor> getMessageDestinationReferenceDescriptors()
Description copied from interface:JndiNameEnvironmentReturn a set of message destination reference descriptors.- Specified by:
getMessageDestinationReferenceDescriptorsin interfaceJndiNameEnvironment- Specified by:
getMessageDestinationReferenceDescriptorsin interfaceMessageDestinationReferenceContainer- Returns:
- java.util.Set of MessageDestinationReferenceDescriptor objects
-
addMessageDestinationReferenceDescriptor
public void addMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor messageDestRef)
Description copied from interface:WritableJndiNameEnvironmentAdds the specified message destination reference to the receiver.- Specified by:
addMessageDestinationReferenceDescriptorin interfaceMessageDestinationReferenceContainer- Specified by:
addMessageDestinationReferenceDescriptorin interfaceWritableJndiNameEnvironment- Parameters:
messageDestRef- the MessageDestinationReferenceDescriptor to add.
-
removeMessageDestinationReferenceDescriptor
public void removeMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestRef)
Description copied from interface:WritableJndiNameEnvironmentRemoves the specified message destination reference from the receiver.- Specified by:
removeMessageDestinationReferenceDescriptorin interfaceMessageDestinationReferenceContainer- Specified by:
removeMessageDestinationReferenceDescriptorin 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:
getMessageDestinationReferenceByNamein interfaceJndiNameEnvironment- Specified by:
getMessageDestinationReferenceByNamein interfaceMessageDestinationReferenceContainer- Parameters:
name-- Returns:
- MessageDestinationReferenceDescriptor object
-
getResourceEnvReferenceDescriptors
public Set<ResourceEnvReferenceDescriptor> getResourceEnvReferenceDescriptors()
Return the set of resource environment references this application declares.- Specified by:
getResourceEnvReferenceDescriptorsin interfaceJndiNameEnvironment- Specified by:
getResourceEnvReferenceDescriptorsin interfaceResourceEnvReferenceContainer- Returns:
- java.util.Set of ResourceEnvReferenceDescriptor objects
-
addResourceEnvReferenceDescriptor
public void addResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference)
Description copied from interface:WritableJndiNameEnvironmentAdds the specified resource environment reference to the receiver.- Specified by:
addResourceEnvReferenceDescriptorin interfaceResourceEnvReferenceContainer- Specified by:
addResourceEnvReferenceDescriptorin interfaceWritableJndiNameEnvironment- Parameters:
resourceEnvReference- the ResourceEnvReferenceDescriptor to add.
-
removeResourceEnvReferenceDescriptor
public void removeResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference)
Description copied from interface:WritableJndiNameEnvironmentRemoves the specified resource environment reference from the receiver.- Specified by:
removeResourceEnvReferenceDescriptorin 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:
getResourceEnvReferenceByNamein interfaceJndiNameEnvironment- Specified by:
getResourceEnvReferenceByNamein interfaceResourceEnvReferenceContainer- Parameters:
name-- Returns:
- ResourceEnvReferenceDescriptor object
-
getResourceReferenceDescriptors
public Set<ResourceReferenceDescriptor> getResourceReferenceDescriptors()
Return the set of resource references this ejb declares.- Specified by:
getResourceReferenceDescriptorsin interfaceJndiNameEnvironment- Specified by:
getResourceReferenceDescriptorsin interfaceResourceReferenceContainer- Returns:
- java.util.Set of ResourceReferenceDescriptor objects
-
addResourceReferenceDescriptor
public void addResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)
Adds a resource reference to me.- Specified by:
addResourceReferenceDescriptorin interfaceResourceReferenceContainer- Specified by:
addResourceReferenceDescriptorin interfaceWritableJndiNameEnvironment- Parameters:
resourceReference- the ResourceReferenceDescriptor to add.
-
removeResourceReferenceDescriptor
public void removeResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)
Removes the given resource reference from me.- Specified by:
removeResourceReferenceDescriptorin 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:
getResourceReferenceByNamein 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:
getEnvironmentPropertyByNamein interfaceJndiNameEnvironment- Parameters:
name-- Returns:
- EnvironmentProperty descriptor
-
getEnvironmentProperties
public Set<EnvironmentProperty> getEnvironmentProperties()
Return a copy of the structure holding the environment properties.- Specified by:
getEnvironmentPropertiesin interfaceJndiNameEnvironment- Returns:
- java.util.Set of EnvironmentProperty objects
-
addEnvironmentProperty
public void addEnvironmentProperty(EnvironmentProperty environmentProperty)
Description copied from interface:WritableJndiNameEnvironmentAdds the specified environment property to the receiver.- Specified by:
addEnvironmentPropertyin interfaceWritableJndiNameEnvironment- Parameters:
environmentProperty- the EnvironmentProperty to add.
-
removeEnvironmentProperty
public void removeEnvironmentProperty(EnvironmentProperty environmentProperty)
Removes the given environment property from me.- Specified by:
removeEnvironmentPropertyin interfaceWritableJndiNameEnvironment- Parameters:
environmentProperty- the EnvironmentProperty to remove.
-
getEntityManagerFactoryReferenceDescriptors
public Set<EntityManagerFactoryReferenceDescriptor> getEntityManagerFactoryReferenceDescriptors()
Description copied from interface:JndiNameEnvironmentReturn a set of entity manager factory reference descriptors.- Specified by:
getEntityManagerFactoryReferenceDescriptorsin interfaceJndiNameEnvironment
-
getEntityManagerFactoryReferenceByName
public EntityManagerFactoryReferenceDescriptor getEntityManagerFactoryReferenceByName(String name)
Return the entity manager factory reference descriptor corresponding to the given name.- Specified by:
getEntityManagerFactoryReferenceByNamein interfaceJndiNameEnvironment- Parameters:
name-- Returns:
-
addEntityManagerFactoryReferenceDescriptor
public void addEntityManagerFactoryReferenceDescriptor(EntityManagerFactoryReferenceDescriptor reference)
- Specified by:
addEntityManagerFactoryReferenceDescriptorin interfaceWritableJndiNameEnvironment
-
getEntityManagerReferenceDescriptors
public Set<EntityManagerReferenceDescriptor> getEntityManagerReferenceDescriptors()
Description copied from interface:JndiNameEnvironmentReturn a set of entity manager reference descriptors.- Specified by:
getEntityManagerReferenceDescriptorsin interfaceJndiNameEnvironment
-
getEntityManagerReferenceByName
public EntityManagerReferenceDescriptor getEntityManagerReferenceByName(String name)
Return the entity manager factory reference descriptor corresponding to the given name.- Specified by:
getEntityManagerReferenceByNamein interfaceJndiNameEnvironment- Parameters:
name-- Returns:
-
addEntityManagerReferenceDescriptor
public void addEntityManagerReferenceDescriptor(EntityManagerReferenceDescriptor reference)
- Specified by:
addEntityManagerReferenceDescriptorin interfaceWritableJndiNameEnvironment
-
getPostConstructDescriptors
public Set<LifecycleCallbackDescriptor> getPostConstructDescriptors()
Description copied from interface:JndiNameEnvironmentReturn a set of post-construct descriptors.- Specified by:
getPostConstructDescriptorsin interfaceJndiNameEnvironment- Returns:
- java.util.Set of LifecycleCallbackDescriptor post-construct objects
-
addPostConstructDescriptor
public void addPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc)
Description copied from interface:WritableJndiNameEnvironmentAdds the specified post-construct descriptor to the receiver.- Specified by:
addPostConstructDescriptorin interfaceWritableJndiNameEnvironment- Parameters:
postConstructDesc- the post-construct LifecycleCallbackDescriptor to add.
-
getPostConstructDescriptorByClass
public LifecycleCallbackDescriptor getPostConstructDescriptorByClass(String className)
Description copied from interface:JndiNameEnvironmentReturn the post-construct descriptor corresponding to the given name.- Specified by:
getPostConstructDescriptorByClassin interfaceJndiNameEnvironment- Returns:
- LifecycleCallbackDescriptor post-construct object
-
getPreDestroyDescriptors
public Set<LifecycleCallbackDescriptor> getPreDestroyDescriptors()
Description copied from interface:JndiNameEnvironmentReturn a set of pre-destroy descriptors.- Specified by:
getPreDestroyDescriptorsin interfaceJndiNameEnvironment- Returns:
- java.util.Set of LifecycleCallbackDescriptor pre-destroy objects
-
addPreDestroyDescriptor
public void addPreDestroyDescriptor(LifecycleCallbackDescriptor preDestroyDesc)
Description copied from interface:WritableJndiNameEnvironmentAdds the specified pre-destroy descriptor to the receiver.- Specified by:
addPreDestroyDescriptorin interfaceWritableJndiNameEnvironment- Parameters:
preDestroyDesc- the pre-destroy LifecycleCallbackDescriptor to add.
-
getPreDestroyDescriptorByClass
public LifecycleCallbackDescriptor getPreDestroyDescriptorByClass(String className)
Description copied from interface:JndiNameEnvironmentReturn the pre-destroy descriptor corresponding to the given name.- Specified by:
getPreDestroyDescriptorByClassin interfaceJndiNameEnvironment- Returns:
- LifecycleCallbackDescriptor pre-destroy object
-
getInjectableResourcesByClass
public List<InjectionCapable> getInjectableResourcesByClass(String className)
- Specified by:
getInjectableResourcesByClassin interfaceJndiNameEnvironment
-
getInjectionInfoByClass
public InjectionInfo getInjectionInfoByClass(Class clazz)
- Specified by:
getInjectionInfoByClassin 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:
getCompatibilityin classBundleDescriptor
-
setCompatibility
public void setCompatibility(String compatValue)
- Overrides:
setCompatibilityin 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:
getEntityManagerFactoriesin 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:
getRolesin interfaceRoles- Overrides:
getRolesin classBundleDescriptor- Returns:
- the Set of roles in the application.
-
getAppRoles
public Set<Role> getAppRoles()
Return the set ofRoleobjects I have (the ones defined in application xml).- Returns:
-
addAppRole
public void addAppRole(SecurityRoleDescriptor descriptor)
Adds a newRoleto the application based on the descriptor- Parameters:
descriptor-
-
addRole
public void addRole(Role role)
Adds a new abstract role- Specified by:
addRolein interfaceRoles- Overrides:
addRolein classBundleDescriptor- Parameters:
role-
-
removeRole
public void removeRole(Role role)
Removes the given role.- Specified by:
removeRolein interfaceRoles- Overrides:
removeRolein classBundleDescriptor- Parameters:
role-
-
setName
public void setName(String name)
Reset the display name of this application.- Overrides:
setNamein 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:
addBundleDescriptorin 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:
getRoleMapperin 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:
getClassLoaderin classBundleDescriptor- Returns:
- the class loader associated with this application
-
print
public void print(StringBuilder toStringBuilder)
A formatted String representing my state.- Overrides:
printin classBundleDescriptor
-
visit
public void visit(DescriptorVisitor aVisitor)
visit the descriptor and all sub descriptors with a DOL visitor implementation- Overrides:
visitin classDescriptor- Parameters:
aVisitor- visitor to traverse the descriptors
-
getModuleID
public String getModuleID()
- Overrides:
getModuleIDin classBundleDescriptor- Returns:
- the module ID for this module descriptor
-
isApplication
public boolean isApplication()
- Overrides:
isApplicationin classBundleDescriptor- Returns:
- true if this module is an application object
-
getModuleType
public ArchiveType getModuleType()
- Specified by:
getModuleTypein 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:
getKeepStatein 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-
-
-