com.sun.enterprise.deployment
Class EnvironmentProperty

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
All Implemented Interfaces:
InjectionCapable, ApplicationParameter, ContextParameter, EnvironmentEntry, InitializationParameter, NameValuePair, WebDescriptor, java.io.Serializable
Direct Known Subclasses:
ConnectorConfigProperty, EjbReferenceDescriptor, EntityManagerFactoryReferenceDescriptor, EntityManagerReferenceDescriptor, JmsDestinationReferenceDescriptor, MessageDestinationReferenceDescriptor, ResourceReferenceDescriptor, RoleReference, ServiceReferenceDescriptor

public class EnvironmentProperty
extends Descriptor
implements InitializationParameter, ContextParameter, ApplicationParameter, WebDescriptor, EnvironmentEntry, InjectionCapable

The EnvironmentProperty class hold the data about a single environment entry for J2EE components.

Author:
Danny Coward
See Also:
Serialized Form

Field Summary
protected  java.lang.String lookupName
           
protected  java.lang.String 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
EnvironmentProperty()
          Construct an environment property if type String and empty string value and no description.
EnvironmentProperty(EnvironmentProperty other)
          copy constructor.
EnvironmentProperty(java.lang.String name, java.lang.String value, java.lang.String description)
          Construct an environment property of given name value and description.
EnvironmentProperty(java.lang.String name, java.lang.String value, java.lang.String description, java.lang.String type)
          Construct an environment property of given name value and description and type.
 
Method Summary
 void addInjectionTarget(InjectionTarget target)
          Add a new injection target for this dependency
 boolean equals(java.lang.Object other)
          Returns true if the argument is an environment property of the same name, false else.
 java.lang.String getComponentEnvName()
          ComponentEnvName is the name of the corresponding java:comp/env entry for the object that is to be injected.
 java.util.Set<InjectionTarget> getInjectionTargets()
           
 java.lang.String getInjectResourceType()
          This is the class name of the type of resource that is to be injected.
 java.lang.String getLookupName()
           
 java.lang.String getMappedName()
           
 java.lang.String getResolvedValue()
          Returns a resolved value of this environment property
 java.lang.Object getResolvedValueObject()
          Returns the typed value object of this environment property.
 java.lang.String getType()
          Returns value type of this environment property as a classname.
 java.lang.String getValue()
          Returns the String value of this environment property
 java.lang.Object getValueObject()
          Returns the typed value object of this environment property.
 java.lang.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()
           
protected  boolean isConflictResourceGroup(EnvironmentProperty other)
           
 boolean isInjectable()
          True if a particular resource instance is injectable.
 boolean isSetValueCalled()
           
 void print(java.lang.StringBuffer toStringBuffer)
          Returns a String representation of this environment property.
 java.lang.StringBuffer printInjectableResourceInfo(java.lang.StringBuffer toStringBuffer)
           
 void setInjectResourceType(java.lang.String resourceType)
           
 void setLookupName(java.lang.String lName)
           
 void setMappedName(java.lang.String mName)
           
 void setType(java.lang.String type)
          Returns value type of this environment property.
 void setValue(java.lang.String value)
          Sets the value of the environment property to the given string.
 
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.web.WebDescriptor
getDescription, getLargeIconUri, getName, getSmallIconUri, setDescription, setLargeIconUri, setName, setSmallIconUri
 
Methods inherited from interface com.sun.enterprise.deployment.web.NameValuePair
getDescription, getName, setDescription, setName
 

Field Detail

mappedName

protected java.lang.String mappedName

lookupName

protected java.lang.String lookupName
Constructor Detail

EnvironmentProperty

public EnvironmentProperty(EnvironmentProperty other)
copy constructor.


EnvironmentProperty

public EnvironmentProperty()
Construct an environment property if type String and empty string value and no description.


EnvironmentProperty

public EnvironmentProperty(java.lang.String name,
                           java.lang.String value,
                           java.lang.String description)
Construct an environment property of given name value and description.


EnvironmentProperty

public EnvironmentProperty(java.lang.String name,
                           java.lang.String value,
                           java.lang.String description,
                           java.lang.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.

Method Detail

getValue

public java.lang.String getValue()
Returns the String value of this environment property

Specified by:
getValue in interface NameValuePair

getResolvedValue

public java.lang.String getResolvedValue()
Returns a resolved value of this environment property


getResolvedValueObject

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


getValueObject

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


getValueType

public java.lang.Class getValueType()
Returns value type of this environment property.


setType

public void setType(java.lang.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 interface EnvironmentEntry

getType

public java.lang.String getType()
Returns value type of this environment property as a classname.

Specified by:
getType in interface EnvironmentEntry

setMappedName

public void setMappedName(java.lang.String mName)

getMappedName

public java.lang.String getMappedName()

setLookupName

public void setLookupName(java.lang.String lName)

getLookupName

public java.lang.String getLookupName()

hasLookupName

public boolean hasLookupName()

setValue

public void setValue(java.lang.String value)
Sets the value of the environment property to the given string.

Specified by:
setValue in interface NameValuePair

isSetValueCalled

public boolean isSetValueCalled()

hasAValue

public boolean hasAValue()

equals

public boolean equals(java.lang.Object other)
Returns true if the argument is an environment property of the same name, false else.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
The hashCode of an environment property is the same as that of the name String.

Overrides:
hashCode in class java.lang.Object

print

public void print(java.lang.StringBuffer toStringBuffer)
Returns a String representation of this environment property.

Overrides:
print in class Descriptor

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 interface InjectionCapable

getInjectionTargets

public java.util.Set<InjectionTarget> getInjectionTargets()
Specified by:
getInjectionTargets in interface InjectionCapable
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 interface InjectionCapable

hasInjectionTargetFromXml

public boolean hasInjectionTargetFromXml()

getComponentEnvName

public java.lang.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 interface InjectionCapable

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

setInjectResourceType

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

printInjectableResourceInfo

public java.lang.StringBuffer printInjectableResourceInfo(java.lang.StringBuffer toStringBuffer)


Copyright © 2012 GlassFish Community. All Rights Reserved.