tn5250j/src/org/tn5250j/scripting JPythonInterpreterDriver.java,1.18,1.19 ExecuteScriptAction.java,1.4,1.5 InterpreterDriverManager.java,1.2,1.3 InterpreterDriver.java,1.1,1.2

"Kenneth J. Pouncey" <[email protected]> Thu, 22 Jul 2004 05:45:21 +0000
Newsgroups gmane.comp.java.tn5250j.cvs
Message-ID <[email protected]>
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j/scripting
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10197/src/org/tn5250j/scripting

Modified Files:
	JPythonInterpreterDriver.java ExecuteScriptAction.java 
	InterpreterDriverManager.java InterpreterDriver.java 
Log Message:
Updates for headless

Index: InterpreterDriver.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/scripting/InterpreterDriver.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** InterpreterDriver.java	27 Jul 2002 05:58:25 -0000	1.1
--- InterpreterDriver.java	22 Jul 2004 05:45:19 -0000	1.2
***************
*** 1,82 ****
! // InterpreterDriver.java
! package org.tn5250j.scripting;
! 
! import org.tn5250j.Session;
! 
! /**
!  * Driver interface for scripting interpreter.
!  * Each language supported must implement this interface.
!  * The implementation fo this interface will typically delegate
!  * the work to the underlying third-party interpreter.
!  * The implementing class must create an instance of itself and
!  * register it with InterpreterDriverManager when it is loaded.
!  * @author Ramnivas Laddad
!  */
! public interface InterpreterDriver  {
!    /**
!     * Execute a script string.
!     * @param script a string to be interpreted
!     * @exception throw a InterpreterDriver.InterpreterException
!     *            which wraps the exception throw by underlying
!     *            interpreter
!     */
!    public void executeScript(Session session,String script)
!             throws InterpreterDriver.InterpreterException;
! 
!    /**
!     * Execute a script file.
!     * @param script a name of file to be interpreted
!     * @exception throw a InterpreterDriver.InterpreterException
!     *            which wraps the exception throw by underlying
!     *            interpreter
!     */
!    public void executeScriptFile(Session session, String scriptFile)
!             throws InterpreterDriver.InterpreterException;
! 
!    /**
!     * Execute a script file.
!     * @param script a name of file to be interpreted
!     * @exception throw a InterpreterDriver.InterpreterException
!     *            which wraps the exception throw by underlying
!     *            interpreter
!     */
!    public void executeScriptFile(String scriptFile)
!             throws InterpreterDriver.InterpreterException;
! 
!    /**
!     * Get the extension for supported extensions by this driver
!     * @return Array of string containing extension supported
!     */
!    public String[] getSupportedExtensions();
! 
!    /**
!     * Get the langauges for supported extensions by this driver
!     * @return Array of string containing languages supported
!     */
!    public String[] getSupportedLanguages();
! 
!    /**
!    * Nested class for wrapping the exception throw by underlying
!    * interpreter while executing scripts
!    */
!    public static class InterpreterException extends Exception {
!       private Exception _underlyingException;
! 
!    /**
!     * Construct a wrapper exception for given undelying exception.
!     * @param ex the underlying exception thrown by the interpreter
!     */
!    public InterpreterException(Exception ex) {
!        _underlyingException = ex;
!    }
! 
!    /**
!     * Get a string representation for this object
!     * @return string representing the object
!     */
!    public String toString() {
!        return "InterpreterException: underlying exception: "
!       + _underlyingException;
!    }
!     }
! }
--- 1,82 ----
! // InterpreterDriver.java
! package org.tn5250j.scripting;
! 
! import org.tn5250j.SessionGUI;
! 
! /**
!  * Driver interface for scripting interpreter.
!  * Each language supported must implement this interface.
!  * The implementation fo this interface will typically delegate
!  * the work to the underlying third-party interpreter.
!  * The implementing class must create an instance of itself and
!  * register it with InterpreterDriverManager when it is loaded.
!  * @author Ramnivas Laddad
!  */
! public interface InterpreterDriver  {
!    /**
!     * Execute a script string.
!     * @param script a string to be interpreted
!     * @exception throw a InterpreterDriver.InterpreterException
!     *            which wraps the exception throw by underlying
!     *            interpreter
!     */
!    public void executeScript(SessionGUI session,String script)
!             throws InterpreterDriver.InterpreterException;
! 
!    /**
!     * Execute a script file.
!     * @param script a name of file to be interpreted
!     * @exception throw a InterpreterDriver.InterpreterException
!     *            which wraps the exception throw by underlying
!     *            interpreter
!     */
!    public void executeScriptFile(SessionGUI session, String scriptFile)
!             throws InterpreterDriver.InterpreterException;
! 
!    /**
!     * Execute a script file.
!     * @param script a name of file to be interpreted
!     * @exception throw a InterpreterDriver.InterpreterException
!     *            which wraps the exception throw by underlying
!     *            interpreter
!     */
!    public void executeScriptFile(String scriptFile)
!             throws InterpreterDriver.InterpreterException;
! 
!    /**
!     * Get the extension for supported extensions by this driver
!     * @return Array of string containing extension supported
!     */
!    public String[] getSupportedExtensions();
! 
!    /**
!     * Get the langauges for supported extensions by this driver
!     * @return Array of string containing languages supported
!     */
!    public String[] getSupportedLanguages();
! 
!    /**
!    * Nested class for wrapping the exception throw by underlying
!    * interpreter while executing scripts
!    */
!    public static class InterpreterException extends Exception {
!       private Exception _underlyingException;
! 
!    /**
!     * Construct a wrapper exception for given undelying exception.
!     * @param ex the underlying exception thrown by the interpreter
!     */
!    public InterpreterException(Exception ex) {
!        _underlyingException = ex;
!    }
! 
!    /**
!     * Get a string representation for this object
!     * @return string representing the object
!     */
!    public String toString() {
!        return "InterpreterException: underlying exception: "
!       + _underlyingException;
!    }
!     }
! }

Index: ExecuteScriptAction.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/scripting/ExecuteScriptAction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ExecuteScriptAction.java	9 Jul 2003 18:55:40 -0000	1.4
--- ExecuteScriptAction.java	22 Jul 2004 05:45:19 -0000	1.5
***************
*** 13,23 ****
  import javax.swing.AbstractAction;
  import java.awt.event.ActionEvent;
! import org.tn5250j.Session;
  
  public class ExecuteScriptAction extends AbstractAction {
     String _scriptFile;
!    Session ses;
  
!    public ExecuteScriptAction(String name, String scriptFile, Session session) {
        super(name);
        _scriptFile = scriptFile;
--- 13,23 ----
  import javax.swing.AbstractAction;
  import java.awt.event.ActionEvent;
! import org.tn5250j.SessionGUI;
  
  public class ExecuteScriptAction extends AbstractAction {
     String _scriptFile;
!    SessionGUI ses;
  
!    public ExecuteScriptAction(String name, String scriptFile, SessionGUI session) {
        super(name);
        _scriptFile = scriptFile;

Index: JPythonInterpreterDriver.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/scripting/JPythonInterpreterDriver.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** JPythonInterpreterDriver.java	26 Jun 2004 11:03:15 -0000	1.18
--- JPythonInterpreterDriver.java	22 Jul 2004 05:45:19 -0000	1.19
***************
*** 16,20 ****
  import org.python.util.PythonInterpreter;
  import org.python.core.*;
! import org.tn5250j.Session;
  
  import javax.swing.JOptionPane;
--- 16,20 ----
  import org.python.util.PythonInterpreter;
  import org.python.core.*;
! import org.tn5250j.SessionGUI;
  
  import javax.swing.JOptionPane;
***************
*** 58,62 ****
     }
     
!    public void executeScript(Session session, String script)
           throws InterpreterDriver.InterpreterException {
        try {
--- 58,62 ----
     }
     
!    public void executeScript(SessionGUI session, String script)
           throws InterpreterDriver.InterpreterException {
        try {
***************
*** 82,90 ****
     }
  
!    public void executeScriptFile(Session session, String scriptFile)
                    throws InterpreterDriver.InterpreterException {
  
        try {
!          final Session s1 = session;
           final String s2 = scriptFile;
  
--- 82,90 ----
     }
  
!    public void executeScriptFile(SessionGUI session, String scriptFile)
                    throws InterpreterDriver.InterpreterException {
  
        try {
!          final SessionGUI s1 = session;
           final String s2 = scriptFile;
  

Index: InterpreterDriverManager.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/scripting/InterpreterDriverManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** InterpreterDriverManager.java	25 Aug 2002 15:37:03 -0000	1.2
--- InterpreterDriverManager.java	22 Jul 2004 05:45:19 -0000	1.3
***************
*** 4,8 ****
  
  import java.util.*;
! import org.tn5250j.Session;
  /**
   * Class for managing interpreter drivers.
--- 4,8 ----
  
  import java.util.*;
! import org.tn5250j.SessionGUI;
  /**
   * Class for managing interpreter drivers.
***************
*** 48,52 ****
      * @param language language for interpreting the script string
      */
!    public static void executeScript(Session session, String script, String language)
                          throws InterpreterDriver.InterpreterException {
        InterpreterDriver driver
--- 48,52 ----
      * @param language language for interpreting the script string
      */
!    public static void executeScript(SessionGUI session, String script, String language)
                          throws InterpreterDriver.InterpreterException {
        InterpreterDriver driver
***************
*** 67,71 ****
       * @param scriptFile file name containing script
       */
!    public static void executeScriptFile(Session session,String scriptFile)
                       throws InterpreterDriver.InterpreterException {
        String extension
--- 67,71 ----
       * @param scriptFile file name containing script
       */
!    public static void executeScriptFile(SessionGUI session,String scriptFile)
                       throws InterpreterDriver.InterpreterException {
        String extension



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click