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 StringAPPLICATION_AUTHORIZATIONFor database resources, this says the application will log in.static StringCONTAINER_AUTHORIZATIONFor database resources this says the container will log in.static StringRESOURCE_SHAREABLEstatic StringRESOURCE_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 voidaddProperty(NameValuePairDescriptor newProp)Add a new runtime property to this cmp resourcevoidcheckType()checks the given class type.booleanequals(Object object)Equality on name.StringgetAuthorization()Return the authorization type of this resource.StringgetDatabaseVendorName()StringgetInjectResourceType()This is the class name of the type of resource that is to be injected.DataSourcegetJDBCDataSource()Lookup the datasource from the namespace based on the JNDI name.StringgetJndiName()Return the JNDI name of this resource reference.MailConfigurationgetMailConfiguration()Return the mail configuration details of thsi resource or null.IteratorgetProperties()ResourcePrincipalgetResourcePrincipal()Return the identity used to authorize this resource.PropertiesgetSchemaGeneratorProperties()StringgetSharingScope()Return the res-sharing-scope of this resource reference.StringgetType()Return the type of the resource.booleanhasAuthorization()Has the authorization type been set?inthashCode()The hashCode of an environment property is the same as that of the name String.booleanhasSharingScope()Has the sharing scope been set?booleanisConflict(ResourceReferenceDescriptor other)booleanisContainerAuthorization()Return true of this resource reference is expecting the container to authorize the resource.booleanisCreateTablesAtDeploy()booleanisDropTablesAtUndeploy()booleanisJDBCResource()booleanisJMSConnectionFactory()Return true if this resource is a JMS connection factory.booleanisMailResource()Return true if this resource is to a JavaMail session object.booleanisORB()Return true is the resource is ofORBtypebooleanisResolved()Does this resource references have a JNDI name.booleanisResourceConnectionFactory()Return true if this resource is a CCI connection factory.booleanisURLResource()Return true if this resource is a URL objectbooleanisWebServiceContext()Return true is the resource is ofWebServiceContexttypevoidprint(StringBuilder toStringBuilder)Returns a formatted string representing my state.voidsetAuthorization(String authorization)Sets the authorization type of this resource.voidsetCreateTablesAtDeploy(boolean createTablesAtDeploy)Sets whether if automatic creation of tables for the CMP Beans is done at deployment timevoidsetDatabaseVendorName(String vendorName)Sets the database vendor namevoidsetDropTablesAtUndeploy(boolean dropTablesAtUndeploy)Sets whether if automatic creation of tables for the CMP Beans is done at deployment timevoidsetInjectResourceType(String resourceType)voidsetJndiName(String jndiName)Set the JNDI name of this resource reference.voidsetMailConfiguration(MailConfiguration mailConfiguration)Sets the mail configuration information for this reference.voidsetResourcePrincipal(ResourcePrincipal resourcePrincipal)Sets the identity used to authorize this resource.voidsetSchemaGeneratorProperties(Properties props)Sets the override properties for the schema generationvoidsetSharingScope(String ss)Set the res-sharing-scope of this resource reference.voidsetType(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:
getJndiNamein 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:
setJndiNamein interfaceNamedDescriptor- Parameters:
jndiName- the JNDI name of the resource reference.
-
getInjectResourceType
public String getInjectResourceType()
Description copied from interface:InjectionCapableThis is the class name of the type of resource that is to be injected.- Specified by:
getInjectResourceTypein interfaceInjectionCapable- Overrides:
getInjectResourceTypein classEnvironmentProperty
-
setInjectResourceType
public void setInjectResourceType(String resourceType)
- Specified by:
setInjectResourceTypein interfaceInjectionCapable- Overrides:
setInjectResourceTypein 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:
getAuthorizationin interfaceResourceReference- Returns:
- the authorization type of the resource.
-
setAuthorization
public void setAuthorization(String authorization)
Sets the authorization type of this resource.- Specified by:
setAuthorizationin interfaceResourceReference- Parameters:
authorization- the authorization type.
-
getType
public String getType()
Return the type of the resource.- Specified by:
getTypein interfaceEnvironmentEntry- Specified by:
getTypein interfaceResourceReference- Overrides:
getTypein classEnvironmentProperty- Returns:
- the type of the resource.
-
setType
public void setType(String type)
Sets the type of this resource.- Specified by:
setTypein interfaceEnvironmentEntry- Specified by:
setTypein interfaceResourceReference- Overrides:
setTypein 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 ofWebServiceContexttype- Returns:
-
isORB
public boolean isORB()
Return true is the resource is ofORBtype- 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:
equalsin classEnvironmentProperty- Parameters:
object-
-
hashCode
public int hashCode()
Description copied from class:EnvironmentPropertyThe hashCode of an environment property is the same as that of the name String.- Overrides:
hashCodein classEnvironmentProperty
-
print
public void print(StringBuilder toStringBuilder)
Returns a formatted string representing my state.- Overrides:
printin 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)
-
-