com.sun.jini.mahalo
Class StorableObject

java.lang.Object
  extended by com.sun.jini.mahalo.StorableObject
All Implemented Interfaces:
Serializable

public class StorableObject
extends Object
implements Serializable

This class holds a MarshalledObject that can be stored persistently. When you invoke get, the object is deserialized, its value cached in this object, and then returned. Subsequent calls to get return that value. This lets you store the object and hold it around, waiting until it is actually deserializable, since it may not be at any given time due to various factors, such as the codebase being unavailable.

Author:
Sun Microsystems, Inc.
See Also:
Serialized Form

Field Summary
private  MarshalledObject bytes
           
private static boolean DEBUG
           
private  Object obj
           
private static long serialVersionUID
           
 
Constructor Summary
StorableObject(Object obj)
          Create a StorableObject that will hold obj in a MarshalledObject.
 
Method Summary
 boolean equals(Object that)
           
private static void fatalError(String msg, Throwable e)
          Unrecoverable error happened -- show it and give up the ghost.
 Object get()
          Return the Remote reference.
 int hashCode()
          Return the hashCode of the MarshalledObject.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bytes

private MarshalledObject bytes

obj

private transient Object obj

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

StorableObject

public StorableObject(Object obj)
               throws RemoteException
Create a StorableObject that will hold obj in a MarshalledObject.

Throws:
RemoteException
Method Detail

hashCode

public int hashCode()
Return the hashCode of the MarshalledObject.

Overrides:
hashCode in class Object

equals

public boolean equals(Object that)
Overrides:
equals in class Object

get

public Object get()
           throws RemoteException
Return the Remote reference. Deserialize the object if we don't already have an actual reference in hand.

Throws:
RemoteException - Problems re-establishing connection with remote object

fatalError

private static void fatalError(String msg,
                               Throwable e)
                        throws RemoteException
Unrecoverable error happened -- show it and give up the ghost.

Throws:
RemoteException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.