Source code for /engineering/autohit-2003/src/autohit/server/service/Service.javaOriginal file Service.java
   1 /**
   2  * AUTOHIT 2003
   3  * Copyright Erich P Gatejen (c) 1989,1997,2003,2004
   4  * 
   5  * This program is free software; you can redistribute it and/or modify 
   6  * it under the terms of the GNU General Public License as published by 
   7  * the Free Software Foundation; either version 2 of the License, or (at
   8  * your option) any later version.
   9  * This program is distributed in the hope that it will be useful, but
  10  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12  * more details.
  13  * 
  14  * You should have received a copy of the GNU General Public License along
  15  * with this program; if not, write to the Free Software Foundation, Inc.,
  16  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17  *
  18  * Additional license information can be found in the documentation.
  19  * @author Erich P Gatejen
  20  */
  21 package autohit.server.service;
  22 
  23 import autohit.vm.VM;
  24 import autohit.vm.VMException;
  25 import autohit.server.SystemContext;
  26 
  27 /**
  28  * Root service.  Basically, it cheats by being a VM.  You must implement
  29  * prepare(), execute(), construct_chain(), and destruct().  Look at 
  30  * autohit.vm.VM for more information.  You must call loadcontext() after instantiating
  31  * and before calling init()!
  32  *
  33  * @author Erich P. Gatejen
  34  * @version 1.0
  35  * <i>Version History</i>
  36  * <code>EPG - Initial - 15Sep03</code>
  37  */
  38 public abstract class Service extends VM {
  39 
  40 	/**
  41 	 *   Make it easier to see the SC
  42 	 */
  43 	public SystemContext sc;
  44 
  45 	// == IMPLEMENTATIONS ===================
  46 
  47 	/**
  48 	 * Complete initialization.  MUST BE CALLED BEFORE
  49 	 * CONSTRUCTION!  This hack lets us use the VM.
  50 	 */
  51 	public void loadcontext(SystemContext ssc) throws VMException {
  52 		sc = ssc;
  53 	}
  54 	
  55 	//	== PROTOTYPES ===================
  56 	/**
  57 	 *  Prepare for execution of the first instruction. 
  58 	 *  @throws Any exceptions it encounters.
  59 	 */
  60 	//public void prepare() throws Exception {
  61 
  62 	/**
  63 	 *  Concrete method for VM execution.  The derived class
  64 	 *  @see autohit.vm.VMException
  65 	 */
  66 	//public abstract void execute() throws VMException;
  67 
  68 	/**
  69 	 * Complete construction.  This will be called when the VM is
  70 	 * initialized.
  71 	 */
  72 	//public abstract void construct() throws VMException;
  73 
  74 	/**
  75 	 * Complete destroy.  This will be called when the VM is
  76 	 * finalizing.
  77 	 */
  78 	//public abstract void destruct() throws VMException;
  79 
  80 }