visad
Class ThingReferenceImpl

java.lang.Object
  extended by visad.ThingReferenceImpl
All Implemented Interfaces:
ThingReference
Direct Known Subclasses:
DataReferenceImpl

public class ThingReferenceImpl
extends Object
implements ThingReference

ThingReferenceImpl is a local implementation of ThingReference.

ThingReferenceImpl is not Serializable and should not be copied between JVMs.


Constructor Summary
ThingReferenceImpl(String name)
          Constructs from a name for the instance.
 
Method Summary
 ThingChangedEvent acknowledgeThingChanged(Action a)
           
 ThingChangedEvent adaptedAcknowledgeThingChanged(RemoteAction a)
           
 ThingChangedEvent adaptedPeekThingChanged(RemoteAction a)
           
 void addThingChangedListener(ThingChangedListener listener, long id)
          Adds a listener for changes in the underlying Thing.
 boolean equals(Object obj)
           
 visad.ThingChangedLink findThingChangedLink(Action a)
          find ThingChangedLink with action
 String getName()
           
 Thing getThing()
           
 long getTick()
           
 long incTick()
          synchronized because incTick, setThing, and adaptedSetThing share access to thing and ref
 ThingChangedEvent peekThingChanged(Action a)
           
 void removeThingChangedListener(ThingChangedListener a)
          ThingChangedListener must be local ActionImpl
 void setThing(Thing t)
          Sets the underlying thing to reference.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThingReferenceImpl

public ThingReferenceImpl(String name)
                   throws VisADException
Constructs from a name for the instance.

Parameters:
name - The name for this instance.
Throws:
VisADException - if the name is null.
Method Detail

getThing

public Thing getThing()
Specified by:
getThing in interface ThingReference

setThing

public void setThing(Thing t)
              throws VisADException,
                     RemoteException
Sets the underlying thing to reference.

Specified by:
setThing in interface ThingReference
Parameters:
t - The thing to reference.
Throws:
RemoteVisADException - if the thing is a RemoteThing.
VisADException - if a VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

getTick

public long getTick()
Specified by:
getTick in interface ThingReference

incTick

public long incTick()
             throws VisADException,
                    RemoteException
synchronized because incTick, setThing, and adaptedSetThing share access to thing and ref

Specified by:
incTick in interface ThingReference
Throws:
VisADException
RemoteException

peekThingChanged

public ThingChangedEvent peekThingChanged(Action a)
                                   throws VisADException
Specified by:
peekThingChanged in interface ThingReference
Throws:
VisADException

acknowledgeThingChanged

public ThingChangedEvent acknowledgeThingChanged(Action a)
                                          throws VisADException
Specified by:
acknowledgeThingChanged in interface ThingReference
Throws:
VisADException

adaptedPeekThingChanged

public ThingChangedEvent adaptedPeekThingChanged(RemoteAction a)
                                          throws VisADException
Throws:
VisADException

adaptedAcknowledgeThingChanged

public ThingChangedEvent adaptedAcknowledgeThingChanged(RemoteAction a)
                                                 throws VisADException
Throws:
VisADException

findThingChangedLink

public visad.ThingChangedLink findThingChangedLink(Action a)
                                            throws VisADException
find ThingChangedLink with action

Throws:
VisADException

getName

public String getName()
Specified by:
getName in interface ThingReference

addThingChangedListener

public void addThingChangedListener(ThingChangedListener listener,
                                    long id)
                             throws RemoteVisADException,
                                    ReferenceException,
                                    VisADException
Adds a listener for changes in the underlying Thing. If the thing changes, then the listener is notified.

Specified by:
addThingChangedListener in interface ThingReference
Parameters:
listener - The listener.
id - The id of the corresponding ReferenceActionLink.
Throws:
RemoteVisADException - if the listener isn't an ActionImpl.
ReferenceException - if the listener is already registered.
VisADException - if a VisAD failure occurs in a subsystem.

removeThingChangedListener

public void removeThingChangedListener(ThingChangedListener a)
                                throws VisADException
ThingChangedListener must be local ActionImpl

Specified by:
removeThingChangedListener in interface ThingReference
Throws:
VisADException

equals

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

toString

public String toString()
Overrides:
toString in class Object