Package com.sun.jini.proxy
Class MarshalledWrapper
java.lang.Object
com.sun.jini.proxy.MarshalledWrapper
- All Implemented Interfaces:
Serializable
Wrapper around
MarshalledInstance that samples the integrity setting (if any) of the
stream it is unmarshalled from, and uses that setting to determine whether or not to verify
codebase integrity when calling the get method of the
contained MarshalledInstance.- Since:
- 2.0
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMarshalledWrapper(Object obj) Creates a newMarshalledWrapperwrapping aMarshalledInstancecontaining the given object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the specified object with thisMarshalledWrapperfor equality.get()Returns the result of calling thegetmethod of the wrappedMarshalledInstance, passing the integrity value sampled during deserialization as theverifyCodebaseIntegrityargument.booleanReturns the integrity value sampled during deserialization of thisMarshalledWrapperinstance, orfalseif this instance was not produced by deserialization or was deserialized from a stream with no integrity protection setting.inthashCode()Returns the hash code value for thisMarshalledWrapper.static booleanintegrityEnforced(ObjectInputStream stream) Returns the integrity protection setting of the given stream, determined as follows: if the stream implementsObjectStreamContextand has in its context collection an object of typeIntegrityEnforcement, theintegrityEnforcedmethod of that object is called and the resulting value returned; otherwise,falseis returned.
-
Constructor Details
-
MarshalledWrapper
Creates a newMarshalledWrapperwrapping aMarshalledInstancecontaining the given object.- Parameters:
obj- object to createMarshalledInstancewith- Throws:
IOException- ifMarshalledInstancecreation fails
-
-
Method Details
-
integrityEnforced
Returns the integrity protection setting of the given stream, determined as follows: if the stream implementsObjectStreamContextand has in its context collection an object of typeIntegrityEnforcement, theintegrityEnforcedmethod of that object is called and the resulting value returned; otherwise,falseis returned.- Returns:
- integrity protection setting of the given stream
-
get
Returns the result of calling thegetmethod of the wrappedMarshalledInstance, passing the integrity value sampled during deserialization as theverifyCodebaseIntegrityargument. If thisMarshalledWrapperinstance was not produced by deserialization or was deserialized from a stream with no integrity protection setting, then averifyCodebaseIntegrityvalue offalseis used.- Returns:
- the object unmarshalled by the wrapped
MarshalledInstance - Throws:
IOException- if anIOExceptionoccurs during unmarshallingClassNotFoundException- if any classes necessary for reconstructing the object being unmarshalled cannot be found
-
getIntegrity
public boolean getIntegrity()Returns the integrity value sampled during deserialization of thisMarshalledWrapperinstance, orfalseif this instance was not produced by deserialization or was deserialized from a stream with no integrity protection setting.- Returns:
- sampled integrity value
-
hashCode
public int hashCode()Returns the hash code value for thisMarshalledWrapper. -
equals
Compares the specified object with thisMarshalledWrapperfor equality. This method returnstrueif and only if the specified object is of the same class as this object and its wrappedMarshalledInstanceis equal to the one in this object.
-