com.sun.enterprise.deployment
Class ResourceReferenceDescriptor

java.lang.Object
  extended by java.util.Observable
      extended by com.sun.enterprise.deployment.DynamicAttributesDescriptor
          extended by com.sun.enterprise.deployment.Descriptor
              extended by com.sun.enterprise.deployment.EnvironmentProperty
                  extended by com.sun.enterprise.deployment.ResourceReferenceDescriptor
All Implemented Interfaces:
InjectionCapable, NamedDescriptor, ApplicationParameter, ContextParameter, EnvironmentEntry, InitializationParameter, NameValuePair, ResourceReference, WebDescriptor, java.io.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
static java.lang.String APPLICATION_AUTHORIZATION
          For database resources, this says the application will log in.
static java.lang.String CONTAINER_AUTHORIZATION
          For database resources this says the container will log in.
static java.lang.String RESOURCE_SHAREABLE
           
static java.lang.String RESOURCE_UNSHAREABLE
           
 
Fields inherited from class com.sun.enterprise.deployment.EnvironmentProperty
lookupName, mappedName
 
Fields inherited from class com.sun.enterprise.deployment.Descriptor
DESCRIPTION_CHANGED, DESCRIPTOR_CHANGED, docType, LARGE_ICON_CHANGED, NAME_CHANGED, SMALL_ICON_CHANGED
 
Constructor Summary
ResourceReferenceDescriptor()
          Default constructor.
ResourceReferenceDescriptor(java.lang.String name, java.lang.String description, java.lang.String type)
          Construct a resource reference with the given name, description and type.
 
