public class AttributeHolder extends Base implements Externalizable
Base.LoggingWriter, Base.StackFrame
Constructor and Description |
---|
AttributeHolder()
Default constructor is required for deserialization purposes.
|
AttributeHolder(AbstractHttpSessionModel model) |
AttributeHolder(String sName,
Object oValue,
AbstractHttpSessionModel model)
Construct an AttributeHolder for a value.
|
Modifier and Type | Method and Description |
---|---|
protected void |
flush()
Called to flush the value to its data storage.
|
protected Object |
getInternalValue()
Obtain the internally managed object value.
|
AbstractHttpSessionModel |
getModel()
Return the AbstractHttpSessionModel to which this AttributeHolder
belongs.
|
String |
getName()
Determine the name of the attribute.
|
Object |
getValue()
Obtain the object form of the value.
|
boolean |
isActivationListener()
Determine if the value is an object that implements the
HttpSessionActivationListener interface.
|
boolean |
isBindingListener()
Determine if the value is an object that implements the
HttpSessionBindingListener interface.
|
protected boolean |
isEnableSuspectAttributes()
Determine if suspect attributes need special treatment.
|
boolean |
isLocal()
If a session distribution controller is used, and if the session
is not local (is distributed), then this property specifies whether
or not this specific attribute is managed locally.
|
protected boolean |
isSuspect()
Determine if the value needs to be serialized because it was never
serialized or because it could have changed.
|
protected boolean |
isSuspect(Object oValue)
Determine if the value needs to be marked as suspect because suspect
attribute handling is enabled and it is not known to be immutable
|
void |
onBound(AttributeHolder holderOrig)
Called when the attribute is bound.
|
void |
onUnbound(boolean fReplaced,
boolean fAll)
Called when the attribute is unbound.
|
protected void |
prepareWrite()
Called to test serialization; if the holder cannot serialize
its value, it should throw an IOException at this point.
|
void |
readExternal(DataInput in)
Helper to read the object state from a stream.
|
void |
readExternal(ObjectInput in)
The object implements the readExternal method to restore its
contents by calling the methods of DataInput for primitive
types and readObject for objects, strings and arrays.
|
protected void |
setInternalValue(Object oValue)
Store the internally managed object value.
|
protected void |
setLocal(boolean fLocal)
Specify whether or not this attribute is managed locally.
|
protected void |
setModel(AbstractHttpSessionModel model) |
protected void |
setSuspect(boolean fSuspect)
Toggle the suspect flag for the value.
|
void |
writeExternal(DataOutput out)
Helper to write the object state to a stream.
|
void |
writeExternal(ObjectOutput out)
The object implements the writeExternal method to save its contents
by calling the methods of DataOutput for its primitive values or
calling the writeObject method of ObjectOutput for objects,
strings, and arrays.
|
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
public AttributeHolder()
public AttributeHolder(AbstractHttpSessionModel model)
public AttributeHolder(String sName, Object oValue, AbstractHttpSessionModel model)
sName
- the attribute nameoValue
- the value of the attribute; not nullmodel
- the http session modelpublic AbstractHttpSessionModel getModel()
protected void setModel(AbstractHttpSessionModel model)
public String getName()
public Object getValue()
public boolean isActivationListener()
public boolean isBindingListener()
public void onBound(AttributeHolder holderOrig)
holderOrig
- the holder that this new bound holder is
replacing, if any, otherwise nullpublic void onUnbound(boolean fReplaced, boolean fAll)
fReplaced
- set to true of this is the result of a bind
operation (so the holder is being replaced)fAll
- true if this method is called within the context
of an AbstractHttpSessionModel.unbind()
callpublic boolean isLocal()
protected void setLocal(boolean fLocal)
Note: an attribute could change from local to distributed if and only if a session distribution controller is used and the session is distributed. It could change from distributed to local only as a result of serialization failure when the attribute preservation feature is enabled.
fLocal
- true iff the attribute is managed locallyprotected void flush() throws IOException
IOException
- on I/O errorprotected Object getInternalValue()
protected void setInternalValue(Object oValue)
oValue
- the object form of the valueprotected boolean isSuspect()
protected boolean isSuspect(Object oValue)
oValue
- the object which may be suspectprotected void setSuspect(boolean fSuspect)
fSuspect
- true if suspect, false otherwiseprotected void prepareWrite() throws IOException
IOException
- if the holder cannot serialize its valueprotected boolean isEnableSuspectAttributes()
SessionHelper.CTX_INIT_ENABLE_SUSPECT_ATTRIBUTES
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
in
- the stream to read data from in order to restore the
objectIOException
- if an I/O exception occurspublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- the stream to write the object toIOException
- if an I/O exception occurspublic void readExternal(DataInput in) throws IOException
in
- the stream to read data from in order to restore the
objectIOException
- if an I/O exception occurspublic void writeExternal(DataOutput out) throws IOException
out
- the stream to write the object toIOException
- if an I/O exception occurs