jas2.plugin
Class Plugin
- java.lang.Object
-
- jas2.plugin.BasicPlugin
-
- jas2.plugin.Plugin
-
- All Implemented Interfaces:
- IPlugin
public abstract class Plugin extends BasicPlugin implements IPlugin
Support for Java Analysis Studio Job Plugins The Plugin class is used to extend the functionality of Java Analysis Studio with experiment, group, or personal extensions. Java Analysis Studio plugins extend the Plugin class in a similar manner that web applets extend Applet. Plugins are a little more flexible than web applets however, since plugins can add new items to the Java Analysis Studio menu, create windows in the main body of the application, and interact with event data.A typical use for a plugin would be to provide an experiment specific event display within the body of the Java Analysis Studio application.
The current plugin functionality is fairly limited, more will be added in later releases. Send suggestions for improved functionality to jas-feedback@sld-mail.slac.stanford.edu
Note: Most of the methods of Plugin require a context, and therefore should not be called before the Plugin is initialized (i.e. its init() method is called).
- See Also:
ExtensionPlugin
-
-
Field Summary
-
Fields inherited from class jas2.plugin.BasicPlugin
out
-
-
Constructor Summary
Constructors Constructor and Description Plugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddRunListener(RunListener listener)A plugin can use this method if it wants to be informed about changes in run state.voiddestroy()Called by the application when the plugin is destroyed typically when the job containing the plugin is closed.hepjas.analysis.EventDatagetCurrentEvent()Fetch the current event, as returned by the current EventSource This method is rather crude, especially in the case of a remote job, since it fetches the entire event over the network (which also implies that the event must be serializable).PluginContextgetPluginContext()Provides access to the PluginContext.voidremoveRunListener(RunListener listener)Remove a run listener previously added using addRunListenervoidsendJob(java.lang.Object message)The plugin can call this method to send a message to the Job.voidsetPluginContext(PluginContext context)Called by the application before the plugins init method is called, to install the PluginContext-
Methods inherited from class jas2.plugin.BasicPlugin
addMenu, error, error, init, installConsole, installControl, installPage, removeMenu, sendMessage
-
-
-
-
Method Detail
-
setPluginContext
public void setPluginContext(PluginContext context)
Called by the application before the plugins init method is called, to install the PluginContext- Specified by:
setPluginContextin interfaceIPlugin
-
getPluginContext
public PluginContext getPluginContext()
Provides access to the PluginContext. It is better to use the many utility methods in Plugin rather than accessing the PluginContext directly.
-
addRunListener
public void addRunListener(RunListener listener)
A plugin can use this method if it wants to be informed about changes in run state. Event Displays typically install a RunListener so that they know when to display a new event- Parameters:
listener- The RunListener to add
-
removeRunListener
public void removeRunListener(RunListener listener)
Remove a run listener previously added using addRunListener- Parameters:
listener- The RunListener to be removed- See Also:
addRunListener(RunListener)
-
getCurrentEvent
public hepjas.analysis.EventData getCurrentEvent() throws NoEventAvailableFetch the current event, as returned by the current EventSource This method is rather crude, especially in the case of a remote job, since it fetches the entire event over the network (which also implies that the event must be serializable). Some better mechanism of interacting with remote events will be provided in future.- Returns:
- The current event, as returned by the current EventSource's getNextEvent method
- Throws:
NoEventAvailable- if there is no current event, or if the current event cannot be fetched (because it is remote and not serializable).
-
sendJob
public void sendJob(java.lang.Object message)
The plugin can call this method to send a message to the Job. This will result in the Job's messageReceived method being called. Note that if the job is a remote job, the message must implement java.io.Serializable or it won't get to the remote server.- Parameters:
message- The message to send- See Also:
jas.server.HistogramServer#addMessageListener(jas.server.MessageListener)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG