|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisad.ActionImpl
public abstract class ActionImpl
ActionImpl is the abstract superclass for runnable threads that need to be notified when ThingReference objects change. For example, this may be used for a Data display or for a spreadsheet cell.
ActionImpl is not Serializable and should not be copied between JVMs.
Constructor Summary | |
---|---|
ActionImpl(java.lang.String name)
|
Method Summary | |
---|---|
void |
addReference(ThingReference ref)
Creates a link to a ThingReference. |
boolean |
checkTicks()
|
void |
disableAction()
disable this Action and if necessary wait for end of doAction |
abstract void |
doAction()
|
void |
enableAction()
enable and notify this Action |
ReferenceActionLink |
findReference(ThingReference ref)
Returns the link associated with a ThingReference. |
java.lang.Thread |
getCurrentActionThread()
|
java.util.Vector |
getLinks()
return vector of ReferenceActionLink-s |
java.lang.String |
getName()
return name of this Action |
void |
removeAllReferences()
remove all ThingReferences |
void |
removeReference(ThingReference ref)
Removes a link to a ThingReference. |
void |
run()
code executed by a thread to manage updates to the corresponding Thing |
boolean |
setEnabled(boolean enable)
Set the "enabled" state of this action. |
void |
setName(java.lang.String name)
change name of this Action |
static void |
setThreadPoolMaximum(int num)
increase the maximum number of threads allowed for the thread pool |
void |
stop()
|
static void |
stopThreadPool()
destroy all threads after they've drained the job queue |
boolean |
thingChanged(ThingChangedEvent e)
|
void |
waitForTasks()
wait for currently-running actions to finish |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionImpl(java.lang.String name)
Method Detail |
---|
public static void stopThreadPool()
public static void setThreadPoolMaximum(int num) throws java.lang.Exception
java.lang.Exception
public void stop()
public boolean checkTicks()
public void enableAction()
public void disableAction()
public boolean setEnabled(boolean enable)
ActionImpl action = ...; boolean wasEnabled = action.setEnabled(false); ... action.setEnabled(wasEnabled);
enable
- The new "enabled" state for this action.
public java.lang.Thread getCurrentActionThread()
public void run()
run
in interface java.lang.Runnable
public abstract void doAction() throws VisADException, java.rmi.RemoteException
VisADException
java.rmi.RemoteException
public boolean thingChanged(ThingChangedEvent e) throws VisADException, java.rmi.RemoteException
thingChanged
in interface ThingChangedListener
VisADException
java.rmi.RemoteException
public void waitForTasks()
public void addReference(ThingReference ref) throws ReferenceException, RemoteVisADException, VisADException, java.rmi.RemoteException
addReference
in interface Action
ref
- The ThingReference to which to create
the link. Subsequent invocation of
thingChanged(ThingChangedEvent)
causes invocation of
ref.acknowledgeThingChanged(this)
. This method invokes
ref.addThingChangedListener(this, ...)
.
RemoteVisADException
- if the reference isn't a ThingReferenceImpl
.
ReferenceException
- if the reference has already been added.
VisADException
- if a VisAD failure occurs.
java.rmi.RemoteException
- if a Java RMI failure occurs.thingChanged(ThingChangedEvent)
,
ThingReference.addThingChangedListener(ThingChangedListener, long)
public void removeReference(ThingReference ref) throws VisADException, java.rmi.RemoteException
Removes a link to a ThingReference.
This implementation invokes findReference(ThingReference)
.
removeReference
in interface Action
ref
- The reference to be removed.
RemoteVisADException
- if the reference isn't a ThingReferenceImpl
.
ReferenceException
- if the reference isn't a part of this
instance.
VisADException
- if a VisAD failure occurs.
java.rmi.RemoteException
- if a Java RMI failure occurs.public void removeAllReferences() throws VisADException, java.rmi.RemoteException
removeAllReferences
in interface Action
VisADException
java.rmi.RemoteException
public ReferenceActionLink findReference(ThingReference ref) throws VisADException
ref
- The reference to find.
ReferenceException
- if the argument is null
.
VisADException
- if the argument is null
.public java.util.Vector getLinks()
public java.lang.String getName()
getName
in interface Action
public void setName(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |