class StorableReference extends Object implements Externalizable
MarshalledObject
so this object can be unmarshalled
even if the proxy can't be (say because it codebase is
unavailable). The get(net.jini.security.ProxyPreparer)
method can
be used to retrieve the proxy on demand.Modifier and Type | Field and Description |
---|---|
private MarshalledObject |
bytes
The proxy in marshalled form
|
private static boolean |
DEBUG |
private Object |
obj
A cached copy of the unmarshalled proxy
|
private boolean |
prepared
True if the
obj has been prepared |
private static long |
serialVersionUID |
Constructor and Description |
---|
StorableReference()
Used by the object output stream.
|
StorableReference(Object obj)
Create a
StorableReference that will hold
obj . |
Modifier and Type | Method and Description |
---|---|
Object |
get(ProxyPreparer preparer)
Return the proxy.
|
void |
readExternal(ObjectInput in) |
void |
writeExternal(ObjectOutput out) |
private MarshalledObject bytes
private transient Object obj
private transient boolean prepared
obj
has been preparedprivate static final boolean DEBUG
private static final long serialVersionUID
public StorableReference(Object obj)
StorableReference
that will hold
obj
.public StorableReference()
public Object get(ProxyPreparer preparer) throws IOException, ClassNotFoundException
preparer
is non-null
and no previous call to get has succeeded. If this method
throws an exception, preparation has not succeeded. If a
previous call to this method has succeed, all future
calls will succeed and return the same object as the
first successful call.preparer
- the ProxyPreparer
to
be used to prepare the reference. May
be null
.IOException
- if the unmarshalling fails. Will
also throw RemoteException
if preparer.prepareProxy
does.ClassNotFoundException
- if unmarshalling fails
with one.SecurityException
- if preparer
does.public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.