public class StorableObject extends Object implements Serializable
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.Modifier and Type | Field and Description |
---|---|
private MarshalledObject |
bytes |
private static boolean |
DEBUG |
private Object |
obj |
private static long |
serialVersionUID |
Constructor and Description |
---|
StorableObject(Object obj)
Create a
StorableObject that will hold obj
in a MarshalledObject . |
Modifier and Type | Method and Description |
---|---|
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 . |
private MarshalledObject bytes
private transient Object obj
private static final boolean DEBUG
private static final long serialVersionUID
public StorableObject(Object obj) throws RemoteException
StorableObject
that will hold obj
in a MarshalledObject
.RemoteException
public int hashCode()
hashCode
of the MarshalledObject
.public Object get() throws RemoteException
RemoteException
- Problems re-establishing connection with remote objectprivate static void fatalError(String msg, Throwable e) throws RemoteException
RemoteException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.