Package com.sun.enterprise.deployment
Class EnvironmentProperty
- java.lang.Object
-
- java.util.Observable
-
- org.glassfish.deployment.common.DynamicAttributesDescriptor
-
- org.glassfish.deployment.common.Descriptor
-
- com.sun.enterprise.deployment.EnvironmentProperty
-
- All Implemented Interfaces:
InjectionCapable
,ApplicationParam
,ContextParameter
,EnvironmentEntry
,InitializationParameter
,NameValuePair
,WebDescriptor
,Serializable
- Direct Known Subclasses:
ConnectorConfigProperty
,EjbReferenceDescriptor
,EntityManagerFactoryReferenceDescriptor
,EntityManagerReferenceDescriptor
,MessageDestinationReferenceDescriptor
,ResourceEnvReferenceDescriptor
,ResourceReferenceDescriptor
,RoleReference
,ServiceReferenceDescriptor
public class EnvironmentProperty extends Descriptor implements InitializationParameter, ContextParameter, ApplicationParam, WebDescriptor, EnvironmentEntry, InjectionCapable
The EnvironmentProperty class hold the data about a single environment entry for J2EE components.The property must of a primitive type or its boxed variant
- Author:
- Danny Coward
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
lookupName
protected String
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 EnvironmentProperty()
Construct an environment property if type String and empty string value and no description.EnvironmentProperty(EnvironmentProperty other)
copy constructor.EnvironmentProperty(String name, String value, String description)
Construct an environment property of given name value and description.EnvironmentProperty(String name, String value, String description, String type)
Construct an environment property of given name value and description and type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInjectionTarget(InjectionTarget target)
Add a new injection target for this dependencyboolean
equals(Object other)
Returns true if the argument is an environment property of the same name, false else.String
getComponentEnvName()
ComponentEnvName is the name of the corresponding java:comp/env entry for the object that is to be injected.Set<InjectionTarget>
getInjectionTargets()
String
getInjectResourceType()
This is the class name of the type of resource that is to be injected.String
getLookupName()
Gets the lookup valueString
getMappedName()
String
getResolvedValue()
Returns a resolved value of this environment propertyObject
getResolvedValueObject()
Returns the typed value object of this environment property.String
getType()
Returns value type of this environment property as a classname.String
getValue()
Returns the String value of this environment propertyObject
getValueObject()
Returns the typed value object of this environment property.Class
getValueType()
Returns value type of this environment property.boolean
hasAValue()
int
hashCode()
The hashCode of an environment property is the same as that of the name String.boolean
hasInjectionTargetFromXml()
boolean
hasLookupName()
boolean
isConflict(EnvironmentProperty other)
protected boolean
isConflictResourceGroup(EnvironmentProperty other)
boolean
isInjectable()
True if a particular resource instance is injectable.boolean
isSetValueCalled()
Returns true if the value of the environment property has been setvoid
print(StringBuilder toStringBuilder)
Returns a String representation of this environment property.StringBuilder
printInjectableResourceInfo(StringBuilder toStringBuilder)
void
setInjectResourceType(String resourceType)
void
setLookupName(String lName)
Sets the lookup namevoid
setMappedName(String mName)
void
setType(String type)
Returns value type of this environment property.void
setValue(String value)
Sets the value of the environment property to the given string.-
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.web.NameValuePair
getDescription, getName, setDescription, setName
-
Methods inherited from interface com.sun.enterprise.deployment.web.WebDescriptor
getDescription, getLargeIconUri, getName, getSmallIconUri, setDescription, setLargeIconUri, setName, setSmallIconUri
-
-
-
-
Constructor Detail
-
EnvironmentProperty
public EnvironmentProperty(EnvironmentProperty other)
copy constructor.- Parameters:
other
-
-
EnvironmentProperty
public EnvironmentProperty()
Construct an environment property if type String and empty string value and no description.
-
EnvironmentProperty
public EnvironmentProperty(String name, String value, String description)
Construct an environment property of given name value and description.- Parameters:
name
-value
-description
-
-
EnvironmentProperty
public EnvironmentProperty(String name, String value, String description, String type)
Construct an environment property of given name value and description and type. Throws an IllegalArgumentException if bounds checking is true and the value cannot be reconciled with the given type.- Parameters:
name
-value
-description
-type
-
-
-
Method Detail
-
getValue
public String getValue()
Returns the String value of this environment property- Specified by:
getValue
in interfaceNameValuePair
- Returns:
-
getResolvedValue
public String getResolvedValue()
Returns a resolved value of this environment property- Returns:
-
getResolvedValueObject
public Object getResolvedValueObject()
Returns the typed value object of this environment property. Throws an IllegalArgumentException if bounds checking is true and the value cannot be reconciled with the given type.- Returns:
-
getValueObject
public Object getValueObject()
Returns the typed value object of this environment property. Throws an IllegalArgumentException if bounds checking is true and the value cannot be reconciled with the given type.- Returns:
-
getValueType
public Class getValueType()
Returns value type of this environment property.- Returns:
-
setType
public void setType(String type)
Returns value type of this environment property. Throws Illegal argument exception if this is not an allowed type and bounds checking.- Specified by:
setType
in interfaceEnvironmentEntry
- Parameters:
type
-
-
getType
public String getType()
Returns value type of this environment property as a classname.- Specified by:
getType
in interfaceEnvironmentEntry
- Returns:
-
setMappedName
public void setMappedName(String mName)
-
getMappedName
public String getMappedName()
- Returns:
- the mapped name or an empty string if not set
-
setLookupName
public void setLookupName(String lName)
Sets the lookup name- Parameters:
lName
-
-
getLookupName
public String getLookupName()
Gets the lookup value- Returns:
- the lookupname or an empty string if not set
-
hasLookupName
public boolean hasLookupName()
- Returns:
- true if lookup is not null and non-zero length
-
setValue
public void setValue(String value)
Sets the value of the environment property to the given string.- Specified by:
setValue
in interfaceNameValuePair
- Parameters:
value
-
-
isSetValueCalled
public boolean isSetValueCalled()
Returns true if the value of the environment property has been set- Returns:
-
hasAValue
public boolean hasAValue()
-
equals
public boolean equals(Object other)
Returns true if the argument is an environment property of the same name, false else.
-
hashCode
public int hashCode()
The hashCode of an environment property is the same as that of the name String.
-
print
public void print(StringBuilder toStringBuilder)
Returns a String representation of this environment property.- Overrides:
print
in classDescriptor
- Parameters:
toStringBuilder
-
-
isConflict
public boolean isConflict(EnvironmentProperty other)
-
isConflictResourceGroup
protected boolean isConflictResourceGroup(EnvironmentProperty other)
-
addInjectionTarget
public void addInjectionTarget(InjectionTarget target)
Description copied from interface:InjectionCapable
Add a new injection target for this dependency- Specified by:
addInjectionTarget
in interfaceInjectionCapable
-
getInjectionTargets
public Set<InjectionTarget> getInjectionTargets()
- Specified by:
getInjectionTargets
in interfaceInjectionCapable
- Returns:
- the set of injection targets for this resource dependency
-
isInjectable
public boolean isInjectable()
Description copied from interface:InjectionCapable
True if a particular resource instance is injectable. All injectable resources are also exposed via their corresponding java:comp/env namespaces, but not all resources in java:comp/env are injectable. A resource is either field injectable or method injectable but never both.- Specified by:
isInjectable
in interfaceInjectionCapable
-
hasInjectionTargetFromXml
public boolean hasInjectionTargetFromXml()
-
getComponentEnvName
public String getComponentEnvName()
Description copied from interface:InjectionCapable
ComponentEnvName is the name of the corresponding java:comp/env entry for the object that is to be injected.- Specified by:
getComponentEnvName
in interfaceInjectionCapable
-
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
-
setInjectResourceType
public void setInjectResourceType(String resourceType)
- Specified by:
setInjectResourceType
in interfaceInjectionCapable
-
printInjectableResourceInfo
public StringBuilder printInjectableResourceInfo(StringBuilder toStringBuilder)
-
-