Method Summary
 void addProperty(NameValuePairDescriptor newProp)
          Add a new runtime property to this cmp resource
 void checkType()
          checks the given class type.
 boolean equals(java.lang.Object object)
          Equality on name.
 java.lang.String getAuthorization()
          Return the authorization type of this resource.
 java.lang.String getDatabaseVendorName()
           
 java.lang.String getInjectResourceType()
          This is the class name of the type of resource that is to be injected.
 javax.sql.DataSource getJDBCDataSource()
          Lookup the datasource from the namespace based on the JNDI name.
 java.lang.String getJndiName()
          Return the JNDI name of this resource reference.
 MailConfiguration getMailConfiguration()
          Return the mail configuration details of thsi resource or null.
 java.util.Iterator getProperties()
           
 ResourcePrincipal getResourcePrincipal()
          Return the identity used to authorize this resource.
 java.util.Properties getSchemaGeneratorProperties()
           
 java.lang.String getSharingScope()
          Return the res-sharing-scope of this resource reference.
 java.lang.String getType()
          Return the type of the resource.
 boolean hasAuthorization()
          Has the authorization type been set?
 boolean hasSharingScope()
          Has the sharing scope been set?
 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()
           
 boolean 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 object.
 boolean isWebServiceContext()
           
 void print(java.lang.StringBuffer toStringBuffer)
          Returns a formatted string representing my state.
 void setAuthorization(java.lang.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 time
 void setDatabaseVendorName(java.lang.String vendorName)
          Sets the database vendor name
 void setDropTablesAtUndeploy(boolean dropTablesAtUndeploy)
          Sets whether if automatic creation of tables for the CMP Beans is done at deployment time
 void setInjectResourceType(java.lang.String resourceType)
           
 void setJndiName(java.lang.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(java.util.Properties props)
          Sets the override properties for the schema generation
 void setSharingScope(java.lang.String ss)
          Set the res-sharing-scope of this resource reference.
 void setType(java.lang.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, hashCode, hasInjectionTargetFromXml, hasLookupName, isConflictResourceGroup, isInjectable, isSetValueCalled, printInjectableResourceInfo, setLookupName, setMappedName, setValue
 
Methods inherited from class com.sun.enterprise.deployment.Descriptor
addDeploymentExtension, addPrefixMapping, createUniqueFilenameAmongst, createUniqueNameAmongst, createUniqueNameAmongstNamedDescriptors, fillDocType, getDeploymentExtensions, getDescription, 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 com.sun.enterprise.deployment.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.ResourceReference
setDescription
 
Methods inherited from interface com.sun.enterprise.deployment.web.NameValuePair
getDescription, getName, getValue, setName, setValue
 
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 java.lang.String APPLICATION_AUTHORIZATION
For database resources, this says the application will log in.

See Also:
Constant Field Values

CONTAINER_AUTHORIZATION

public static final java.lang.String CONTAINER_AUTHORIZATION
For database resources this says the container will log in.

See Also:
Constant Field Values

RESOURCE_SHAREABLE

public static final java.lang.String RESOURCE_SHAREABLE
See Also:
Constant Field Values

RESOURCE_UNSHAREABLE

public static final java.lang.String RESOURCE_UNSHAREABLE
See Also:
Constant Field Values
Constructor Detail

ResourceReferenceDescriptor

public ResourceReferenceDescriptor(java.lang.String name,
                                   java.lang.String description,
                                   java.lang.String type)
Construct a resource reference with the given name, description and type.

Parameters:
the - name of the reference
the - description
the - type of the resource reference.

ResourceReferenceDescriptor

public ResourceReferenceDescriptor()
Default constructor.

Method Detail

getJndiName

public java.lang.String getJndiName()
Return the JNDI name of this resource reference.

Specified by:
getJndiName in interface NamedDescriptor
Returns:
the JNDI name of the resource reference.

setJndiName

public void setJndiName(java.lang.String jndiName)
Set the JNDI name of this resource reference.

Specified by:
setJndiName in interface NamedDescriptor
Parameters:
the - JNDI name of the resource reference.

getInjectResourceType

public java.lang.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 interface InjectionCapable
Overrides:
getInjectResourceType in class EnvironmentProperty

setInjectResourceType

public void setInjectResourceType(java.lang.String resourceType)
Specified by:
setInjectResourceType in interface InjectionCapable
Overrides:
setInjectResourceType in class EnvironmentProperty

hasSharingScope

public boolean hasSharingScope()
Has the sharing scope been set?

Returns:
true if the sharing scope has been set

getSharingScope

public java.lang.String getSharingScope()
Return the res-sharing-scope of this resource reference.

Returns:
the sharing scope.

setSharingScope

public void setSharingScope(java.lang.String ss)
Set the res-sharing-scope of this resource reference.

Parameters:
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 java.lang.String getAuthorization()
Return the authorization type of this resource. The default value is APPLICATION_AUTHORIZATION

Specified by:
getAuthorization in interface ResourceReference
Returns:
the authorization type of the resource.

setAuthorization

public void setAuthorization(java.lang.String authorization)
Sets the authorization type of this resource.

Specified by:
setAuthorization in interface ResourceReference
Parameters:
the - authorization type.

getType

public java.lang.String getType()
Return the type of the resource.

Specified by:
getType in interface EnvironmentEntry
Specified by:
getType in interface ResourceReference
Overrides:
getType in class EnvironmentProperty
Returns:
the type of the resource.

setType

public void setType(java.lang.String type)
Sets the type of this resource.

Specified by:
setType in interface EnvironmentEntry
Specified by:
setType in interface ResourceReference
Overrides:
setType in class EnvironmentProperty
Parameters:
the - type of the resource.

getJDBCDataSource

public javax.sql.DataSource getJDBCDataSource()
Lookup the datasource from the namespace based on the JNDI name.

Returns:
the data source

isWebServiceContext

public boolean isWebServiceContext()

isORB

public boolean isORB()

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.

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:
the - principal.

setMailConfiguration

public void setMailConfiguration(MailConfiguration mailConfiguration)
Sets the mail configuration information for this reference.

Parameters:
the - mail configuration object.

addProperty

public void addProperty(NameValuePairDescriptor newProp)
Add a new runtime property to this cmp resource


getProperties

public java.util.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


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


getDatabaseVendorName

public java.lang.String getDatabaseVendorName()
Returns:
the database vendor name

setDatabaseVendorName

public void setDatabaseVendorName(java.lang.String vendorName)
Sets the database vendor name


getSchemaGeneratorProperties

public java.util.Properties getSchemaGeneratorProperties()
Returns:
the override properties for the schema generation

setSchemaGeneratorProperties

public void setSchemaGeneratorProperties(java.util.Properties props)
Sets the override properties for the schema generation


equals

public boolean equals(java.lang.Object object)
Equality on name.

Overrides:
equals in class EnvironmentProperty

print

public void print(java.lang.StringBuffer toStringBuffer)
Returns a formatted string representing my state.

Overrides:
print in class EnvironmentProperty

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



Copyright © 2012 GlassFish Community. All Rights Reserved.