visad
Class ThingReferenceImpl

java.lang.Object
  extended byvisad.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.


Field Summary
(package private)  Vector ListenerVector
          Vector of ThingChangedLinks; ThingReferenceImpl is not Serializable, but mark as transient anyway
(package private)  String Name
          name of scalar type
 
Constructor Summary
ThingReferenceImpl(String name)
          Constructs from a name for the instance.
 
Method Summary
 ThingChangedEvent acknowledgeThingChanged(Action a)
           
 ThingChangedEvent adaptedAcknowledgeThingChanged(RemoteAction a)
           
(package private)  void adaptedAddThingChangedListener(RemoteAction a, long id)
          method for use by RemoteThingReferenceImpl that adapts this ThingReferenceImpl
 ThingChangedEvent adaptedPeekThingChanged(RemoteAction a)
           
(package private)  void adaptedRemoveThingChangedListener(RemoteAction a)
          method for use by RemoteThingReferenceImpl that adapts this ThingReferenceImpl
(package private)  void adaptedSetThing(RemoteThing t, RemoteThingReference r)
          method for use by RemoteThingReferenceImpl that adapts this ThingReferenceImpl
 void addThingChangedListener(ThingChangedListener listener, long id)
          Adds a listener for changes in the underlying Thing.
 boolean equals(Object obj)
           
 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
 

Field Detail

Name

String Name
name of scalar type


ListenerVector

transient Vector ListenerVector
Vector of ThingChangedLinks; ThingReferenceImpl is not Serializable, but mark as transient anyway

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.

adaptedSetThing

void adaptedSetThing(RemoteThing t,
                     RemoteThingReference r)
               throws VisADException,
                      RemoteException
method for use by RemoteThingReferenceImpl that adapts this ThingReferenceImpl

Throws:
VisADException
RemoteException

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 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.

adaptedAddThingChangedListener

void adaptedAddThingChangedListener(RemoteAction a,
                                    long id)
                              throws VisADException
method for use by RemoteThingReferenceImpl that adapts this ThingReferenceImpl

Throws:
VisADException

removeThingChangedListener

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

Specified by:
removeThingChangedListener in interface ThingReference
Throws:
VisADException

adaptedRemoveThingChangedListener

void adaptedRemoveThingChangedListener(RemoteAction a)
                                 throws VisADException
method for use by RemoteThingReferenceImpl that adapts this ThingReferenceImpl

Throws:
VisADException

equals

public boolean equals(Object obj)

toString

public String toString()