Package com.sun.enterprise.deployment
Class ResourceReferenceDescriptor
- java.lang.Object
-
- java.util.Observable
-
- org.glassfish.deployment.common.DynamicAttributesDescriptor
-
- org.glassfish.deployment.common.Descriptor
-
- com.sun.enterprise.deployment.EnvironmentProperty
-
- com.sun.enterprise.deployment.ResourceReferenceDescriptor
-
- All Implemented Interfaces:
InjectionCapable
,NamedDescriptor
,ApplicationParam
,ContextParameter
,EnvironmentEntry
,InitializationParameter
,NameValuePair
,ResourceReference
,WebDescriptor
,Serializable
public class ResourceReferenceDescriptor extends EnvironmentProperty implements NamedDescriptor, ResourceReference
This descriptor represents a dependency on a resource.- Author:
- Danny Coward
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_AUTHORIZATION
For database resources, this says the application will log in.static String
CONTAINER_AUTHORIZATION
For database resources this says the container will log in.static String
RESOURCE_SHAREABLE
static String
RESOURCE_UNSHAREABLE
-
Fields inherited from class com.sun.enterprise.deployment.EnvironmentProperty
lookupName, mappedName
-
Fields inherited from class org.glassfish.deployment.common.Descriptor
DESCRIPTION_CHANGED, DESCRIPTOR_CHANGED, docType, LARGE_ICON_CHANGED, NAME_CHANGED, SMALL_ICON_CHANGED
-
-
Constructor Summary
Constructors Constructor Description ResourceReferenceDescriptor()
Default constructor.ResourceReferenceDescriptor(String name, String description, String type)
Construct a resource reference with the given name, description and type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(NameValuePairDescriptor newProp)
Add a new runtime property to this cmp resourcevoid
checkType()
checks the given class type.boolean
equals(Object object)
Equality on name.String
getAuthorization()
Return the authorization type of this resource.String
getDatabaseVendorName()
String
getInjectResourceType()
This is the class name of the type of resource that is to be injected.DataSource
getJDBCDataSource()
Lookup the datasource from the namespace based on the JNDI name.String
getJndiName()
Return the JNDI name of this resource reference.MailConfiguration
getMailConfiguration()
Return the mail configuration details of thsi resource or null.Iterator
getProperties()
ResourcePrincipal
getResourcePrincipal()
Return the identity used to authorize this resource.Properties
getSchemaGeneratorProperties()
String
getSharingScope()
Return the res-sharing-scope of this resource reference.String
getType()
Return the type of the resource.boolean
hasAuthorization()
Has the authorization type been set?int
hashCode()
The hashCode of an environment property is the same as that of the name String.boolean
hasSharingScope()
Has the sharing scope been set?boolean
isConflict(ResourceReferenceDescriptor other)
boolean
isContainerAuthorization()
Return true of this resource reference is expecting the container to authorize the resource.boolean
isCreateTablesAtDeploy()
boolean
isDropTablesAtUndeploy()
boolean
isJDBCResource()
boolean
isJMSConnectionFactory()
Return true if this resource is a JMS connection factory.boolean
isMailResource()
Return true if this resource is to a JavaMail session object.boolean
isORB()
Return true is the resource is ofORB
typeboolean
isResolved()
Does this resource references have a JNDI name.boolean
isResourceConnectionFactory()
Return true if this resource is a CCI connection factory.boolean
isURLResource()
Return true if this resource is a URL objectboolean
isWebServiceContext()
Return true is the resource is ofWebServiceContext
typevoid
print(StringBuilder toStringBuilder)
Returns a formatted string representing my state.void
setAuthorization(String authorization)
Sets the authorization type of this resource.void
setCreateTablesAtDeploy(boolean createTablesAtDeploy)
Sets whether if automatic creation of tables for the CMP Beans is done at deployment timevoid
setDatabaseVendorName(String vendorName)
Sets the database vendor namevoid
setDropTablesAtUndeploy(boolean dropTablesAtUndeploy)
Sets whether if automatic creation of tables for the CMP Beans is done at deployment timevoid
setInjectResourceType(String resourceType)
void
setJndiName(String jndiName)
Set the JNDI name of this resource reference.void
setMailConfiguration(MailConfiguration mailConfiguration)
Sets the mail configuration information for this reference.void
setResourcePrincipal(ResourcePrincipal resourcePrincipal)
Sets the identity used to authorize this resource.void
setSchemaGeneratorProperties(Properties props)
Sets the override properties for the schema generationvoid
setSharingScope(String ss)
Set the res-sharing-scope of this resource reference.void
setType(String type)
Sets the type of this resource.-
Methods inherited from class com.sun.enterprise.deployment.EnvironmentProperty
addInjectionTarget, getComponentEnvName, getInjectionTargets, getLookupName, getMappedName, getResolvedValue, getResolvedValueObject, getValue, getValueObject, getValueType, hasAValue, hasInjectionTargetFromXml, hasLookupName, isConflict, isConflictResourceGroup, isInjectable, isSetValueCalled, printInjectableResourceInfo, setLookupName, setMappedName, setValue
-
Methods inherited from class org.glassfish.deployment.common.Descriptor
addDescriptorExtension, addPrefixMapping, createUniqueFilenameAmongst, createUniqueNameAmongst, createUniqueNameAmongstNamedDescriptors, fillDocType, getDeploymentExtensions, getDescription, getDescriptorExtension, getDescriptorExtensions, getDisplayName, getDocType, getLargeIconUri, getLocalizedDescription, getLocalizedDescriptions, getLocalizedDisplayName, getLocalizedDisplayNames, getLocalizedLargeIconUri, getLocalizedLargeIconUris, getLocalizedSmallIconUri, getLocalizedSmallIconUris, getName, getPrefixMapping, getSmallIconUri, isBoundsChecking, setBoundsChecking, setDescription, setDisplayName, setLargeIconUri, setLocalizedDescription, setLocalizedDisplayName, setLocalizedLargeIconUri, setLocalizedSmallIconUri, setName, setSmallIconUri, visit
-
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, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.sun.enterprise.deployment.NamedDescriptor
getName
-
Methods inherited from interface com.sun.enterprise.deployment.web.NameValuePair
getDescription, getName, getValue, setName, setValue
-
Methods inherited from interface com.sun.enterprise.deployment.web.ResourceReference
setDescription
-
Methods inherited from interface com.sun.enterprise.deployment.web.WebDescriptor
getDescription, getLargeIconUri, getName, getSmallIconUri, setDescription, setLargeIconUri, setName, setSmallIconUri
-
-
-
-
Field Detail
-
APPLICATION_AUTHORIZATION
public static final String APPLICATION_AUTHORIZATION
For database resources, this says the application will log in.- See Also:
- Constant Field Values
-
CONTAINER_AUTHORIZATION
public static final String CONTAINER_AUTHORIZATION
For database resources this says the container will log in.- See Also:
- Constant Field Values
-
RESOURCE_SHAREABLE
public static final String RESOURCE_SHAREABLE
- See Also:
- Constant Field Values
-
RESOURCE_UNSHAREABLE
public static final String RESOURCE_UNSHAREABLE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResourceReferenceDescriptor
public ResourceReferenceDescriptor(String name, String description, String type)
Construct a resource reference with the given name, description and type.- Parameters:
name
- the name of the referencedescription
- the descriptiontype
- the type of the resource reference.
-
ResourceReferenceDescriptor
public ResourceReferenceDescriptor()
Default constructor.
-
-
Method Detail
-
getJndiName
public String getJndiName()
Return the JNDI name of this resource reference.- Specified by:
getJndiName
in interfaceNamedDescriptor
- Returns:
- the JNDI name of the resource reference.
-
setJndiName
public void setJndiName(String jndiName)
Set the JNDI name of this resource reference.- Specified by:
setJndiName
in interfaceNamedDescriptor
- Parameters:
jndiName
- the JNDI name of the resource reference.
-
getInjectResourceType
public String getInjectResourceType()
Description copied from interface:InjectionCapable
This is the class name of the type of resource that is to be injected.- Specified by:
getInjectResourceType
in interfaceInjectionCapable
- Overrides:
getInjectResourceType
in classEnvironmentProperty
-
setInjectResourceType
public void setInjectResourceType(String resourceType)
- Specified by:
setInjectResourceType
in interfaceInjectionCapable
- Overrides:
setInjectResourceType
in classEnvironmentProperty
-
hasSharingScope
public boolean hasSharingScope()
Has the sharing scope been set?- Returns:
- true if the sharing scope has been set
-
getSharingScope
public String getSharingScope()
Return the res-sharing-scope of this resource reference.- Returns:
- the sharing scope.
-
setSharingScope
public void setSharingScope(String ss)
Set the res-sharing-scope of this resource reference.- Parameters:
ss
- the sharing scope.
-
isResolved
public boolean isResolved()
Does this resource references have a JNDI name.- Returns:
- true if the resource reference has a JNDI name, false otherwise
-
hasAuthorization
public boolean hasAuthorization()
Has the authorization type been set?- Returns:
- true if the authorization type has been set
-
isContainerAuthorization
public boolean isContainerAuthorization()
Return true of this resource reference is expecting the container to authorize the resource.- Returns:
- true if authorization is container managed.
-
getAuthorization
public String getAuthorization()
Return the authorization type of this resource. The default value is APPLICATION_AUTHORIZATION- Specified by:
getAuthorization
in interfaceResourceReference
- Returns:
- the authorization type of the resource.
-
setAuthorization
public void setAuthorization(String authorization)
Sets the authorization type of this resource.- Specified by:
setAuthorization
in interfaceResourceReference
- Parameters:
authorization
- the authorization type.
-
getType
public String getType()
Return the type of the resource.- Specified by:
getType
in interfaceEnvironmentEntry
- Specified by:
getType
in interfaceResourceReference
- Overrides:
getType
in classEnvironmentProperty
- Returns:
- the type of the resource.
-
setType
public void setType(String type)
Sets the type of this resource.- Specified by:
setType
in interfaceEnvironmentEntry
- Specified by:
setType
in interfaceResourceReference
- Overrides:
setType
in classEnvironmentProperty
- Parameters:
type
- the type of the resource.
-
getJDBCDataSource
public DataSource getJDBCDataSource()
Lookup the datasource from the namespace based on the JNDI name.- Returns:
- the data source
-
isWebServiceContext
public boolean isWebServiceContext()
Return true is the resource is ofWebServiceContext
type- Returns:
-
isORB
public boolean isORB()
Return true is the resource is ofORB
type- Returns:
-
isMailResource
public boolean isMailResource()
Return true if this resource is to a JavaMail session object.- Returns:
- true if the resource is a JavaMail session object.
-
isJDBCResource
public boolean isJDBCResource()
- Returns:
- true if the resource is a jdbc DataSource object.
-
isURLResource
public boolean isURLResource()
Return true if this resource is a URL object- Returns:
- true if the resource is a URL object, false otherwise.
- See Also:
URL
-
isJMSConnectionFactory
public boolean isJMSConnectionFactory()
Return true if this resource is a JMS connection factory.- Returns:
- true if the resource is a JMS connection factory, false otherwise.
-
getResourcePrincipal
public ResourcePrincipal getResourcePrincipal()
Return the identity used to authorize this resource.- Returns:
- the principal.
-
setResourcePrincipal
public void setResourcePrincipal(ResourcePrincipal resourcePrincipal)
Sets the identity used to authorize this resource.- Parameters:
resourcePrincipal
- the principal.
-
setMailConfiguration
public void setMailConfiguration(MailConfiguration mailConfiguration)
Sets the mail configuration information for this reference.- Parameters:
mailConfiguration
- the mail configuration object.
-
addProperty
public void addProperty(NameValuePairDescriptor newProp)
Add a new runtime property to this cmp resource- Parameters:
newProp
-
-
getProperties
public Iterator getProperties()
- Returns:
- the runtime properties for this cmp resource
-
getMailConfiguration
public MailConfiguration getMailConfiguration()
Return the mail configuration details of thsi resource or null.- Returns:
- the mail configuration object.
-
isCreateTablesAtDeploy
public boolean isCreateTablesAtDeploy()
- Returns:
- true if automatic creation of tables for the CMP Beans is done at deployment time
-
setCreateTablesAtDeploy
public void setCreateTablesAtDeploy(boolean createTablesAtDeploy)
Sets whether if automatic creation of tables for the CMP Beans is done at deployment time- Parameters:
createTablesAtDeploy
-
-
isDropTablesAtUndeploy
public boolean isDropTablesAtUndeploy()
- Returns:
- true if automatic creation of tables for the CMP Beans is done at deployment time
-
setDropTablesAtUndeploy
public void setDropTablesAtUndeploy(boolean dropTablesAtUndeploy)
Sets whether if automatic creation of tables for the CMP Beans is done at deployment time- Parameters:
dropTablesAtUndeploy
-
-
getDatabaseVendorName
public String getDatabaseVendorName()
- Returns:
- the database vendor name
-
setDatabaseVendorName
public void setDatabaseVendorName(String vendorName)
Sets the database vendor name- Parameters:
vendorName
-
-
getSchemaGeneratorProperties
public Properties getSchemaGeneratorProperties()
- Returns:
- the override properties for the schema generation
-
setSchemaGeneratorProperties
public void setSchemaGeneratorProperties(Properties props)
Sets the override properties for the schema generation- Parameters:
props
-
-
equals
public boolean equals(Object object)
Equality on name.- Overrides:
equals
in classEnvironmentProperty
- Parameters:
object
-
-
hashCode
public int hashCode()
Description copied from class:EnvironmentProperty
The hashCode of an environment property is the same as that of the name String.- Overrides:
hashCode
in classEnvironmentProperty
-
print
public void print(StringBuilder toStringBuilder)
Returns a formatted string representing my state.- Overrides:
print
in classEnvironmentProperty
- Parameters:
toStringBuilder
-
-
isResourceConnectionFactory
public boolean isResourceConnectionFactory()
Return true if this resource is a CCI connection factory.- Returns:
- true if the resource is a CCI connection factory, false otherwise.
-
checkType
public void checkType()
checks the given class type. throws an IllegalArgumentException if bounds checking if the class of type "type" does not exist
-
isConflict
public boolean isConflict(ResourceReferenceDescriptor other)
-
-