summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/ACE.java164
-rw-r--r--java/src/AcceptStrategy.java89
-rw-r--r--java/src/Acceptor.java213
-rw-r--r--java/src/ActivateStrategy.java43
-rw-r--r--java/src/AddServiceObjectNode.java59
-rw-r--r--java/src/Blob.java94
-rw-r--r--java/src/BlobHandler.java35
-rw-r--r--java/src/BlobReader.java104
-rw-r--r--java/src/BlobWriter.java193
-rw-r--r--java/src/ClassNameGenerator.java182
-rw-r--r--java/src/ClassReader.java147
-rw-r--r--java/src/Condition.java124
-rw-r--r--java/src/Connector.java149
-rw-r--r--java/src/CreationStrategy.java61
-rw-r--r--java/src/EventHandler.java52
-rw-r--r--java/src/GetOpt.java150
-rw-r--r--java/src/INETAddr.java99
-rw-r--r--java/src/IOCntlCmds.java34
-rw-r--r--java/src/IOCntlMsg.java128
-rw-r--r--java/src/JACE.DSP248
-rw-r--r--java/src/JACE.DSW29
-rw-r--r--java/src/Makefile156
-rw-r--r--java/src/MessageBlock.java453
-rw-r--r--java/src/MessageQueue.java626
-rw-r--r--java/src/MessageType.java110
-rw-r--r--java/src/Module.java253
-rw-r--r--java/src/Mutex.java92
-rw-r--r--java/src/OS.java72
-rw-r--r--java/src/ParseNode.java74
-rw-r--r--java/src/ProfileTimer.java48
-rw-r--r--java/src/RWMutex.java174
-rw-r--r--java/src/Readme17
-rw-r--r--java/src/RemoveNode.java38
-rw-r--r--java/src/ResumeNode.java37
-rw-r--r--java/src/SOCKAcceptor.java114
-rw-r--r--java/src/SOCKConnector.java75
-rw-r--r--java/src/SOCKStream.java209
-rw-r--r--java/src/Semaphore.java103
-rw-r--r--java/src/ServiceConfig.java421
-rw-r--r--java/src/ServiceLoader.java242
-rw-r--r--java/src/ServiceObject.java80
-rw-r--r--java/src/ServiceObjectRecord.java36
-rw-r--r--java/src/ServiceRecord.java257
-rw-r--r--java/src/ServiceRepository.java190
-rw-r--r--java/src/StrategyAcceptor.java148
-rw-r--r--java/src/Stream.java438
-rw-r--r--java/src/StreamHead.java120
-rw-r--r--java/src/StreamTail.java111
-rw-r--r--java/src/SuspendNode.java37
-rw-r--r--java/src/SvcHandler.java85
-rw-r--r--java/src/Svc_Conf.y210
-rw-r--r--java/src/Task.java415
-rw-r--r--java/src/TaskFlags.java44
-rw-r--r--java/src/ThreadManager.java109
-rw-r--r--java/src/ThruTask.java48
-rw-r--r--java/src/TimeValue.java256
-rw-r--r--java/src/TimedWait.java134
-rw-r--r--java/src/TimeoutException.java34
-rw-r--r--java/src/TimerQueue.java421
-rw-r--r--java/src/Token.java298
-rw-r--r--java/src/Yylex.java1316
-rw-r--r--java/src/Yylex.lex79
-rw-r--r--java/src/parser.java623
-rw-r--r--java/src/sym.java36
64 files changed, 0 insertions, 11236 deletions
diff --git a/java/src/ACE.java b/java/src/ACE.java
deleted file mode 100644
index 8fa6e1823fa..00000000000
--- a/java/src/ACE.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.OS
- *
- * = FILENAME
- * JACE.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.OS;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- * <blockquote>Constants, utility "functions", etc.</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * Defines default constants for ACE. Many of these are used for the
- * ACE tests and applications. You may want to change some of these to
- * correspond to your environment. Also, routines for error handling,
- * debugging and bit manipulation are included.
- *</blockquote>
- *
- * <h2>NOTES</h2>
- *<blockquote>
- * This class is non-instantiable, and intended only to provide a constrained
- * namespace.
- *</blockquote>
- */
-public abstract class ACE
-{
- /**
- * Default port on which a server listens for connections.
- */
- public static final int DEFAULT_SERVER_PORT = 10002;
-
- /**
- * Default name to use for a thread group.
- */
- public static final String DEFAULT_THREAD_GROUP_NAME = "ace_thread_group";
-
- /**
- * Disable debugging. Once debugging is disabled, all ACE.DEBUG
- * statements would be ignored.
- */
- public static final void disableDebugging ()
- {
- ACE.debug_ = false;
- }
-
- /**
- * Enable debugging. Once debugging is enabled, all ACE.DEBUG
- * statements get printed.
- */
- public static final void enableDebugging ()
- {
- ACE.debug_ = true;
- }
-
- /**
- * Print the string representation of Java Exception.
- *@param e Java exception
- */
- public static final void ERROR (Exception e)
- {
- System.err.println (e);
- }
-
- /**
- * Print the string being passed in.
- *@param s a Java String
- */
- public static final void ERROR (String s)
- {
- System.err.println (s);
- }
-
- /**
- * Print the string being passed in.
- *@param s A Java String
- *@return Error value passed in
- */
- public static final int ERROR_RETURN (String s, int errorVal)
- {
- System.err.println (s);
- return errorVal;
- }
-
- /**
- * Print the string being passed in. Note the behavior will vary
- * depending upon whether debugging is enabled or disabled.
- *@param s a Java String
- */
- public static final void DEBUG (String s)
- {
- if (ACE.debug_)
- System.out.println (s);
- }
-
- /**
- * Flush out any data that may be buffered.
- */
- public static final void FLUSH ()
- {
- System.out.flush ();
- }
-
- /**
- * Set the bits of WORD using BITS as the mask.
- *@param WORD the bits to be set.
- *@param BITS the mask to use.
- *@return The value obtained after setting the bits.
- */
- public static final long SET_BITS (long WORD, long BITS)
- {
- return WORD | BITS;
- }
-
- /**
- * Clear the bits of WORD using BITS as the mask.
- *@param WORD the bits to clear.
- *@param BITS the mask to use.
- *@return The value obtained after clearing the bits.
- */
- public static final long CLR_BITS (long WORD, long BITS)
- {
- return WORD & ~BITS;
- }
-
- /**
- * Check if bits are enabled in WORD.
- *@param WORD the bits to check.
- *@param BIT the bit to check to see if it is enabled or not.
- *@return true if bit is enabled, false otherwise.
- */
- public static final boolean BIT_ENABLED (long WORD, long BIT)
- {
- return (WORD & BIT) != 0;
- }
-
- /**
- * Check if bits are disabled in WORD.
- *@param WORD the bits to check.
- *@param BIT the bit to check to see if it is disabled or not.
- *@return true if bit is disabled, false otherwise.
- */
- public static final boolean BIT_DISABLED (long WORD, long BIT)
- {
- return (WORD & BIT) == 0;
- }
-
- // Debug flag (turn debugging on/off)
- private static boolean debug_ = true;
-
- // Default private constructor to avoid instantiation
- private ACE ()
- {
- }
-}
-
-
diff --git a/java/src/AcceptStrategy.java b/java/src/AcceptStrategy.java
deleted file mode 100644
index 7b48510840e..00000000000
--- a/java/src/AcceptStrategy.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * AcceptStrategy.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.SOCK_SAP.*;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Interface for specifying a passive connection
- * acceptance strategy for a
- * <a href="ACE.Connection.SvcHandler.html"><tt>SvcHandler</tt></a>
- * .
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *
- *<blockquote>
- * This class provides a strategy that manages passive
- * connection setup for an application, and can be extended
- * to define new strategies.
- *</blockquote>
- *
- * @see SvcHandler
- * @see Acceptor
- */
-
-public class AcceptStrategy
-{
- /**
- * Create an instance of Accept Strategy.
- *@param port port number where the server will listen for connections
- *@exception IOException couldn't open port
- */
- AcceptStrategy (int port) throws IOException
- {
- this.open (port);
- }
-
- /**
- * Initialize AcceptStrategy.
- *@param port port number where the server will listen for connections
- *@exception IOException couldn't open port
- */
- public void open (int port) throws IOException
- {
- // Create a new SOCK_Acceptor to accept client connections
- this.sockAcceptor_ = new SOCKAcceptor (port);
- }
-
- /**
- * Accept connections into the SvcHandler. Note that subclasses
- * should overwrite this method to provide a different accept
- * strategy.
- *@param sh Svc Handler in which to accept the connection
- *@exception SocketException
- *@exception IOException
- *@return 0
- */
- public int acceptSvcHandler (SvcHandler sh) throws
- SocketException, IOException
- {
- // Create a new stream
- SOCKStream sockStream = new SOCKStream ();
-
- // Block in accept. Returns when a connection shows up
- this.sockAcceptor_.accept (sockStream);
-
- // Set the streams for the new handler
- sh.setHandle (sockStream);
- return 0;
- }
-
- // Our connection acceptance factory
- private SOCKAcceptor sockAcceptor_;
-
-}
diff --git a/java/src/Acceptor.java b/java/src/Acceptor.java
deleted file mode 100644
index 1db6e01f7b5..00000000000
--- a/java/src/Acceptor.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * Acceptor.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.OS.*;
-import JACE.SOCK_SAP.*;
-import JACE.ServiceConfigurator.*;
-
-/**
- * <hr>
- * <p><h2>SYNOPSIS</h2>
- *
- * <blockquote>Abstract factory for creating a service handler
- * (<a href="ACE.Connection.SvcHandler.html"><tt>SvcHandler</tt></a>),
- * accepting into the
- * <a href="ACE.Connection.SvcHandler.html"><tt>SvcHandler</tt></a>, and activating the
- * <a href="ACE.Connection.SvcHandler.html"><tt>SvcHandler</tt></a>.</blockquote>
- *
- * <p><h2>DESCRIPTION</h2>
- *
- * <blockquote>Implements the basic strategy for passively establishing
- * connections with applications. The <tt>Acceptor</tt>
- * is a factory for <tt>SvcHandler</tt> instances, and, by default
- * generates a new <tt>SvcHandler</tt> instance for each connection
- * esablished.</blockquote>
- *
- * <p>
- *
- * <blockquote> The user of this class <em>must</em> provide a
- * reference to a handler factory prior to calling <a
- * href="#accept()"><tt>accept</tt></a>, or an exception will be
- * thrown. The handler factory is identified by the meta-class for
- * the <tt>SvcHandler</tt>, and is typically obtained by calling <a
- * href="java.lang.Class#classForName(java.lang.String)"><tt>Class.classForName("SvcHandler")</tt></a>.
- * </blockquote>
- *
- * <p>
- *
- * <blockquote> TCP is the transport mechanism used, via
- * <a href="ACE.SOCK_SAP.SOCKAcceptor.html#_top_"><tt>SOCKAcceptor</tt></a>,
- * <em>et.al.</em> The SvcHandler is instantiated with a concrete type
- * that performs the application-specific service. </blockquote>
- *
- * <h2>NOTES</h2>
- *
- * <blockquote> This class is not directly related to the
- * <tt>AcceptorStrategy</tt> class.</blockquote>
- *
- *
- * @see java.lang.Class,ACE.Connection.SvcHandler,ACE.SOCK_SAP.SOCKAcceptor */
-public class Acceptor extends ServiceObject
-{
- /**
- * Create an instance of Acceptor. Default constructor. Note that if
- * an instance is created via this method, <tt>setHandlerFactory</tt>
- * must be called prior to using <tt>accept</tt>.
- *
- * @see ACE.Connection.Acceptor.setHandlerFactory
- */
- public Acceptor ()
- {
- }
-
- /**
- * Create an instance of Acceptor.
- *@param handlerFactory meta-class reference used to create
- * an instance of a SvcHandler when a connection is accepted
- * (typically obtained by calling <tt>Class.classForName</tt>).
- *
- *@see java.lang.Class.classForName
- */
- public Acceptor (Class handlerFactory)
- {
- this.handlerFactory_ = handlerFactory;
- }
-
- /**
- * Set the handler factory. This is provided to aid the default
- * no-arg constructor.
- *@param handlerFactory meta-class reference used to create
- * an instance of a SvcHandler when a connection is accepted
- * (typically obtained by calling <tt>Class.classForName</tt>).
- *
- *@see java.lang.Class.classForName
- */
- public void setHandlerFactory (Class handlerFactory)
- {
- this.handlerFactory_ = handlerFactory;
- }
-
- /**
- * Initialize the Acceptor.
- *@param port TCP port number where the Acceptor will listen for connections
- *@exception IOException socket level exception
- */
- public void open (int port) throws IOException
- {
- this.sockAcceptor_ = new SOCKAcceptor (port);
- }
-
- /**
- * Template method for accepting connections. Delegates operational
- * activities to the following bridge methods:
- * <ul>
- * <li><tt>makeSvcHandler</tt></li>
- * <li><tt>acceptSvcHandler</tt></li>
- * <li><tt>activateSvcHandler</tt></li>
- * </ul>
- *
- * <p>
- *
- * The method first obtains a <tt>SvcHandler</tt> via
- * <tt>makeSvcHandler</tt>, accepts the connection <q>into</q> the
- * handler using <tt>acceptSvcHandler</tt>, and finally turns over
- * control to the handler with <tt>activateSvcHandler</tt>.
- *
- *@exception SocketException socket level error
- *@exception InstantiationException <tt>makeSvcHandler</tt> failure
- *@exception IllegalAccessException <tt>makeSvcHandler</tt> failure
- *@exception IOException socket level error
- */
- public void accept () throws SocketException,
- InstantiationException,
- IllegalAccessException,
- IOException
- {
-
- // Create a Svc_Handler using the appropriate Creation_Strategy
- SvcHandler sh = this.makeSvcHandler ();
-
- // Accept a connection into the SvcHandler using the appropriate
- // Accept_Strategy
- this.acceptSvcHandler (sh);
-
- // Activate the SvcHandler using the appropriate ActivationStrategy
- this.activateSvcHandler (sh);
- }
-
- /**
- * Bridge method for creating a <tt>SvcHandler</tt>. The default is to
- * create a new <SvcHandler>. However, subclasses can override this
- * policy to perform <SvcHandler> creation in any way that they like
- * (such as creating subclass instances of <SvcHandler>, using a
- * singleton, etc.)
- *@return a new instance of the SvcHandler
- *@exception InstantiationException could not create new SvcHandler
- *@exception IllegalAccessException no SvcHandler factory provided
- */
- protected SvcHandler makeSvcHandler ()
- throws InstantiationException, IllegalAccessException
- {
- // Create a new handler for the connection
- return (SvcHandler) handlerFactory_.newInstance ();
- }
-
- /**
- * Bridge method for accepting the new connection into the
- * <tt>SvcHandler</tt>. The default behavior delegates the work to
- * <tt>SOCKAcceptor.accept</tt>. However, subclasses can override this
- * strategy.
- *@param sh SvcHandler in which to accept the connection
- *@return 0
- *@exception SocketException socket level error
- *@exception IOException socket level error
- */
- protected int acceptSvcHandler (SvcHandler sh)
- throws SocketException, IOException
- {
- // Create a new stream
- SOCKStream sockStream = new SOCKStream ();
-
- // Block in accept. Returns when a connection shows up
- this.sockAcceptor_.accept (sockStream);
-
- // Set the streams for the new handler
- sh.setHandle (sockStream);
- return 0;
- }
-
- /**
- * Bridge method for activating a <tt>SvcHandler</tt>. The default
- * behavior of this method is to activate the <tt>SvcHandler</tt> by
- * calling its open() method (which allows the <tt>SvcHandler</tt> to
- * define its own concurrency strategy). However, subclasses can
- * override this strategy to do more sophisticated concurrency
- * activations.
- *@param sh SvcHandler to activate
- *@return 0
- */
- protected int activateSvcHandler (SvcHandler sh)
- {
- sh.open (null);
- return 0;
- }
-
- // Handler class that should be instantiated when a connection is
- // made with a client
- private Class handlerFactory_;
-
- // Our connection acceptance factory
- protected SOCKAcceptor sockAcceptor_;
-}
diff --git a/java/src/ActivateStrategy.java b/java/src/ActivateStrategy.java
deleted file mode 100644
index 882203ad552..00000000000
--- a/java/src/ActivateStrategy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * ActivateStrategy.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-
-/**
- * <hr>
- *<h2>SYNOPSIS</h2>
- * Bridge supporting activation strategy used by
- * <a href="ACE.Connection.StrategyAcceptor.html#_top_"><tt>StrategyAcceptor</tt></a>
- *
- *<h2>DESCRIPTION</h2>
- * Subclass and overload
- * <a href="#activateSvcHandler(ACE.Connection.SvcHandler)"><tt>activateSvcHandler</tt></a>
- * in order change the activation strategy. Then, submit this subclass to
- * <a href="ACE.Connection.StrategyAcceptor.html#_top_"><tt>StrategyAcceptor</tt></a>
- * as the activation strategy.
- *
- *@see StrategyAcceptor
- */
-public class ActivateStrategy
-{
- /**
- * Activate the Svc Handler. Note that subclasses should overwrite
- * this method to provide a different Activate strategy.
- *@param sh Svc Handler to activate
- *@return zero if success, non-zero for failure
- */
- public int activateSvcHandler (SvcHandler sh)
- {
- sh.open (null);
- return 0;
- }
-}
diff --git a/java/src/AddServiceObjectNode.java b/java/src/AddServiceObjectNode.java
deleted file mode 100644
index 86d1d2e66fd..00000000000
--- a/java/src/AddServiceObjectNode.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import JACE.ServiceConfigurator.*;
-import JACE.OS.*;
-import java_cup.runtime.*;
-
-class AddServiceObjectNode extends ParseNode
-{
-
- public AddServiceObjectNode (int act_num)
- {
- super(act_num);
-
- this.locator_ = new String();
- this.params_ = new String();
- }
-
- /* String with possible locator information -- used when trying to load
- old C++ format files */
- public String locator ()
- {
- return this.locator_;
- }
-
- public String params ()
- {
- return this.params_;
- }
-
- public void params (String params)
- {
- this.params_ = params;
- }
-
- public boolean suspended ()
- {
- return this.suspended_;
- }
-
- public void init(String name, String locator, boolean suspended)
- {
- super.name_ = name;
- this.locator_ = locator;
- this.suspended_ = suspended;
- }
-
- public void apply ()
- {
- System.err.println("AddServiceObjectNode apply");
-
- if (JACE.ServiceConfigurator.ServiceConfig.initialize(this) == -1)
- ACE.ERROR("Error adding " + this.name_);
- }
-
- String params_;
- String locator_;
- boolean suspended_;
-};
diff --git a/java/src/Blob.java b/java/src/Blob.java
deleted file mode 100644
index 69feef248b3..00000000000
--- a/java/src/Blob.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * Blob.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.SOCK_SAP.*;
-import JACE.ASX.*;
-import JACE.OS.*;
-
-public class Blob
-{
- public int open (String filename, String hostname , int port)
- {
- this.filename_ = filename;
- this.hostname_ = hostname;
- this.port_ = port;
- return 0;
- }
-
- public MessageBlock read (int length, int offset)
- {
- // Check if we have a valid length and a valid offset
- if (length < 0 || offset < 0)
- {
- ACE.ERROR ("Blob::read(): Negative length or offset");
- return null;
- }
-
- // Create a Blob Reader
- BlobReader blobReader = new BlobReader (length, offset, this.filename_, this.hostname_, this.port_);
-
- // Receive data
- MessageBlock mb = blobReader.receiveData ();
- if (blobReader.bytesRead () != length)
- return null;
- else
- return mb;
- }
-
- public int write (MessageBlock mb, int length, int offset)
- {
- // Check if we have a valid length and a valid offset
- if (length < 0 || offset < 0)
- ACE.ERROR ("Blob::write(): Negative length or offset");
-
- // Create a Blob Writer
- BlobWriter blobWriter = new BlobWriter (mb, length, offset, this.filename_);
-
- try
- {
- // Connect to the server
- this.connector_.open (this.hostname_, this.port_);
- this.connector_.connect (blobWriter);
- }
- catch (UnknownHostException e)
- {
- ACE.ERROR (e);
- }
- catch (InstantiationException e)
- {
- ACE.ERROR (e);
- }
- catch (IllegalAccessException e)
- {
- ACE.ERROR (e);
- }
- catch (IOException e)
- {
- ACE.ERROR (e);
- }
-
- return blobWriter.bytesWritten ();
- }
-
- public int close ()
- {
- return 0;
- }
-
- String filename_;
- String hostname_;
- int port_;
- Connector connector_ = new Connector ();
-}
diff --git a/java/src/BlobHandler.java b/java/src/BlobHandler.java
deleted file mode 100644
index ec282bdeaa9..00000000000
--- a/java/src/BlobHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * BlobHandler.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.SOCK_SAP.*;
-import JACE.ASX.*;
-import JACE.OS.*;
-
-public abstract class BlobHandler extends SvcHandler
-{
- public BlobHandler (int length, int offset, String filename)
- {
- this.length_ = length;
- this.offset_ = offset;
- this.filename_ = filename;
- }
-
- public abstract int open (Object obj);
-
- protected int length_ = 0;
- protected int offset_ = 0;
- protected String filename_ = null;
-}
-
diff --git a/java/src/BlobReader.java b/java/src/BlobReader.java
deleted file mode 100644
index 7209f3c721f..00000000000
--- a/java/src/BlobReader.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * BlobReader.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.SOCK_SAP.*;
-import JACE.ASX.*;
-import JACE.OS.*;
-
-// Reader **************************************************
-
-public class BlobReader
-{
- public BlobReader (int length,
- int offset,
- String filename,
- String hostname,
- int port)
- {
- this.length_ = length;
- this.offset_= offset;
- this.filename_ = filename;
- this.hostname_ = hostname;
- this.port_ = port;
- }
-
-
- public MessageBlock receiveData ()
- {
- String hostname = this.hostname_;
- String filename = this.filename_;
-
- // Check if the filename begins with a "/" and if so, remove it
- // since we are concatenating a "/" to the hostname.
- if (this.filename_.startsWith ("/"))
- filename = this.filename_.substring (1);
-
- hostname = hostname + ":" + this.port_ + "/";
- // System.out.println (hostname + filename);
-
- // Allocate a buffer to hold the offset worth of data
- byte tempBuf [] = new byte [this.offset_];
- // Allocate a buffer to hold the actual data
- byte dataBuf [] = new byte [this.length_];
-
- try
- {
- // Create a URL to fetch the file
- URL url = new URL (this.protocol_ + hostname + filename);
-
- // Get the input stream and pipe it to a DataInputStream
- DataInputStream iStream = new DataInputStream (url.openStream ());
-
- // Read the offset worth of bytes
- iStream.readFully (tempBuf, 0, this.offset_);
-
- // Read length worth of bytes
- iStream.readFully (dataBuf, 0, this.length_);
- }
- catch (MalformedURLException e)
- {
- ACE.ERROR (e);
- }
- catch (IOException e)
- {
- ACE.ERROR (e);
- }
- // Cache number of bytes read
- this.bytesRead_ = this.length_;
- return new MessageBlock (new String (dataBuf, 0, this.length_));
- }
-
- public int close (long flags)
- {
- return 0;
- }
-
- public int bytesRead ()
- {
- return this.bytesRead_;
- }
-
- private String protocol_ = "http://";
-
- int length_ = 0;
- int offset_= 0;
- String filename_ = null;
- String hostname_ = "localhost";
- int port_ = 80;
-
- int bytesRead_ = 0;
-}
-
-
diff --git a/java/src/BlobWriter.java b/java/src/BlobWriter.java
deleted file mode 100644
index 4c4d5d1d31b..00000000000
--- a/java/src/BlobWriter.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * BlobWriter.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.SOCK_SAP.*;
-import JACE.ASX.*;
-import JACE.OS.*;
-
-// Writer **************************************************
-
-public class BlobWriter extends BlobHandler
-{
- public BlobWriter (MessageBlock mb,
- int length,
- int offset,
- String filename)
- {
- super (length, offset, filename);
- this.mb_ = mb;
- this.returnCode_ = -1;
- }
-
- public int open (Object obj)
- {
- if (this.sendRequest () != 0)
- {
- ACE.ERROR ("BlobWriter::open():sendRequest failed");
- return -1;
- }
- else if (this.receiveReply () != 0)
- {
- ACE.ERROR ("BlobWriter::open():receiveReply failed");
- return -1;
- }
- return 0;
- }
-
- public int close (long flags)
- {
- return 0;
- }
-
- public int bytesWritten ()
- {
- return this.bytesWritten_;;
- }
-
- protected int sendRequest ()
- {
- // Check for sanity -- check if we have any data to send.
- if (this.offset_+ this.length_ > this.mb_.length ())
- {
- ACE.ERROR ("BlobWriter::sendRequest():Invalid offset/length");
- return -1;
- }
-
- if (this.sendHeader () == -1)
- {
- ACE.ERROR ("BlobWriter::sendHeader failed.");
- return -1;
- }
- else
- if (this.sendData () == -1)
- {
- ACE.ERROR ("BlobWriter::sendData failed.");
- return -1;
- }
- return 0;
- }
-
- // Send the header
- protected int sendHeader ()
- {
- String filename = this.filename_;
- // Check if the filename begins with a "/" and if it doesn't, add it
- if (!this.filename_.startsWith ("/"))
- filename = "/" + this.filename_;
-
- // Create the header, store the actual length in mesglen
- String mesg = this.requestPrefix_ + " " + filename + " " + this.requestSuffix_ + " " + this.length_ + "\n\n";
- System.out.print (mesg);
-
- try
- {
- if (this.peer ().send (mesg) < 0)
- {
- ACE.ERROR ("Error sending request");
- return -1;
- }
- }
- catch (IOException e)
- {
- ACE.ERROR (e);
- return -1;
- }
- return 0;
- }
-
- // Send the data
- protected int sendData ()
- {
- // Get the actual data to send
- String data = this.mb_.base ().substring (this.offset_,
- this.offset_ + this.length_);
-
- try
- {
- // System.out.println (data);
- // Now send the data
- if (this.peer ().send (data) != this.length_)
- {
- ACE.ERROR ("Error sending file");
- return -1;
- }
- }
- catch (IOException e)
- {
- ACE.ERROR (e);
- return -1;
- }
- this.bytesWritten_ = this.length_;
- return 0;
- }
-
-
- protected int receiveReply ()
- {
- // Receive the reply from the server
- StringBuffer reply = new StringBuffer (1024);
-
- try
- {
- if (this.peer ().recv (reply) < 0)
- {
- ACE.ERROR ("Error receiving reply from server");
- return -1;
- }
- }
- catch (IOException e)
- {
- ACE.ERROR (e);
- }
-
- String s = reply.toString ();
-
- int index = -1;
- // Now parse the reply to see if it was a success or a failure
- if ((index = s.indexOf (replyPrefix_)) == -1)
- {
- ACE.ERROR ("Error receiving reply from server");
- return -1;
- }
-
- int codeIndex = index + replyPrefix_.length () + 1;
-
- // Assume code is a 3 digit number
- String codeString = s.substring (codeIndex, codeIndex + 3);
-
- returnCode_ = (new Integer (codeString)).intValue ();
- // System.out.println (code);
-
- if (returnCode_ >= 200 && returnCode_ < 300) // Check if everything went smoothly
- return 0;
- else
- return -1;
- }
-
- public int returnCode ()
- {
- return this.returnCode_;
- }
-
- protected String protocol_ = "http://";
- protected int bytesWritten_ = 0;
- protected MessageBlock mb_ = null;
- protected String requestPrefix_ = "PUT";
- protected String requestSuffix_ = "HTTP/1.0\nContent-length:";
- protected String replyPrefix_ = "HTTP/1.0";
- protected int returnCode_;
-}
-
-
diff --git a/java/src/ClassNameGenerator.java b/java/src/ClassNameGenerator.java
deleted file mode 100644
index 8c08b33c09c..00000000000
--- a/java/src/ClassNameGenerator.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ClassNameGenerator.java
- *
- * Given a locator string which may specify a class name, this generates as many possible locations for that
- * class file as possible. This is needed when trying to infer a class name from a C++ DLL line in the
- * svc.conf file. Implements the Enumeration interface. A variety of questionable tactics are
- * used.
- *
- *@author Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import java.lang.*;
-import java.util.*;
-import JACE.OS.*;
-
-public class ClassNameGenerator implements Enumeration
-{
- /**
- * Constructor
- * @param locator Locator string -- approximate class name
- */
- public ClassNameGenerator (String locator)
- {
- this.locator_ = locator;
- this.current_ = 0;
- this.suggestions_ = new Vector();
-
- this.makeSuggestions();
- }
-
- /**
- * More unseen possibilities?
- */
- public boolean hasMoreElements()
- {
- return this.current_ < this.suggestions_.size();
- }
-
- /**
- * Get the next string
- */
- public Object nextElement()
- {
- return this.suggestions_.elementAt(this.current_++);
- }
-
- /**
- * Take away things underscores, adjust capitalization. This
- * makes a name more like a Java class name
- */
- String makeJavaName(String oldName)
- {
- StringTokenizer tok = new StringTokenizer(oldName, "_");
- String result = new String();
-
- while (tok.hasMoreTokens()) {
- String token = tok.nextToken();
-
- if (token.length() > 0) {
-
- result += (Character.toUpperCase(token.charAt(0)) + token.substring(1));
- }
- }
-
- return result;
- }
-
-
- /**
- * Generate the suggestions
- */
- void makeSuggestions()
- {
- String slash = new String(System.getProperty("file.separator"));
-
- // Discard things like .shobj
- if ((this.locator_.charAt(0) == '.') && (this.locator_.charAt(1) != '.')) {
- int firstslash = this.locator_.indexOf(slash);
- if (firstslash > 0)
- this.locator_ = this.locator_.substring(firstslash + 1);
- }
-
- // Find the last directory separator and the colon (inbetween
- // these two is the last directory name, and by our convention
- // this should be the class name)
- int lastSlash = this.locator_.lastIndexOf(slash);
- int colon = this.locator_.lastIndexOf(":");
-
- ACE.DEBUG("Working with " + this.locator_ + " " +
- lastSlash + " " + colon);
-
- // Best bet first:
- // Locator string is a path, and the last directory name is the class
- // name
- String lastDir = new String(this.locator_.substring(lastSlash + 1,
- colon));
-
- // Save any other path info for later tries
- String path = null;
- if (lastSlash >= 0)
- path = this.locator_.substring(0, lastSlash + 1);
-
- int tryNum = 0;
-
- if (lastDir.length() > 0) {
-
- // Add this try
- this.suggestions_.addElement(lastDir);
-
- if (path != null)
- this.suggestions_.addElement(path + lastDir);
-
- // Second try:
- // Same as the first, but changed to the Java convention for class names:
- // Begins with a capital letter, capital letters for new words rather
- // than underscores.
-
- String try2 = this.makeJavaName(lastDir);
-
- this.suggestions_.addElement(try2);
- if (path != null)
- this.suggestions_.addElement(path + try2);
- }
-
- // Third try:
- // After the colon, the name of the method that created instances of the
- // class in C++ may contain the class name. Maybe in the format of
- // make_classname, etc.
-
- String lastWord = new String(this.locator_.substring(colon + 1));
-
- if (lastWord.length() > 0) {
-
- // Try the word after the colon, too
- this.suggestions_.addElement(lastWord);
- if (path != null)
- this.suggestions_.addElement(path + lastWord);
-
- String try2 = this.makeJavaName(lastWord);
-
- this.suggestions_.addElement(try2);
- if (path != null)
- this.suggestions_.addElement(path + try2);
-
- int make = lastWord.indexOf("make");
- if (make >= 0) {
-
- make += 4;
- String makeTry = new String(lastWord.substring(make));
-
- if (makeTry.length() > 0) {
-
- this.suggestions_.addElement(makeTry);
- if (path != null)
- this.suggestions_.addElement(path + makeTry);
-
- String try3 = this.makeJavaName(makeTry);
-
- this.suggestions_.addElement(try3);
- if (path != null)
- this.suggestions_.addElement(path + try3);
- }
- }
- }
-
- }
-
- String locator_;
- Vector suggestions_;
-
- int current_;
-};
-
-
diff --git a/java/src/ClassReader.java b/java/src/ClassReader.java
deleted file mode 100644
index deddf32eac2..00000000000
--- a/java/src/ClassReader.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ClassReader.java
- *
- *@author Everett Anderson
- *
- *@see JACE.ServiceConfigurator
- *@see JACE.ServiceConfigurator.ServiceLoader
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import JACE.OS.*;
-import java.io.*;
-import java.lang.*;
-import java.util.*;
-
-/**
- * <hr>
- * <p><b>TITLE</b><br>
- * Given a classfile name, this determines the qualified class name
- * of what's inside (pacakage and class name together). It is necessary
- * when users want to dynamically load classes, but don't provide the
- * full name in svc.conf.
- */
-
-public class ClassReader
-{
- // Types found in classfiles
- public static final byte CONSTANT_Class = 7;
- public static final byte CONSTANT_Fieldref = 9;
- public static final byte CONSTANT_Methodref = 10;
- public static final byte CONSTANT_InterfaceMethodref = 11;
- public static final byte CONSTANT_String = 8;
- public static final byte CONSTANT_Integer = 3;
- public static final byte CONSTANT_Float = 4;
- public static final byte CONSTANT_Long = 5;
- public static final byte CONSTANT_Double = 6;
- public static final byte CONSTANT_NameAndType = 12;
- public static final byte CONSTANT_Utf8 = 1;
-
- /** Returns a string that is the qualified class name of the
- * given file. It returns null if there are any problems.
- *
- *@param fileName File to examine
- *
- *@return String that's the qualified class name of the
- * given file (null on error)
- */
- public static String getClassName(String fileName)
- {
- try {
-
- // Open the .class file
- FileInputStream fis = new FileInputStream(fileName);
-
- DataInputStream dis = new DataInputStream(fis);
-
- // Skip magic number and version numbers
- dis.skipBytes(8);
-
- // Find out how many entries are in the constant pool table
- int count = dis.readUnsignedShort();
-
- // Hash table to hold the text entries (possibilities for
- // the class name)
- Hashtable ht = new Hashtable();
-
- // Vector that holds the index of the class name for each
- // class record (the vector is indexed by placement in the
- // table)
- Vector vt = new Vector(count);
- Integer noValue = new Integer(-1);
- int type;
-
- // Scan through all the entries
- for (int i = 1; i < count; i++) {
-
- // Read what type of entry this is
- type = dis.readUnsignedByte();
-
- switch (type) {
-
- case CONSTANT_Class:
- // Save the index of the class name
- vt.addElement(new Integer(dis.readUnsignedShort()));
- break;
- case CONSTANT_Fieldref:
- case CONSTANT_Methodref:
- case CONSTANT_InterfaceMethodref:
- case CONSTANT_Integer:
- case CONSTANT_Float:
- case CONSTANT_NameAndType:
- // Skip the data
- vt.addElement(noValue);
- dis.skipBytes(4);
- break;
- case CONSTANT_String:
- // Skip the data
- vt.addElement(noValue);
- dis.skipBytes(2);
- break;
- case CONSTANT_Long:
- case CONSTANT_Double:
- // Skip the data
- vt.addElement(noValue);
- dis.skipBytes(8);
- // These take up two spots in the table
- i++;
- break;
- case CONSTANT_Utf8:
- vt.addElement(noValue);
- // Save the text in the hash table
- ht.put(new Integer(i), new String(dis.readUTF()));
- break;
- default:
- System.err.println("Unknown type: " + type);
- break;
-
- }
-
- }
-
- // Skip the access flags
- dis.skipBytes(2);
-
- // Get index in table of this class
- int classIdx = dis.readUnsignedShort();
-
- // Get index in the table of the name of this class
- Integer idx = (Integer)vt.elementAt(classIdx - 1);
-
- // Put the result in period separated notation
- String result = new String(((String)ht.get(idx)).replace('/', '.'));
-
- return result;
-
- } catch (IOException e) {
- ACE.ERROR("" + e);
- return null;
- }
- }
-}
diff --git a/java/src/Condition.java b/java/src/Condition.java
deleted file mode 100644
index 59a97c9a1a7..00000000000
--- a/java/src/Condition.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Concurrency
- *
- * = FILENAME
- * Condition.java
- *
- *@author Irfan Pyarali
- *
- *************************************************/
-package JACE.Concurrency;
-
-import JACE.ASX.TimeoutException;
-import JACE.ASX.TimeValue;
-
-/**
- * <hr>
- * <h2>TITLE</h2>
- *<blockquote>
- * Abstraction for <em>traditional</em>
- * condition variable
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * This condition variable allows the use of one
- * mutex between multiple conditions.
- * This implementation is based on the C++ version of ACE.
- *</blockquote>
- */
-public class Condition
-{
- /**
- * Default constructor
- *@param Mutex for synchronization
- */
- public Condition (Mutex mutex)
- {
- mutex_ = mutex;
- }
-
- /**
- * Wait for condition to become signaled.
- *@exception InterruptedException exception during wait
- */
- public void Wait ()
- throws InterruptedException
- {
- waiters_++;
-
- try
- {
- mutex_.release();
- semaphore_.acquire ();
- mutex_.acquire ();
- }
- finally
- {
- waiters_--;
- }
- }
-
- /**
- * TimedWait for condition to become signaled.
- *@exception TimeoutException wait timed out exception
- *@exception InterruptedException exception during wait
- */
- public void Wait (TimeValue tv)
- throws TimeoutException, InterruptedException
- {
- waiters_++;
-
- try
- {
- mutex_.release();
-
- TimeValue start = TimeValue.getTimeOfDay ();
-
- semaphore_.acquire (tv);
-
- TimeValue now = TimeValue.getTimeOfDay ();
- tv.minusEquals (TimeValue.minus (now, start));
-
- mutex_.acquire (tv);
- }
- finally
- {
- waiters_--;
- }
- }
-
- /**
- * Signal condition. Wake one waiter (if any).
- */
- public void signal ()
- {
- if (waiters_ > 0)
- semaphore_.release ();
- }
-
- /**
- * Signal condition. Wake up all waiters (if any).
- */
- public void broadcast ()
- {
- for (int i = waiters_; i > 0; i--)
- semaphore_.release ();
- }
-
- /**
- * Accessor to lock
- *@return Mutex
- */
- public Mutex mutex ()
- {
- return mutex_;
- }
-
- private int waiters_;
- private Semaphore semaphore_ = new Semaphore (0);
- private Mutex mutex_;
-
-}
diff --git a/java/src/Connector.java b/java/src/Connector.java
deleted file mode 100644
index 81b701e7b4d..00000000000
--- a/java/src/Connector.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * Connector.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.OS.*;
-import JACE.SOCK_SAP.*;
-import JACE.ServiceConfigurator.*;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Abstract factory for connecting a
- * (<a href="ACE.Connection.SvcHandler.html"><tt>SvcHandler</tt></a>),
- * to an application.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * Implements the basic strategy for actively establishing connections
- * with applications. The <tt>Connector</tt> establishes the connection,
- * passing it on to a <tt>SvcHandler</tt> instance, and handing over
- * control to that instance.
- *<p>
- * TCP is the transport mechanism used, via
- * <a href="ACE.SOCK_SAP.SOCKConnector.html#_top_"><tt>SOCKConnector</tt></a>.
- *</blockquote>
- *
- *<h2>NOTES</h2>
- *<blockquote>
- * This class, as currently implemented, does not work like its C++ counterpart.
- * Future versions are expected to rectify this discrepancy.
- *</blockquote>
- *
- *@see SOCKConnector,SvcHandler
- */
-public class Connector extends ServiceObject
-{
- /**
- * Create a Connector. Do nothing constructor. Allows user to
- * call <a href="#open(java.lang.String)">open</a>() later.
- */
- public Connector ()
- {
- }
-
- /**
- * Create a Connector passing in server hostname and port
- * number, effectively shorthand for calling
- * <a href="#open(java.lang.String)">open</a>().
- *@param hostname server hostname
- *@param port server port number
- */
- public Connector (String hostname, int port)
- {
- this.open (hostname, port);
- }
-
- /**
- * Initialize the Connector passing in server hostname and port
- * number. Note that no connection attempt is made.
- *@param hostname server hostname
- *@param port server port number
- */
- public void open (String hostname, int port)
- {
- this.hostname_ = hostname;
- this.port_ = port;
- }
-
- /**
- * Connect to the server.
- *@param sh Svc Handler to use to handle the connection
- */
- public void connect (SvcHandler sh) throws UnknownHostException,
- SocketException,
- InstantiationException,
- IllegalAccessException,
- IOException
- {
- // Make a connection using the appropriate Connection_Strategy
- this.connectSvcHandler (sh);
-
- // Activate the Svc_Handler using the appropriate Activation_Strategy
- this.activateSvcHandler (sh);
- }
-
- /**
- * Bridge method for making a new connection. The default behavior
- * creates a new SOCKConnector and then calls setHandle() on the
- * <SvcHandler> that was passed in. Subclasses can override this
- * strategy, if needed.
- *@param sh Svc Handler to use to handle the connection
- *@return 0
- */
- protected int connectSvcHandler (SvcHandler sh) throws
- SocketException, IOException
- {
- // Create a new stream
- SOCKStream sockStream = new SOCKStream ();
-
- // Create a SOCK_Connector (note the constructor does the connect for us)
- this.sockConnector_ = new SOCKConnector (sockStream,
- this.hostname_,
- this.port_);
- ACE.DEBUG ("Connected to " +
- sockStream.socket ().getInetAddress ());
-
- // Set the streams for the new handler
- sh.setHandle (sockStream);
- return 0;
- }
-
- /**
- * Bridge method for activating a <SvcHandler>. The default
- * behavior of this method is to activate the <SvcHandler> by
- * calling its open() method (which allows the SVC_HANDLER to define
- * its own concurrency strategy). However, subclasses can override
- * this strategy to do more sophisticated concurrency activations.
- *@param sh Svc Handler to activate
- *@return 0
- */
- protected int activateSvcHandler (SvcHandler sh)
- {
- sh.open (null);
- return 0;
- }
-
-
- // Port server is listening on
- private int port_;
-
- // Server hostname
- private String hostname_;
-
- // Our connection factory
- private SOCKConnector sockConnector_;
-}
diff --git a/java/src/CreationStrategy.java b/java/src/CreationStrategy.java
deleted file mode 100644
index 219dc712668..00000000000
--- a/java/src/CreationStrategy.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * CreationStrategy.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Defines the interface for specifying a creation strategy for a
- * <a href="ACE.Connection.SvcHandler.html#_top_"><tt>SvcHandler</tt></a> to the
- * <a href="ACE.Connection.StrategyAcceptor.html#_top_"><tt>StrategyAcceptor</tt></a>.
- *</blockquote>
- *
- * <p><b>DESCRIPTION</b><br>
- *<blockquote>
- * The default behavior is to make a new SvcHandler. However,
- * subclasses can override this strategy to perform SvcHandler
- * creation in any way that they like (such as creating subclass
- * instances of SvcHandler, using a singleton, dynamically
- * linking the handler, etc.).
- *</blockquote>
- *
- *@see SvcHandler,StrategyAcceptor,AcceptStrategy,ActivateStrategy
- */
-public class CreationStrategy
-{
- /**
- * Create an instance of Creation Strategy.
- *@param handlerFactory Svc Handler factory that is used to create
- * an instance of a Svc Handler
- */
- public CreationStrategy (Class handlerFactory)
- {
- this.handlerFactory_ = handlerFactory;
- }
-
- /**
- * Create a new SvcHandler. Note that subclasses should override
- * this method to provide a new creation strategy.
- *@return reference to a new instance of the SvcHandler (or subclass)
- *@exception InstantiationException Unable to instantiate.
- *@exception IllegalAccessException No handler factory available.
- */
- public SvcHandler makeSvcHandler () throws InstantiationException,
- IllegalAccessException
- {
- // Create a new Svc_Handler
- return (SvcHandler) handlerFactory_.newInstance ();
- }
-
- private Class handlerFactory_;
-}
diff --git a/java/src/EventHandler.java b/java/src/EventHandler.java
deleted file mode 100644
index 53a9974bf08..00000000000
--- a/java/src/EventHandler.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Reactor
- *
- * = FILENAME
- * EventHandler.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Reactor;
-
-import JACE.ASX.TimeValue;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Provides an abstract interface for handling timer events.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * Classes implementing this interface handle a timer's
- * expiration.
- *</blockquote>
- *
- * <h2>NOTES</h2>
- *<blockquote>
- * Users of C++ ACE will notice that this defines a substantially
- * smaller interface than the C++ counterpart. Signal events are
- * absent due to the complete absence of this feature from Java itself.
- * Moreover, at this point
- * there is still some question regarding whether or not the I/O
- * portion will make any sense or fit into the Java model for I/O.
- *</blockquote>
- *
- *@see TimerQueue,Reactor
- */
-public interface EventHandler
-{
- /**
- * Called when timer expires.
- *@param tv Time Value for which timer was set
- *@param obj An arbitrary object that was passed to the Timer Queue
- * (Asynchronous Completion Token)
- */
- public int handleTimeout (TimeValue tv, Object obj);
-}
-
-// Note that more methods will be added as needed
diff --git a/java/src/GetOpt.java b/java/src/GetOpt.java
deleted file mode 100644
index 2bf5d27c406..00000000000
--- a/java/src/GetOpt.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Misc
- *
- * = FILENAME
- * GetOpt.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Misc;
-
-import java.io.*;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Iterator for parsing command-line arguments.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * This version of `get_opt' appears to the caller like standard
- * Unix `get_opt' but it behaves differently for the user, since
- * it allows the user to intersperse the options with the other
- * arguments.
- *
- * <p> As `get_opt' works, it permutes the elements of `argv' so that,
- * when it is done, all the options precede everything else. Thus
- * all application programs are extended to handle flexible argument
- * order.
- *</blockquote>
- *
- */
-public class GetOpt
-{
- /**
- * Constructor
- *@param args command line arguments
- *@param optstring string containing the legitimate option
- * characters. A colon in optstring means that the previous character
- * is an option that wants an argument which is then taken from the
- * rest of the current args-element. Here is an example of what
- * optstring might look like: "c:dP:p".
- */
- public GetOpt (String[] args, String optstring)
- {
- // Cache the arguments
- this.args_ = args;
- this.hasArg_ = false;
-
- // Build the arg hashtable
- this.buildArgTable (optstring);
- }
-
- /**
- * Scan elements specified in optstring for next option flag.
- *@return The character corresponding to the next flag.
- */
- public int next ()
- {
- if (this.args_ == null)
- return -1;
-
- if (this.index_ < this.args_.length)
- {
- String arg = this.args_[this.index_++];
-
- // Make sure flag starts with "-"
- if (!arg.startsWith ("-"))
- return -1;
-
- // Check if there is more than one character specified as flag
- if (arg.length () > 2)
- return -1;
-
- // So far so good
- // Check if the flag is in the arg_table and if it is get the
- // associated binding.
- Character c = (Character) this.argTable_.get (new Character (arg.charAt (1)));
- if (c == null)
- return -1;
-
- if (c.charValue () == '#')
- {
- this.hasArg_ = false;
- return arg.charAt (1);
- }
- else if (c.charValue () == ':')
- {
- this.hasArg_ = true;
- return arg.charAt (1);
- }
- else // This should not happen
- return -1;
- }
- return -1;
- }
-
- /**
- * Get the argument (if any) associated with the flag.
- *@return the argument associated with the flag.
- */
- public String optarg ()
- {
- if (this.hasArg_)
- return this.args_[this.index_++];
- else
- return null;
- }
-
- // Build the argument table
- private void buildArgTable (String s)
- {
- this.argTable_ = new Hashtable ();
- StringTokenizer tokens = new StringTokenizer (s, ":");
- while (tokens.hasMoreTokens ())
- {
- // Get the next token
- String t = tokens.nextToken ();
-
- // First add all flags except the one with ":" after it
- // Note "#" is an arbitrary character we use to distinguish
- // the two cases
- for (int i = 0; i < t.length () - 1; i++)
- this.argTable_.put (new Character (t.charAt (i)),
- new Character ('#'));
-
- // Now Add the flag just before ":" to the arg_table
- this.argTable_.put (new Character (t.charAt (t.length () - 1)),
- new Character (':'));
- }
- }
-
- private String [] args_;
- // Copy of the args passed in
-
- private boolean hasArg_;
- // Indicator that the flag has an argument following it
-
- private int index_;
- // Index into the array of arguments
-
- private Hashtable argTable_;
- // Table of flags that take arguments after them
-}
diff --git a/java/src/INETAddr.java b/java/src/INETAddr.java
deleted file mode 100644
index 8d16c46c6b3..00000000000
--- a/java/src/INETAddr.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.SOCK_SAP
- *
- * = FILENAME
- * INETAddr.java
- *
- *@author Chris Cleeland
- *
- *************************************************/
-package JACE.SOCK_SAP;
-
-import java.io.*;
-import java.net.*;
-import JACE.OS.*;
-
-/**
- * <hr>
- * <p><b>TITLE</b><br>
- * Defines an endpoint of a connection, encapsulating host and port.
- * This is only a part-way implementation of C++ ACE's ACE_INET_Addr.
- *
- * <p><b>LIMITATIONS</b><br>
- * Currently the class is very limited in its capabilities; it will
- * be expanded in future revisions of ACE.
- */
-public class INETAddr // extends Addr
-{
- private InetAddress addr_;
- private int port_ = 0;
- /**
- */
- public INETAddr ()
- {
- // Do nothing constructor
- }
-
- /**
- * Create an INETAddr from a port/hostname
- *@param port port number to connect with server at
- *@param hostname hostname of the server
- */
- public INETAddr (int port, String hostname) throws UnknownHostException
- {
- super();
- port_ = port;
- addr_ = InetAddress.getByName(hostname);
- // Should really use getAllByName(),
- // but I don't think we do that in
- // C++ ACE, even.
- }
-
- /**
- * Create an INETAddr from an address.
- * @param address an address in the form "ip-number:port-number", <em>e.g.</em> <pre>tango.cs.wustl.edu:1234</pre> or <pre>128.252.166.57:1234</pre>; if no ':' is present address is assumed to be <b>INADDR_ANY</b> and address contains only the port number
- * @throws UnknownHostException
- */
- public INETAddr (String address) throws UnknownHostException
- {
- int colon = address.indexOf(':');
- if (colon != 0)
- {
- addr_ = InetAddress.getByName(address.substring(0, colon));
- address = address.substring(colon+1);
- }
-
- port_ = Integer.parseInt(address);
- }
-
- /**
- * Return the name of the host.
- */
- public String getHostName()
- {
- return addr_.getHostName();
- }
-
- /**
- * Return the dotted Internet address.
- */
- public String getHostAddr()
- {
- return addr_.toString();
- }
-
- /**
- * Return the port number.
- */
- public int getPortNumber()
- {
- return port_;
- }
-
- public String toString()
- {
- return getHostAddr() + Integer.toString(port_);
- }
-}
diff --git a/java/src/IOCntlCmds.java b/java/src/IOCntlCmds.java
deleted file mode 100644
index 2469428a3a6..00000000000
--- a/java/src/IOCntlCmds.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * TaskFlags.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-public abstract class IOCntlCmds
-{
- /** Set the low water mark. */
- public static final int SET_LWM = 1;
-
- /** Get the low water mark. */
- public static final int GET_LWM = 2;
-
- /** Set the high water mark. */
- public static final int SET_HWM = 3;
-
- /** Get the high water mark. */
- public static final int GET_HWM = 4;
-
- /** Link modules */
- public static final int MOD_LINK = 5;
-
- /** Unlink modules */
- public static final int MOD_UNLINK = 6;
-
-}
diff --git a/java/src/IOCntlMsg.java b/java/src/IOCntlMsg.java
deleted file mode 100644
index 8b69310c4f7..00000000000
--- a/java/src/IOCntlMsg.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * IOCntlMsg.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-import JACE.OS.*;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Data format for IOCTL messages
- *</blockquote>
- */
-public class IOCntlMsg
-{
-
- // = Initialization method.
-
- /*
- * Initialize the control message.
- *@param c IOCntlCmd for the control message. Note that this should
- * be of type IOCntlCmds
- */
- public IOCntlMsg (int c)
- {
- this.cmd_ = c;
- }
-
- // = Get/set methods
-
- /*
- * Get the command.
- *@return the command.
- */
- public int cmd ()
- {
- return this.cmd_;
- }
-
- /*
- * Set the command.
- *@param c the command.
- */
- public void cmd (int c)
- {
- this.cmd_ = c;
- }
-
- /*
- * Get the count.
- *@return the count.
- */
- public int count ()
- {
- return this.count_;
- }
-
- /*
- * Set the count.
- *@param c the count.
- */
- public void count (int c)
- {
- this.count_ = c;
- }
-
- /*
- * Get the error.
- *@return the error.
- */
- public int error ()
- {
- return this.error_;
- }
-
- /*
- * Set the error.
- *@param e the error.
- */
- public void error (int e)
- {
- this.error_ = e;
- }
-
- /*
- * Get the return value.
- *@return the return value.
- */
- public int rval ()
- {
- return this.rval_;
- }
-
- /*
- * Set the return value.
- *@param r the return value.
- */
- public void rval (int r)
- {
- this.rval_ = r;
- }
-
- public String toString ()
- {
- return (new Integer (this.cmd_)).toString ();
- }
-
- private int cmd_;
- // Command.
-
- private int count_;
- // Count.
-
- private int error_;
- // Error.
-
- private int rval_;
- // Return value
-}
diff --git a/java/src/JACE.DSP b/java/src/JACE.DSP
deleted file mode 100644
index 8abec10535c..00000000000
--- a/java/src/JACE.DSP
+++ /dev/null
@@ -1,248 +0,0 @@
-# Microsoft Developer Studio Project File - Name="JACE" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Java Virtual Machine Java Project" 0x0809
-
-CFG=JACE - Java Virtual Machine Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "JACE.MAK".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "JACE.MAK" CFG="JACE - Java Virtual Machine Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "JACE - Java Virtual Machine Release" (based on\
- "Java Virtual Machine Java Project")
-!MESSAGE "JACE - Java Virtual Machine Debug" (based on\
- "Java Virtual Machine Java Project")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-JAVA=jvc.exe
-
-!IF "$(CFG)" == "JACE - Java Virtual Machine Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ""
-# PROP BASE Intermediate_Dir ""
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "..\classes-r\"
-# PROP Intermediate_Dir ""
-# PROP Target_Dir ""
-# ADD BASE JAVA /O
-# ADD JAVA /O
-
-!ELSEIF "$(CFG)" == "JACE - Java Virtual Machine Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ""
-# PROP BASE Intermediate_Dir ""
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\classes\"
-# PROP Intermediate_Dir ""
-# PROP Target_Dir ""
-# ADD BASE JAVA /g
-# ADD JAVA /g
-
-!ENDIF
-
-# Begin Target
-
-# Name "JACE - Java Virtual Machine Release"
-# Name "JACE - Java Virtual Machine Debug"
-# Begin Source File
-
-SOURCE=.\Acceptor.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\AcceptStrategy.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\ACE.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\ActivateStrategy.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Blob.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\BlobHandler.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\BlobReader.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\BlobWriter.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Condition.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Connector.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\CreationStrategy.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\EventHandler.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\GetOpt.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\INETAddr.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\IOCntlCmds.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\IOCntlMsg.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\MessageBlock.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\MessageQueue.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\MessageType.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Module.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Mutex.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\OS.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\ProfileTimer.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\RWMutex.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Semaphore.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\ServiceConfig.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\ServiceObject.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\ServiceRepository.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\SOCKAcceptor.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\SOCKConnector.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\SOCKStream.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\StrategyAcceptor.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Stream.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\StreamHead.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\StreamTail.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\SvcHandler.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Task.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\TaskFlags.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\ThreadManager.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\ThruTask.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\TimedWait.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\TimeoutException.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\TimerQueue.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\TimeValue.java
-# End Source File
-# Begin Source File
-
-SOURCE=.\Token.java
-# End Source File
-# End Target
-# End Project
diff --git a/java/src/JACE.DSW b/java/src/JACE.DSW
deleted file mode 100644
index 1adb106b259..00000000000
--- a/java/src/JACE.DSW
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "JACE"=.\JACE.DSP - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/java/src/Makefile b/java/src/Makefile
deleted file mode 100644
index 272f4bb4b3b..00000000000
--- a/java/src/Makefile
+++ /dev/null
@@ -1,156 +0,0 @@
-# Makefile
-# $Id$
-
-.SUFFIXES: .java .class
-
-JACE_WRAPPER = ..
-CLASSDIR = $(JACE_WRAPPER)/classes
-DOCDIR = $(JACE_WRAPPER)/doc
-
-JC = javac
-JCOPTS = -g -d $(CLASSDIR)
-JD = javadoc
-JDOPTS = -d $(DOCDIR)
-
-COMPILE.java = $(JC) $(JCOPTS) $(filter %.java,$?)
-
-CLASSPATH := $(CLASSDIR):$(CLASSPATH)
-
-all: asx os concurrency connection timers misc reactor svcconfig socksap
-
-pkg_all = $(pkg_asx_timestuff) $(pkg_asx) $(pkg_os) $(pkg_concurrency) \
- $(pkg_connection) $(pkg_timers) $(pkg_misc) $(pkg_reactor) \
- $(pkg_socksap) $(pkg_svcconfig)
-
-doc:
- $(JD) $(JDOPTS) $(addsuffix .java,$(pkg_all)) $(packages)
-
-clean:
- find ${JACE_WRAPPER}/classes/JACE -name '*.class' -print | xargs ${RM}
-
-docclean:
- find ${JACE_WRAPPER}/doc -name '*.html' -print | xargs ${RM}
-
-realclean: clean docclean
-
-
-pkg_asx_timestuff = \
- TimeValue \
- TimeoutException \
- TimedWait
-
-asx_timestuff: $(addsuffix .java,$(pkg_asx_timestuff))
- $(COMPILE.java)
-
-pkg_asx = \
- IOCntlCmds \
- IOCntlMsg \
- Task \
- TaskFlags \
- ThruTask \
- Module \
- MessageType \
- MessageBlock \
- MessageQueue \
- StreamHead \
- StreamTail \
- Stream
-
-asx: os asx_timestuff reactor concurrency $(addsuffix .java,$(pkg_asx))
- $(COMPILE.java)
-
-pkg_os = \
- OS \
- ACE
-
-os: $(addsuffix .java,$(pkg_os))
- $(COMPILE.java)
-
-pkg_concurrency = \
- Condition \
- Mutex \
- RWMutex \
- Semaphore \
- ThreadManager \
- Token
-
-concurrency: $(addsuffix .java,$(pkg_concurrency)) asx_timestuff os
- $(COMPILE.java)
-
-pkg_connection = \
- SvcHandler \
- Acceptor \
- Connector \
- AcceptStrategy \
- ActivateStrategy \
- CreationStrategy \
- StrategyAcceptor \
- Blob \
- BlobHandler \
- BlobReader \
- BlobWriter
-
-connection: os socksap svcconfig $(addsuffix .java,$(pkg_connection))
- $(COMPILE.java)
-
-pkg_timers = \
- ProfileTimer
-
-timers: $(addsuffix .java,$(pkg_timers))
- $(COMPILE.java)
-
-pkg_misc = \
- GetOpt
-
-misc: $(addsuffix .java,$(pkg_misc))
- $(COMPILE.java)
-
-pkg_reactor = \
- EventHandler \
- TimerQueue
-
-reactor: asx_timestuff $(addsuffix .java,$(pkg_reactor))
- $(COMPILE.java)
-
-pkg_socksap = \
- INETAddr \
- SOCKStream \
- SOCKAcceptor \
- SOCKConnector
-
-socksap: os $(addsuffix .java,$(pkg_socksap))
- $(COMPILE.java)
-
-pkg_svcconfig = \
- ServiceLoader \
- ClassNameGenerator \
- ClassReader \
- parser \
- sym \
- ParseNode \
- SuspendNode \
- ResumeNode \
- RemoveNode \
- ServiceRecord \
- ServiceObjectRecord \
- Yylex \
- AddServiceObjectNode \
- ServiceObject \
- ServiceConfig \
- ServiceRepository
-
-svcconfig: os reactor misc $(addsuffix .java,$(pkg_svcconfig))
- $(COMPILE.java)
-
-packages = JACE \
- JACE.ASX \
- JACE.Connection \
- JACE.Concurrency \
- JACE.Misc \
- JACE.OS \
- JACE.Reactor \
- JACE.SOCK_SAP \
- JACE.Service_Configurator \
- JACE.Timers
-
-
diff --git a/java/src/MessageBlock.java b/java/src/MessageBlock.java
deleted file mode 100644
index 1741f9bef80..00000000000
--- a/java/src/MessageBlock.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * MessageBlock.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-import JACE.OS.*;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Object used to store messages in the ASX framework.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * <tt>MessageBlock</tt> is modeled after the message data structures
- * used in System V STREAMS. A <tt>MessageBlock</tt> is composed of
- * one or more <tt>MessageBlock</tt>s that are linked together by <em>PREV</em>
- * and <em>NEXT</em> pointers. In addition, a <tt>MessageBlock</tt> may also be
- * linked to a chain of other <tt>MessageBlock</tt>s. This structure
- * enables efficient manipulation of arbitrarily-large messages
- * <em>without</em> incurring memory copying overhead.
- *</blockquote>
- *
- *@see MessageQueue
- */
-public class MessageBlock
-{
- /**
- * Create an empty Message Block
- */
- public MessageBlock ()
- {
- this (0);
- }
-
- /**
- * Create an empty Message Block.
- * Note that this assumes that type of MessageBlock is MB_DATA.
- *@param size size of the Message Block to create.
- */
- public MessageBlock (int size)
- {
- // Note the explicit cast toString() is needed. For some strange
- // reason, it fails otherwise if size == 0.
- this ((new StringBuffer (size)).toString ());
- }
-
- /**
- * Create a Message Block. Note that this assumes that type of
- * MessageBlock is MB_DATA.
- *@param data initial data to create a Message Block with.
- */
- public MessageBlock (String data)
- {
- this (MessageType.MB_DATA,
- null,
- data);
- }
-
- /**
- * Create a Message Block.
- *@param type type of the Message Block (must be one of those
- * specified in class Message Type)
- *@param cont next block of data
- *@param data initial data to create Message Block with
- */
- public MessageBlock (int type,
- MessageBlock cont,
- String data)
- {
- this.flags_ = 0;
- this.priority_ = 0;
- this.next_ = null;
- this.prev_ = null;
-
- this.init (type, cont, data);
- }
-
- /**
- * Create a Message Block. Note that this assumes that type of
- * MessageBlock is MB_OBJECT.
- *@param obj initial object to create a Message Block with.
- */
- public MessageBlock (Object obj)
- {
- this (MessageType.MB_OBJECT,
- null,
- obj);
- }
-
- /**
- * Create a Message Block.
- *@param type type of the Message Block (must be one of those
- * specified in class Message Type)
- *@param cont next block of data
- *@param obj initial object to create Message Block with
- */
- public MessageBlock (int type,
- MessageBlock cont,
- Object obj)
- {
- this.init (type, cont, obj);
- }
-
- /* Initialize the Message Block
- *@param data data to initialize Message Block with
- */
- public void init (String data)
- {
- this.base_ = new StringBuffer (data);
- }
-
- /**
- * Initialize a Message Block.
- *@param type type of the Message Block (must be one of those
- * specified in class Message Type)
- *@param cont next block of data
- *@param data data to initialize Message Block with
- */
- public void init (int msgType,
- MessageBlock msgCont,
- String data)
- {
- if (data.length () == 0)
- this.base_ = new StringBuffer (0);
- else
- this.base_ = new StringBuffer (data);
- this.type_ = msgType;
- this.cont_ = msgCont;
- }
-
- /**
- * Initialize a Message Block. Note that this assumes that type of
- * MessageBlock is MB_OBJECT.
- *@param obj initial object to initialize a Message Block with.
- */
- public void init (Object obj)
- {
- this.init (MessageType.MB_OBJECT, null, obj);
- }
-
- /**
- * Initialize a Message Block.
- *@param type type of the Message Block (must be one of those
- * specified in class Message Type)
- *@param cont next block of data
- *@param obj object to initialize Message Block with
- */
- public void init (int msgType,
- MessageBlock msgCont,
- Object obj)
- {
- this.obj_ = obj;
- this.type_ = msgType;
- this.cont_ = msgCont;
- this.flags_ = 0;
- this.priority_ = 0;
- this.next_ = null;
- this.prev_ = null;
- }
-
- /**
- * Set message flags. Note that the flags will be set on top of
- * already set flags.
- *@param moreFlags flags to set for the Message Block.
- */
- public long setFlags (long moreFlags)
- {
- // Later we might mask more_flags so that user can't change
- // internal ones: more_flags &= ~(USER_FLAGS -1).
- this.flags_ = ACE.SET_BITS (this.flags_, moreFlags);
- return this.flags_;
- }
-
- /**
- * Unset message flags.
- *@param lessFlags flags to unset for the Message Block.
- */
- public long clrFlags (long lessFlags)
- {
- // Later we might mask more_flags so that user can't change
- // internal ones: less_flags &= ~(USER_FLAGS -1).
- this.flags_ = ACE.CLR_BITS (this.flags_, lessFlags);
- return this.flags_;
- }
-
- /**
- * Get the message flags.
- *@return Message flags
- */
- public long flags ()
- {
- return this.flags_;
- }
-
- /**
- * Get the type of the message.
- *@return message type
- */
- public int msgType ()
- {
- return this.type_;
- }
-
- /**
- * Set the type of the message.
- *@param t type of the message
- */
- public void msgType (int t)
- {
- this.type_ = t;
- }
-
- /**
- * Get the class of the message. Note there are two classes,
- * <normal> messages and <high-priority> messages.
- *@return message class
- */
- public int msgClass ()
- {
- return this.msgType () >= MessageType.MB_PRIORITY
- ? MessageType.MB_PRIORITY : MessageType.MB_NORMAL;
- }
-
- /**
- * Find out if the message is a data message.
- *@return true if message is a data message, false otherwise
- */
- public boolean isDataMsg ()
- {
- int mt = this.msgType ();
- return mt == MessageType.MB_DATA
- || mt == MessageType.MB_PROTO
- || mt == MessageType.MB_PCPROTO;
- }
-
- /**
- * Find out if the message is an object message.
- *@return true if message is an object message, false otherwise
- */
- public boolean isObjMsg ()
- {
- int mt = this.msgType ();
- return mt == MessageType.MB_OBJECT
- || mt == MessageType.MB_PROTO
- || mt == MessageType.MB_PCPROTO;
- }
-
- /**
- * Get the priority of the message.
- *@return message priority
- */
- public long msgPriority ()
- {
- return this.priority_;
- }
-
- /**
- * Set the priority of the message.
- *@param pri priority of the message
- */
- public void msgPriority (long pri)
- {
- this.priority_ = pri;
- }
-
- /**
- * Get message data. This assumes that msgType is MB_DATA.
- *@return message data
- */
- public String base ()
- {
- // Create a String object to return
- char temp[] = new char [this.base_.length ()];
- this.base_.getChars (0, this.base_.length (), temp, 0);
- return new String (temp);
- }
-
- /**
- * Set the message data. This assumes that msgType is MB_DATA.
- *@param data message data
- *@param msgFlags message flags
- */
- public void base (String data,
- long msgFlags)
- {
- this.base_ = new StringBuffer (data);
- this.flags_ = msgFlags;
- }
-
- /**
- * Get message object. This assumes that msgType is MB_OBJECT.
- *@return message object
- */
- public Object obj ()
- {
- return this.obj_;
- }
-
- /**
- * Set the message object. This assumes that msgType is MB_OBJECT.
- *@param object message object
- *@param msgFlags message flags
- */
- public void obj (Object obj,
- long msgFlags)
- {
- this.obj_ = obj;
- this.flags_ = msgFlags;
- }
-
- // = The following four methods only make sense if the Message_Block
- // is of type MB_DATA and not MB_OBJECT.
-
- /**
- * Get length of the message. This method only makes sense if the
- * MessageBlock is of type MB_DATA and not MB_OBJECT.
- *@return length of the message.
- */
- public int length ()
- {
- return this.base_.length ();
- }
-
- /**
- * Set the length of the message. This method only makes sense if the
- * MessageBlock is of type MB_DATA and not MB_OBJECT.
- *@param n message length
- */
- public void length (int n)
- {
- this.base_.setLength (n);
- }
-
- /**
- * Get size of the allocated buffer for the message. This method
- * only makes sense if the MessageBlock is of type MB_DATA and not
- * MB_OBJECT.
- *@return size of the message buffer
- */
- public int size ()
- {
- return this.base_.capacity ();
- }
-
- /**
- * Set the total size of the buffer. This method will grow the
- * buffer if need be. Also, this method only makes sense if the
- * MessageBlock is of type MB_DATA and not MB_OBJECT.
- *@param n size of message buffer
- */
- public void size (int n)
- {
- this.base_.ensureCapacity (n);
- }
-
-
- /**
- * Get the continuation field. The coninuation field is used to
- * chain together composite messages.
- *@return the continuation field
- */
- public MessageBlock cont ()
- {
- return this.cont_;
- }
-
- /**
- * Set the continuation field. The coninuation field is used to
- * chain together composite messages.
- *@param msgCont continuation field
- */
- void cont (MessageBlock msgCont)
- {
- this.cont_ = msgCont;
- }
-
- /**
- * Get link to next message. The next message points to the
- * <MessageBlock> directly ahead in the MessageQueue.
- *@return next message block
- */
- MessageBlock next ()
- {
- return this.next_;
- }
-
- /**
- * Set link to next message. The next message points to the
- * <MessageBlock> directly ahead in the MessageQueue.
- *@param msgBlock next message block
- */
- void next (MessageBlock msgBlock)
- {
- this.next_ = msgBlock;
- }
-
- /**
- * Get link to previous message. The previous message points to the
- * <MessageBlock> directly before in the MessageQueue.
- *@return previous message block
- */
- MessageBlock prev ()
- {
- return this.prev_;
- }
-
- /**
- * Set link to previous message. The previous message points to the
- * <MessageBlock> directly before in the MessageQueue.
- *@param msgBlock previous message block
- */
- void prev (MessageBlock msgBlock)
- {
- this.prev_ = msgBlock;
- }
-
- private int type_;
- // Type of message.
-
- private long flags_;
- // Misc flags.
-
- private long priority_;
- // Priority of message.
-
- private StringBuffer base_;
- // String data of message block (initialized to null).
-
- private Object obj_;
- // Object data of message block (initialized to null).
-
- private MessageBlock cont_;
- // Next message block in the chain.
-
- private MessageBlock next_;
- // Next message in the list.
-
- private MessageBlock prev_;
- // Previous message in the list.
-
-}
-
diff --git a/java/src/MessageQueue.java b/java/src/MessageQueue.java
deleted file mode 100644
index f71c91ca857..00000000000
--- a/java/src/MessageQueue.java
+++ /dev/null
@@ -1,626 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * MessageQueue.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-import java.util.Date;
-import JACE.OS.*;
-import JACE.Reactor.*;
-
-class NotFullCondition extends TimedWait
-{
- public NotFullCondition (MessageQueue mq)
- {
- super (mq);
- this.mq_ = mq;
- }
-
- public boolean condition () {
- // Delegate to the appropriate conditional
- // check on the MessageQueue.
- return !this.mq_.isFull ();
- }
- private MessageQueue mq_;
-}
-
-class NotEmptyCondition extends TimedWait
-{
- public NotEmptyCondition (MessageQueue mq)
- {
- super (mq);
- this.mq_ = mq;
- }
-
- public boolean condition () {
- // Delegate to the appropriate conditional
- // check on the MessageQueue.
- return !this.mq_.isEmpty ();
- }
- private MessageQueue mq_;
-}
-
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * A thread-safe message queueing facility, modeled after the
- * queueing facilities in System V StreamS.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *</blockquote>
- * <tt>MessageQueue</tt> is the central queueing facility for messages
- * in the ASX framework. All operations are thread-safe, as it is intended
- * to be used for inter-thread communication (<em>e.g.</em>, a producer and
- * consumer thread joined by a <tt>MessageQueue</tt>). The queue
- * consiste of <tt>MessageBlock</tt>s.
- *</blockquote>
- *
- *@see MessageBlock,TimeValue
- */
-public class MessageQueue
-{
- /**
- * Default constructor
- */
- public MessageQueue ()
- {
- this (DEFAULT_HWM, DEFAULT_LWM);
- }
-
- /**
- * Create a Message Queue with high and low water marks.
- *@param hwm High water mark (max number of bytes allowed in the
- * queue)
- *@param lwm Low water mark (min number of bytes in the queue)
- */
- public MessageQueue (int hwm, int lwm)
- {
- if (this.open (hwm, lwm) == -1)
- ACE.ERROR ("open");
- }
-
- /**
- * Initialize a Message Queue with high and low water marks.
- *@param hwm High water mark (max number of bytes allowed in the
- * queue)
- *@param lwm Low water mark (min number of bytes in the queue)
- */
- public synchronized int open (int hwm, int lwm)
- {
- this.highWaterMark_ = hwm;
- this.lowWaterMark_ = lwm;
- this.deactivated_ = false;
- this.currentBytes_ = 0;
- this.currentCount_ = 0;
- this.tail_ = null;
- this.head_ = null;
- return 0;
- }
-
- // = For enqueue, enqueueHead, enqueueTail, and dequeueHead if
- // timeout is specified, the caller will wait for amount of time in
- // tv. Calls will return, however, when queue is closed,
- // deactivated, or if the time specified in tv elapses.
-
- /**
- * Enqueue a <MessageBlock> into the <MessageQueue> in accordance
- * with its <msgPriority> (0 is lowest priority). Note that the
- * call will block (unless the queue has been deactivated).
- *@param newItem item to enqueue onto the Message Queue
- *@return -1 on failure, else the number of items still on the queue.
- */
- public synchronized int enqueue (MessageBlock newItem) throws InterruptedException
- {
- return this.enqueue (newItem, null);
- }
-
- /**
- * Enqueue a <MessageBlock> into the <MessageQueue> in accordance
- * with its <msgPriority> (0 is lowest priority). Note that the
- * call will return if <timeout> amount of time expires or if the
- * queue has been deactivated.
- *@param newItem item to enqueue onto the Message Queue
- *@param tv amount of time (TimeValue) to wait before returning
- * (unless operation completes before)
- *@return -1 on failure, else the number of items still on the
- * queue.
- */
- public synchronized int enqueue (MessageBlock newItem,
- TimeValue tv) throws InterruptedException
- {
- int result = -1;
- if (this.deactivated_)
- return -1;
- try
- {
- if (tv == null) // Need to do a blocking wait
- notFullCondition_.timedWait ();
- else // Need to do a timed wait
- notFullCondition_.timedWait (tv);
- }
- catch (TimeoutException e)
- {
- return -1;
- }
-
- // Check again if queue is still active
- if (this.deactivated_)
- return -1;
- else
- result = this.enqueueInternal (newItem);
-
- // Tell any blocked threads that the queue has a new item!
- this.notEmptyCondition_.broadcast ();
- return result;
- }
-
- /**
- * Enqueue a <MessageBlock> at the end of the <MessageQueue>. Note
- * that the call will block (unless the queue has been deactivated).
- *@param newItem item to enqueue onto the Message Queue
- *@return -1 on failure, else the number of items still on the queue.
- */
- public synchronized int enqueueTail (MessageBlock newItem) throws InterruptedException
- {
- return this.enqueueTail (newItem, null);
- }
-
- /**
- * Enqueue a <MessageBlock> at the end of the <MessageQueue>. Note
- * that the call will return if <timeout> amount of time expires or
- * if the queue has been deactivated.
- *@param newItem item to enqueue onto the Message Queue
- *@param tv amount of time (TimeValue) to wait before returning
- * (unless operation completes before)
- *@return -1 on failure, else the number of items still on the queue.
- */
- public synchronized int enqueueTail (MessageBlock newItem,
- TimeValue tv) throws InterruptedException
- {
- int result = -1;
- if (this.deactivated_)
- return -1;
- try
- {
- if (tv == null) // Need to do a blocking wait
- notFullCondition_.timedWait ();
- else // Need to do a timed wait
- notFullCondition_.timedWait (tv);
- }
- catch (TimeoutException e)
- {
- return -1;
- }
-
- // Check again if queue is still active
- if (this.deactivated_)
- return -1;
- else
- result = this.enqueueTailInternal (newItem);
-
- // Tell any blocked threads that the queue has a new item!
- this.notEmptyCondition_.broadcast ();
- return result;
- }
-
- /**
- * Enqueue a <MessageBlock> at the head of the <MessageQueue>. Note
- * that the call will block (unless the queue has been deactivated).
- *@param newItem item to enqueue onto the Message Queue
- *@return -1 on failure, else the number of items still on the queue.
- */
- public synchronized int enqueueHead (MessageBlock newItem) throws InterruptedException
- {
- return this.enqueueHead (newItem, null);
- }
-
- /**
- * Enqueue a <MessageBlock> at the head of the <MessageQueue>. Note
- * that the call will return if <timeout> amount of time expires or
- * if the queue has been deactivated.
- *@param newItem item to enqueue onto the Message Queue
- *@param tv amount of time (TimeValue) to wait before returning
- * (unless operation completes before)
- *@return -1 on failure, else the number of items still on the queue.
- */
- public synchronized int enqueueHead (MessageBlock newItem,
- TimeValue tv) throws InterruptedException
- {
- int result = -1;
- if (this.deactivated_)
- return -1;
- try
- {
- if (tv == null) // Need to do a blocking wait
- notFullCondition_.timedWait ();
- else // Need to do a timed wait
- notFullCondition_.timedWait (tv);
- }
- catch (TimeoutException e)
- {
- return -1;
- }
-
- // Check again if queue is still active
- if (this.deactivated_)
- return -1;
- else
- result = this.enqueueHeadInternal (newItem);
-
- // Tell any blocked threads that the queue has a new item!
- this.notEmptyCondition_.broadcast ();
- return result;
- }
-
- /**
- * Dequeue and return the <MessageBlock> at the head of the
- * <MessageQueue>. Note that the call will block (unless the queue
- * has been deactivated).
- *@return null on failure, else the <MessageBlock> at the head of queue.
- */
- public synchronized MessageBlock dequeueHead () throws InterruptedException
- {
- return this.dequeueHead (null);
- }
-
- /**
- * Dequeue and return the <MessageBlock> at the head of the
- * <MessageQueue>. Note that the call will return if <timeout>
- * amount of time expires or if the queue has been deactivated.
- *@return null on failure, else the <MessageBlock> at the head of queue.
- */
- public synchronized MessageBlock dequeueHead (TimeValue tv) throws InterruptedException
- {
- MessageBlock result = null;
- if (this.deactivated_)
- return null;
- try
- {
- if (tv == null) // Need to do a blocking wait
- notEmptyCondition_.timedWait ();
- else // Need to do a timed wait
- notEmptyCondition_.timedWait (tv);
- }
- catch (TimeoutException e)
- {
- return null;
- }
-
- // Check again if queue is still active
- if (this.deactivated_)
- return null;
- else
- result = this.dequeueHeadInternal ();
-
- // Tell any blocked threads that the queue has room for an item!
- this.notFullCondition_.broadcast ();
- return result;
- }
-
- /**
- * Check if queue is full.
- *@return true if queue is full, else false.
- */
- public synchronized boolean isFull ()
- {
- return this.isFullInternal ();
- }
-
- /**
- * Check if queue is empty.
- *@return true if queue is empty, else false.
- */
- public synchronized boolean isEmpty ()
- {
- return this.isEmptyInternal ();
- }
-
- /**
- * Get total number of bytes on the queue.
- *@return total number number of bytes on the queue
- */
- public int messageBytes ()
- {
- return this.currentBytes_;
- }
-
- /**
- * Get total number of messages on the queue.
- *@return total number number of messages on the queue
- */
- public int messageCount ()
- {
- return this.currentCount_;
- }
-
- // = Flow control routines
-
- /**
- * Get high watermark.
- *@return high watermark
- */
- public int highWaterMark ()
- {
- return this.highWaterMark_;
- }
-
- /**
- * Set high watermark.
- *@param hwm high watermark
- */
- public void highWaterMark (int hwm)
- {
- this.highWaterMark_ = hwm;
- }
-
- /**
- * Get low watermark.
- *@return low watermark
- */
- public int lowWaterMark ()
- {
- return this.lowWaterMark_;
- }
-
- /**
- * Set low watermark.
- *@param lwm low watermark
- */
- public void lowWaterMark (int lwm)
- {
- this.lowWaterMark_ = lwm;
- }
-
- // = Activation control methods.
-
- /**
- * Deactivate the queue and wakeup all threads waiting on the queue
- * so they can continue. No messages are removed from the queue,
- * however. Any other operations called until the queue is
- * activated again will immediately return -1.
- *@return WAS_INACTIVE if queue was inactive before the call and
- * WAS_ACTIVE if queue was active before the call.
- */
- public synchronized int deactivate ()
- {
- return this.deactivateInternal ();
- }
-
-
- /**
- * Reactivate the queue so that threads can enqueue and dequeue
- * messages again.
- *@return WAS_INACTIVE if queue was inactive before the call and
- * WAS_ACTIVE if queue was active before the call.
- */
- public synchronized int activate ()
- {
- return this.activateInternal ();
- }
-
- protected boolean isEmptyInternal ()
- {
- // Not sure about this one!!!!
- return this.currentBytes_ <= this.lowWaterMark_ && this.currentCount_ <= 0;
- }
-
- protected boolean isFullInternal ()
- {
- return this.currentBytes_ > this.highWaterMark_;
- }
-
- protected int deactivateInternal ()
- {
- int currentStatus =
- this.deactivated_ ? WAS_INACTIVE : WAS_ACTIVE;
-
- this.notFullCondition_.broadcast ();
- this.notEmptyCondition_.broadcast ();
-
- this.deactivated_ = true;
- return currentStatus;
- }
-
- protected int activateInternal ()
- {
- int currentStatus =
- this.deactivated_ ? WAS_INACTIVE : WAS_ACTIVE;
- this.deactivated_ = false;
-
- return currentStatus;
- }
-
- protected int enqueueTailInternal (MessageBlock newItem)
- {
- if (newItem == null)
- return -1;
-
- // List was empty, so build a new one.
- if (this.tail_ == null)
- {
- this.head_ = newItem;
- this.tail_ = newItem;
- newItem.next (null);
- newItem.prev (null);
- }
- // Link at the end.
- else
- {
- newItem.next (null);
- this.tail_.next (newItem);
- newItem.prev (this.tail_);
- this.tail_ = newItem;
- }
-
- if (newItem.msgType() != MessageType.MB_OBJECT)
- {
- // Make sure to count *all* the bytes in a composite message!!!
- for (MessageBlock temp = newItem;
- temp != null;
- temp = temp.cont ())
- this.currentBytes_ += temp.size ();
- }
-
- this.currentCount_++;
- return this.currentCount_;
- }
-
- protected int enqueueHeadInternal (MessageBlock newItem)
- {
- if (newItem == null)
- return -1;
-
- newItem.prev (null);
- newItem.next (this.head_);
-
- if (this.head_ != null)
- this.head_.prev (newItem);
- else
- this.tail_ = newItem;
-
- this.head_ = newItem;
-
- if (newItem.msgType() != MessageType.MB_OBJECT)
- {
- // Make sure to count *all* the bytes in a composite message!!!
- for (MessageBlock temp = newItem;
- temp != null;
- temp = temp.cont ())
- this.currentBytes_ += temp.size ();
- }
-
- this.currentCount_++;
-
- return this.currentCount_;
- }
-
- protected int enqueueInternal (MessageBlock newItem)
- {
- if (newItem == null)
- return -1;
-
- if (this.head_ == null)
- // Check for simple case of an empty queue, where all we need to
- // do is insert <newItem> into the head.
- return this.enqueueHeadInternal (newItem);
- else
- {
- MessageBlock temp;
-
- // Figure out where the new item goes relative to its priority.
-
- for (temp = this.head_;
- temp != null;
- temp = temp.next ())
- {
- if (temp.msgPriority () <= newItem.msgPriority ())
- // Break out when we've located an item that has lower
- // priority that <newItem>.
- break;
- }
-
- if (temp == null)
- // Check for simple case of inserting at the end of the queue,
- // where all we need to do is insert <newItem> after the
- // current tail.
- return this.enqueueTailInternal (newItem);
- else if (temp.prev () == null)
- // Check for simple case of inserting at the beginning of the
- // queue, where all we need to do is insert <newItem> before
- // the current head.
- return this.enqueueHeadInternal (newItem);
- else
- {
- // Insert the message right before the item of equal or lower
- // priority.
- newItem.next (temp);
- newItem.prev (temp.prev ());
- temp.prev ().next (newItem);
- temp.prev (newItem);
- }
- }
-
- if (newItem.msgType() != MessageType.MB_OBJECT)
- {
- // Make sure to count *all* the bytes in a composite message!!!
- for (MessageBlock temp = newItem;
- temp != null;
- temp = temp.cont ())
- this.currentBytes_ += temp.size ();
- }
-
- this.currentCount_++;
- return this.currentCount_;
- }
-
- protected MessageBlock dequeueHeadInternal ()
- {
- MessageBlock firstItem = this.head_;
- this.head_ = this.head_.next ();
-
- if (this.head_ == null)
- this.tail_ = null;
-
- if (firstItem.msgType() != MessageType.MB_OBJECT)
- {
- // Make sure to subtract off all of the bytes associated with this
- // message.
- for (MessageBlock temp = firstItem;
- temp != null;
- temp = temp.cont ())
- this.currentBytes_ -= temp.size ();
- }
-
- this.currentCount_--;
- return firstItem;
- }
-
-
- /** Default high watermark (16 K). */
- public final static int DEFAULT_HWM = 16 * 1024;
-
- /** Default low watermark. */
- public final static int DEFAULT_LWM = 0;
-
- /** Message queue was active before activate() or deactivate(). */
- public final static int WAS_ACTIVE = 1;
-
- /** Message queue was inactive before activate() or deactivate(). */
- public final static int WAS_INACTIVE = 2;
-
- private int highWaterMark_;
- // Greatest number of bytes before blocking.
-
- private int lowWaterMark_;
- // Lowest number of bytes before unblocking occurs.
-
- private boolean deactivated_;
- // Indicates that the queue is inactive.
-
- private int currentBytes_;
- // Current number of bytes in the queue.
-
- private int currentCount_;
- // Current number of messages in the queue.
-
- private MessageBlock head_;
- // Head of Message_Block list.
-
- private MessageBlock tail_;
- // Tail of Message_Block list.
-
- // The Delegated Notification mechanisms.
- private NotFullCondition notFullCondition_ = new NotFullCondition (this);
- private NotEmptyCondition notEmptyCondition_ = new NotEmptyCondition (this);
-
-}
diff --git a/java/src/MessageType.java b/java/src/MessageType.java
deleted file mode 100644
index 62c34455854..00000000000
--- a/java/src/MessageType.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * MessageType.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Message types used by ACE.MessageBlock.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * Defines bit masks used to identify various types of messages.
- *</blockquote>
- *
- *<h2>NOTES</h2>
- *<blockquote>
- * This class is not intended to be instantiable.
- *</blockquote>
- */
-public class MessageType
-{
- // = Data and protocol messages (regular and priority)
- /** regular data */
- public static final int MB_DATA = 0x01;
-
- /** protocol control */
- public static final int MB_PROTO = 0x02;
-
- /** regular data */
- public static final int MB_OBJECT = 0x09;
-
-
- // = Control messages (regular and priority)
- /** line break */
- public static final int MB_BREAK = 0x03;
-
- /** pass file pointer */
- public static final int MB_PASSFP = 0x04;
-
- /** post an event to an event queue */
- public static final int MB_EVENT = 0x05;
-
- /** generate process signal */
- public static final int MB_SIG = 0x06;
-
- /** ioctl; set/get params */
- public static final int MB_IOCTL = 0x07;
-
- /** set various stream head options */
- public static final int MB_SETOPTS = 0x08;
-
-
- // = Control messages (high priority; go to head of queue)
- /** acknowledge ioctl */
- public static final int MB_IOCACK = 0x81;
-
- /** negative ioctl acknowledge */
- public static final int MB_IOCNAK = 0x82;
-
- /** priority proto message */
- public static final int MB_PCPROTO = 0x83;
-
- /** generate process signal */
- public static final int MB_PCSIG = 0x84;
-
- /** generate read notification */
- public static final int MB_READ = 0x85;
-
- /** flush your queues */
- public static final int MB_FLUSH = 0x86;
-
- /** stop transmission immediately */
- public static final int MB_STOP = 0x87;
-
- /** restart transmission after stop */
- public static final int MB_START = 0x88;
-
- /** line disconnect */
- public static final int MB_HANGUP = 0x89;
-
- /** fatal error used to set u.u_error */
- public static final int MB_ERROR = 0x8a;
-
- /** post an event to an event queue */
- public static final int MB_PCEVENT = 0x8b;
-
-
- /** Normal priority messages */
- public static final int MB_NORMAL = 0x00;
-
- /** High priority control messages */
- public static final int MB_PRIORITY = 0x80;
-
- // Default private constructor to avoid instantiation
- private MessageType ()
- {
- }
-}
-
diff --git a/java/src/Module.java b/java/src/Module.java
deleted file mode 100644
index 6eb56bcbf43..00000000000
--- a/java/src/Module.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * Module.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-import JACE.OS.*;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Provides an abstraction for managing a bi-directional flow of
- * messages.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * This is based on the Module concept in System V Streams,
- * which contains a pair of Tasks, one for handling upstream
- * processing, one for handling downstream processing.
- *</blockquote>
- */
-public class Module
-{
- // = Initialization and termination methods.
-
- /**
- * Create an empty Module.
- */
- public Module ()
- {
- // Do nothing...
- this.name ("<unknown>");
- }
-
- /*
- * Create an initialized module.
- *@param modName identity of the module.
- *@param writerQ writer task of the module.
- *@param readerQ reader task of the module.
- *@param flags Module flags
- */
- public Module (String modName,
- Task writerQ,
- Task readerQ,
- Object flags)
- {
- this.open (modName, writerQ, readerQ, flags);
- }
-
- /*
- * Create an initialized module.
- *@param modName identity of the module.
- *@param writerQ writer task of the module.
- *@param readerQ reader task of the module.
- *@param flags Module flags
- */
- public void open (String modName,
- Task writerQ,
- Task readerQ,
- Object arg)
- {
- this.name (modName);
- this.arg_ = arg;
-
- if (writerQ == null)
- writerQ = new ThruTask ();
- if (readerQ == null)
- readerQ = new ThruTask ();
-
- this.reader (readerQ);
- this.writer (writerQ);
-
- // Setup back pointers.
- readerQ.module (this);
- writerQ.module (this);
- }
-
-
- /*
- * Set the writer task.
- *@param q the writer task
- */
- public void writer (Task q)
- {
- this.qPair_[1] = q;
- if (q != null)
- q.flags (ACE.CLR_BITS (q.flags (), TaskFlags.ACE_READER));
- }
-
- /*
- * Set the reader task.
- *@param q the reader task
- */
- public void reader (Task q)
- {
- this.qPair_[0] = q;
- if (q != null)
- q.flags (ACE.SET_BITS (q.flags (), TaskFlags.ACE_READER));
- }
-
- /*
- * Link this Module on top of Module.
- *@param m the module to link this on top of.
- */
- public void link (Module m)
- {
- this.next (m);
- this.writer ().next (m.writer ());
- m.reader ().next (this.reader ());
- }
-
- /*
- * Set and get pointer to sibling Task in Module.
- *@param orig the task to get the sibling for
- *@return the sibling of the task
- */
- public Task sibling (Task orig)
- {
- if (this.qPair_[0] == orig)
- return this.qPair_[1];
- else if (this.qPair_[1] == orig)
- return this.qPair_[0];
- else
- return null;
- }
-
- /*
- * Close down the module and its tasks.
- *@param flags Module flags
- *@return 0 on success, -1 on failure
- */
- public int close (long flags)
- {
- Task readerQ = this.reader ();
- Task writerQ = this.writer ();
- int result = 0;
-
- if (readerQ != null)
- {
- if (readerQ.close (flags) == -1)
- result = -1;
- readerQ.flush (flags);
- readerQ.next (null);
- }
-
- if (writerQ != null)
- {
- if (writerQ.close (flags) == -1)
- result = -1;
- writerQ.flush (flags);
- writerQ.next (null);
- }
-
- return result;
- }
-
- /*
- * Get the argument passed to tasks.
- *@return the argument passed to tasks.
- */
- public Object arg ()
- {
- return this.arg_;
- }
-
- /*
- * Set the argument to be passed to tasks.
- *@param a the argument to be passed to tasks.
- */
- public void arg (Object a)
- {
- this.arg_ = a;
- }
-
- /*
- * Get the name of the module.
- *@return the name of the module.
- */
- public String name ()
- {
- return this.name_;
- }
-
- /*
- * Set the name of the module.
- *@param n the name of the module.
- */
- public void name (String n)
- {
- this.name_ = n;
- }
-
- /*
- * Get the writer task of the module.
- *@return the writer task of the module.
- */
- public Task writer ()
- {
- return this.qPair_[1];
- }
-
- /*
- * Get the reader task of the module.
- *@return the reader task of the module.
- */
- public Task reader ()
- {
- return this.qPair_[0];
- }
-
- /*
- * Get the next pointer to the module above in the stream.
- *@return the next pointer to the module above in the stream.
- */
- public Module next ()
- {
- return this.next_;
- }
-
- /*
- * Set the next pointer to the module above in the stream.
- *@param m the next pointer to the module above in the stream.
- */
- public void next (Module m)
- {
- this.next_ = m;
- }
-
- private Task qPair_[] = new Task[2];
- // Pair of Tasks that form the "read-side" and "write-side" of the
- // ACE_Module partitioning.
-
- private String name_ = null;
- // Name of the ACE_Module.
-
- private Module next_;
- // Next ACE_Module in the stack.
-
- private Object arg_;
- // Argument passed through to the reader and writer task when they
- // are opened.
-
-}
-
diff --git a/java/src/Mutex.java b/java/src/Mutex.java
deleted file mode 100644
index 8daab4ff9eb..00000000000
--- a/java/src/Mutex.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Concurrency
- *
- * = FILENAME
- * Mutex.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Concurrency;
-
-import java.util.*;
-import JACE.ASX.*;
-
-class TimedWaitMAdapter extends TimedWait
-{
- TimedWaitMAdapter (Object obj)
- {
- super (obj);
- }
-
- // Check to see if the lock is currently held or not.
- public boolean condition ()
- {
- return !this.inUse_;
- }
-
- // Acquire/Release the lock
- public void inUse (boolean c)
- {
- this.inUse_ = c;
- }
-
- private boolean inUse_ = false;
- // The actual lock
-}
-
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Value added abstraction for mutex variable creation.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * A timed mutex, <em>i.e.</em> a mutex whose operations do not
- * block forever and can <q>time out</q>.
- *</blockquote>
- */
-public class Mutex
-{
- /**
- * Acquire the mutex. Note that this will block.
- *@exception InterruptedException exception during wait
- */
- public synchronized void acquire () throws InterruptedException
- {
- this.monitor_.timedWait ();
- this.monitor_.inUse (true);
- }
-
- /**
- * Acquire the mutex. Note that the call will return if <timeout>
- * amount of time expires.
- *@param tv amount of time (TimeValue) to wait before returning
- * (unless operation completes before)
- *@exception TimeoutException wait timed out exception
- *@exception InterruptedException exception during wait
- */
- public synchronized void acquire (TimeValue tv) throws
- TimeoutException, InterruptedException
- {
- this.monitor_.timedWait (tv);
- this.monitor_.inUse (true);
- }
-
- /**
- * Release the mutex.
- */
- public synchronized void release ()
- {
- this.monitor_.inUse (false);
- this.monitor_.signal ();
- }
-
- private TimedWaitMAdapter monitor_ = new TimedWaitMAdapter (this);
- // The monitor (adapter) to wait on
-}
diff --git a/java/src/OS.java b/java/src/OS.java
deleted file mode 100644
index c17fd6d07f2..00000000000
--- a/java/src/OS.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.OS
- *
- * = FILENAME
- * OS.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.OS;
-
-import java.util.StringTokenizer;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Methods to extend the capabilities of the Java runtime system.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * This non-instantiable class contains little <q>utility functions</q>
- * that should have been in Java to begin with :-)
- *</blockquote>
- */
-public class OS
-{
- /**
- * Create an array of Strings from a single String using <delim> as
- * the delimiter.
- *@param args the String to break up to make an array of Strings
- *@param delim the delimeter to use to break the String up
- *@return an array containing the original String broken up
- */
- public static String [] createStringArray (String args, String delim)
- {
- // First determine the number of arguments
- int count = 0;
- StringTokenizer tokens = new StringTokenizer (args, delim);
- while (tokens.hasMoreTokens ())
- {
- tokens.nextToken ();
- count++;
- }
- if (count == 0)
- return null;
-
- // Create argument array
- String [] argArray = new String [count];
- int index = 0;
- tokens = new StringTokenizer (args, " ");
- while (tokens.hasMoreTokens ())
- {
- argArray [index] = tokens.nextToken ();
- index++;
- }
-
- // Assert index == count
- if (index != count)
- return null;
- else
- return argArray;
- }
-
- // Default private constructor to avoid instantiation
- private OS ()
- {
- }
-}
diff --git a/java/src/ParseNode.java b/java/src/ParseNode.java
deleted file mode 100644
index b6d2d4957ed..00000000000
--- a/java/src/ParseNode.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ParseNode.java
- *
- * Base class for the data types used in the parse tree for adjusting
- * services. Things like SuspendNode extend this. They help connect
- * CUP/JLex with the service configurator system.
- *
- *@author Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import JACE.ServiceConfigurator.*;
-import JACE.OS.*;
-import java_cup.runtime.*;
-
-public class ParseNode extends java_cup.runtime.symbol
-{
- /**
- * Constructor
- *
- */
- public ParseNode (int number)
- {
- super(number);
-
- this.name_ = new String("Uninitialized");
- }
-
- /**
- * Initialize the service (subclasses
- * may do more than set the name)
- */
- public void init (String name)
- {
- this.name_ = name;
- }
-
- /**
- * Subclasses override to do real work, usually
- * initiating a service or modifying one
- */
- public void apply ()
- {
- // Empty
- }
-
- /**
- * Retrive the service name
- */
- public String name()
- {
- return this.name_;
- }
-
- /**
- * Set the name of the service
- */
- public void name(String newName)
- {
- this.name_ = newName;
- }
-
- String name_;
-};
-
-
-
diff --git a/java/src/ProfileTimer.java b/java/src/ProfileTimer.java
deleted file mode 100644
index b7e9c908a13..00000000000
--- a/java/src/ProfileTimer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Timers
- *
- * = FILENAME
- * ProfileTimer.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Timers;
-
-/**
- * <hr>
- * <p><b>TITLE</b><br>
- * A Java wrapper for interval timers.
- */
-public class ProfileTimer
-{
- /**
- * Start the timer.
- */
- public void start ()
- {
- this.startTime_ = java.lang.System.currentTimeMillis ();
- }
-
- /**
- * Stop the timer.
- */
- public void stop ()
- {
- this.stopTime_ = java.lang.System.currentTimeMillis ();
- }
-
- /**
- * Determine elapsed time between start and stop.
- *@return Total elapsed time (stop - start).
- */
- public long elapsedTime ()
- {
- return this.stopTime_ - this.startTime_;
- }
-
- private long startTime_;
- private long stopTime_;
-}
diff --git a/java/src/RWMutex.java b/java/src/RWMutex.java
deleted file mode 100644
index 1161d9a8618..00000000000
--- a/java/src/RWMutex.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Concurrency
- *
- * = FILENAME
- * RWMutex.java
- *
- *@author Ross Dargahi (rossd@krinfo.com), Prashant Jain, and Irfan Pyarali
- *
- *************************************************/
-
-package JACE.Concurrency;
-
-import JACE.OS.*;
-
-/*******************************************************************************
-* <HR>
-* <B> Description </B>
-* <BR>
-* This class increments a read/write lock. A read/write lock allows multiple
-* readers or a single writer to access the guarded element.
-* This implementation is based on the C++ version of ACE.
-* </PRE><P><HR>
-* <B> Notes </B>
-* <UL>
-* <LI> This class does not support recursive semantics
-* </UL>
-*******************************************************************************/
-public class RWMutex
-{
- /**
- * Acquires the write lock
- * @exception InterruptedException Lock acquisition interrupted
- **/
- public void acquire()
- throws InterruptedException
- {
- acquireWrite();
- }
-
- /**
- * Acquires the read lock
- * @exception InterruptedException Lock acquisition interrupted
- **/
- public void acquireRead()
- throws InterruptedException
- {
- // make sure we start with no exception
- InterruptedException exception_ = null;
-
- // grab lock
- lock_.acquire ();
-
- // Give preference to writers who are waiting.
- while (referenceCount_ < 0 || numberOfWaitingWriters_ > 0)
- {
- numberOfWaitingReaders_++;
- try
- {
- waitingReaders_.Wait ();
- }
- catch (InterruptedException exception)
- {
- // cache exception
- exception_ = exception;
- }
- numberOfWaitingReaders_--;
- }
-
- if (exception_ == null)
- // No errors
- referenceCount_++;
-
- // make sure this is released in all cases
- lock_.release ();
-
- if (exception_ != null)
- // error: propogate
- throw exception_;
- }
-
- /**
- * Acquires the write lock
- * @exception InterruptedException Lock acquisition interrupted
- **/
- public void acquireWrite()
- throws InterruptedException
- {
- // make sure we start with no exception
- InterruptedException exception_ = null;
-
- // grab lock
- lock_.acquire ();
-
- // Give preference to writers who are waiting.
- while (referenceCount_ != 0)
- {
- numberOfWaitingWriters_++;
- try
- {
- waitingWriters_.Wait ();
- }
- catch (InterruptedException exception)
- {
- // cache exception
- exception_ = exception;
- }
- numberOfWaitingWriters_--;
- }
-
- if (exception_ == null)
- // No errors
- referenceCount_ = -1;
-
- // make sure this is released in all cases
- lock_.release ();
-
- if (exception_ != null)
- // error: propogate
- throw exception_;
- }
-
- /**
- * Release held lock
- * @exception InterruptedException Lock acquisition interrupted
- **/
- public void release()
- throws InterruptedException
- {
- lock_.acquire ();
-
- // Releasing a reader.
- if (referenceCount_ > 0)
- referenceCount_--;
- else
- // Releasing a writer.
- if (referenceCount_ == -1)
- referenceCount_ = 0;
-
- // Give preference to writers over readers...
- if (numberOfWaitingWriters_ > 0)
- {
- waitingWriters_.signal ();
- }
- else if (numberOfWaitingReaders_ > 0)
- {
- waitingReaders_.broadcast ();
- }
-
-
- lock_.release ();
- }
-
- private Mutex lock_ = new Mutex ();
- // Serialize access to internal state.
-
- private Condition waitingReaders_ = new Condition (lock_);
- // Reader threads waiting to acquire the lock.
-
- private int numberOfWaitingReaders_;
- // Number of waiting readers.
-
- private Condition waitingWriters_ = new Condition (lock_);
- // Writer threads waiting to acquire the lock.
-
- private int numberOfWaitingWriters_ = 0;
- // Number of waiting writers.
-
- private int referenceCount_ = 0;
- // Value is -1 if writer has the lock, else this keeps track of the
- // number of readers holding the lock.
-}
-
diff --git a/java/src/Readme b/java/src/Readme
deleted file mode 100644
index 73220d55de4..00000000000
--- a/java/src/Readme
+++ /dev/null
@@ -1,17 +0,0 @@
-Make sure to update the environment variable CLASSPATH to include the
-path to where java/classes/ is located. The Java compiler uses this to
-find classes when resolving dependencies.
-
-The Makefile has been worked over severely, and it now REQUIRES GNU
-Make. The makefile is still a little rough, and will definitely
-evolve.
-
-Suggestions are welcome at cleeland@cs.wustl.edu or pjain@cs.wustl.edu.
-
-Also, TimeValue moved from the ACE.Reactor to ACE.ASX package to break
-up some circular dependency problems.
-
-The documentation for Java ACE has not been included in the release
-but can be automatically generated by typing "make doc" in the src
-directory. Note that the gif images needed by the documentaion ARE
-included in the release.
diff --git a/java/src/RemoveNode.java b/java/src/RemoveNode.java
deleted file mode 100644
index d93a0911054..00000000000
--- a/java/src/RemoveNode.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * RemoveNode.java
- *
- * Used when a service is specified to be removed based on a line
- * in a service configurator file. Note: Make sure to call the
- * prepareToReload method in ServiceConfig before reloading the
- * service that is being removed.
- *
- *@author Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import JACE.ServiceConfigurator.*;
-import JACE.OS.*;
-import java_cup.runtime.*;
-
-class RemoveNode extends ParseNode
-{
- public RemoveNode (int act_num)
- {
- super(act_num);
- }
-
- public void apply ()
- {
- ACE.DEBUG("RemoveNode apply");
-
- if (JACE.ServiceConfigurator.ServiceConfig.remove(this.name_) == -1)
- ACE.ERROR("Error removing " + this.name_);
- }
-};
diff --git a/java/src/ResumeNode.java b/java/src/ResumeNode.java
deleted file mode 100644
index 00d42a2994a..00000000000
--- a/java/src/ResumeNode.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ResumeNode.java
- *
- * Used when a service is specified to be resumed based on a line
- * in a service configurator file. The actual implementation of the
- * service being resumed does the work.
- *
- *@author Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import JACE.ServiceConfigurator.*;
-import JACE.OS.*;
-import java_cup.runtime.*;
-
-class ResumeNode extends ParseNode
-{
- public ResumeNode (int act_num)
- {
- super(act_num);
- }
-
- public void apply ()
- {
- ACE.DEBUG("ResumeNode apply: " + this.name_);
-
- if (JACE.ServiceConfigurator.ServiceConfig.resume(this.name_) == -1)
- ACE.ERROR("Error resuming " + this.name_);
- }
-};
diff --git a/java/src/SOCKAcceptor.java b/java/src/SOCKAcceptor.java
deleted file mode 100644
index aaca725426a..00000000000
--- a/java/src/SOCKAcceptor.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.SOCK_SAP
- *
- * = FILENAME
- * SOCKAcceptor.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.SOCK_SAP;
-
-import java.io.*;
-import java.net.*;
-import JACE.OS.*;
-
-/**
- * <hr>
- * <p><b>TITLE</b><br>
- * Defines the format and interface for an ACE.SOCKAcceptor.
- */
-public class SOCKAcceptor
-{
- // = Initialization
-
- /**
- * Create a SOCKAcceptor. Do nothing constructor. Allows user to
- * call open() later and pass in the port number.
- */
- public SOCKAcceptor ()
- {
- }
-
- /**
- * Create a SOCKAcceptor.
- *@param port port number where the server will listen for connections
- */
- public SOCKAcceptor (int port) throws IOException
- {
- this.open (port);
- }
-
- /**
- * Create socket to listen for connections on.
- *@param port port number where the server will listen for connections
- */
- public void open(int port) throws IOException
- {
- // Close old socket (if there is one)
- this.close ();
-
- // Create a new server socket
- this.listenSocket_ = new ServerSocket (port);
- // ACE.DEBUG ("Server listening on port " + port);
- }
-
- /**
- * Close the socket and do any necessary cleanup.
- */
- public void close () throws IOException
- {
- if (this.listenSocket_ != null)
- {
- this.listenSocket_.close ();
- this.listenSocket_ = null;
- }
- }
-
- /**
- * Accept a connection. The streams are set when the method returns.
- *@param sockStream SOCK Stream to use for the connection
- */
- public void accept (SOCKStream sockStream) throws SocketException, IOException
- {
- // Block in accept. Returns when a connection shows up and sets
- // the streams
- sockStream.socket (this.listenSocket_.accept ());
- ACE.DEBUG ("Accepted connection from " +
- sockStream.socket ().getInetAddress ());
- }
-
- /**
- * Get the underlying listen socket.
- *@return the underlying listen socket
- */
- public ServerSocket listenSocket ()
- {
- return this.listenSocket_;
- }
-
- /**
- * Set the underlying listen socket.
- *@param s the underlying listen socket
- */
- public void listenSocket (ServerSocket s)
- {
- this.listenSocket_ = s;
- }
-
- /**
- * Clean up when the garbage collector gets run (if at all). Note
- * that there is no guarantee that finalize () will get called.
- */
- protected void finalize () throws Throwable
- {
- super.finalize ();
- this.close ();
- }
-
- // Socket on which listen for connections (by default initialized to
- // null)
- private ServerSocket listenSocket_;
-}
diff --git a/java/src/SOCKConnector.java b/java/src/SOCKConnector.java
deleted file mode 100644
index 98dfcaf6b3d..00000000000
--- a/java/src/SOCKConnector.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.SOCK_SAP
- *
- * = FILENAME
- * SOCKConnector.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.SOCK_SAP;
-
-import java.io.*;
-import java.net.*;
-import JACE.OS.*;
-
-/**
- * <hr>
- * <p><b>TITLE</b><br>
- * Defines an active connection factory for the socket wrappers.
- */
-public class SOCKConnector
-{
- // = Initialization
-
- /**
- * Create a SOCKConnector. Do nothing constructor. Allows user to
- * call connect() later.
- */
- public SOCKConnector ()
- {
- // Do nothing constructor
- }
-
- /**
- * Create a SOCKConnector and connect to the server.
- *@param sockStream SOCK Stream to use for the connection
- *@param hostname hostname of the server
- *@param port port number to connect with server at
- */
- public SOCKConnector (SOCKStream sockStream,
- String hostname,
- int port) throws SocketException, IOException
- {
- this.connect (sockStream,
- hostname,
- port);
- }
-
- /**
- * Connect to the server.
- *@param sockStream SOCK Stream to use for the connection
- *@param hostname hostname of the server
- *@param port port number to connect with server at
- */
- public void connect (SOCKStream sockStream,
- String hostname,
- int port) throws SocketException, IOException
- {
- sockStream.socket (new Socket (hostname, port));
- }
-
- /**
- * Connect to the server.
- *@param sockStream SOCK Stream to use for the connection
- *@param addr INETAddr instance specifying host/port
- */
- public void connect (SOCKStream sockStream,
- INETAddr addr) throws SocketException, IOException
- {
- sockStream.socket (new Socket (addr.getHostName(),
- addr.getPortNumber()));
- }
-}
diff --git a/java/src/SOCKStream.java b/java/src/SOCKStream.java
deleted file mode 100644
index 638482d8e40..00000000000
--- a/java/src/SOCKStream.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.SOCK_SAP
- *
- * = FILENAME
- * SOCKStream.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.SOCK_SAP;
-
-import java.io.*;
-import java.net.*;
-import JACE.OS.*;
-
-/**
- * <hr>
- * <p><b>TITLE</b><br>
- * Defines the methods in the ACE.SOCKStream abstraction.
- *
- * <p><b>DESCRIPTION</b><br>
- * This adds additional wrapper methods atop the java Socket class.
- */
-public class SOCKStream
-{
- /**
- * Create a default SOCK Stream. Do nothing constructor.
- */
- public SOCKStream ()
- {
- }
-
- /**
- * Create a SOCK Stream.
- *@param s Socket to initialize SOCK Stream with.
- */
- public SOCKStream (Socket s) throws IOException
- {
- this.socket (s);
- }
-
- /**
- * Set the socket and the underlying streams.
- *@param s Socket associated with the SOCK Stream.
- */
- public void socket (Socket s) throws IOException
- {
- this.socket_ = s;
- // Note that if s is not a valid socket or is null, the
- // following calls will throw exceptions
-
- // Create buffered, platform independent byte streams. This hasn't been switched
- // to the newer character streams since the change would break cross talk with
- // non-Java sockets.
-
- this.iStream_ = new DataInputStream(new BufferedInputStream(s.getInputStream()));
-
- this.oStream_ = new PrintStream(new DataOutputStream(new BufferedOutputStream(s.getOutputStream())));
- }
-
- /* Get the underlying Socket.
- *@return the underlying socket
- */
- public Socket socket ()
- {
- return this.socket_;
- }
-
- /**
- * Close the streams and the underlying socket.
- */
- public void close () throws IOException
- {
- if (this.socket_ != null)
- this.socket_.close ();
- this.socket_ = null;
- }
-
- // = The following send and recv methods are overloaded to provide a
- // flexible interface
-
- /**
- * Send a StringBuffer. Note that the method blocks.
- *@param s the StringBuffer to send
- *@return the length of the StringBuffer
- */
- public int send (StringBuffer s) throws IOException
- {
- // Get the data out
- String buf = s.toString ();
-
- this.oStream_.println(buf);
- this.oStream_.flush ();
-
- return buf.length ();
- }
-
- /**
- * Send a String. Note that the method blocks.
- *@param s the String to send
- *@return the length of the String
- */
- public int send (String s) throws IOException
- {
- this.oStream_.println(s);
- this.oStream_.flush();
-
- return s.length ();
- }
-
- /**
- * Send an array of bytes. Note that the method blocks.
- *@param b array of bytes to send
- *@param offset offset into the byte array to start sending from
- *@param length number of bytes to send
- *@return number of bytes sent
- */
- public int sendN (byte[] b, int offset, int length) throws IOException
- {
- this.oStream_.write (b, offset, length);
- this.oStream_.flush ();
- return length;
- }
-
- /**
- * Receive data and append it to the StringBuffer that was passed
- * in. Note that the method blocks.
- *@param s the StringBuffer to append the result of the recv to
- *@return the length of the String received
- */
- public int recv (StringBuffer s) throws IOException
- {
- String temp = this.iStream_.readLine ();
- s.append (temp);
-
- if (temp == null) // Possible if user sends just a line feed, but
- return -1; // not checking would cause a null ptr exception
- else
- return temp.length ();
- }
-
- /**
- * Receive an array of characters. This method blocks until either
- * all the bytes are read, the end of the stream is detected, or
- * an exception is thrown.
- *@param b byte array to receive the data in
- *@param offset the start offset of the data in the byte array.
- *@param n number of bytes to receive
- *@return n
- */
- public int recvN (byte[] b, int offset, int n) throws IOException
- {
- this.iStream_.readFully (b, offset, n);
- return n;
- }
-
- /**
- * Set the underlying input stream.
- *@param iStream the input stream
- */
- public void inputStream (InputStream iStream)
- {
- this.iStream_ = new DataInputStream(new BufferedInputStream(iStream));
- }
-
- /**
- * Get the underlying input stream.
- *@return the underlying input stream
- */
- public InputStream inputStream ()
- {
- return this.iStream_;
- }
-
- /**
- * Set the underlying output stream.
- *@param iStream the output stream
- */
- public void outputStream (OutputStream oStream)
- {
- this.oStream_ = new PrintStream(new DataOutputStream(new BufferedOutputStream(oStream)));
- }
-
- /**
- * Get the underlying output stream.
- *@return the underlying output stream
- */
- public OutputStream outputStream ()
- {
- return this.oStream_;
- }
-
- /**
- * Cleanup when the SOCK Stream is garbage collected.
- */
- protected void finalize () throws Throwable
- {
- super.finalize ();
- this.close ();
- }
-
- private Socket socket_;
-
- // = The input and output streams (by default null)
- private DataInputStream iStream_;
- private PrintStream oStream_;
-}
diff --git a/java/src/Semaphore.java b/java/src/Semaphore.java
deleted file mode 100644
index 4762712d722..00000000000
--- a/java/src/Semaphore.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Concurrency
- *
- * = FILENAME
- * Semaphore.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Concurrency;
-
-import java.util.*;
-import JACE.ASX.*;
-
-class TimedWaitSAdapter extends JACE.ASX.TimedWait
-{
- TimedWaitSAdapter (Object obj)
- {
- super (obj);
- }
-
- // Check to see if there are any semaphores available.
- public boolean condition ()
- {
- return this.count_ > 0;
- }
-
- // Increment the count by one
- public void increment ()
- {
- this.count_++;
- }
-
- // Decrement the count by one
- public void decrement ()
- {
- this.count_--;
- }
-
- // Set the count
- public void count (int c)
- {
- this.count_ = c;
- }
-
- private int count_ = 0;
-}
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- * Implementation of Dijkstra's counting semaphore in java.
- */
-public class Semaphore
-{
- /**
- * Create a Semaphore.
- *@param count semaphore count
- */
- public Semaphore (int c)
- {
- this.monitor_.count (c);
- }
-
- /**
- * Acquire the Semaphore. Note that this will block.
- *@exception InterruptedException exception during wait
- */
- public synchronized void acquire () throws InterruptedException
- {
- this.monitor_.timedWait ();
- this.monitor_.decrement ();
- }
-
- /**
- * Acquire the Semaphore. Note that the call will return if <timeout>
- * amount of time expires.
- *@param tv amount of time (TimeValue) to wait before returning
- * (unless operation completes before)
- *@exception TimeoutException wait timed out exception
- *@exception InterruptedException exception during wait
- */
- public synchronized void acquire (TimeValue tv)
- throws JACE.ASX.TimeoutException, InterruptedException
- {
- this.monitor_.timedWait (tv);
- this.monitor_.decrement ();
- }
-
- /**
- * Release the Semaphore.
- */
- public synchronized void release ()
- {
- this.monitor_.increment ();
- this.monitor_.signal ();
- }
-
- private TimedWaitSAdapter monitor_ = new TimedWaitSAdapter (this);
- // The monitor (adapter) to wait on
-}
diff --git a/java/src/ServiceConfig.java b/java/src/ServiceConfig.java
deleted file mode 100644
index 69fc8cf566e..00000000000
--- a/java/src/ServiceConfig.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ServiceConfig.java
- *
- * Services can be suspended, resumed, removed, and reloaded. Reloading requires that
- * the user calls a prepareForReload method after removing a service. You can't access
- * the ServiceObjects that are loaded directly -- anything loaded with a class loader
- * must be wrapped and have its methods called via reflection. This is because a
- * loaded class doesn't exist in the same space as one loaded with the system loader.
- *
- *
- *
- *@author Prashant Jain, Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import java.util.*;
-import java.net.*;
-import java.lang.*;
-import JACE.OS.*;
-import JACE.Misc.*;
-
-/**
- * <hr>
- * <p><b>TITLE</b><br>
- * Provide the base class that supplies common server daemon
- * operations. Also provides a global point for interacting with
- * the service repository.
- */
-public class ServiceConfig
-{
- /** Begins the process of loading a service configurator file:
- * parses the command line and calls either loadOldConfigFile or
- * processDirectives depending on whether or not the user wants
- * to try to load a C++ svc.conf file.
- */
- public static int open (String [] args) throws FileNotFoundException, IOException, ClassNotFoundException, IllegalAccessException, InstantiationException
- {
- // Parse the command line
- ServiceConfig.parseArgs (args);
-
- // Create a repository and class loader
- if (ServiceConfig.svcRep_ == null)
- ServiceConfig.svcRep_ = new ServiceRepository ();
- if (ServiceConfig.loader_ == null)
- ServiceConfig.loader_ = new ServiceLoader();
-
- if (ServiceConfig.oldConfigFormat_)
- return ServiceConfig.loadOldConfigFile();
- else
- return ServiceConfig.processDirectives ();
-
- }
-
- /** Parses the command line
- * Valid command line options:
- * -b Run as a daemon (not implemented yet)
- * -d Debug mode
- * -n No defaults
- * -o Attempt to load a C++ ACE service config file
- * -f <filename> Load services in the given file [see below for info]
- *
- */
- protected static void parseArgs (String [] args)
- {
- GetOpt getopt = new GetOpt (args, "bdnf:o:");
- for (int c; (c = getopt.next ()) != -1; )
- switch (c)
- {
- case 'b':
- // Note: not supported yet!
- ServiceConfig.beADaemon_ = true;
- break;
- case 'd':
- ServiceConfig.debug_ = true;
- break;
- case 'n':
- ServiceConfig.noDefaults_ = true;
- break;
- case 'o':
- ServiceConfig.oldConfigFormat_ = true;
- break;
- case 'f':
- ServiceConfig.serviceConfigFile_ = getopt.optarg ();
- break;
- default:
- ACE.ERROR ((char ) c + " is not a ServiceConfig option");
- break;
- }
- }
-
- /** Called by ParseNode subclass
- * Asks the Service Repository to spend a service
- */
- public static int suspend (String name)
- {
- return svcRep_.suspend(name);
- }
-
- /** Called by ParseNode subclass
- * Asks the Service Repository to resume a service
- */
- public static int resume (String name)
- {
- return svcRep_.resume(name);
- }
-
- /** Called by ParseNode subclass
- * Asks the Service Repository to remove a serivce
- */
- public static int remove (String name)
- {
- return svcRep_.remove(name);
- }
-
- /** Should be called before the user wants to reload
- * a service. This calls garbage collection to
- * (hopefully) obliterate the names of any unused
- * service classes, and creates a new instance
- * of the ClassLoader so there won't be problems
- * reloading.
- */
- public static void prepareForReload()
- {
- ServiceConfig.loader_ = new ServiceLoader();
-
- System.gc();
-
- }
-
- /**
- * Parse a service configurator file, creating classes as necessary
- *
- * This is getting too complicated -- since CUP and JLex are available, it would be nice to
- * develop a grammar for this. Unfortunately, there may be file problems when trying to get
- * CUP and JLex to produce more than one parser per program.
- *
- * Current formats:
- *
- * load <Service Name> <Full Class Name> Service_Object "<argument list>"
- *
- * resume <Service Name>
- * suspend <Service Name>
- * remove <Service Name>
- *
- */
- protected static int processDirectives () throws FileNotFoundException, IOException, ClassNotFoundException, IllegalAccessException, InstantiationException
- {
- if (ServiceConfig.serviceConfigFile_ == null)
- ServiceConfig.serviceConfigFile_ = "svc.conf";
-
- ACE.DEBUG("Processing directives in file " + ServiceConfig.serviceConfigFile_);
-
- File configFile = new File (ServiceConfig.serviceConfigFile_);
-
- // Check if file exists and is a normal file
- if (!configFile.exists () || !configFile.isFile ())
- throw new FileNotFoundException ("File " + ServiceConfig.serviceConfigFile_ + " not found");
-
- // Check if the file is readable
- if (!configFile.canRead ())
- throw new IOException ("File " + ServiceConfig.serviceConfigFile_ + " not readable");
-
- // Set up the stream
- FileInputStream fileIn = new FileInputStream (configFile);
-
- // Parse the file
- StreamTokenizer in = new StreamTokenizer (fileIn);
-
- // Set '#' as comment character to be ignored and set '/' as
- // ordinary character (was original comment character)
- // in.commentChar ('#');
- in.ordinaryChar ('/');
-
- // Set characters in ASCII range 33 to 47, ASCII range 91 to 96,
- // and ASCII range 123 to 126 as ordinary characters
- in.wordChars ('!', '/'); // ASCII range 33 to 47
- in.wordChars (':', '@'); // ASCII range 58 to 64
- in.wordChars ('[', '`'); // ASCII range 91 to 96
- in.wordChars ('{', '~'); // ASCII range 123 to 126
-
- String commandName = null;
- String serviceName = null;
- String className = null;
- String classType = null;
- String args = null;
- // Create a state machine
- int state = ServiceConfig.COMMAND_NAME;
-
- // The apply() method on ParseNode starts the process of actually executing the
- // desired action (suspend, load, etc)
- ParseNode result = null;
-
- while (in.nextToken () != StreamTokenizer.TT_EOF)
- {
- switch (state)
- {
- case ServiceConfig.COMMAND_NAME:
- if (in.ttype == StreamTokenizer.TT_WORD) {
- commandName = in.sval;
-
- // This is a hack, but it should work until CUP is easier
- // to deal with when multiple parsers are needed
- if (commandName.equals("load"))
- result = new AddServiceObjectNode(0);
- else
- if (commandName.equals("remove"))
- result = new RemoveNode(0);
- else
- if (commandName.equals("suspend"))
- result = new SuspendNode(0);
- else
- if (commandName.equals("resume"))
- result = new ResumeNode(0);
- else
- throw new IOException ("COMMAND NAME missing or invalid: " + commandName);
-
- ACE.DEBUG("Command node type: " + ((Object)result).getClass().getName());
-
-
- } else
- throw new IOException ("Illegal COMMAND NAME argument in file " + ServiceConfig.serviceConfigFile_);
- state = ServiceConfig.SERVICE_NAME;
- break;
- case ServiceConfig.SERVICE_NAME:
- if (in.ttype == StreamTokenizer.TT_WORD)
- serviceName = in.sval;
- else
- throw new IOException ("Illegal SERVICE NAME argument in file " + ServiceConfig.serviceConfigFile_);
-
-
- if (!commandName.equals("load")) {
- result.init(serviceName);
- result.apply();
- in.whitespaceChars (' ', ' ');
- state = ServiceConfig.SERVICE_NAME;
- } else
- state = ServiceConfig.CLASS_NAME;
- break;
- case ServiceConfig.CLASS_NAME:
- if (in.ttype == StreamTokenizer.TT_WORD)
- className = in.sval;
- else
- throw new IOException ("Illegal CLASS NAME argument in file " + ServiceConfig.serviceConfigFile_);
- state = ServiceConfig.CLASS_TYPE;
- break;
- case ServiceConfig.CLASS_TYPE:
- if (in.ttype == StreamTokenizer.TT_WORD)
- classType = in.sval;
- else
- throw new IOException ("Illegal CLASS TYPE argument in file " + ServiceConfig.serviceConfigFile_);
- state = ServiceConfig.ARGS;
- // Set space to be an ordinary character to allow
- // arguments to be parsed in
- in.wordChars (' ', ' ');
- break;
- case ServiceConfig.ARGS:
- ACE.DEBUG("Processing arguments");
-
- args = new String("");
-
- if (in.ttype == StreamTokenizer.TT_WORD)
- {
- args = in.sval;
-
- // If just two double quotes, there are no args
- if (args.length() == 2) {
- args = new String("");
- } else
- args = args.substring(1, args.length() - 1);
- }
-
- // Quick hack until more parsing necessary -- set the needed data
- ((AddServiceObjectNode)result).init(serviceName, className, false);
- ((AddServiceObjectNode)result).params(args);
-
- result.apply();
-
- state = ServiceConfig.SERVICE_NAME;
- // Set space back to whitespace-character to extract the
- // next token
- in.whitespaceChars (' ', ' ');
- break;
- default:
- throw new IOException ("Illegal argument in file " + ServiceConfig.serviceConfigFile_);
- }
- }
- return 0;
- }
-
- /** Parses the svc.conf file, treating it as a C++ ACE svc.conf file.
- * This will involve attempts to infer the class name from
- * the service initializer path, and isn't very accurate.
- */
- public static int loadOldConfigFile ()
- {
- parser ps = new parser();
-
- try {
-
- ps.parse();
-
- } catch (Exception e) {
- ACE.ERROR("Error: " + e);
- return -1;
- }
-
- return 0;
- }
-
-
- /**
- * This is called when apply() is called on AddServiceObjectNodes. Similar
- * methods could be developed for later data types (AddStreamNode, etc). This
- * tries to load the ServiceObject and its classes. When trying to find info
- * from the C++ files, this generates possible file paths.
- */
- public static int initialize (AddServiceObjectNode son)
- {
- Class c = null;
-
- if (ServiceConfig.oldConfigFormat_) {
-
- // Generate a lot of possible file locations and names
- ClassNameGenerator cng = new ClassNameGenerator(son.locator());
- String attempt = null;
- boolean ready = false;
-
-
- // Try to load the class based on the names we can infer from
- // the C++ svc.conf line
- while ((cng.hasMoreElements()) && (!ready)) {
- try {
-
- attempt = (String)cng.nextElement();
-
- c = loader_.loadClass(attempt, true);
-
- ready = true;
-
- } catch (ClassNotFoundException e) { }
-
- }
-
- // Couldn't find the class
- if (!ready) {
- ACE.ERROR("Can't find class with locator: " + son.locator());
- return -1;
- }
-
- } else {
-
- try {
-
- c = loader_.loadClass(son.locator(), true);
-
- } catch (ClassNotFoundException e) {
- ACE.ERROR("Can't find class with locator: " + son.locator());
- return 01;
- }
-
- }
-
- try {
-
- Object service = c.newInstance();
- // Can't cast this to a ServiceObject, even though it will look just
- // like one -- Java puts things loaded with a non-standard class loader
- // in their own name space. The ServiceObjectRecord is a wrapper that
- // gets around this by using reflection.
- ServiceObjectRecord svcObjRec = new ServiceObjectRecord(service, son.name());
-
- // Split the argument array up into smaller pieces
- String [] argArray = OS.createStringArray (son.params(), " ");
-
- // Initialize the service -- start it running
- svcObjRec.init(argArray);
-
- // Put it in the service repository
- svcRep_.insert((ServiceRecord)svcObjRec);
-
- } catch (IllegalAccessException e) {
- ACE.ERROR("Error " + e);
- return -1;
- } catch (InstantiationException e) {
- ACE.ERROR("Error " + e);
- return -1;
- }
-
- return 0;
- }
-
- // Set by command line options
- private static boolean oldConfigFormat_ = false;
- private static boolean beADaemon_ = false;
- private static boolean debug_ = false;
- private static boolean noDefaults_ = false;
-
- public static String serviceConfigFile_ = "svc.conf";
-
- private static ServiceRepository svcRep_ = null;
- private static ServiceLoader loader_ = null;
-
- // States for the state-machine used in parsing the config file
- private final static int SERVICE_NAME = 0;
- private final static int CLASS_NAME = 1;
- private final static int CLASS_TYPE = 2;
- private final static int ARGS = 3;
- private final static int COMMAND_NAME = 4;
-
-
-}
-
-
-
diff --git a/java/src/ServiceLoader.java b/java/src/ServiceLoader.java
deleted file mode 100644
index c9b201c72a8..00000000000
--- a/java/src/ServiceLoader.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ServiceLoader.java
- *
- * Implementation of a ClassLoader
- *
- *@author Prashant Jain, Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import java.util.*;
-import java.net.*;
-import java.lang.*;
-import JACE.OS.*;
-import JACE.Misc.*;
-
-public class ServiceLoader extends ClassLoader
-{
- /**
- * Constructor
- */
- public ServiceLoader ()
- {
- super ();
- this.getClassPath ();
- }
-
- /**
- * Searches the class path for a given file
- *
- *@param filename File name to look for
- *@return Returns the absolute path to the file
- * (useful for package name)
- */
- public String findFileInClasspath (String filename)
- {
- // Checks for the given name across the classpath
- StringTokenizer tokens = new StringTokenizer (this.classPath_,
- this.pathSeparator_);
-
- while (tokens.hasMoreTokens())
- {
- String fn = tokens.nextToken() + this.fileSeparator_ + filename;
-
- File f = new File (fn);
-
- if (f.exists() && f.isFile() && f.canRead())
- return new String(f.getAbsolutePath());
- }
-
- return null;
- }
-
- /**
- * Load a class from across the network
- */
- public Class loadClass (URL url, boolean resolve) throws ClassNotFoundException
- {
- Class newClass = null;
- // Try to load it the class by reading in the bytes.
- // Note that we are not catching ClassNotFoundException here
- // since our caller will catch it.
- try
- {
- URLConnection urlConnection = url.openConnection ();
-
- // Get the input stream associated with the URL connection and
- // pipe it to a newly created DataInputStream
- DataInputStream i = new DataInputStream (urlConnection.getInputStream ());
-
- // Allocate a buffer big enough to hold the contents of the
- // data we are about to read
- byte [] buf = new byte [urlConnection.getContentLength ()];
-
- // Now read all the data into the buffer
- i.readFully (buf);
-
- newClass = defineClass (buf, 0, buf.length);
- // ACE.DEBUG ("Loaded class: "+ name);
-
- // Check if we need to load other classes referred to by this class.
- if (resolve)
- resolveClass (newClass);
- }
- catch (IOException e)
- {
- throw new ClassNotFoundException (e.toString ());
- }
- return newClass;
- }
-
-
- /**
- * Load a class file:
- *
- * @param fn A file name WITHOUT the .class extension
- * @param resolve Standard resolve flag -- user should set to true
- *
- * @return A Class file capable of creating quasi-useful instances
- * of the loaded class. They can't exist in the normal
- * Java space, though, so it's impossible to cast them
- * to something useful. Use a wrapper and reflection
- * as in ServiceRecords.
- */
- public Class loadClass (String fn, boolean resolve) throws ClassNotFoundException
- {
- Class newClass;
-
- // Load built-in java classes with the system loader
- if (fn.startsWith("java")) {
- newClass = findSystemClass(fn);
- if (newClass == null)
- throw (new ClassNotFoundException());
- else
- return newClass;
- }
-
- // If given a dot separated qualified name, put it in OS path format.
- // This assumes the file separator is one char
- String str = new String(fn);
- if (str.indexOf('.') >= 0)
- str = str.replace('.', this.fileSeparator_.charAt(0));
- str = str + ".class";
-
- // Search the class path for the given file name
- String fullname = this.findFileInClasspath(str);
- if (fullname == null) {
-
- // If we can't find the class file, see if the
- // system can
- if ((newClass = findSystemClass(fn)) != null) {
- return newClass;
- } else
- throw (new ClassNotFoundException());
- }
-
- try
- {
- // Try to load it the class by reading in the bytes.
- // Note that we are not catching ClassNotFoundException here
- // since our caller will catch it.
- try
- {
- byte[] buf = bytesForClass (fullname);
-
- // ***** Note *****
- // This looks inside the class file and digs up the true
- // fully qualified class name. You need this to
- // load the class!
- String className = ClassReader.getClassName(fullname);
-
- if (className != null) {
- ACE.DEBUG("Defining class with name: " + className);
- newClass = defineClass (className, buf, 0, buf.length);
- } else {
- // Try it anyway
- newClass = defineClass (null, buf, 0, buf.length);
-
- ACE.ERROR("Unknown class name");
- }
-
- // Check if we need to load other classes referred to by this class.
- if (resolve)
- resolveClass (newClass);
-
- } catch (ClassNotFoundException e) {
-
- ACE.DEBUG ("Using default loader for class: " + fn);
-
- if ((newClass = findSystemClass (fn)) != null)
- return newClass;
- else
- throw (e); // Rethrow the exception
- }
- }
- catch (IOException e)
- {
- throw new ClassNotFoundException (e.toString ());
- }
-
- return newClass;
- }
-
- /**
- * Get system properties for later use
- */
- private void getClassPath ()
- {
- // Cache system properties that are needed when trying to find a
- // class file
- this.classPath_ = System.getProperty ("java.class.path", ".");
- this.pathSeparator_ = System.getProperty ("path.separator", ":");
- this.fileSeparator_ = System.getProperty ("file.separator", "/");
- }
-
- /**
- * Read file into a byte array
- */
- private byte[] bytesForClass (String name) throws IOException, ClassNotFoundException
- {
- // Set up the stream
- FileInputStream in = new FileInputStream (name);
-
- // Get byte count
- int length = in.available ();
-
- if (length == 0)
- throw new ClassNotFoundException (name);
-
- // Create an array of bytes to read the file in
- byte[] buf = new byte[length];
-
- // Read the file
- in.read (buf);
-
- // Return byte array
- return buf;
- }
-
- private String classPath_;
- // Class path that is loaded at construction
-
- private String pathSeparator_;
- // Platform-dependent path separator (e.g., : or ;)
-
- private String fileSeparator_;
- // Platform-dependent file separator (e.g., / or \)
-
- private String context_ = null;
-}
-
-
-
-
-
-
diff --git a/java/src/ServiceObject.java b/java/src/ServiceObject.java
deleted file mode 100644
index 1c420c08f3b..00000000000
--- a/java/src/ServiceObject.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ServiceObject.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import JACE.ASX.*;
-import JACE.Reactor.*;
-
-public class ServiceObject implements EventHandler
-{
- /**
- * Initialize object when dynamic loading occurs. Overwrite this
- * method to do anything useful.
- *@return -1 (default implementation)
- */
- public int init (String [] args)
- {
- return -1;
- }
-
- /**
- * Terminate the object. Note that an object can not be explicitly
- * unloaded. Overwrite this method to do anything useful.
- *@return -1 (default implementation)
- */
- public int fini ()
- {
- return -1;
- }
-
- /**
- * Get information on an active object. Overwrite this method to do
- * anything useful.
- *@return null (default implementation)
- */
- public String info ()
- {
- return null;
- }
-
- /**
- * Called when timer expires. Overwrite this method to do
- * anything useful.
- *@param tv Time Value for which timer was set
- *@param obj An arbitrary object that was passed to the Timer Queue
- * (Asynchronous Completion Token)
- *@return -1
- */
- public int handleTimeout (TimeValue tv, Object obj)
- {
- return -1;
- }
-
- /**
- * Request that this service suspend activity. Overwrite this
- * method to do anything useful.
- */
- public int suspend ()
- {
- return -1;
- }
-
- /**
- * Request that this service resume activity. Overwrite this
- * method to do anything useful.
- */
- public int resume ()
- {
- return -1;
- }
-}
diff --git a/java/src/ServiceObjectRecord.java b/java/src/ServiceObjectRecord.java
deleted file mode 100644
index b92a72173cb..00000000000
--- a/java/src/ServiceObjectRecord.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ServiceObjectRecord.java
- *
- * Provided to show future symmetry. ServiceRecord currently
- * provides all the desired behavior necessary for a record
- * of a ServiceObject, but later there could be ModuleRecords,
- * etc.
- *
- *@see JACE.ServiceConfigurator.ServiceRecord;
- *
- *@author Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.lang.*;
-import JACE.ServiceConfigurator.*;
-
-public class ServiceObjectRecord extends ServiceRecord
-{
- public ServiceObjectRecord (Object so, String name)
- {
- super (so, name);
- }
-
-};
-
-
-
-
-
diff --git a/java/src/ServiceRecord.java b/java/src/ServiceRecord.java
deleted file mode 100644
index 6c598aa732f..00000000000
--- a/java/src/ServiceRecord.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ServiceRecord.java
- *
- * This class structure is used in the ServiceRepository. Each service
- * object, module, or stream in the repository should be wrapped by a
- * type of ServiceRecord. The contained object does the real work.
- *
- * Modules and Streams will require records with more functionality.
- *
- * The caller should never be allowed to access the Object within the
- * record -- casting will result in a ClassCastException because of
- * the problem with loading classes with a ClassLoader. To get
- * around this, all the method calls are made on the Object via
- * reflection.
- *
- *@see JACE.ServiceConfigurator.ServiceObject
- *@see JACE.ServiceConfigurator.ServiceRepository
- *
- *@author Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import java.lang.*;
-import java.lang.reflect.*;
-import JACE.ServiceConfigurator.*;
-import JACE.OS.*;
-
-public class ServiceRecord
-{
- /**
- * Constructor
- *
- *@param service A java Object, the service
- *@param name Name of this service
- */
- ServiceRecord (Object service, String name)
- {
- this.service_ = service;
- this.name_ = name;
- this.suspended_ = false;
- }
-
- /**
- * Forward the call to suspend
- * @return -1 error
- */
- public int suspend()
- {
- this.setSuspend(true);
-
- Object result = this.invokeSimpleReflected("suspend");
-
- if (result == null)
- return -1;
- else
- return ((Integer)result).intValue();
- }
-
-
- /**
- * Forward the call to resume
- * @return -1 error
- */
- public int resume()
- {
- this.setSuspend(false);
-
- Object result = this.invokeSimpleReflected("resume");
-
- if (result == null)
- return -1;
- else
- return ((Integer)result).intValue();
- }
-
-
- /**
- * Initialize the service, provide the given command line args to it.
- *
- */
- public int init(String [] args)
- {
- Class types[] = new Class[1];
- if (args == null)
- args = new String[0];
-
- types[0] = args.getClass();
-
- // Find the method we want to call
- Method m;
- try {
- m = this.object().getClass().getMethod("init", types);
- } catch (NoSuchMethodException e) {
- ACE.ERROR("" + e);
- return -1;
- } catch (SecurityException e) {
- ACE.ERROR("" + e);
- return -1;
- }
-
- Class ptypes[] = m.getParameterTypes();
- //for (int x = 0; x < ptypes.length; x++)
- // System.err.println(ptypes[x].getName());
- Object params[] = new Object[1];
-
- params[0] = args;
-
- int result = -1;
- try {
- result = ((Integer)m.invoke(this.object(), params)).intValue();
- } catch (IllegalAccessException e) {
- ACE.ERROR("" + e);
- return -1;
- } catch (IllegalArgumentException e) {
- ACE.ERROR("" + e);
- return -1;
- } catch (InvocationTargetException e) {
- ACE.ERROR("init(): " + e.getTargetException());
- return -1;
- }
-
- return result;
- }
-
- /**
- * Prepare to close it
- */
- public int fini()
- {
- Object result = this.invokeSimpleReflected("fini");
-
- if (result == null)
- return -1;
- else
- return ((Integer)result).intValue();
- }
-
- /**
- * Obtain information about this service
- */
- public String info()
- {
- Object result = this.invokeSimpleReflected("info");
-
- System.err.println("info fin");
-
- if (result == null)
- return null;
- else
- return new String((String)result);
- }
-
- /** Invokes the method with the given name on the ServiceObject.
- * The invoked method must take no parameters for this to work.
- * Could be adjusted to throw a generic exception.
- */
- private Object invokeSimpleReflected(String name)
- {
- Method m;
-
- // find the desired method
- try {
- m = this.object().getClass().getMethod(name, null);
- } catch (NoSuchMethodException e) {
- ACE.ERROR("" + e);
- return null;
- } catch (SecurityException e) {
- ACE.ERROR("" + e);
- return null;
- }
-
- // Invoke it
- Object result = null;
-
- try {
- result = m.invoke(this.object(), null);
- } catch (IllegalAccessException e) {
- ACE.ERROR("" + e);
- } catch (IllegalArgumentException e) {
- ACE.ERROR("" + e);
- } catch (InvocationTargetException e) {
- ACE.ERROR(name + "(): " + e.getTargetException());
- }
-
- return result;
- }
-
- /**
- * Accessor for the name
- */
- public String name()
- {
- return new String(this.name_);
- }
-
- /** Set the name of the service
- */
- public void name(String name)
- {
- this.name_ = name;
- }
-
- /** Is this service suspended?
- */
- public boolean suspended()
- {
- return this.suspended_;
- }
-
- /** Set the suspended flag
- */
- void setSuspend (boolean suspended)
- {
- this.suspended_ = suspended;
- }
-
- /** Accessor for the contained Object. This should
- * never be available to the end user since they
- * might try casting the result.
- */
- Object object()
- {
- return this.service_;
- }
-
- /**
- * Set the contained object
- */
- void object(Object service)
- {
- this.service_ = service;
- }
-
- Object service_;
- String name_;
- boolean suspended_;
-};
-
-
-/*
-class ModuleRecord extends ServiceRecord
-{
-};
-
-class StreamRecord extends ServiceRecord
-{
-};
-*/
-
-
diff --git a/java/src/ServiceRepository.java b/java/src/ServiceRepository.java
deleted file mode 100644
index 8845fb52d0a..00000000000
--- a/java/src/ServiceRepository.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * ServiceRepository.java
- *
- * The service repository stores the network services, allowing them to be removed, suspended,
- * resumed, etc. To reload a service, the caller must remove it from the repository and then
- * call prepareForReload().
- *
- *@see JACE.ServiceConfigurator.ServiceRecord;
- *@see JACE.ServiceConfigurator.ServiceConfig;
- *
- *@author Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import java.util.*;
-import JACE.ServiceConfigurator.*;
-
-public class ServiceRepository
-{
- /**
- * Constructor
- */
- public ServiceRepository ()
- {
- this.serviceVector_ = new Vector();
- }
-
- /**
- * Constructor
- *
- *@param initialSize Initial vector size for the repository
- */
- public ServiceRepository (int initialSize)
- {
- this.serviceVector_ = new Vector (initialSize);
- }
-
- /**
- * Shut down all the services, closing them in reverse order of insertion
- *
- * Maybe should be called by finalize?
- */
- public int close()
- {
- for (int i = this.size() - 1; i >= 0; i--) {
- ServiceRecord rec = (ServiceRecord)this.serviceVector_.elementAt(i);
-
- rec.fini();
-
- this.serviceVector_.removeElementAt(i);
- }
-
- return 0;
- }
-
- /**
- * Insert a ServiceRecord into the repository.
- * (If already in, calls fini() and replaces)
- *
- *@param srvRec ServiceRecord to add
- */
- public void insert (ServiceRecord srvRec)
- {
- ServiceRecord alreadyIn = find(srvRec.name());
-
- // Replace the service
- if (alreadyIn != null) {
- alreadyIn.fini();
- this.serviceVector_.removeElement(alreadyIn);
- }
-
- this.serviceVector_.addElement(srvRec);
- }
-
- /**
- * Finds the ServiceRecord associated with a given
- * service name. Note -- the user should not try to
- * get a ServiceObject out of the ServiceRecord.
- * Same as saying ignoreSuspended is false on the
- * next method.
- *
- *@param name Name of the service to find
- */
- public ServiceRecord find (String name)
- {
- return this.find(name, false);
- }
-
- /** Return the service record for the given service. The caller
- * should NOT try to access a ServiceObject (or Module or Stream)
- * by taking it out of the ServiceRecord -- just make the calls
- * through the record!
- *
- *@param name Name of the service to find
- *@param ignoreSuspended Allow finding suspended services?
- */
- public ServiceRecord find (String name, boolean ignoreSuspended)
- {
- ServiceRecord rec;
-
- for (int i = 0; i < this.size(); i++) {
- rec = (ServiceRecord)this.serviceVector_.elementAt(i);
-
- if ((rec.name().equals(name)) && ((!ignoreSuspended) || (!rec.suspended())))
- return rec;
- }
-
- return null;
- }
-
- /** Take the given service out of the repository. This also sets the
- * reference in the repository to null to ensure there are no
- * hidden references to the old ServiceObject. To reload, the user must
- * still run prepareToReload on ServiceConfig if they don't want any
- * problems.
- */
- public int remove (String name)
- {
- ServiceRecord rec = this.find(name, false);
-
- if (rec == null)
- return -1;
-
- int index = this.serviceVector_.indexOf(rec);
-
- // Shut down the service
- rec.fini();
-
- // Make sure there are no hidden references left
- this.serviceVector_.setElementAt(null, index);
-
- this.serviceVector_.removeElementAt(index);
-
- return 0;
- }
-
- /**
- * Resume a suspended service
- *@param name Name of the service to resume
- */
- public int resume (String name)
- {
- ServiceRecord rec = this.find(name, false);
-
- if (rec == null)
- return -1;
-
- return rec.resume();
- }
-
- /**
- * Suspend a service
- *@param name Name of the service to suspend
- */
- public int suspend (String name)
- {
- ServiceRecord rec = this.find(name, false);
-
- if (rec == null)
- return -1;
-
- return rec.suspend();
- }
-
- /**
- * Returns the number of items in the repository
- */
- public int size ()
- {
- return this.serviceVector_.size();
- }
-
- // Vector representation
- Vector serviceVector_;
-};
-
-
-
-
-
-
-
-
diff --git a/java/src/StrategyAcceptor.java b/java/src/StrategyAcceptor.java
deleted file mode 100644
index 07f81a8ad63..00000000000
--- a/java/src/StrategyAcceptor.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * StrategyAcceptor.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.OS.*;
-import JACE.SOCK_SAP.*;
-
-public class StrategyAcceptor
-{
- /**
- * Create an instance of StrategyAcceptor.
- *@param handlerFactory Svc Handler factory that is used to create
- * an instance of a Svc Handler when a connection is accepted.
- */
- public StrategyAcceptor (Class handlerFactory)
- {
- this (handlerFactory, null, null, null);
- }
-
- /**
- * Create an instance of StrategyAcceptor. Use the creation
- * strategy and the handlerFactory passed in to creae a new instance
- * of the Svc Handler.
- *@param handlerFactory Svc Handler factory that is used to create
- * an instance of a Svc Handler when a connection is accepted.
- *@param creStrategy Creation strategy to use to create a new
- * instance of the Svc Handler.
- *@param acceptStrategy Accept strategy to use to accept a new
- * connection into the Svc Handler.
- *@param activateStrategy Activate strategy to use to activate the
- * instance of the Svc Handler.
- */
- public StrategyAcceptor (Class handlerFactory,
- CreationStrategy creStrategy,
- AcceptStrategy acceptStrategy,
- ActivateStrategy activateStrategy)
- {
- // Cache everything
- this.handlerFactory_ = handlerFactory;
- this.creStrategy_ = creStrategy;
- this.acceptStrategy_ = acceptStrategy;
- this.activateStrategy_ = activateStrategy;
- }
-
- /**
- * Initialize the Strategy Acceptor. The method creates the
- * appropriate strategies as needed.
- *@param port port number where the server will listen for connections
- */
- public void open (int port) throws IOException
- {
- if (this.creStrategy_ == null)
- this.creStrategy_ = new CreationStrategy (this.handlerFactory_);
- if (this.acceptStrategy_ == null)
- this.acceptStrategy_ = new AcceptStrategy (port);
- else
- this.acceptStrategy_.open (port);
- if (this.activateStrategy_ == null)
- this.activateStrategy_ = new ActivateStrategy ();
- }
-
- /**
- * Accept a connection using the appropriate strategies.
- */
- public void accept () throws SocketException,
- InstantiationException,
- IllegalAccessException,
- IOException
- {
- // Create a Svc_Handler using the appropriate Creation_Strategy
- SvcHandler sh = this.makeSvcHandler ();
-
- // Accept a connection into the Svc_Handler
- this.acceptSvcHandler (sh);
-
- // Activate the Svc_Handler
- this.activateSvcHandler (sh);
- }
-
- /**
- * Bridge method for creating a SvcHandler. The strategy for
- * creating a SvcHandler is configured into the Acceptor via it's
- * creStrategy_. If no strategy is passed in, the default behavior
- * of this method is to use the default CreationStrategy.
- *@return a new instance of the Svc Handler
- */
- protected SvcHandler makeSvcHandler () throws InstantiationException,
- IllegalAccessException
- {
- // Create a new handler for the connection
- return this.creStrategy_.makeSvcHandler ();
- }
-
-
- /**
- * Bridge method for accepting the new connection into the
- * <SvcHandler>. The strategy for accepting into a SvcHandler is
- * configured into the Acceptor via it's acceptStrategy_. If no
- * strategy is passed in, the default behavior of this method is to
- * use the default AcceptStrategy.
- *@param sh Svc Handler in which to accept the connection
- *@return result of accepting a connection using the accept strategy
- */
- protected int acceptSvcHandler (SvcHandler sh) throws
- SocketException, IOException
- {
- // Delegate responsibility to the appropriate strategy
- return this.acceptStrategy_.acceptSvcHandler (sh);
- }
-
- /**
- * Bridge method for activating a <SvcHandler>. The strategy for
- * activating a SvcHandler is configured into the Acceptor via it's
- * activateStrategy_. If no strategy is passed in, the default
- * behavior of this method is to use the default ActivateStrategy.
- *@param sh Svc Handler to activate
- *@return result of activating the Svc Handler
- */
- protected int activateSvcHandler (SvcHandler sh)
- {
- // Delegate responsibility to the appropriate strategy
- return this.activateStrategy_.activateSvcHandler (sh);
- }
-
- // Handler class that should be instantiated when a connection is
- // made with a client
- private Class handlerFactory_;
-
- // Creation Strategy
- private CreationStrategy creStrategy_;
-
- // Accept Strategy
- private AcceptStrategy acceptStrategy_;
-
- // Activation Strategy
- private ActivateStrategy activateStrategy_;
-}
diff --git a/java/src/Stream.java b/java/src/Stream.java
deleted file mode 100644
index 030114d092f..00000000000
--- a/java/src/Stream.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * Stream.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-import JACE.OS.*;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * This class is the primary abstraction for the ASX framework.
- * It is moduled after System V Stream.
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * A Stream consists of a stack of <Modules>, each of which
- * contains two <Tasks>.
- *</blockquote>
- */
-
-public class Stream
-{
-
- public Stream ()
- {
- this (null, null, null);
- }
-
- // Create a Stream consisting of <head> and <tail> as the Stream
- // head and Stream tail, respectively. If these are 0 then the
- // <ACE_Stream_Head> and <ACE_Stream_Tail> are used, respectively.
- // <arg> is the value past in to the open() methods of the tasks.
-
- public Stream (Object a,
- Module head,
- Module tail)
- {
- this.linkedUs_ = null;
- // this.final_close_ = this.lock_;
-
- if (this.open (a, head, tail) == -1)
- ACE.ERROR ("open" + head.name () + " " + tail.name ());
- }
-
- public int push (Module newTop)
- {
- if (this.pushModule (newTop,
- this.streamHead_.next (),
- this.streamHead_) == -1)
- return -1;
- else
- return 0;
- }
-
- public int put (MessageBlock mb, TimeValue tv)
- {
- return this.streamHead_.writer ().put (mb, tv);
- }
-
- public MessageBlock get (TimeValue tv) throws InterruptedException
- {
- return this.streamHead_.reader ().getq (tv);
- }
-
-// Return the "top" ACE_Module in a ACE_Stream, skipping over the
-// stream_head.
-
- public Module top ()
- {
- if (this.streamHead_.next () == this.streamTail_)
- return null;
- else
- return this.streamHead_.next ();
- }
-
-// Remove the "top" ACE_Module in a ACE_Stream, skipping over the
-// stream_head.
-
- public int pop (long flags)
- {
- if (this.streamHead_.next () == this.streamTail_)
- return -1;
- else
- {
- // Skip over the ACE_Stream head.
- Module top = this.streamHead_.next ();
- Module newTop = top.next ();
-
- this.streamHead_.next (newTop);
-
- // Close the top ACE_Module.
-
- top.close (flags);
-
- this.streamHead_.writer ().next (newTop.writer ());
- newTop.reader ().next (this.streamHead_.reader ());
-
- return 0;
- }
- }
-
-// Remove a named ACE_Module from an arbitrary place in the
-// ACE_Stream.
-
- public int remove (String name, long flags)
- {
- Module prev = null;
-
- for (Module mod = this.streamHead_;
- mod != null; mod = mod.next ())
- if (name.compareTo (mod.name ()) == 0)
- {
- if (prev == null) // Deleting ACE_Stream Head
- this.streamHead_.link (mod.next ());
- else
- prev.link (mod.next ());
-
- mod.close (flags);
- return 0;
- }
- else
- prev = mod;
-
- return -1;
- }
-
- public Module find (String name)
- {
- for (Module mod = this.streamHead_;
- mod != null;
- mod = mod.next ())
- if (name.compareTo (mod.name ()) == 0)
- return mod;
-
- return null;
- }
-
-// Actually push a module onto the stack...
-
- private int pushModule (Module newTop,
- Module currentTop,
- Module head)
- {
- Task ntReader = newTop.reader ();
- Task ntWriter = newTop.writer ();
- Task ctReader = null;
- Task ctWriter = null;
-
- if (currentTop != null)
- {
- ctReader = currentTop.reader ();
- ctWriter = currentTop.writer ();
- ctReader.next (ntReader);
- }
-
- ntWriter.next (ctWriter);
-
- if (head != null)
- {
- if (head != newTop)
- head.link (newTop);
- }
- else
- ntReader.next (null);
-
- newTop.next (currentTop);
-
- if (ntReader.open (newTop.arg ()) == -1)
- return -1;
-
- if (ntWriter.open (newTop.arg ()) == -1)
- return -1;
- return 0;
- }
-
- public synchronized int open (Object a,
- Module head,
- Module tail)
- {
- Task h1 = null, h2 = null;
- Task t1 = null, t2 = null;
-
- if (head == null)
- {
- h1 = new StreamHead ();
- h2 = new StreamHead ();
- head = new Module ("ACEStreamHead", h1, h2, a);
- }
-
- if (tail == null)
- {
- t1 = new StreamTail ();
- t2 = new StreamTail ();
- tail = new Module ("ACEStreamTail",
- t1, t2, a);
- }
-
- // Make sure *all* the allocation succeeded!
- if (h1 == null || h2 == null || head == null
- || t1 == null || t2 == null || tail == null)
- {
- // Close up!
- head.close (0);
- tail.close (0);
- return -1;
- }
-
- this.streamHead_ = head;
- this.streamTail_ = tail;
-
- if (this.pushModule (this.streamTail_,
- null, null) == -1)
- return -1;
- else if (this.pushModule (this.streamHead_,
- this.streamTail_,
- this.streamHead_) == -1)
- return -1;
- else
- return 0;
- }
-
- public synchronized int close (long flags)
- {
- if (this.streamHead_ != null
- && this.streamTail_ != null)
- {
- // Don't bother checking return value here.
- this.unlinkInternal ();
-
- int result = 0;
-
- // Remove and cleanup all the intermediate modules.
-
- while (this.streamHead_.next () != this.streamTail_)
- {
- if (this.pop (flags) == -1)
- result = -1;
- }
-
- // Clean up the head and tail of the stream.
- if (this.streamHead_.close (flags) == -1)
- result = -1;
- if (this.streamTail_.close (flags) == -1)
- result = -1;
-
- this.streamHead_ = null;
- this.streamTail_ = null;
-
- // Tell all threads waiting on the close that we are done.
- // this.final_close_.broadcast ();
- return result;
- }
- return 0;
- }
-
- public int control (int cmd, Object a) throws InterruptedException
- {
- IOCntlMsg ioc = new IOCntlMsg (cmd);
-
- // Create a data block that contains the user-supplied data.
- MessageBlock db =
- new MessageBlock (MessageType.MB_IOCTL,
- null,
- a);
-
- // Create a control block that contains the control field and a
- // pointer to the data block.
- MessageBlock cb =
- new MessageBlock (MessageType.MB_IOCTL,
- db,
- (Object) ioc);
-
- int result = 0;
-
- if (this.streamHead_.writer ().put (cb, new TimeValue ()) == -1)
- result = -1;
- else if ((cb = this.streamHead_.reader ().getq (new TimeValue ())) == null)
- result = -1;
- else
- result = ((IOCntlMsg ) cb.obj ()).rval ();
-
- return result;
- }
-
-// Link two streams together at their bottom-most Modules (i.e., the
-// one just above the Stream tail). Note that all of this is premised
-// on the fact that the Stream head and Stream tail are non-NULL...
-// This must be called with locks held.
-
- private int linkInternal (Stream us)
- {
- this.linkedUs_ = us;
- // Make sure the other side is also linked to us!
- us.linkedUs_ = this;
-
- Module myTail = this.streamHead_;
-
- if (myTail == null)
- return -1;
-
- // Locate the module just above our Stream tail.
- while (myTail.next () != this.streamTail_)
- myTail = myTail.next ();
-
- Module otherTail = us.streamHead_;
-
- if (otherTail == null)
- return -1;
-
- // Locate the module just above the other Stream's tail.
- while (otherTail.next () != us.streamTail_)
- otherTail = otherTail.next ();
-
- // Reattach the pointers so that the two streams are linked!
- myTail.writer ().next (otherTail.reader ());
- otherTail.writer ().next (myTail.reader ());
- return 0;
- }
-
- public synchronized int link (Stream us)
- {
- return this.linkInternal (us);
- }
-
-// Must be called with locks held...
-
- private int unlinkInternal ()
- {
- // Only try to unlink if we are in fact still linked!
-
- if (this.linkedUs_ != null)
- {
- Module myTail = this.streamHead_;
-
- // Only relink if we still exist!
- if (myTail != null)
- {
- // Find the module that's just before our stream tail.
- while (myTail.next () != this.streamTail_)
- myTail = myTail.next ();
-
- // Restore the writer's next() link to our tail.
- myTail.writer ().next (this.streamTail_.writer ());
- }
-
- Module otherTail = this.linkedUs_.streamHead_;
-
- // Only fiddle with the other side if it in fact still remains.
- if (otherTail != null)
- {
- while (otherTail.next () != this.linkedUs_.streamTail_)
- otherTail = otherTail.next ();
-
- otherTail.writer ().next (this.linkedUs_.streamTail_.writer ());
-
- }
-
- // Make sure the other side is also aware that it's been unlinked!
- this.linkedUs_.linkedUs_ = null;
-
- this.linkedUs_ = null;
- return 0;
- }
- else
- return -1;
- }
-
- public synchronized int unlink ()
- {
- return this.unlinkInternal ();
- }
-
- public void dump ()
- {
- ACE.DEBUG ("-------- module links --------");
-
- for (Module mp = this.streamHead_; ; mp = mp.next ())
- {
- ACE.DEBUG ("module name = " + mp.name ());
- if (mp == this.streamTail_)
- break;
- }
-
- ACE.DEBUG ("-------- writer links --------");
-
- Task tp;
-
- for (tp = this.streamHead_.writer (); ; tp = tp.next ())
- {
- ACE.DEBUG ("writer queue name = " + tp.name ());
- tp.dump ();
- ACE.DEBUG ("-------\n");
- if (tp == this.streamTail_.writer ()
- || (this.linkedUs_ != null && tp == this.linkedUs_.streamHead_.reader ()))
- break;
- }
-
- ACE.DEBUG ("-------- reader links --------\n");
- for (tp = this.streamTail_.reader (); ; tp = tp.next ())
- {
- ACE.DEBUG ("reader queue name = " + tp.name ());
- tp.dump ();
- ACE.DEBUG ("-------\n");
- if (tp == this.streamHead_.reader ()
- || (this.linkedUs_ != null && tp == this.linkedUs_.streamHead_.writer ()))
- break;
- }
- }
-
- Module streamHead_ = null;
- // Pointer to the head of the stream.
-
- Module streamTail_ = null;
- // Pointer to the tail of the stream.
-
- Stream linkedUs_ = null;
- // Pointer to an adjoining linked stream.
-
- // = Synchronization objects used for thread-safe streams.
- // ACE_SYNCH_MUTEX lock_;
- // Protect the stream against race conditions.
-
- // ACE_SYNCH_CONDITION final_close_;
- // Use to tell all threads waiting on the close that we are done.
-
-}
-
-
diff --git a/java/src/StreamHead.java b/java/src/StreamHead.java
deleted file mode 100644
index 37d9c2af0c3..00000000000
--- a/java/src/StreamHead.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * StreamHead.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-import JACE.OS.*;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Standard module that acts as the head of a ustream.
- *</blockquote>
- */
-
-public class StreamHead extends Task
-{
- // Module that acts as the head of a Stream.
-
- public int open (Object obj)
- {
- return 0;
- }
-
- public int close (long l)
- {
- return 0;
- }
-
- public int svc ()
- {
- return -1;
- }
-
- private int control (MessageBlock mb)
- {
-
- IOCntlMsg ioc = (IOCntlMsg) mb.obj ();
- int cmd = ioc.cmd ();
-
- switch (cmd)
- {
- case IOCntlCmds.SET_LWM:
- case IOCntlCmds.SET_HWM:
- this.waterMarks (cmd, mb.cont ().length ());
- ioc.rval (0);
- break;
- default:
- return 0;
- }
- return ioc.rval ();
- }
-
- /* Performs canonical flushing at the ACE_Stream Head */
-
- private int canonicalFlush (MessageBlock mb)
- {
- String s = mb.base ();
- long f = (new Long (s)).longValue ();
-
- if ((f & TaskFlags.ACE_FLUSHR) != 0)
- {
- this.flush (TaskFlags.ACE_FLUSHALL);
- f &= ~TaskFlags.ACE_FLUSHR;
- }
- if ((f & TaskFlags.ACE_FLUSHW) != 0)
- return this.reply (mb, new TimeValue ());
- return 0;
- }
-
- public int put (MessageBlock mb, TimeValue tv)
- {
- int res = 0;
- if (mb.msgType () == MessageType.MB_IOCTL
- && (res = this.control (mb)) == -1)
- return res;
-
- if (this.isWriter ())
- {
- return this.putNext (mb, tv);
- }
- else /* this.isReader () */
- {
- switch (mb.msgType ())
- {
- case MessageType.MB_FLUSH:
- return this.canonicalFlush (mb);
- default:
- break;
- }
-
- try
- {
- return this.putq (mb, tv);
- }
- catch (InterruptedException e)
- {
- return -1;
- }
- }
- }
-
- public void dump ()
- {
- }
-
- public int handleTimeout (TimeValue tv, Object obj)
- {
- return 0;
- }
-
-}
diff --git a/java/src/StreamTail.java b/java/src/StreamTail.java
deleted file mode 100644
index 44f9dde6634..00000000000
--- a/java/src/StreamTail.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * StreamTail.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-import JACE.OS.*;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Standard module that acts as the tail of a ustream.
- *</blockquote>
- */
-
-public class StreamTail extends Task
-{
- // Module that acts as the tail of a Stream.
-
- public int open (Object obj)
- {
- return 0;
- }
-
- public int close (long l)
- {
- return 0;
- }
-
- public int svc ()
- {
- return -1;
- }
-
- private int control (MessageBlock mb)
- {
- IOCntlMsg ioc = (IOCntlMsg) mb.obj ();
- int cmd = ioc.cmd ();
-
- switch (cmd)
- {
- case IOCntlCmds.SET_LWM:
- case IOCntlCmds.SET_HWM:
- {
- int size = mb.cont ().length ();
-
- this.waterMarks (cmd, size);
- this.sibling ().waterMarks (cmd, size);
- ioc.rval (0);
- break;
- }
- default:
- mb.msgType (MessageType.MB_IOCNAK);
- }
- return this.reply (mb, new TimeValue ());
- }
-
- // Perform flush algorithm as though we were the driver
- private int canonicalFlush (MessageBlock mb)
- {
- String s = mb.base ();
- long f = (new Long (s)).longValue ();
-
- if ((f & TaskFlags.ACE_FLUSHW) != 0)
- {
- this.flush (TaskFlags.ACE_FLUSHALL);
- f &= ~TaskFlags.ACE_FLUSHW;
- }
- if ((f & TaskFlags.ACE_FLUSHR) != 0)
- {
- this.sibling ().flush (TaskFlags.ACE_FLUSHALL);
- return this.reply (mb, new TimeValue ());
- }
- return 0;
- }
-
- public int put (MessageBlock mb, TimeValue tv)
- {
- if (this.isWriter ())
- {
- switch (mb.msgType ())
- {
- case MessageType.MB_IOCTL:
- return this.control (mb);
- /* NOTREACHED */
- default:
- break;
- }
- }
-
- return -1;
- }
-
- public void dump ()
- {
- }
-
- public int handleTimeout (TimeValue tv, Object obj)
- {
- return 0;
- }
-
-}
diff --git a/java/src/SuspendNode.java b/java/src/SuspendNode.java
deleted file mode 100644
index a34ae457e80..00000000000
--- a/java/src/SuspendNode.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ServiceConfigurator
- *
- * = FILENAME
- * SuspendNode.java
- *
- * Used when a service is specified to be suspended based on a line
- * in a service configurator file. The actual implementation of the
- * service being suspended does the work.
- *
- *@author Everett Anderson
- *
- *************************************************/
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import JACE.ServiceConfigurator.*;
-import JACE.OS.*;
-import java_cup.runtime.*;
-
-class SuspendNode extends ParseNode
-{
- public SuspendNode (int act_num)
- {
- super(act_num);
- }
-
- public void apply ()
- {
- ACE.DEBUG("Suspend Node apply: " + this.name_);
-
- if (JACE.ServiceConfigurator.ServiceConfig.suspend(this.name_) == -1)
- ACE.ERROR("Error suspending " + this.name_);
- }
-};
diff --git a/java/src/SvcHandler.java b/java/src/SvcHandler.java
deleted file mode 100644
index cb9af5a3334..00000000000
--- a/java/src/SvcHandler.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Connection
- *
- * = FILENAME
- * SvcHandler.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Connection;
-
-import java.io.*;
-import java.net.*;
-import JACE.SOCK_SAP.*;
-import JACE.ASX.*;
-import JACE.Reactor.*;
-
-public abstract class SvcHandler extends Task
-{
-
- /**
- * Do nothing constructor.
- */
- public SvcHandler ()
- {
- }
-
- /**
- * Set the stream using the SOCKStream passed in. This sets the
- * underlying peer
- *@param s SOCK Stream to use for the connection
- */
- public void setHandle (SOCKStream s) throws IOException
- {
- this.stream_ = s;
- }
-
- /**
- * Get the underlying peer
- *@return the underlying peer
- */
- public SOCKStream peer ()
- {
- return this.stream_;
- }
-
- /**
- * Abstract method that subclasses must define to allow
- * initialization to take place.
- */
- public abstract int open (Object obj);
-
- /**
- * Provide a default implementation to simplify ancestors.
- *@return 0
- */
- public int close (long flags)
- {
- return 0;
- }
-
- /**
- * Provide a default implementation to simplify ancestors.
- *@return -1
- */
- public int put (MessageBlock mb, TimeValue tv)
- {
- return -1;
- }
-
- /**
- * Provide a default implementation to simplify ancestors.
- *@param tv Time Value for which timer was set
- *@param obj An arbitrary object that was passed to the Timer Queue
- * (Asynchronous Completion Token)
- */
- public int handleTimeout (TimeValue tv, Object obj)
- {
- return -1;
- }
-
- protected SOCKStream stream_;
-}
diff --git a/java/src/Svc_Conf.y b/java/src/Svc_Conf.y
deleted file mode 100644
index 1079779eb31..00000000000
--- a/java/src/Svc_Conf.y
+++ /dev/null
@@ -1,210 +0,0 @@
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import java.lang.*;
-import java_cup.runtime.*;
-import JACE.ServiceConfigurator.*;
-import JACE.OS.*;
-
-parser code {:
- // Lexical Analyzer
- private Yylex lexer_;
-
- public void setLexer(Yylex lexer)
- {
- this.lexer_ = lexer;
- }
-:};
-
-init with {:
- try {
-
- FileInputStream fs = new FileInputStream(new String(ServiceConfig.serviceConfigFile_));
-
- this.setLexer(new Yylex(fs));
-
- } catch (FileNotFoundException fnf) {
-
- ACE.ERROR("File not found: " + fnf);
-
- } catch (SecurityException se) {
-
- ACE.ERROR("Security: " + se);
- }
-:};
-
-scan with {: return this.lexer_.yylex(); :};
-
-terminal token ACE_DYNAMIC, ACE_STATIC, ACE_SUSPEND, ACE_RESUME, ACE_REMOVE, ACE_STREAM;
-terminal token ACE_MODULE_T, ACE_STREAM_T, ACE_SVC_OBJ_T, ACE_ACTIVE, ACE_INACTIVE;
-terminal str_token ACE_PATHNAME, ACE_IDENT, ACE_STRING;
-terminal token ACE_LPAREN, ACE_RPAREN, ACE_LBRACE, ACE_RBRACE, ACE_STAR, ACE_COLON;
-terminal token ACE_USTREAM;
-
-non terminal AddServiceObjectNode dynamic, svc_location; /* AddServiceObjectNode */
-non terminal SuspendNode suspend; /* SuspendNode */
-non terminal ResumeNode resume; /* ResumeNode */
-non terminal RemoveNode remove; /* RemoveNode */
-non terminal ParseNode module_list, stream, svc_config_entry;
-non terminal ParseNode svc_config_entries, static;
-non terminal java_cup.runtime.str_token stream_modules, module;
-non terminal java_cup.runtime.int_token status;
-non terminal java_cup.runtime.str_token svc_initializer;
-non terminal java_cup.runtime.str_token pathname, parameters_opt;
-non terminal java_cup.runtime.str_token stream_ops, type;
-
-start with svc_config_entries;
-
-svc_config_entries ::= svc_config_entry:e1 svc_config_entries
- {:
- if (e1 != null)
- e1.apply();
- :}
- |
- svc_config_entry:e1
- {:
- if (e1 != null)
- e1.apply();
- :}
- ;
-
-svc_config_entry ::= dynamic
- {:
- /* Empty -- result auto set to dynamic */
- /* CUP$result = (ParseNode)CUP$stack.elementAt(CUP$top-0); */
- :}
- |
- static
- {:
- /* More graceful error system needed here */
- ACE.ERROR("Not implemented: static service loading"); :}
- |
- suspend
- {:
- /* Empty -- result auto set to suspend */
- /* CUP$result = (ParseNode)CUP$stack.elementAt(CUP$top-0); */
- :}
- |
- resume
- {: /* Empty -- result auto set to resume */
- :}
- |
- remove
- {:
-
- :}
- |
- stream
- {: ACE.ERROR("Not implemented: stream loading"); :}
- ;
-
-dynamic ::= ACE_DYNAMIC svc_location:e1 parameters_opt:e2
-{:
- RESULT.init(e1.name(), e1.locator(), e1.suspended());
-
- RESULT.params(e2.str_val);
-:}
- ;
-
-static ::= ACE_STATIC ACE_IDENT parameters_opt
- ;
-
-suspend ::= ACE_SUSPEND ACE_IDENT:e1
-{:
- RESULT.init(e1.str_val);
-:}
- ;
-
-resume ::= ACE_RESUME ACE_IDENT:e1
-{:
- RESULT.init(e1.str_val);
-:}
- ;
-
-remove ::= ACE_REMOVE ACE_IDENT:e1
-{:
- RESULT.init(e1.str_val);
-:}
- ;
-
-stream ::= ACE_USTREAM stream_ops stream_modules
- |
- ACE_USTREAM ACE_IDENT stream_modules
- ;
-
-stream_ops ::= dynamic
- |
- static
- ;
-
-stream_modules ::= ACE_LBRACE
- |
- module_list ACE_RBRACE
- ;
-
-module_list ::= module_list module
- {: ACE.ERROR("Not implemented: module manipulation"); :}
- |
- {: ACE.ERROR("Not implemented: module manipulation"); :}
- ;
-
-module ::= dynamic
- |
- static
- |
- suspend
- |
- resume
- |
- remove
- ;
-
-svc_location ::= ACE_IDENT:e1 type:e2 svc_initializer:e3 status:e4
-{:
- boolean suspended = false;
- if (e4.int_val == 1)
- suspended = true;
-
- RESULT.init(e1.str_val, e3.str_val, suspended);
-:}
-;
-
-status ::= ACE_ACTIVE
- {: RESULT.int_val = 0; :}
- |
- ACE_INACTIVE
- {: RESULT.int_val = 1; :}
- |
- {: // Default case
- RESULT.int_val = 0; :}
- ;
-
-svc_initializer ::= pathname:e1 ACE_COLON ACE_IDENT:e2
- {: RESULT.str_val = new String(e1.str_val + ":" + e2.str_val); :}
- |
- pathname:e1 ACE_COLON ACE_IDENT:e2 ACE_LPAREN ACE_RPAREN
- {: RESULT.str_val = new String(e1.str_val + ":" + e2.str_val); :}
- ;
-
-type ::= ACE_MODULE_T ACE_STAR
- |
- ACE_SVC_OBJ_T ACE_STAR
- {: RESULT.str_val = new String("Service Object"); :}
- |
- ACE_STREAM_T ACE_STAR
- ;
-
-parameters_opt ::= ACE_STRING:e
- {: RESULT.str_val = new String(e.str_val); :}
- |
- ;
-
-pathname ::= ACE_PATHNAME:e
- {: RESULT.str_val = new String(e.str_val); :}
- |
- ACE_IDENT:e
- {: RESULT.str_val = new String(e.str_val); :}
- ;
-
-
-
diff --git a/java/src/Task.java b/java/src/Task.java
deleted file mode 100644
index 065e7869fef..00000000000
--- a/java/src/Task.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * Task.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-import JACE.OS.*;
-import JACE.Reactor.*;
-import JACE.Concurrency.*;
-
-public abstract class Task implements Runnable, EventHandler
-{
- // = Initialization/termination methods.
-
- /**
- * Initialize a Task. Note, we allocate a message queue ourselves.
- */
- public Task ()
- {
- this.msgQueue_ = new MessageQueue ();
- this.thrMgr_ = null;
- }
-
- /**
- * Initialize a Task. Note, we use the message queue and thread
- * manager supplied by the user.
- *@param mq Message Queue to hold list of messages on the Task
- *@param thrMgr Thread Manager that manages all the spawned threads
- */
- public Task (MessageQueue mq,
- ThreadManager thrMgr)
- {
- this.msgQueue_ = mq;
- this.thrMgr_ = thrMgr;
- }
-
- /**
- * Not meant to be invoked by the user directly!. This needs to be
- * in the public interface in order to get invoked by Thread
- * class.
- */
- public void run ()
- {
- this.svc ();
- }
-
- // = Initialization and termination hooks (note that these *must* be
- // defined by subclasses).
-
- /**
- * Hook called to open a Task.
- *@param obj used to pass arbitrary information
- */
- public abstract int open (Object obj);
-
- /**
- * Hook called to close a Task.
- */
- public abstract int close (long flags);
-
- // = Immediate and deferred processing methods, respectively.
-
- /**
- * Transfer a message into the queue to handle immediate
- * processing.
- *@param mb Message Block to handle immediately
- *@param tv amount of time to wait for
- */
- public abstract int put (MessageBlock mb, TimeValue tv);
-
- /**
- * Run by a daemon thread to handle deferred processing. Note, that
- * to do anything useful, this method should be overriden by the
- * subclass.
- *@return default implementation always returns 0.
- */
- public int svc ()
- {
- return 0;
- }
-
- /**
- * Set the underlying Thread Manager.
- *@param t Thread Manager to use
- */
- public synchronized void thrMgr (ThreadManager t)
- {
- this.thrMgr_ = t;
- }
-
- /**
- * Get the Thread Manager.
- *@return Underlying Thread Manager
- */
- public synchronized ThreadManager thrMgr ()
- {
- return this.thrMgr_;
- }
-
- // = Active object method.
-
- /**
- * Turn the task into an active object. That is, having <nThreads>
- * separate threads of control that all invoke Task::svc.
- *@param flags Task Flags
- *@param nThreads number of threads to spawn
- *@param forceActive whether to force creation of new threads or not
- *@return -1 if failure occurs, 1 if Task is already an active
- * object and <forceActive> is false (doesn't *not* create a new
- * thread in this case), and 0 if Task was not already an active
- * object and a thread is created successfully or thread is an active
- * object and <forceActive> is true.
- */
- public synchronized int activate (long flags, int nThreads, boolean forceActive)
- {
- // Create a Thread Manager if we do not already have one
- if (this.thrMgr_ == null)
- this.thrMgr_ = new ThreadManager ();
-
- if (this.thrCount () > 0 && forceActive == false)
- return 1; // Already active.
- this.flags_ = flags;
-
- if (ACE.BIT_ENABLED (flags, TaskFlags.THR_DAEMON))
- this.thrMgr_.spawnN (nThreads, this, true); // Spawn off all threads as daemon threads
- else // Spawn off all threads as normal threads
- this.thrMgr_.spawnN (nThreads, this, false);
-
- return 0;
- }
-
- // = Suspend/resume a Task
-
- /**
- * Suspend a task.
- */
- public synchronized void suspend ()
- {
- // Suspend all threads
- if (this.thrMgr_ != null)
- this.thrMgr_.thrGrp ().suspend ();
- }
-
- /**
- * Resume a suspended task.
- */
- public synchronized void resume ()
- {
- // Resume all threads
- if (this.thrMgr_ != null)
- this.thrMgr_.thrGrp ().resume ();
- }
-
- /**
- * Get the current group name.
- *@return name of the current thread group
- */
- public synchronized String grpName ()
- {
- if (this.thrMgr_ != null)
- return this.thrMgr_.thrGrp ().getName ();
- else
- return null;
- }
-
- /**
- * Get the message queue associated with this task.
- *@return the message queue associated with this task.
- */
- public MessageQueue msgQueue ()
- {
- return this.msgQueue_;
- }
-
- /**
- * Set the message queue associated with this task.
- *@param mq Message Queue to use with this Task.
- */
- public void msgQueue (MessageQueue mq)
- {
- this.msgQueue_ = mq;
- }
-
- /**
- * Get the number of threads currently running within the Task.
- *@return the number of threads currently running within the Task.
- * 0 if we're a passive object, else > 0.
- */
- public synchronized int thrCount ()
- {
- if (this.thrMgr_ != null)
- return this.thrMgr_.thrGrp ().activeCount ();
- else
- return 0;
- }
-
- /**
- * Set the Task flags
- *@param flags Task Flags
- */
- public synchronized void flags (long flags)
- {
- this.flags_ = flags;
- }
-
- /**
- * Get the Task flags
- *@return Task Flags
- */
- public synchronized long flags ()
- {
- return this.flags_;
- }
-
- // = Message queue manipulation methods.
-
-
- /*
- * Dump debug information.
- */
- public void dump ()
- {
- }
-
- /**
- * Insert message into the message queue.
- *@param mb Message Block to insert into the Message Queue
- *@param tv amount of time to wait for
- */
- protected int putq (MessageBlock mb, TimeValue tv) throws InterruptedException
- {
- return this.msgQueue_.enqueueTail (mb, tv);
- }
-
- /**
- * Extract the first message from the queue. Note that the call is blocking.
- *@return the first Message Block from the Message Queue.
- *@param tv amount of time to wait for
- */
- protected MessageBlock getq (TimeValue tv) throws InterruptedException
- {
- return this.msgQueue_.dequeueHead (tv);
- }
-
- /**
- * Return a message back to the queue.
- *@param mb Message Block to return back to the Message Queue
- *@param tv amount of time to wait for
- */
- protected int ungetq (MessageBlock mb, TimeValue tv) throws InterruptedException
- {
- return this.msgQueue_.enqueueHead (mb, tv);
- }
-
- /**
- * Transfer message to the adjacent ACETask in an ACEStream.
- *@param mb Message Block to transfer to the adjacent Task
- *@param tv amount of time to wait for
- *@return -1 if there is no adjacent Task, else the return value of
- * trying to put the Message Block on that Task's Message Queue.
- */
- protected int putNext (MessageBlock mb, TimeValue tv)
- {
- return this.next_ == null ? -1 : this.next_.put (mb, tv);
- }
-
- /**
- * Turn the message back around. Puts the message in the sibling's
- * Message Queue.
- *@param mb Message Block to put into sibling's Message Queue
- *@param tv amount of time to wait for
- *@return -1 if there is no adjacent Task to the sibling, else the
- * return value of trying to put the Message Block on sibling's
- * Message Queue.
- */
- protected int reply (MessageBlock mb, TimeValue tv)
- {
- return this.sibling ().putNext (mb, tv);
- }
-
- // = ACE_Task utility routines to identify names et al.
-
- /**
- * Get the name of the enclosing Module.
- *@return the name of the enclosing Module if there's one associated
- * with the Task, else null.
- */
- protected String name ()
- {
- if (this.mod_ == null)
- return null;
- else
- return this.mod_.name ();
- }
-
- /**
- * Get the Task's sibling.
- *@return the Task's sibling if there's one associated with the
- * Task's Module, else null.
- */
- protected Task sibling ()
- {
- if (this.mod_ == null)
- return null;
- else
- return this.mod_.sibling (this);
- }
-
- /**
- * Set the Task's module.
- *@param mod the Task's Module.
- */
- protected void module (Module mod)
- {
- this.mod_ = mod;
- }
-
- /**
- * Get the Task's module.
- *@return the Task's Module if there is one, else null.
- */
- protected Module module ()
- {
- return this.mod_;
- }
-
- /**
- * Check if queue is a reader.
- *@return true if queue is a reader, else false.
- */
- protected boolean isReader ()
- {
- return (ACE.BIT_ENABLED (this.flags_, TaskFlags.ACE_READER));
- }
-
- /**
- * Check if queue is a writer.
- *@return true if queue is a writer, else false.
- */
- protected boolean isWriter ()
- {
- return (ACE.BIT_DISABLED (this.flags_, TaskFlags.ACE_READER));
- }
-
- // = Pointers to next ACE_Queue (if ACE is part of an ACE_Stream).
-
- /**
- * Get next Task pointer.
- *@return pointer to the next Task
- */
- protected Task next ()
- {
- return this.next_;
- }
-
- /**
- * Set next Task pointer.
- *@param task next task pointer
- */
- protected void next (Task task)
- {
- this.next_ = task;
- }
-
- // Special routines corresponding to certain message types.
-
- /**
- * Flush the Message Queue
- *@return 0 if Message Queue is null, 1 if flush succeeds, -1 if
- * ACE_FLUSHALL bit is not enabled in flags.
- */
- protected int flush (long flag)
- {
- if (ACE.BIT_ENABLED (flag, TaskFlags.ACE_FLUSHALL))
- return (this.msgQueue_ == null ? 0 : 1);
- else
- return -1;
- }
-
-
- /**
- * Manipulate watermarks.
- *@param cmd IOCntlCmd
- *@param size watermark
- */
- protected void waterMarks (int cmd, int size)
- {
- if (cmd == IOCntlCmds.SET_LWM)
- this.msgQueue_.lowWaterMark (size);
- else /* cmd == IOCntlMsg.SET_HWM */
- this.msgQueue_.highWaterMark (size);
- }
-
- private ThreadManager thrMgr_ = null;
- // Thread_Manager that manages all the spawned threads
-
- private long flags_;
- // Task flags.
-
- private MessageQueue msgQueue_;
- // List of messages on the Task..
-
- private Task next_;
- // Adjacent ACE_Task.
-
- private Module mod_;
- // Back-pointer to the enclosing module.
-}
diff --git a/java/src/TaskFlags.java b/java/src/TaskFlags.java
deleted file mode 100644
index 590e514b5e2..00000000000
--- a/java/src/TaskFlags.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * TaskFlags.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-public abstract class TaskFlags
-{
- /** Identifies a Task as being the "reader" in a Module. */
- public static final int ACE_READER = 01;
-
- /** Just flush data messages in the queue. */
- public static final int ACE_FLUSHDATA = 02;
-
- /** Flush all messages in the Queue. */
- public static final int ACE_FLUSHALL = 04;
-
- /** Flush read queue */
- public static final int ACE_FLUSHR = 010;
-
- /** Flush write queue */
- public static final int ACE_FLUSHW = 020;
-
- /** Flush both queues */
- public static final int ACE_FLUSHRW = 030;
-
- /** Identifies a thread as suspended */
- public static final int THR_SUSPENDED = 0x00000080;
-
- /** Identifies a thread as a daemon thread */
- public static final int THR_DAEMON = 0x00000100;
-
- // Default private constructor to avoid instantiation
- private TaskFlags ()
- {
- }
-}
diff --git a/java/src/ThreadManager.java b/java/src/ThreadManager.java
deleted file mode 100644
index 5043d26511e..00000000000
--- a/java/src/ThreadManager.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Concurrency
- *
- * = FILENAME
- * ThreadManager.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Concurrency;
-
-import java.util.*;
-import JACE.OS.*;
-
-public class ThreadManager
-{
- /**
- * Default constructor
- */
- public ThreadManager ()
- {
- this (ACE.DEFAULT_THREAD_GROUP_NAME);
- }
-
- /**
- * Create a Thread Manager.
- *@param groupName name of the thread group that the Thread Manager
- * will manage
- */
- public ThreadManager (String groupName)
- {
- this.thrGrp_ = new ThreadGroup (groupName);
- if (this.thrGrp_ == null)
- ACE.ERROR ("Thread group create failed");
- }
-
- /**
- * Create a new thread.
- *@param thr the caller whose run method will be invoked when the
- * thread has been spawned
- *@param daemon flag indicating whether the thread should be
- * spawned off as a daemon thread
- */
- public void spawn (Runnable thr,
- boolean daemon)
- {
- Thread t = new Thread (this.thrGrp_, thr);
- if (daemon) // Set the thread to be a daemon thread
- t.setDaemon (true);
- t.start ();
- }
-
- /**
- * Create a new thread and also give it a name.
- *@param thr the caller whose run method will be invoked when the
- * thread has been spawned
- *@param threadName the name of the new thread
- *@param daemon flag indicating whether the thread should be
- * spawned off as a daemon thread
- */
- public void spawn (Runnable thr,
- String threadName,
- boolean daemon)
- {
- Thread t = new Thread (this.thrGrp_, thr, threadName);
- if (daemon) // Set the thread to be a daemon thread
- t.setDaemon (true);
- t.start ();
- }
-
-
- /**
- * Create <n> new threads.
- *@param n the number of threads to spawn
- *@param thr the caller whose run method will be invoked by each of
- * the <n> threads
- *@param daemon flag indicating whether the threads should be
- * spawned off as daemon threads
- */
- public void spawnN (int n,
- Runnable thr,
- boolean daemon)
- {
- // Spawn off all the threads.
- for (int i = 0; i < n; i++)
- {
- this.spawn (thr, daemon);
- }
- }
-
- /**
- * Get the thread group containing all the threads. Note that the
- * thread group can be used to get information regarding number of
- * active threads as well as to suspend/resume all the threads in
- * the group.
- *@return the thread group that contains all the threads managed by
- * the Thread Manager
- */
- public ThreadGroup thrGrp ()
- {
- return this.thrGrp_;
- }
-
- private ThreadGroup thrGrp_;
- // Thread Group that contains all the spawned threads
-
-}
diff --git a/java/src/ThruTask.java b/java/src/ThruTask.java
deleted file mode 100644
index aebc8eb1f48..00000000000
--- a/java/src/ThruTask.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * ThruTask.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.ASX;
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Standard module that acts as a "no op", simply passing on all
- * data to its adjacent neighbor.
- *</blockquote>
- */
-public class ThruTask extends Task
-{
- public int open (Object obj)
- {
- return 0;
- }
-
- public int close (long flags)
- {
- return 0;
- }
-
- public int put (MessageBlock msg, TimeValue tv)
- {
- return this.putNext (msg, tv);
- }
-
- public int svc ()
- {
- return -1;
- }
-
- public int handleTimeout (TimeValue tv, Object obj)
- {
- return 0;
- }
-}
diff --git a/java/src/TimeValue.java b/java/src/TimeValue.java
deleted file mode 100644
index 280f45ab0f1..00000000000
--- a/java/src/TimeValue.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Reactor
- *
- * = FILENAME
- * TimeValue.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-//package JACE.Reactor;
-package JACE.ASX;
-
-public class TimeValue
-{
- public final static TimeValue zero = new TimeValue (0,0);
-
- /**
- * Default constructor
- */
- public TimeValue ()
- {
- this (0, 0);
- }
-
- /**
- * Constructor
- *@param sec seconds
- */
- public TimeValue (long sec)
- {
- this (sec, 0);
- }
-
- /**
- * Constructor
- *@param sec seconds
- *@param nanos nanoseconds
- */
- public TimeValue (long sec, int nanos)
- {
- this.set (sec, nanos);
- }
-
- /**
- * Sets the seconds and nanoseconds of Time Value
- *@param sec seconds
- *@param nanos nanoseconds
- */
- public void set (long sec, int nanos)
- {
- this.millisec_ = sec * 1000;
- this.nanos_ = nanos;
- this.normalize ();
- }
-
- /**
- * Get seconds
- *@return Seconds
- */
- public long sec ()
- {
- return this.millisec_/1000;
- }
-
- /**
- * Get nanoseconds
- *@return Nanoseconds
- */
- public int nanos ()
- {
- return this.nanos_;
- }
-
- /**
- * Get time in milliseconds.
- *@return time in milliseconds
- */
- public long getMilliTime ()
- {
- return this.millisec_;
- }
-
- /**
- * Get a String representation of the Time Value.
- *@return String representation of the Time Value
- */
- public String toString ()
- {
- return (new Long (this.millisec_/1000)).toString () + ":" +
- (new Integer (this.nanos_)).toString ();
- }
-
- /**
- * Get current time.
- *@return the current system time
- */
- public static TimeValue getTimeOfDay ()
- {
- return new TimeValue (System.currentTimeMillis ()/1000);
- }
-
- /**
- * Compare two Time Values for equality.
- *@param tv Time Value to compare with
- *@return true if the two Time Values are equal, false otherwise
- */
- public boolean equals (TimeValue tv)
- {
- return this.millisec_ == (tv.sec () * 1000) && this.nanos_ == tv.nanos ();
- }
-
- /**
- * Compare two Time Values for non-equality.
- *@param tv Time Value to compare with
- *@return true if the two Time Values are not equal, false otherwise
- */
- public boolean notEquals (TimeValue tv)
- {
- return !this.equals (tv);
- }
-
- /**
- * Add two Time Values.
- *@param tv1 The first Time Value
- *@param tv2 The second Time Value
- *@return sum of the two Time Values.
- */
- public static TimeValue plus (TimeValue tv1, TimeValue tv2)
- {
- TimeValue tv = new TimeValue (tv1.sec () + tv2.sec (),
- tv1.nanos () + tv2.nanos ());
- tv.normalize ();
- return tv;
- }
-
- /**
- * Subtract two Time Values.
- *@param tv1 The first Time Value
- *@param tv2 The second Time Value
- *@return difference of the two Time Values.
- */
- public static TimeValue minus (TimeValue tv1, TimeValue tv2)
- {
- TimeValue tv = new TimeValue (tv1.sec () - tv2.sec (),
- tv1.nanos () - tv2.nanos ());
- tv.normalize ();
- return tv;
- }
-
- /**
- * Add Time Value to "this".
- *@param tv The Time Value to add to this.
- */
- public void plusEquals (TimeValue tv)
- {
- this.set (this.sec () + tv.sec (),
- this.nanos () + tv.nanos ());
- this.normalize ();
- }
-
- /**
- * Subtract Time Value from "this".
- *@param tv The Time Value to subtract from this.
- */
- public void minusEquals (TimeValue tv)
- {
- this.set (this.sec () - tv.sec (),
- this.nanos () - tv.nanos ());
- this.normalize ();
- }
-
- /**
- * Compare two Time Values for less than.
- *@param tv Time Value to compare with
- *@return true if "this" is less than tv, false otherwise
- */
- public boolean lessThan (TimeValue tv)
- {
- return tv.greaterThan (this);
- }
-
- /**
- * Compare two Time Values for greater than.
- *@param tv Time Value to compare with
- *@return true if "this" is greater than tv, false otherwise
- */
- public boolean greaterThan (TimeValue tv)
- {
- if (this.sec () > tv.sec ())
- return true;
- else if (this.sec () == tv.sec ()
- && this.nanos () > tv.nanos ())
- return true;
- else
- return false;
- }
-
- /**
- * Compare two Time Values for <=.
- *@param tv Time Value to compare with
- *@return true if "this" <= tv, false otherwise
- */
- public boolean lessThanEqual (TimeValue tv)
- {
- return tv.greaterThanEqual (this);
- }
-
- /**
- * Compare two Time Values for >=.
- *@param tv Time Value to compare with
- *@return true if "this" >= tv, false otherwise
- */
- public boolean greaterThanEqual (TimeValue tv)
- {
- return this.sec () >= tv.sec () && this.nanos () >= tv.nanos ();
- }
-
- private void normalize ()
- {
- if (this.nanos_ >= ONE_MILLISECOND)
- {
- do
- {
- this.millisec_++;
- this.nanos_ -= ONE_MILLISECOND;
- }
- while (this.nanos_ >= ONE_MILLISECOND);
- }
- else if (this.nanos_ <= -ONE_MILLISECOND)
- {
- do
- {
- this.millisec_--;
- this.nanos_ += ONE_MILLISECOND;
- }
- while (this.nanos_ <= -ONE_MILLISECOND);
- }
-
- if (this.millisec_ >= 1 && this.nanos_ < 0)
- {
- this.millisec_--;
- this.nanos_ += ONE_MILLISECOND;
- }
- else if (this.millisec_ < 0 && this.nanos_ > 0)
- {
- this.millisec_++;
- this.nanos_ -= ONE_MILLISECOND;
- }
- }
-
- private long millisec_;
- private int nanos_;
- private final static int ONE_MILLISECOND = 1000000;
-}
diff --git a/java/src/TimedWait.java b/java/src/TimedWait.java
deleted file mode 100644
index acf771dfca1..00000000000
--- a/java/src/TimedWait.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * TimedWait.java
- *
- *@author Prashant Jain and Doug Schmidt
- *
- *************************************************/
-package JACE.ASX;
-
-public abstract class TimedWait
-{
- /**
- * Default Constructor. Sets "this" to be used for the delegation of
- * the wait() call to.
- */
- public TimedWait ()
- {
- object_ = this;
- }
-
- /**
- * Constructor. Allows subclasses to supply us with an Object that
- * is delegated the wait() call.
- *@param obj The Object that is delegated the wait() call.
- */
- public TimedWait (Object obj)
- {
- object_ = obj;
- }
-
- /**
- * Hook method that needs to be implemented by subclasses.
- */
- public abstract boolean condition ();
-
- /**
- * Wait until condition becomes true. Note that the method
- * blocks. Also note that this method is final to ensure that no one
- * overrides it.
- * IMPORTANT: This method assumes it is called with the object_'s
- * monitor lock already held.
- */
- public final void timedWait () throws InterruptedException
- {
- // Acquire the monitor lock.
- if (!condition ())
- {
- // Only attempt to perform the wait if the condition isn't
- // true initially.
- for (;;)
- {
- // Wait until we are notified.
- object_.wait ();
-
- // Recheck the condition.
- if (condition ())
- break; // Condition became true.
- // else we were falsely notified so go back into wait
- }
- }
- }
-
- /**
- * Template Method that implements the actual timed wait. Note that
- * this method is final to ensure that no one overrides it.
- * IMPORTANT: This method assumes it is called with the object_'s
- * monitor lock already held.
- *@param tv Amount of time to do wait for.
- */
- public final void timedWait (TimeValue tv)
- throws InterruptedException,
- TimeoutException
- {
- // Acquire the monitor lock.
- if (!condition ())
- {
- // Only attempt to perform the timed wait if the condition isn't
- // true initially.
- long start = System.currentTimeMillis ();
- long waitTime = tv.getMilliTime ();
-
- for (;;) {
- // Wait until we are notified.
- object_.wait (waitTime);
-
- // Recheck the condition.
- if (!condition ()) {
- long now = System.currentTimeMillis ();
- long timeSoFar = now - start;
-
- // Timed out!
- if (timeSoFar >= tv.getMilliTime ())
- throw new TimeoutException ();
- else
- // We still have some time left to wait, so adjust the
- // wait_time.
- waitTime = tv.getMilliTime () - timeSoFar;
- }
- else
- break; // Condition became true.
- }
- }
- }
-
- /**
- * Notify any one thread waiting on the object_.
- * IMPORTANT: This method assumes it is called with the object_'s
- * monitor lock already held.
- */
- public final void signal () {
- object_.notify ();
- }
-
- /**
- * Notify all threads waiting on the object_.
- * IMPORTANT: This method assumes it is called with the object_'s
- * monitor lock already held.
- */
- public final void broadcast () {
- object_.notifyAll ();
- }
-
- /**
- * The object we delegate to. If a subclass gives us a particular
- * object, we use that to delegate to, otherwise, we ``delegate''
- * to ourself (i.e., this).
- */
- protected Object object_;
-
-}
diff --git a/java/src/TimeoutException.java b/java/src/TimeoutException.java
deleted file mode 100644
index b55549938dc..00000000000
--- a/java/src/TimeoutException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.ASX
- *
- * = FILENAME
- * TimeoutException.java
- *
- *@author Prashant Jain and Doug Schmidt
- *
- *************************************************/
-package JACE.ASX;
-
-public class TimeoutException extends Exception
-{
- /**
- * Default Constructor.
- */
- public TimeoutException ()
- {
- super ("Timed Out");
- }
-
- /**
- * Constructor.
- *@param timeout The timeout value which expired.
- *@param desc Textual description of the exception
- */
- public TimeoutException (TimeValue timeout, String desc)
- {
- super ("Timed Out in " + timeout + ": " + desc);
- }
-
-}
diff --git a/java/src/TimerQueue.java b/java/src/TimerQueue.java
deleted file mode 100644
index 74bac5ec398..00000000000
--- a/java/src/TimerQueue.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Reactor
- *
- * = FILENAME
- * TimerQueue.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Reactor;
-
-import java.util.*;
-import JACE.ASX.*;
-
-class TimerNode
-{
- public TimerNode (EventHandler handler,
- Object arg,
- TimeValue timerValue,
- TimeValue interval,
- TimerNode next,
- int timerId)
- {
- this.handler_ = handler;
- this.arg_ = arg;
- this.timerValue_ = timerValue;
- this.interval_ = interval;
- this.next_ = next;
- this.timerId_ = timerId;
- }
-
- public EventHandler handler_;
- // Handler to invoke <handleTimeout> on when a timeout occurs.
-
- public Object arg_;
- // Argument to pass to <handleTimeout>.
-
- public TimeValue timerValue_;
- // Time until the timer expires.
-
- public TimeValue interval_;
- // If this is a periodic timer this holds the time until the next
- // timeout.
-
- public TimerNode next_;
- // Pointer to next timer.
-
- public int timerId_;
- // Id of this timer (used to cancel timers before they expire).
-}
-
-class WaitObject extends TimedWait
-{
- public boolean condition ()
- {
- return this.condition_;
- }
-
- public void condition (boolean c)
- {
- this.condition_ = c;
- }
-
- private boolean condition_ = false;
-}
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Class that provides an interface to timers.
- *
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * This is a simple implementation that keeps a linked list of
- * absolute timers. It allows multiple timers to be scheduled
- * and returns a timer id for each timer scheduled. In addition,
- * it allows periodic timers to be scheduled.
- *</blockquote>
- */
-public class TimerQueue implements Runnable
-{
- /**
- * Constructor.
- *@param createInternalThread flag specifying whether to create an
- * internal thread that runs the event loop. If it is true, a thread
- * is spawned and it runs the event loop, handling all timeout
- * events. If it is false, the caller is then responsible for calling
- * handleEvents () to run the event loop.
- */
- public TimerQueue (boolean createInternalThread)
- {
- this.eventLoopRunning_ = false;
- if (createInternalThread)
- new Thread (this).start ();
- }
-
- /**
- * The thread run method. Do *NOT* call this method! It gets called
- * automatically.
- */
- public void run ()
- {
- this.handleEvents ();
- }
-
- /**
- * Handle timeout events. This forms the event loop and takes care
- * of all scheduling. This method should only be called if the Timer
- * Queue was constructed with the value of createInternalThread as
- * false.
- */
- public void handleEvents ()
- {
- if (!this.eventLoopRunning_)
- {
- // Set the flag indicating that the event loop is now running
- this.eventLoopRunning_ = true;
-
- TimeValue timeout = null;
- TimeValue earliest = null;
-
- for (;;)
- {
- synchronized (this.obj_)
- {
- earliest = this.earliestTime ();
- if (earliest != null)
- timeout = TimeValue.minus (earliest, TimeValue.getTimeOfDay ());
- else
- timeout = new TimeValue ();
- try
- {
- // Extract the earliest time from the queue and do a timed wait
- this.obj_.timedWait (timeout);
-
- // We have been notified. Check to see if we need to
- // restart the wait with a different timeout
- if (this.reset_)
- {
- this.reset_ = false;
- this.obj_.condition (false);
- timeout = TimeValue.minus (this.earliestTime (), TimeValue.getTimeOfDay ());
- }
- }
- catch (TimeoutException e)
- {
- // Timeout occurred. Call handleTimeout on appropriate
- // Event Handlers
- this.dispatchHandlers ();
- }
- catch (InterruptedException e)
- {
- }
- }
- }
- }
- }
-
- /**
- * Check if the queue is empty.
- *@return true if queue is empty, else false.
- */
- boolean isEmpty ()
- {
- return this.head_ == null;
- }
-
- /**
- * Get the node of the earliest node in the TimerQueue.
- *@return the time of the earlier node in the TimerQueue.
- */
- TimeValue earliestTime ()
- {
- synchronized (this.obj_)
- {
- if (!this.isEmpty ())
- return this.head_.timerValue_;
- else
- return null;
- }
- }
-
- /**
- * Schedule an <EventHandler> that will expire after <delta> amount
- * of time. If it expires then <obj> is passed in as the value to
- * the <EventHandler>'s <handleTimeout> callback method. This method
- * returns a timer id that uniquely identifies the timer and can be
- * used to cancel the timer before it expires.
- *@param handler Event Handler that is to be scheduled with the timer
- *@param obj Object that is passed back to the Event Handler when
- * timeout occurs (Asynchronous Completion Token)
- *@param delta amount of time for which to schedule the timer
- *@return id of the timer scheduled
- */
- public int scheduleTimer (EventHandler handler,
- Object obj,
- TimeValue delta)
- {
- return this.scheduleTimer (handler, obj, delta, TimeValue.zero);
- }
-
- /**
- * Schedule an <EventHandler> that will expire after <delta> amount
- * of time. If it expires then <obj> is passed in as the value to
- * the <EventHandler>'s <handleTimeout> callback method. If
- * <interval> is != to <TimeValue.zero> then it is used to
- * reschedule the <EventHandler> automatically. This method
- * returns a timer id that uniquely identifies the timer and can be
- * used to cancel the timer before it expires.
- *@param handler Event Handler that is to be scheduled with the timer
- *@param arg Object that is passed back to the Event Handler when
- * timeout occurs (Asynchronous Completion Token)
- *@param timeout amount of time for which to schedule the timer
- *@param interval amount of time to use to reschedule the timer
- *@return id of the timer scheduled
- */
- public int scheduleTimer (EventHandler handler,
- Object arg,
- TimeValue timeout,
- TimeValue interval)
- {
- // Increment the sequence number (it will wrap around).
- this.timerId_++;
- TimeValue futureTime = TimeValue.plus (timeout, TimeValue.getTimeOfDay ());
- TimerNode node = new TimerNode (handler,
- arg,
- futureTime,
- interval,
- null,
- this.timerId_);
- synchronized (this.obj_)
- {
- // Check if event loop is running. If it is not, then we can
- // just place it at the appropriate place in the queue and
- // don't need to do any notification. If event loop is
- // running, then check if the node is the first node in the
- // queue (either because the queue is empty or because the
- // time for the node is earlier than the currently scheduled
- // timer node).
- if (this.eventLoopRunning_ &&
- (this.isEmpty () || futureTime.lessThan (this.earliestTime ())))
- {
- // Insert the node into (the beginning of) the queue to be
- // scheduled.
- this.reschedule (node);
-
- // Notify the waiting thread so that it can reschedule
- // using the earliest timeout
- this.obj_.notify ();
- }
- else // Place in the appropriate position in the queue.
- {
- this.reschedule (node);
- }
- }
- return this.timerId_;
- }
-
-
- /**
- * Cancel the single timer associated with <timerId>.
- *@param timerId id of the timer that needs to be cancelled.
- *@return Object that was passed in when timer was scheduled
- * (Asynchronous Completion Token).
- */
- public Object cancelTimer (int timerId)
- {
- TimerNode prev = null;
- TimerNode curr = null;
-
- synchronized (this.obj_)
- {
- // Try to locate the TimerNode that matches the timerId.
- for (curr = this.head_;
- curr != null && curr.timerId_ != timerId;
- curr = curr.next_)
- prev = curr;
-
- if (curr != null)
- {
- if (prev == null)
- this.head_ = curr.next_;
- else
- prev.next_ = curr.next_;
-
- return curr.arg_;
- }
- }
- return null;
- }
-
- /**
- * Cancel all timers associated with <Event Handler>.
- *@param handler Event Handler whose associated timers need to be cancelled.
- */
- public void cancelTimer (EventHandler handler)
- {
- TimerNode prev = null;
- TimerNode curr = this.head_;
-
- synchronized (this.obj_)
- {
- while (curr != null)
- {
- if (curr.handler_ == handler)
- {
- if (prev == null)
- {
- this.head_ = curr.next_;
- curr = this.head_;
- }
- else
- {
- prev.next_ = curr.next_;
- curr = prev.next_;
- }
- }
- else
- {
- prev = curr;
- curr = curr.next_;
- }
- }
- }
- }
-
- // Call handleTimeout() on all handlers whose timers have expired.
- private void dispatchHandlers ()
- {
- TimeValue currentTime = TimeValue.getTimeOfDay ();
-
- for (;;)
- {
- if (this.isEmpty () || this.earliestTime ().greaterThan (currentTime))
- break; // There aren't any more timers eligible to expire.
-
- TimerNode expired = this.head_;
- EventHandler handler = expired.handler_;
- Object arg = expired.arg_;
- int result;
-
- this.head_ = this.head_.next_;
-
- // Check whether this is an interval timer.
- if (expired.interval_.greaterThan (TimeValue.zero))
- {
- // Make sure that we skip past values that have already
- // "expired".
- do
- expired.timerValue_.plusEquals (expired.interval_);
- while (expired.timerValue_.lessThanEqual (currentTime));
-
- // Since this is an interval timer, we need to reschedule
- // it.
- this.reschedule (expired);
- }
-
- // Perform the callback.
- result = handler.handleTimeout (currentTime, arg);
-
- if (result == -1)
- this.cancelTimer (handler);
- }
- }
-
- // Reschedule a TimerNode by inserting it at the appropriate
- // position in the queue.
- private void reschedule (TimerNode expired)
- {
- if (this.isEmpty () ||
- expired.timerValue_.lessThan (this.earliestTime ()))
- {
- expired.next_ = this.head_;
- this.head_ = expired;
- // Set the condition to true so that the waiting thread can be
- // notified and it can reschedule.
- this.obj_.condition (true);
- this.reset_ = true;
- }
- else
- {
- TimerNode prev = this.head_;
- TimerNode after = this.head_.next_;
-
- // Locate the proper position in the queue.
-
- while (after != null
- && expired.timerValue_.greaterThan (after.timerValue_))
- {
- prev = after;
- after = after.next_;
- }
-
- expired.next_ = after;
- prev.next_ = expired;
- }
- }
-
- private WaitObject obj_ = new WaitObject ();
- // Synchronization object (as well as object to use to do wait on)
-
- private TimerNode head_;
- // Pointer to linked list of TimerHandles.
-
- private int timerId_;
- // Keeps track of the timer id that uniquely identifies each timer.
- // This id can be used to cancel a timer via the <cancel (int)>
- // method.
-
- private boolean reset_;
- // Flag indicating whether to start the wait again
-
- private boolean eventLoopRunning_;
- // Flag indicating whether the event loop is running or not
-}
-
diff --git a/java/src/Token.java b/java/src/Token.java
deleted file mode 100644
index a17be013ad5..00000000000
--- a/java/src/Token.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*************************************************
- *
- * = PACKAGE
- * JACE.Concurrency
- *
- * = FILENAME
- * Token.java
- *
- *@author Prashant Jain
- *
- *************************************************/
-package JACE.Concurrency;
-
-import java.util.*;
-import JACE.ASX.*;
-
-class WaitObject extends TimedWait
-{
- public boolean condition ()
- {
- return this.condition_;
- }
-
- public void condition (boolean c)
- {
- this.condition_ = c;
- }
-
- private boolean condition_ = false;
-}
-
-/**
- * <hr>
- * <h2>SYNOPSIS</h2>
- *<blockquote>
- * Class that acquires, renews, and releases a synchronization
- * token that is serviced in strict FIFO ordering.
- *
- *</blockquote>
- *
- * <h2>DESCRIPTION</h2>
- *<blockquote>
- * This is a general-purpose synchronization mechanism that offers
- * several benefits. For example, it implements "recursive mutex"
- * semantics, where a thread that owns the token can reacquire it
- * without deadlocking. In addition, threads that are blocked
- * awaiting the token are serviced in strict FIFO order as other
- * threads release the token. The solution makes use of the
- * Specific Notification pattern presented by Tom Cargill in
- * "Specific Notification for Java Thread Synchronization," PLoP96.
- *</blockquote>
- */
-public class Token
-{
- /**
- * Acquire the token. Note that this will block. The method uses
- * synchronized blocks internally to avoid race conditions.
- *@return 0 if acquires without calling <sleepHook>
- * 1 if <sleepHook> is called.
- * -1 if failure occurs
- *@exception InterruptedException exception during wait
- */
- public int acquire () throws InterruptedException
- {
- try
- {
- return this.acquire (new TimeValue ());
- }
- catch (TimeoutException e)
- {
- // This really shouldn't happen since we are supposed to
- // block.
- return -1;
- }
- }
-
- /**
- * Acquire the token. Wait for timeout amount of time. The method
- * uses synchronized blocks internally to avoid race conditions.
- *@param timeout Amount of time to wait for in trying to acquire the
- * token.
- *@return 0 if acquires without calling <sleepHook>
- * 1 if <sleepHook> is called.
- * -1 if failure occurs
- *@exception TimeoutException exception if timeout occurs
- *@exception InterruptedException exception during wait
- */
- public int acquire (TimeValue timeout) throws InterruptedException, TimeoutException
- {
- int result = 0;
- WaitObject snl = new WaitObject ();
- boolean mustWait;
- synchronized (snl)
- {
- synchronized (this)
- {
- mustWait = !this.snq_.isEmpty ();
- if (mustWait &&
- Thread.currentThread ().toString ().compareTo (this.owner_) == 0)
- {
- // I am the one who has the token. So just increment
- // the nesting level
- this.nestingLevel_++;
- return result;
- }
- // Add local lock to the queue
- this.snq_.addElement (snl);
- }
- if (mustWait)
- {
- result = 1;
- // Call sleep hook
- sleepHook ();
- snl.timedWait (timeout); // Do a blocking wait
- }
- // Set the owner of the token
- this.owner_ = Thread.currentThread ().toString ();
- }
- return result;
- }
-
- /**
- * Try to acquire the token. Implements a non-blocking acquire.
- *@return 0 if acquires without calling <sleepHook>
- * 1 if <sleepHook> is called.
- * -1 if failure occurs
- */
- public synchronized int tryAcquire ()
- {
- int result = 0;
- if (!this.snq_.isEmpty ())
- {
- // No one has the token, so acquire it
- this.snq_.addElement (new WaitObject ());
- }
- // Check if I am the one holding the token.
- else if (Thread.currentThread ().toString ().compareTo (this.owner_) == 0)
- {
- this.nestingLevel_++;
- }
- // Someone else has the token.
- else
- {
- // Will have to block to acquire the token, so call
- // sleepHook and return
- sleepHook ();
- result = 1;
- }
- return result;
- }
-
- /**
- * Method that is called before a thread goes to sleep in an
- * acquire(). This should be overridden by a subclass to define
- * the appropriate behavior before acquire() goes to sleep.
- * By default, this is a no-op.
- */
- public void sleepHook ()
- {
- }
-
- /**
- * An optimized method that efficiently reacquires the token if no
- * other threads are waiting. This is useful for situations where
- * you don't want to degrade the quality of service if there are
- * other threads waiting to get the token.
- *@param requeuePosition Position in the queue where to insert the
- * lock. If requeuePosition == -1 and there are other threads
- * waiting to obtain the token we are queued at the end of the list
- * of waiters. If requeuePosition > -1 then it indicates how many
- * entries to skip over before inserting our thread into the list of
- * waiters (e.g.,requeuePosition == 0 means "insert at front of the
- * queue").
- *@exception InterruptedException exception during wait
- */
- public void renew (int requeuePosition) throws InterruptedException
- {
- try
- {
- this.renew (requeuePosition, new TimeValue ());
- }
- catch (TimeoutException e)
- {
- // This really shouldn't happen since we are supposed to
- // block.
- }
- }
-
- /**
- * An optimized method that efficiently reacquires the token if no
- * other threads are waiting. This is useful for situations where
- * you don't want to degrade the quality of service if there are
- * other threads waiting to get the token.
- *@param requeuePosition Position in the queue where to insert the
- * lock. If requeuePosition == -1 and there are other threads
- * waiting to obtain the token we are queued at the end of the list
- * of waiters. If requeuePosition > -1 then it indicates how many
- * entries to skip over before inserting our thread into the list of
- * waiters (e.g.,requeuePosition == 0 means "insert at front of the
- * queue").
- *@param timeout Amount of time to wait for in trying to acquire the
- * token.
- *@exception TimeoutException exception if timeout occurs
- *@exception InterruptedException exception during wait
- */
- public void renew (int requeuePosition, TimeValue timeout)
- throws InterruptedException, TimeoutException
- {
- WaitObject snl = null;
- int saveNestingLevel = 0;
-
- synchronized (this)
- {
- // Check if there is a thread waiting to acquire the token. If
- // not or if requeuePosition == 0, then we don't do anything
- // and we simply keep the token.
- if (this.snq_.size () > 1 && requeuePosition != 0)
- {
- // Save the nesting level
- saveNestingLevel = this.nestingLevel_;
- this.nestingLevel_ = 0;
-
- // Reinsert ourselves at requeuePosition in the queue
- snl = (WaitObject) this.snq_.firstElement ();
- this.snq_.removeElementAt (0);
-
- if (requeuePosition < 0)
- this.snq_.addElement (snl); // Insert at end
- else
- this.snq_.insertElementAt (snl, requeuePosition);
-
- synchronized (this.snq_.firstElement ())
- {
- // Notify the first waiting thread in the queue
- WaitObject obj = (WaitObject) this.snq_.firstElement ();
- // Set its condition to be true so that it falls out
- // of the for loop
- obj.condition (true);
- // Now signal the thread
- obj.signal ();
- }
- }
- }
-
- // Check if we reinserted the lock in the queue and therefore need
- // to do a wait
- if (snl != null)
- {
- synchronized (snl)
- {
- // Set the condition to be false so that we can begin the
- // wait
- snl.condition (false);
- // Do a blocking wait
- snl.timedWait (timeout);
- }
- // Restore the nesting level and current owner of the lock
- this.nestingLevel_ = saveNestingLevel;
- this.owner_ = Thread.currentThread ().toString ();
- }
- }
-
- /**
- * Release the token.
- */
- public synchronized void release ()
- {
- // Check if nestingLevel > 0 and if so, decrement it
- if (this.nestingLevel_ > 0)
- this.nestingLevel_--;
- else
- {
- this.snq_.removeElementAt (0);
- if (!this.snq_.isEmpty ())
- {
- synchronized (this.snq_.firstElement ())
- {
- // Notify the first waiting thread in the queue
- WaitObject obj = (WaitObject) this.snq_.firstElement ();
- // Set its condition to be true so that it falls out
- // of the for loop
- obj.condition (true);
- // Now signal the thread
- obj.signal ();
- }
- }
- }
- }
-
- private Vector snq_ = new Vector ();
- // Vector of lock objects
-
- private int nestingLevel_ = 0;
- // Current Nesting Level
-
- private String owner_ = null;
- // Current owner of the token.
-}
diff --git a/java/src/Yylex.java b/java/src/Yylex.java
deleted file mode 100644
index a23a48efe88..00000000000
--- a/java/src/Yylex.java
+++ /dev/null
@@ -1,1316 +0,0 @@
-package JACE.ServiceConfigurator;
-import java.lang.*;
-import java.io.*;
-import JACE.OS.*;
-import java_cup.runtime.*;
-// This was written for JLex version 1.2
-
-
-class Yylex {
- private final int YY_BUFFER_SIZE = 512;
- private final int YY_F = -1;
- private final int YY_NO_STATE = -1;
- private final int YY_NOT_ACCEPT = 0;
- private final int YY_START = 1;
- private final int YY_END = 2;
- private final int YY_NO_ANCHOR = 4;
- private final byte YYEOF = -1;
-
- // Used to assemble the parameter string for a service
- private String params;
- private java.io.DataInputStream yy_instream;
- private int yy_buffer_index;
- private int yy_buffer_read;
- private int yy_buffer_start;
- private int yy_buffer_end;
- private byte yy_buffer[];
- private int yyline;
- private int yy_lexical_state;
- Yylex (java.io.InputStream instream) {
- if (null == instream) {
- throw (new Error("Error: Bad input stream initializer."));
- }
- yy_instream = new java.io.DataInputStream(instream);
- yy_buffer = new byte[YY_BUFFER_SIZE];
- yy_buffer_read = 0;
- yy_buffer_index = 0;
- yy_buffer_start = 0;
- yy_buffer_end = 0;
- yyline = 0;
- yy_lexical_state = YYINITIAL;
- }
- private boolean yy_eof_done = false;
- private final int COMMENT = 1;
- private final int YYINITIAL = 0;
- private final int PARAMS = 2;
- private final int yy_state_dtrans[] = {
- 0,
- 23,
- 30
- };
- private void yybegin (int state) {
- yy_lexical_state = state;
- }
- private byte yy_advance ()
- throws java.io.IOException {
- int next_read;
- int i;
- int j;
-
- if (yy_buffer_index < yy_buffer_read) {
- return yy_buffer[yy_buffer_index++];
- }
-
- if (0 != yy_buffer_start) {
- i = yy_buffer_start;
- j = 0;
- while (i < yy_buffer_read) {
- yy_buffer[j] = yy_buffer[i];
- ++i;
- ++j;
- }
- yy_buffer_end = yy_buffer_end - yy_buffer_start;
- yy_buffer_start = 0;
- yy_buffer_read = j;
- yy_buffer_index = j;
- next_read = yy_instream.read(yy_buffer,
- yy_buffer_read,
- yy_buffer.length - yy_buffer_read);
- if (-1 == next_read) {
- return YYEOF;
- }
- yy_buffer_read = yy_buffer_read + next_read;
- }
-
- while (yy_buffer_index >= yy_buffer_read) {
- if (yy_buffer_index >= yy_buffer.length) {
- yy_buffer = yy_double(yy_buffer);
- }
- next_read = yy_instream.read(yy_buffer,
- yy_buffer_read,
- yy_buffer.length - yy_buffer_read);
- if (-1 == next_read) {
- return YYEOF;
- }
- yy_buffer_read = yy_buffer_read + next_read;
- }
- return yy_buffer[yy_buffer_index++];
- }
- private void yy_move_start () {
- if ((byte) '\n' == yy_buffer[yy_buffer_start]) {
- ++yyline;
- }
- ++yy_buffer_start;
- }
- private void yy_pushback () {
- --yy_buffer_end;
- }
- private void yy_mark_start () {
- int i;
- for (i = yy_buffer_start; i < yy_buffer_index; ++i) {
- if ((byte) '\n' == yy_buffer[i]) {
- ++yyline;
- }
- }
- yy_buffer_start = yy_buffer_index;
- }
- private void yy_mark_end () {
- yy_buffer_end = yy_buffer_index;
- }
- private void yy_to_mark () {
- yy_buffer_index = yy_buffer_end;
- }
- private java.lang.String yytext () {
- return (new java.lang.String(yy_buffer,0,
- yy_buffer_start,
- yy_buffer_end - yy_buffer_start));
- }
- private int yylength () {
- return yy_buffer_end - yy_buffer_start;
- }
- private byte[] yy_double (byte buf[]) {
- int i;
- byte newbuf[];
- newbuf = new byte[2*buf.length];
- for (i = 0; i < buf.length; ++i) {
- newbuf[i] = buf[i];
- }
- return newbuf;
- }
- private final int YY_E_INTERNAL = 0;
- private final int YY_E_MATCH = 1;
- private java.lang.String yy_error_string[] = {
- "Error: Internal error.\n",
- "Error: Unmatched input.\n"
- };
- private void yy_error (int code,boolean fatal) {
- java.lang.System.out.print(yy_error_string[code]);
- java.lang.System.out.flush();
- if (fatal) {
- throw new Error("Fatal Error.\n");
- }
- }
- private int yy_acpt[] = {
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NOT_ACCEPT,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NOT_ACCEPT,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR,
- YY_NO_ANCHOR
- };
- private int yy_cmap[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 2, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 3, 4, 0, 0, 0, 0,
- 5, 6, 7, 0, 0, 8, 8, 8,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 10, 0, 0, 0, 0, 0,
- 0, 11, 12, 12, 12, 13, 12, 12,
- 12, 12, 12, 12, 12, 14, 12, 15,
- 12, 12, 16, 17, 18, 12, 12, 12,
- 12, 12, 12, 0, 8, 0, 0, 19,
- 0, 20, 21, 22, 23, 24, 12, 12,
- 12, 25, 26, 12, 27, 28, 29, 30,
- 31, 12, 32, 33, 34, 35, 36, 12,
- 12, 37, 12, 38, 0, 39, 0, 0
-
- };
- private int yy_rmap[] = {
- 0, 1, 1, 1, 1, 1, 1, 2,
- 1, 3, 1, 1, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 4,
- 1, 1, 1, 1, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67
- };
- private int yy_nxt[][] = {
- { 1, 28, 28, 2, 3, 4, 5, 6,
- 7, 7, 8, 9, 9, 9, 72, 9,
- 9, 73, 9, 9, 74, 9, 9, 81,
- 9, 84, 9, 9, 9, 9, 9, 9,
- 75, 76, 9, 9, 9, 9, 10, 11
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 7, -1, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { 24, 24, 25, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24
-
- },
- { -1, 28, 28, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 12, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { 26, 26, 27, 27, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 13, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 14, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 15, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 16, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 17, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 18, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 19, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 20,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 21, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 22, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 29, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 31, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 32, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 33, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 34, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 35, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 36, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 37, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 38, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 39, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 40, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 41, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 42, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 43, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 44, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 45, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 46, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 47, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 48, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 49, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 50, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 51, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 52,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 53, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 54, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 55, 9, 9, 9,
- 9, 56, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 57, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 58, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 59, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 60,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 61, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 62, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 63, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 64, 9, 9, 9, 9, 9,
- 90, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 65, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 66, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 67, 78, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 68, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 69, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 70, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 71, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 77, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 79, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 80,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 82, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 83, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 85, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 86, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 87, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 88, 9, -1, -1
-
- },
- { -1, -1, -1, -1, -1, -1, -1, -1,
- 7, 9, -1, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 89, 9, 9, 9, 9, 9, -1, -1
-
- }
- };
- public java_cup.runtime.token yylex ()
- throws java.io.IOException {
- byte yy_lookahead;
- int yy_anchor = YY_NO_ANCHOR;
- int yy_state = yy_state_dtrans[yy_lexical_state];
- int yy_next_state = YY_NO_STATE;
- int yy_last_accept_state = YY_NO_STATE;
- boolean yy_initial = true;
- int yy_this_accept;
-
- yy_mark_start();
- yy_this_accept = yy_acpt[yy_state];
- if (YY_NOT_ACCEPT != yy_this_accept) {
- yy_last_accept_state = yy_state;
- yy_mark_end();
- }
- while (true) {
- yy_lookahead = yy_advance();
- yy_next_state = YY_F;
- if (YYEOF != yy_lookahead) {
- yy_next_state = yy_nxt[yy_rmap[yy_state]][yy_cmap[yy_lookahead]];
- }
- if (YY_F != yy_next_state) {
- yy_state = yy_next_state;
- yy_initial = false;
- yy_this_accept = yy_acpt[yy_state];
- if (YY_NOT_ACCEPT != yy_this_accept) {
- yy_last_accept_state = yy_state;
- yy_mark_end();
- }
- }
- else {
- if (YYEOF == yy_lookahead && true == yy_initial) {
-
- return new java_cup.runtime.token (sym.EOF);
- }
- else if (YY_NO_STATE == yy_last_accept_state) {
- throw (new Error("Lexical Error: Unmatched Input."));
- }
- else {
- yy_to_mark();
- yy_anchor = yy_acpt[yy_last_accept_state];
- if (0 != (YY_END & yy_anchor)) {
- yy_pushback();
- }
- if (0 != (YY_START & yy_anchor)) {
- yy_move_start();
- }
- switch (yy_last_accept_state) {
- case 0:
- { /* Skip all white space */ }
- case -2:
- break;
- case 1:
- {
- ACE.ERROR ("Unknown text, line " + (yyline + 1) + ": \"" + yytext() + "\"");
- return new java_cup.runtime.str_token (sym.error);
-}
- case -3:
- break;
- case 2:
- {
- yybegin(PARAMS);
- params = new String();
-}
- case -4:
- break;
- case 3:
- { yybegin(COMMENT); }
- case -5:
- break;
- case 4:
- { return new java_cup.runtime.token (sym.ACE_LPAREN); }
- case -6:
- break;
- case 5:
- { return new java_cup.runtime.token (sym.ACE_RPAREN); }
- case -7:
- break;
- case 6:
- { return new java_cup.runtime.token (sym.ACE_STAR); }
- case -8:
- break;
- case 7:
- {
- return new java_cup.runtime.str_token (sym.ACE_PATHNAME, yytext());
-}
- case -9:
- break;
- case 8:
- { return new java_cup.runtime.token (sym.ACE_COLON); }
- case -10:
- break;
- case 9:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -11:
- break;
- case 10:
- { return new java_cup.runtime.token (sym.ACE_LBRACE); }
- case -12:
- break;
- case 11:
- { return new java_cup.runtime.token (sym.ACE_RBRACE); }
- case -13:
- break;
- case 12:
- { return new java_cup.runtime.token (sym.ACE_MODULE_T); }
- case -14:
- break;
- case 13:
- { return new java_cup.runtime.token (sym.ACE_STREAM_T); }
- case -15:
- break;
- case 14:
- { return new java_cup.runtime.token (sym.ACE_ACTIVE); }
- case -16:
- break;
- case 15:
- { return new java_cup.runtime.token (sym.ACE_REMOVE); }
- case -17:
- break;
- case 16:
- { return new java_cup.runtime.token (sym.ACE_RESUME); }
- case -18:
- break;
- case 17:
- { return new java_cup.runtime.token (sym.ACE_STATIC); }
- case -19:
- break;
- case 18:
- { return new java_cup.runtime.token (sym.ACE_USTREAM); }
- case -20:
- break;
- case 19:
- {return new java_cup.runtime.token (sym.ACE_DYNAMIC); }
- case -21:
- break;
- case 20:
- { return new java_cup.runtime.token (sym.ACE_SUSPEND); }
- case -22:
- break;
- case 21:
- { return new java_cup.runtime.token (sym.ACE_INACTIVE); }
- case -23:
- break;
- case 22:
- { return new java_cup.runtime.token (sym.ACE_SVC_OBJ_T); }
- case -24:
- break;
- case 24:
- { /* Skip everything on a comment line */ }
- case -25:
- break;
- case 25:
- { yybegin(YYINITIAL); }
- case -26:
- break;
- case 26:
- {
- params = params + yytext();
-}
- case -27:
- break;
- case 27:
- {
- yybegin(YYINITIAL);
- return new java_cup.runtime.str_token (sym.ACE_STRING, params);
-}
- case -28:
- break;
- case 28:
- { /* Skip all white space */ }
- case -29:
- break;
- case 29:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -30:
- break;
- case 31:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -31:
- break;
- case 32:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -32:
- break;
- case 33:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -33:
- break;
- case 34:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -34:
- break;
- case 35:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -35:
- break;
- case 36:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -36:
- break;
- case 37:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -37:
- break;
- case 38:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -38:
- break;
- case 39:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -39:
- break;
- case 40:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -40:
- break;
- case 41:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -41:
- break;
- case 42:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -42:
- break;
- case 43:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -43:
- break;
- case 44:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -44:
- break;
- case 45:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -45:
- break;
- case 46:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -46:
- break;
- case 47:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -47:
- break;
- case 48:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -48:
- break;
- case 49:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -49:
- break;
- case 50:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -50:
- break;
- case 51:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -51:
- break;
- case 52:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -52:
- break;
- case 53:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -53:
- break;
- case 54:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -54:
- break;
- case 55:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -55:
- break;
- case 56:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -56:
- break;
- case 57:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -57:
- break;
- case 58:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -58:
- break;
- case 59:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -59:
- break;
- case 60:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -60:
- break;
- case 61:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -61:
- break;
- case 62:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -62:
- break;
- case 63:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -63:
- break;
- case 64:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -64:
- break;
- case 65:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -65:
- break;
- case 66:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -66:
- break;
- case 67:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -67:
- break;
- case 68:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -68:
- break;
- case 69:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -69:
- break;
- case 70:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -70:
- break;
- case 71:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -71:
- break;
- case 72:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -72:
- break;
- case 73:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -73:
- break;
- case 74:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -74:
- break;
- case 75:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -75:
- break;
- case 76:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -76:
- break;
- case 77:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -77:
- break;
- case 78:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -78:
- break;
- case 79:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -79:
- break;
- case 80:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -80:
- break;
- case 81:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -81:
- break;
- case 82:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -82:
- break;
- case 83:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -83:
- break;
- case 84:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -84:
- break;
- case 85:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -85:
- break;
- case 86:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -86:
- break;
- case 87:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -87:
- break;
- case 88:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -88:
- break;
- case 89:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -89:
- break;
- case 90:
- {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
- case -90:
- break;
- default:
- yy_error(YY_E_INTERNAL,false);
- case -1:
- }
- yy_initial = true;
- yy_state = yy_state_dtrans[yy_lexical_state];
- yy_next_state = YY_NO_STATE;
- yy_last_accept_state = YY_NO_STATE;
- yy_mark_start();
- yy_this_accept = yy_acpt[yy_state];
- if (YY_NOT_ACCEPT != yy_this_accept) {
- yy_last_accept_state = yy_state;
- }
- }
- }
- }
- }
-}
diff --git a/java/src/Yylex.lex b/java/src/Yylex.lex
deleted file mode 100644
index e40a69f73f7..00000000000
--- a/java/src/Yylex.lex
+++ /dev/null
@@ -1,79 +0,0 @@
-package JACE.ServiceConfigurator;
-
-import java.lang.*;
-import java.io.*;
-import JACE.OS.*;
-import java_cup.runtime.*;
-
-// This was written for JLex version 1.2
-
-%%
-
-// Return a java_cup.runtime.token instead of a Yytoken from yylex()
-%type java_cup.runtime.token
-%{
- // Used to assemble the parameter string for a service
- private String params;
-%}
-
-%eofval{
- return new java_cup.runtime.token (sym.EOF);
-%eofval}
-
-%line
-
-%state COMMENT
-%state PARAMS
-
-ALPHA=[A-Za-z_]
-DIGIT=[0-9]
-WHITE_SPACE=[\ \t\b\012]
-PATHNAME=[\.\\\/A-Za-z_\-0-9]
-NEWLINE=\n
-OTHER=.
-
-%%
-
-<YYINITIAL> dynamic {return new java_cup.runtime.token (sym.ACE_DYNAMIC); }
-<YYINITIAL> static { return new java_cup.runtime.token (sym.ACE_STATIC); }
-<YYINITIAL> suspend { return new java_cup.runtime.token (sym.ACE_SUSPEND); }
-<YYINITIAL> resume { return new java_cup.runtime.token (sym.ACE_RESUME); }
-<YYINITIAL> remove { return new java_cup.runtime.token (sym.ACE_REMOVE); }
-<YYINITIAL> stream { return new java_cup.runtime.token (sym.ACE_USTREAM); }
-<YYINITIAL> Module { return new java_cup.runtime.token (sym.ACE_MODULE_T); }
-<YYINITIAL> Service_Object { return new java_cup.runtime.token (sym.ACE_SVC_OBJ_T); }
-<YYINITIAL> STREAM { return new java_cup.runtime.token (sym.ACE_STREAM_T); }
-<YYINITIAL> active { return new java_cup.runtime.token (sym.ACE_ACTIVE); }
-<YYINITIAL> inactive { return new java_cup.runtime.token (sym.ACE_INACTIVE); }
-<YYINITIAL> ":" { return new java_cup.runtime.token (sym.ACE_COLON); }
-<YYINITIAL> \" {
- yybegin(PARAMS);
- params = new String();
-}
-<YYINITIAL> "#" { yybegin(COMMENT); }
-<YYINITIAL> "*" { return new java_cup.runtime.token (sym.ACE_STAR); }
-<YYINITIAL> "(" { return new java_cup.runtime.token (sym.ACE_LPAREN); }
-<YYINITIAL> ")" { return new java_cup.runtime.token (sym.ACE_RPAREN); }
-<YYINITIAL> "{" { return new java_cup.runtime.token (sym.ACE_LBRACE); }
-<YYINITIAL> "}" { return new java_cup.runtime.token (sym.ACE_RBRACE); }
-<YYINITIAL> {WHITE_SPACE}* { /* Skip all white space */ }
-<YYINITIAL> {ALPHA}({ALPHA}|{DIGIT}|_)* {
- return new java_cup.runtime.str_token (sym.ACE_IDENT, yytext());
-}
-<YYINITIAL> {PATHNAME}* {
- return new java_cup.runtime.str_token (sym.ACE_PATHNAME, yytext());
-}
-<YYINITIAL> {NEWLINE} { /* Empty */ }
-<YYINITIAL> {OTHER} {
- ACE.ERROR ("Unknown text, line " + (yyline + 1) + ": \"" + yytext() + "\"");
- return new java_cup.runtime.str_token (sym.error);
-}
-<PARAMS> [\"\n] {
- yybegin(YYINITIAL);
- return new java_cup.runtime.str_token (sym.ACE_STRING, params);
-}
-<PARAMS> . {
- params = params + yytext();
-}
-<COMMENT> {NEWLINE} { yybegin(YYINITIAL); }
-<COMMENT> {OTHER} { /* Skip everything on a comment line */ }
diff --git a/java/src/parser.java b/java/src/parser.java
deleted file mode 100644
index 214b2abef6b..00000000000
--- a/java/src/parser.java
+++ /dev/null
@@ -1,623 +0,0 @@
-
-//----------------------------------------------------
-// The following code was generated by CUP v0.9e
-// Sun Nov 09 13:56:12 CST 1997
-//----------------------------------------------------
-
-package JACE.ServiceConfigurator;
-
-import java.io.*;
-import java.lang.*;
-import java_cup.runtime.*;
-import JACE.ServiceConfigurator.*;
-import JACE.OS.*;
-
-public class parser extends java_cup.runtime.lr_parser {
-
- /** constructor */
- public parser() {super();}
-
- /** production table */
- protected static final short _production_table[][] = {
- {0, 2}, {9, 2}, {9, 1}, {8, 1}, {8, 1},
- {8, 1}, {8, 1}, {8, 1}, {8, 1}, {1, 3},
- {10, 3}, {3, 2}, {4, 2}, {5, 2}, {7, 3},
- {7, 3}, {17, 1}, {17, 1}, {11, 1}, {11, 2},
- {6, 2}, {6, 0}, {12, 1}, {12, 1}, {12, 1},
- {12, 1}, {12, 1}, {2, 4}, {13, 1}, {13, 1},
- {13, 0}, {14, 3}, {14, 5}, {18, 2}, {18, 2},
- {18, 2}, {16, 1}, {16, 0}, {15, 1}, {15, 1}
- };
-
- /** access to production table */
- public short[][] production_table() {return _production_table;}
-
- /** parse action table */
- protected static final short[][] _action_table = {
- /*0*/{2,6,3,10,4,15,5,11,6,3,22,2,-1,0},
- /*1*/{2,6,3,10,14,47,-1,0},
- /*2*/{14,44,-1,0},
- /*3*/{0,-5,2,-5,3,-5,4,-5,5,-5,6,-5,22,-5,-1,0},
- /*4*/{0,-7,2,-7,3,-7,4,-7,5,-7,6,-7,22,-7,-1,0},
- /*5*/{14,24,-1,0},
- /*6*/{0,-3,2,6,3,10,4,15,5,11,6,3,22,2,-1,0},
- /*7*/{0,-9,2,-9,3,-9,4,-9,5,-9,6,-9,22,-9,-1,0},
- /*8*/{0,-6,2,-6,3,-6,4,-6,5,-6,6,-6,22,-6,-1,0},
- /*9*/{14,19,-1,0},
- /*10*/{14,18,-1,0},
- /*11*/{0,-8,2,-8,3,-8,4,-8,5,-8,6,-8,22,-8,-1,0},
- /*12*/{0,17,-1,0},
- /*13*/{0,-4,2,-4,3,-4,4,-4,5,-4,6,-4,22,-4,-1,0},
- /*14*/{14,16,-1,0},
- /*15*/{0,-12,2,-12,3,-12,4,-12,5,-12,6,-12,19,-12,22,-12,-1,0},
- /*16*/{0,-1,-1,0},
- /*17*/{0,-13,2,-13,3,-13,4,-13,5,-13,6,-13,19,-13,22,-13,-1,0},
- /*18*/{0,-38,2,-38,3,-38,4,-38,5,-38,6,-38,15,20,18,-38,19,-38,22,-38,-1,0},
- /*19*/{0,-37,2,-37,3,-37,4,-37,5,-37,6,-37,18,-37,19,-37,22,-37,-1,0},
- /*20*/{0,-11,2,-11,3,-11,4,-11,5,-11,6,-11,18,-11,19,-11,22,-11,-1,0},
- /*21*/{0,-2,-1,0},
- /*22*/{0,-38,2,-38,3,-38,4,-38,5,-38,6,-38,15,20,18,-38,19,-38,22,-38,-1,0},
- /*23*/{8,26,9,28,10,27,-1,0},
- /*24*/{13,32,14,35,-1,0},
- /*25*/{20,31,-1,0},
- /*26*/{20,30,-1,0},
- /*27*/{20,29,-1,0},
- /*28*/{13,-36,14,-36,-1,0},
- /*29*/{13,-35,14,-35,-1,0},
- /*30*/{13,-34,14,-34,-1,0},
- /*31*/{21,-39,-1,0},
- /*32*/{0,-31,2,-31,3,-31,4,-31,5,-31,6,-31,11,42,12,41,15,-31,18,-31,19,-31,22,-31,-1,0},
- /*33*/{21,36,-1,0},
- /*34*/{21,-40,-1,0},
- /*35*/{14,37,-1,0},
- /*36*/{0,-32,2,-32,3,-32,4,-32,5,-32,6,-32,11,-32,12,-32,15,-32,16,38,18,-32,19,-32,22,-32,-1,0},
- /*37*/{17,39,-1,0},
- /*38*/{0,-33,2,-33,3,-33,4,-33,5,-33,6,-33,11,-33,12,-33,15,-33,18,-33,19,-33,22,-33,-1,0},
- /*39*/{0,-28,2,-28,3,-28,4,-28,5,-28,6,-28,15,-28,18,-28,19,-28,22,-28,-1,0},
- /*40*/{0,-30,2,-30,3,-30,4,-30,5,-30,6,-30,15,-30,18,-30,19,-30,22,-30,-1,0},
- /*41*/{0,-29,2,-29,3,-29,4,-29,5,-29,6,-29,15,-29,18,-29,19,-29,22,-29,-1,0},
- /*42*/{0,-10,2,-10,3,-10,4,-10,5,-10,6,-10,18,-10,19,-10,22,-10,-1,0},
- /*43*/{0,-14,2,-14,3,-14,4,-14,5,-14,6,-14,19,-14,22,-14,-1,0},
- /*44*/{2,-18,3,-18,4,-18,5,-18,6,-18,18,-18,19,-18,-1,0},
- /*45*/{2,-22,3,-22,4,-22,5,-22,6,-22,18,50,19,-22,-1,0},
- /*46*/{2,-22,3,-22,4,-22,5,-22,6,-22,18,50,19,-22,-1,0},
- /*47*/{2,-17,3,-17,4,-17,5,-17,6,-17,18,-17,19,-17,-1,0},
- /*48*/{2,6,3,10,4,15,5,11,6,3,19,54,-1,0},
- /*49*/{0,-19,2,-19,3,-19,4,-19,5,-19,6,-19,22,-19,-1,0},
- /*50*/{0,-16,2,-16,3,-16,4,-16,5,-16,6,-16,22,-16,-1,0},
- /*51*/{2,-21,3,-21,4,-21,5,-21,6,-21,19,-21,-1,0},
- /*52*/{2,-24,3,-24,4,-24,5,-24,6,-24,19,-24,-1,0},
- /*53*/{0,-20,2,-20,3,-20,4,-20,5,-20,6,-20,22,-20,-1,0},
- /*54*/{2,-26,3,-26,4,-26,5,-26,6,-26,19,-26,-1,0},
- /*55*/{2,-25,3,-25,4,-25,5,-25,6,-25,19,-25,-1,0},
- /*56*/{2,-27,3,-27,4,-27,5,-27,6,-27,19,-27,-1,0},
- /*57*/{2,-23,3,-23,4,-23,5,-23,6,-23,19,-23,-1,0},
- /*58*/{0,-15,2,-15,3,-15,4,-15,5,-15,6,-15,22,-15,-1,0},
- };
-
- /** access to parse action table */
- public short[][] action_table() {return _action_table;}
-
- /** reduce_goto table */
- protected static final short[][] _reduce_table = {
- /*0*/{1,13,3,8,4,4,5,11,7,7,8,6,9,12,10,3,-1,-1},
- /*1*/{1,47,10,44,17,45,-1,-1},
- /*2*/{-1,-1},
- /*3*/{-1,-1},
- /*4*/{-1,-1},
- /*5*/{2,22,-1,-1},
- /*6*/{1,13,3,8,4,4,5,11,7,7,8,6,9,21,10,3,-1,-1},
- /*7*/{-1,-1},
- /*8*/{-1,-1},
- /*9*/{-1,-1},
- /*10*/{-1,-1},
- /*11*/{-1,-1},
- /*12*/{-1,-1},
- /*13*/{-1,-1},
- /*14*/{-1,-1},
- /*15*/{-1,-1},
- /*16*/{-1,-1},
- /*17*/{-1,-1},
- /*18*/{16,20,-1,-1},
- /*19*/{-1,-1},
- /*20*/{-1,-1},
- /*21*/{-1,-1},
- /*22*/{16,42,-1,-1},
- /*23*/{18,24,-1,-1},
- /*24*/{14,32,15,33,-1,-1},
- /*25*/{-1,-1},
- /*26*/{-1,-1},
- /*27*/{-1,-1},
- /*28*/{-1,-1},
- /*29*/{-1,-1},
- /*30*/{-1,-1},
- /*31*/{-1,-1},
- /*32*/{13,39,-1,-1},
- /*33*/{-1,-1},
- /*34*/{-1,-1},
- /*35*/{-1,-1},
- /*36*/{-1,-1},
- /*37*/{-1,-1},
- /*38*/{-1,-1},
- /*39*/{-1,-1},
- /*40*/{-1,-1},
- /*41*/{-1,-1},
- /*42*/{-1,-1},
- /*43*/{-1,-1},
- /*44*/{-1,-1},
- /*45*/{6,48,11,58,-1,-1},
- /*46*/{6,48,11,50,-1,-1},
- /*47*/{-1,-1},
- /*48*/{1,57,3,55,4,54,5,56,10,52,12,51,-1,-1},
- /*49*/{-1,-1},
- /*50*/{-1,-1},
- /*51*/{-1,-1},
- /*52*/{-1,-1},
- /*53*/{-1,-1},
- /*54*/{-1,-1},
- /*55*/{-1,-1},
- /*56*/{-1,-1},
- /*57*/{-1,-1},
- /*58*/{-1,-1},
- };
-
- /** access to reduce_goto table */
- public short[][] reduce_table() {return _reduce_table;}
-
- /** instance of action encapsulation class */
- protected CUP$actions action_obj;
-
- /** action encapsulation object initializer */
- protected void init_actions()
- {
- action_obj = new CUP$actions();
- }
-
- /** invoke a user supplied parse action */
- public java_cup.runtime.symbol do_action(
- int act_num,
- java_cup.runtime.lr_parser parser,
- java.util.Stack stack,
- int top)
- throws java.lang.Exception
- {
- /* call code in generated class */
- return action_obj.CUP$do_action(act_num, parser, stack, top);
- }
-
- /** start state */
- public int start_state() {return 0;}
- /** start production */
- public int start_production() {return 0;}
-
- /** EOF symbol index */
- public int EOF_sym() {return 0;}
-
- /** error symbol index */
- public int error_sym() {return 1;}
-
-
- /** user initialization */
- public void user_init() throws java.lang.Exception
- {
-
- try {
-
- FileInputStream fs = new FileInputStream(new String(ServiceConfig.serviceConfigFile_));
-
- this.setLexer(new Yylex(fs));
-
- } catch (FileNotFoundException fnf) {
-
- ACE.ERROR("File not found: " + fnf);
-
- } catch (SecurityException se) {
-
- ACE.ERROR("Security: " + se);
- }
-
- }
-
- /** scan to get the next token */
- public java_cup.runtime.token scan()
- throws java.lang.Exception
- {
- return this.lexer_.yylex();
- }
-
-
- // Lexical Analyzer
- private Yylex lexer_;
-
- public void setLexer(Yylex lexer)
- {
- this.lexer_ = lexer;
- }
-
-};
-
-/** Cup generated class to encapsulate user supplied action code.*/
-class CUP$actions {
-
- /** Constructor */
- CUP$actions() { }
-
- /** Method with the actual generated action code. */
- public final java_cup.runtime.symbol CUP$do_action(
- int CUP$act_num,
- java_cup.runtime.lr_parser CUP$parser,
- java.util.Stack CUP$stack,
- int CUP$top)
- throws java.lang.Exception
- {
- /* object for return from actions */
- java_cup.runtime.symbol CUP$result;
-
- /* select the action based on the action number */
- switch (CUP$act_num)
- {
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 39: // pathname ::= ACE_IDENT
- {
- CUP$result = new java_cup.runtime.str_token(/*pathname*/15);
- ((java_cup.runtime.str_token)CUP$result).str_val = new String((/*e*/(str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 38: // pathname ::= ACE_PATHNAME
- {
- CUP$result = new java_cup.runtime.str_token(/*pathname*/15);
- ((java_cup.runtime.str_token)CUP$result).str_val = new String((/*e*/(str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 37: // parameters_opt ::=
- {
- CUP$result = new java_cup.runtime.str_token(/*parameters_opt*/16);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 36: // parameters_opt ::= ACE_STRING
- {
- CUP$result = new java_cup.runtime.str_token(/*parameters_opt*/16);
- ((java_cup.runtime.str_token)CUP$result).str_val = new String((/*e*/(str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 35: // type ::= ACE_STREAM_T ACE_STAR
- {
- CUP$result = new java_cup.runtime.str_token(/*type*/18);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 34: // type ::= ACE_SVC_OBJ_T ACE_STAR
- {
- CUP$result = new java_cup.runtime.str_token(/*type*/18);
- ((java_cup.runtime.str_token)CUP$result).str_val = new String("Service Object");
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 33: // type ::= ACE_MODULE_T ACE_STAR
- {
- CUP$result = new java_cup.runtime.str_token(/*type*/18);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 32: // svc_initializer ::= pathname ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN
- {
- CUP$result = new java_cup.runtime.str_token(/*svc_initializer*/14);
- ((java_cup.runtime.str_token)CUP$result).str_val = new String((/*e1*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-4)).str_val + ":" + (/*e2*/(str_token)CUP$stack.elementAt(CUP$top-2)).str_val);
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 31: // svc_initializer ::= pathname ACE_COLON ACE_IDENT
- {
- CUP$result = new java_cup.runtime.str_token(/*svc_initializer*/14);
- ((java_cup.runtime.str_token)CUP$result).str_val = new String((/*e1*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-2)).str_val + ":" + (/*e2*/(str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 30: // status ::=
- {
- CUP$result = new java_cup.runtime.int_token(/*status*/13);
- // Default case
- ((java_cup.runtime.int_token)CUP$result).int_val = 0;
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 29: // status ::= ACE_INACTIVE
- {
- CUP$result = new java_cup.runtime.int_token(/*status*/13);
- ((java_cup.runtime.int_token)CUP$result).int_val = 1;
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 28: // status ::= ACE_ACTIVE
- {
- CUP$result = new java_cup.runtime.int_token(/*status*/13);
- ((java_cup.runtime.int_token)CUP$result).int_val = 0;
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 27: // svc_location ::= ACE_IDENT type svc_initializer status
- {
- CUP$result = new AddServiceObjectNode(/*svc_location*/2);
-
- boolean suspended = false;
- if ((/*e4*/(java_cup.runtime.int_token)CUP$stack.elementAt(CUP$top-0)).int_val == 1)
- suspended = true;
-
- ((AddServiceObjectNode)CUP$result).init((/*e1*/(str_token)CUP$stack.elementAt(CUP$top-3)).str_val, (/*e3*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-1)).str_val, suspended);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 26: // module ::= remove
- {
- CUP$result = new java_cup.runtime.str_token(/*module*/12);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 25: // module ::= resume
- {
- CUP$result = new java_cup.runtime.str_token(/*module*/12);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 24: // module ::= suspend
- {
- CUP$result = new java_cup.runtime.str_token(/*module*/12);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 23: // module ::= static
- {
- CUP$result = new java_cup.runtime.str_token(/*module*/12);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 22: // module ::= dynamic
- {
- CUP$result = new java_cup.runtime.str_token(/*module*/12);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 21: // module_list ::=
- {
- CUP$result = new ParseNode(/*module_list*/6);
- ACE.ERROR("Not implemented: module manipulation");
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 20: // module_list ::= module_list module
- {
- CUP$result = new ParseNode(/*module_list*/6);
- ACE.ERROR("Not implemented: module manipulation");
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 19: // stream_modules ::= module_list ACE_RBRACE
- {
- CUP$result = new java_cup.runtime.str_token(/*stream_modules*/11);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 18: // stream_modules ::= ACE_LBRACE
- {
- CUP$result = new java_cup.runtime.str_token(/*stream_modules*/11);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 17: // stream_ops ::= static
- {
- CUP$result = new java_cup.runtime.str_token(/*stream_ops*/17);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 16: // stream_ops ::= dynamic
- {
- CUP$result = new java_cup.runtime.str_token(/*stream_ops*/17);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 15: // stream ::= ACE_USTREAM ACE_IDENT stream_modules
- {
- CUP$result = new ParseNode(/*stream*/7);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 14: // stream ::= ACE_USTREAM stream_ops stream_modules
- {
- CUP$result = new ParseNode(/*stream*/7);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 13: // remove ::= ACE_REMOVE ACE_IDENT
- {
- CUP$result = new RemoveNode(/*remove*/5);
-
- ((RemoveNode)CUP$result).init((/*e1*/(str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 12: // resume ::= ACE_RESUME ACE_IDENT
- {
- CUP$result = new ResumeNode(/*resume*/4);
-
- ((ResumeNode)CUP$result).init((/*e1*/(str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 11: // suspend ::= ACE_SUSPEND ACE_IDENT
- {
- CUP$result = new SuspendNode(/*suspend*/3);
-
- ((SuspendNode)CUP$result).init((/*e1*/(str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 10: // static ::= ACE_STATIC ACE_IDENT parameters_opt
- {
- CUP$result = new ParseNode(/*static*/10);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 9: // dynamic ::= ACE_DYNAMIC svc_location parameters_opt
- {
- CUP$result = new AddServiceObjectNode(/*dynamic*/1);
-
- ((AddServiceObjectNode)CUP$result).init((/*e1*/(AddServiceObjectNode)CUP$stack.elementAt(CUP$top-1)).name(), (/*e1*/(AddServiceObjectNode)CUP$stack.elementAt(CUP$top-1)).locator(), (/*e1*/(AddServiceObjectNode)CUP$stack.elementAt(CUP$top-1)).suspended());
-
- ((AddServiceObjectNode)CUP$result).params((/*e2*/(java_cup.runtime.str_token)CUP$stack.elementAt(CUP$top-0)).str_val);
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 8: // svc_config_entry ::= stream
- {
- CUP$result = new ParseNode(/*svc_config_entry*/8);
- ACE.ERROR("Not implemented: stream loading");
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 7: // svc_config_entry ::= remove
- {
- CUP$result = new ParseNode(/*svc_config_entry*/8);
-
-
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 6: // svc_config_entry ::= resume
- {
- CUP$result = new ParseNode(/*svc_config_entry*/8);
- /* Empty -- result auto set to resume */
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 5: // svc_config_entry ::= suspend
- {
- CUP$result = new ParseNode(/*svc_config_entry*/8);
-
- /* Empty -- result auto set to suspend */
- /* CUP$result = (ParseNode)CUP$stack.elementAt(CUP$top-0); */
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 4: // svc_config_entry ::= static
- {
- CUP$result = new ParseNode(/*svc_config_entry*/8);
-
- /* More graceful error system needed here */
- ACE.ERROR("Not implemented: static service loading");
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 3: // svc_config_entry ::= dynamic
- {
- CUP$result = new ParseNode(/*svc_config_entry*/8);
-
- /* Empty -- result auto set to dynamic */
- /* CUP$result = (ParseNode)CUP$stack.elementAt(CUP$top-0); */
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 2: // svc_config_entries ::= svc_config_entry
- {
- CUP$result = new ParseNode(/*svc_config_entries*/9);
-
- if ((/*e1*/(ParseNode)CUP$stack.elementAt(CUP$top-0)) != null)
- (/*e1*/(ParseNode)CUP$stack.elementAt(CUP$top-0)).apply();
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 1: // svc_config_entries ::= svc_config_entry svc_config_entries
- {
- CUP$result = new ParseNode(/*svc_config_entries*/9);
-
- if ((/*e1*/(ParseNode)CUP$stack.elementAt(CUP$top-1)) != null)
- (/*e1*/(ParseNode)CUP$stack.elementAt(CUP$top-1)).apply();
-
- }
- return CUP$result;
-
- /*. . . . . . . . . . . . . . . . . . . .*/
- case 0: // $START ::= svc_config_entries EOF
- {
- CUP$result = new java_cup.runtime.token(/*$START*/0);
-
- }
- /* ACCEPT */
- CUP$parser.done_parsing();
- return CUP$result;
-
- /* . . . . . .*/
- default:
- throw new Exception(
- "Invalid action number found in internal parse table");
-
- }
- }
-};
-
diff --git a/java/src/sym.java b/java/src/sym.java
deleted file mode 100644
index aeaadf19354..00000000000
--- a/java/src/sym.java
+++ /dev/null
@@ -1,36 +0,0 @@
-
-//----------------------------------------------------
-// The following code was generated by CUP v0.9e
-// Sun Nov 09 13:56:12 CST 1997
-//----------------------------------------------------
-
-package JACE.ServiceConfigurator;
-
-/** Cup generated class containing symbol constants. */
-public class sym {
- /* terminals */
- static final int ACE_STATIC = 3;
- static final int ACE_ACTIVE = 11;
- static final int EOF = 0;
- static final int ACE_IDENT = 14;
- static final int ACE_USTREAM = 22;
- static final int ACE_LPAREN = 16;
- static final int ACE_MODULE_T = 8;
- static final int error = 1;
- static final int ACE_DYNAMIC = 2;
- static final int ACE_RESUME = 5;
- static final int ACE_LBRACE = 18;
- static final int ACE_REMOVE = 6;
- static final int ACE_STREAM = 7;
- static final int ACE_STRING = 15;
- static final int ACE_RPAREN = 17;
- static final int ACE_COLON = 21;
- static final int ACE_PATHNAME = 13;
- static final int ACE_STAR = 20;
- static final int ACE_SVC_OBJ_T = 10;
- static final int ACE_RBRACE = 19;
- static final int ACE_SUSPEND = 4;
- static final int ACE_STREAM_T = 9;
- static final int ACE_INACTIVE = 12;
-};
-