Package geomss.app

Class GeomSSBatch

  • All Implemented Interfaces:
    java.lang.Runnable

    public class GeomSSBatch
    extends java.lang.Thread
    This class will run a GeomSS BeanShell script in batch (background or non-interactive) mode.

    Modified by: Joseph A. Huwaldt

    Version:
    February 17, 2025
    Author:
    Joseph A. Huwaldt, Date: September 7, 2010
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  GeomSSBatch.PublicScene
      A class that serves as the public interface (in BeanShell) for this application's 3D scene.
      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static javax.measure.unit.Unit[] LENGTH_UNITS
      The length unit options for this program.
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      GeomSSBatch​(java.util.ResourceBundle resBundle, java.io.File scriptFile)
      Construct a new batch script running thread.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void initializeBeanShell​(java.lang.String appName, bsh.Interpreter bsh, GeomSSApp appInterface)
      Provides the initial setup of the BeanShell environment required by GeomSS.
      static GeometryList readGeometryData​(java.util.ResourceBundle resBundle, java.awt.Component parent, java.io.File theFile)
      Method that reads in a data file and return the resulting data structure.
      void run()
      The run() method just sits and waits for incoming connections and hands each one off to a new ServerJobRunner thread to handle it.
      static void writeGeometryData​(java.util.ResourceBundle resBundle, java.awt.Component parent, GeometryList geometry, java.io.File theFile, GeomReader writer)
      Method that writes out geometry to a data file using a specific GeomReader instance.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • LENGTH_UNITS

        public static final javax.measure.unit.Unit[] LENGTH_UNITS
        The length unit options for this program.
    • Constructor Detail

      • GeomSSBatch

        public GeomSSBatch​(java.util.ResourceBundle resBundle,
                           java.io.File scriptFile)
                    throws bsh.EvalError
        Construct a new batch script running thread.
        Parameters:
        resBundle - The main application's resource bundle. May not be null.
        scriptFile - The existing script file to be run. May not be null.
        Throws:
        bsh.EvalError - if there is a problem setting up BeanShell.
    • Method Detail

      • run

        public void run()
        The run() method just sits and waits for incoming connections and hands each one off to a new ServerJobRunner thread to handle it.
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • initializeBeanShell

        public static void initializeBeanShell​(java.lang.String appName,
                                               bsh.Interpreter bsh,
                                               GeomSSApp appInterface)
                                        throws bsh.EvalError
        Provides the initial setup of the BeanShell environment required by GeomSS.
        Parameters:
        appName - The name of this application. May not be null.
        bsh - A reference to the BeanShell interpreter to be configured.
        appInterface - The interface to GeomSS application methods such as "print".
        Throws:
        bsh.EvalError - BeanShell evaluation error.
      • readGeometryData

        public static GeometryList readGeometryData​(java.util.ResourceBundle resBundle,
                                                    java.awt.Component parent,
                                                    java.io.File theFile)
                                             throws java.io.IOException
        Method that reads in a data file and return the resulting data structure.
        Parameters:
        resBundle - The main application's resource bundle. May not be null.
        parent - The parent frame for dialogs (null is fine).
        theFile - The file to be read in. If null is passed, this method will do nothing.
        Returns:
        The list of geometry read in or null if nothing was read in.
        Throws:
        java.io.IOException - if unable to read in the geometry data.
      • writeGeometryData

        public static void writeGeometryData​(java.util.ResourceBundle resBundle,
                                             java.awt.Component parent,
                                             GeometryList geometry,
                                             java.io.File theFile,
                                             GeomReader writer)
                                      throws java.io.IOException
        Method that writes out geometry to a data file using a specific GeomReader instance.
        Parameters:
        resBundle - The main application's resource bundle. May not be null.
        parent - The parent frame for dialogs (null is fine).
        geometry - The geometry object to be written out. May not be null.
        theFile - The file to be written to. May not be null.
        writer - The GeomReader to use to write out the file. May not be null.
        Throws:
        java.io.IOException - if unable to write the geometry data.