de.cau.cs.kieler.maude
Class MaudeInterfacePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by de.cau.cs.kieler.maude.MaudeInterfacePlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class MaudeInterfacePlugin
extends AbstractUIPlugin

This activator class controls the life cycle of the MaudeInterfacePlugin. It also provides the access to the one and only instance of this class and hence a way to access the maude interface thread.

Rating yellow
(2010-08-15)

Field Summary
static String PLUGIN_ID
           
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
MaudeInterfacePlugin()
          The constructor
 
Method Summary
 boolean closeMaudeSession(int maudeSessionId)
          Closes a maude session and removes all links to it.
 int createMaudeSession(String pathToMaudeParam, String pathToMaudeCodeParam)
          Creates a new maude session.
static MaudeInterfacePlugin getDefault()
          Returns the shared instance of the Maude Interface plug-in.
 String queryMaude(String queryRequest, int maudeSessionId)
          Query maude with a string returning a string for a given maude session id.
 String queryMaude(String queryRequest, int wait, int maudeSessionId)
          Query maude with a string returning a string for a given maude session id.
 void start(org.osgi.framework.BundleContext context)
           
 void startMaudeSession(int maudeSessionId)
          Starts a maude session.
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final String PLUGIN_ID
See Also:
Constant Field Values
Constructor Detail

MaudeInterfacePlugin

public MaudeInterfacePlugin()
The constructor

Method Detail

start

public void start(org.osgi.framework.BundleContext context)
           throws Exception
Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class AbstractUIPlugin
Throws:
Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws Exception
Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class AbstractUIPlugin
Throws:
Exception

getDefault

public static MaudeInterfacePlugin getDefault()
Returns the shared instance of the Maude Interface plug-in. This is mainly used by the execution thread to access the view of the KIELER Execution Manager or the other way round.

Returns:
the shared instance

createMaudeSession

public int createMaudeSession(String pathToMaudeParam,
                              String pathToMaudeCodeParam)
Creates a new maude session.

Parameters:
pathToMaudeParam - the path to maude.exe
pathToMaudeCodeParam - the path to the maude code
Returns:
the int

closeMaudeSession

public boolean closeMaudeSession(int maudeSessionId)
Closes a maude session and removes all links to it.

Parameters:
maudeSessionId - the maude session id
Returns:
true, if successful

queryMaude

public String queryMaude(String queryRequest,
                         int wait,
                         int maudeSessionId)
                  throws Exception
Query maude with a string returning a string for a given maude session id.

Parameters:
queryRequest - the query request
wait - the wait in milliseconds
maudeSessionId - the maude session id
Returns:
the string
Throws:
Exception - the exception

queryMaude

public String queryMaude(String queryRequest,
                         int maudeSessionId)
                  throws Exception
Query maude with a string returning a string for a given maude session id.

Parameters:
queryRequest - the query request
maudeSessionId - the maude session id
Returns:
the string
Throws:
Exception - the exception

startMaudeSession

public void startMaudeSession(int maudeSessionId)
                       throws Exception
Starts a maude session.

Parameters:
maudeSessionId - the maude session id
Throws:
Exception - the exception