Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jini.proxy
Class MarshalledWrapper

    java.lang.Object
      com.sun.jini.proxy.MarshalledWrapper

All Implemented Interfaces:
  Serializable

public class MarshalledWrapper
extends Object
implements 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
See Also:
  Serialized Form

Constructor Summary
`MarshalledWrapper(MarshalledInstance instance)` Creates a new `MarshalledWrapper` wrapping the given `MarshalledInstance`.
`MarshalledWrapper(Object obj)` Creates a new `MarshalledWrapper` wrapping a `MarshalledInstance` containing the given object.

Method Summary
`boolean` | `equals(Object obj)` Compares the specified object with this `MarshalledWrapper` for equality.
`Object` | `get()` Returns the result of calling the `get` method of the wrapped `MarshalledInstance`, passing the integrity value sampled during deserialization as the `verifyCodebaseIntegrity` argument.
`boolean` | `getIntegrity()` Returns the integrity value sampled during deserialization of this `MarshalledWrapper` instance, or `false` if this instance was not produced by deserialization or was deserialized from a stream with no integrity protection setting.
`MarshalledInstance` | `getMarshalledInstance()` Returns the `MarshalledInstance` wrapped by this `MarshalledWrapper`.
`int` | `hashCode()` Returns the hash code value for this `MarshalledWrapper`.
`static boolean` | `integrityEnforced(ObjectInputStream stream)` Returns the integrity protection setting of the given stream, determined as follows: if the stream implements `ObjectStreamContext` and has in its context collection an object of type `IntegrityEnforcement`, the `integrityEnforced` method of that object is called and the resulting value returned; otherwise, `false` is returned.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MarshalledWrapper

    public MarshalledWrapper(Object obj)
                      throws IOException

  Creates a new `MarshalledWrapper` wrapping a `MarshalledInstance` containing the given object.

Parameters:
  `obj` - object to create `MarshalledInstance` with
Throws:
  `IOException` - if `MarshalledInstance` creation fails

### MarshalledWrapper

    public MarshalledWrapper(MarshalledInstance instance)

  Creates a new `MarshalledWrapper` wrapping the given `MarshalledInstance`.

Parameters:
  `instance` - `MarshalledInstance` to wrap
Throws:
  `NullPointerException` - if `instance` is `null`

Method Detail

### integrityEnforced

    public static boolean integrityEnforced(ObjectInputStream stream)

  Returns the integrity protection setting of the given stream, determined as follows: if the stream implements `ObjectStreamContext` and has in its context collection an object of type `IntegrityEnforcement`, the `integrityEnforced` method of that object is called and the resulting value returned; otherwise, `false` is returned.

  Returns:
    integrity protection setting of the given stream

### get

    public Object get()
               throws IOException,
                      ClassNotFoundException

  Returns the result of calling the `get` method of the wrapped `MarshalledInstance`, passing the integrity value sampled during deserialization as the `verifyCodebaseIntegrity` argument. If this `MarshalledWrapper` instance was not produced by deserialization or was deserialized from a stream with no integrity protection setting, then a `verifyCodebaseIntegrity` value of `false` is used.

  Returns:
    the object unmarshalled by the wrapped `MarshalledInstance`
  Throws:
    `IOException` - if an `IOException` occurs during unmarshalling
    `ClassNotFoundException` - if any classes necessary for reconstructing the object being unmarshalled cannot be found

### getMarshalledInstance

    public MarshalledInstance getMarshalledInstance()

  Returns the `MarshalledInstance` wrapped by this `MarshalledWrapper`.

  Returns:
    wrapped `MarshalledInstance`

### getIntegrity

    public boolean getIntegrity()

  Returns the integrity value sampled during deserialization of this `MarshalledWrapper` instance, or `false` if 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 this `MarshalledWrapper`.

  Returns:
    the hash code value for this `MarshalledWrapper`.

### equals

    public boolean equals(Object obj)

  Compares the specified object with this `MarshalledWrapper` for equality. This method returns `true` if and only if the specified object is of the same class as this object and its wrapped `MarshalledInstance` is equal to the one in this object.

  Parameters:
    `obj` - object to compare with
  Returns:
    `true` if `obj` is equivalent to this object; `false` otherwise

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Sun Microsystems, Inc. All rights reserved