com.sun.sgs.impl.util
Class WrappedSerializable<T>

java.lang.Object
  extended by com.sun.sgs.impl.util.WrappedSerializable<T>
Type Parameters:
T - type of object wrapped
All Implemented Interfaces:
Serializable

public final class WrappedSerializable<T>
extends Object
implements Serializable

A wrapper for an object that is serializable, but may or may not be a ManagedObject. An instance of this serializable wrapper contains a managed reference to the object specified during construction as follows:

When an instance of WrappedSerializable is no longer in use, the remove method should be invoked on the instance so that if a wrapper was created for the object, the wrapper can be removed.

See Also:
Serialized Form

Constructor Summary
WrappedSerializable(T object)
          Constructs an instance of this class with the specified object.
 
Method Summary
 T get()
          Returns the object in this wrapper.
 void remove()
          Marks this instance as removed, and if this instance contains a ManagedObject wrapper to the object specified during construction, then removes the wrapper as well.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrappedSerializable

public WrappedSerializable(T object)
Constructs an instance of this class with the specified object. The specified object must implement Serializable and may or may not be a ManagedObject.

Parameters:
object - an object
Throws:
IllegalArgumentException - if the specified object does not implement Serializable
Method Detail

get

public T get()
Returns the object in this wrapper.

Returns:
T the object in this wrapper
Throws:
IllegalStateException - if remove has been invoked on this instance

remove

public void remove()
Marks this instance as removed, and if this instance contains a ManagedObject wrapper to the object specified during construction, then removes the wrapper as well.

Throws:
IllegalStateException - if remove has been invoked on this instance

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved