/*
 * $Header: /san01/cvs/ashpool/csrc/modjava/Attic/Prog.java,v 1.5 2004/03/15 22:15:12 aleigh Exp $
 */

/*
 * Copyright (c) 2003 Alex Leigh, All Rights Reserved
 *
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ALEX LEIGH The copyright
 * notice above does not evidence any actual or intended publication of such
 * source code.
 *
 * Use, disclosure, copying, distribution, or transmission of this code without
 * express permission is prohibited.
 */

import com.ashpool.continuity.*;

 public class Prog {
     public static void main(String[] args) {
        System.out.println("-java-> Loading entrance.so..");
        
        System.setProperty("java.library.path","../lib");
        try {
          System.loadLibrary("javaentrance");
        } catch (Exception e) {
          System.out.println("loadLibrary: " + e.getMessage());
        }
     }

     public static void handle(String[] args) {
       System.out.println("Prog->Handler: called");

       String foo = ContRequest.getResponseTuple("Server");
       String uri = ContRequest.getRequestTuple("uri");

       ContRequest.setResponseTuple("Content-Type","text/plain");
       System.out.println("->java-> server: " + foo);
       System.out.println("->java-> uri: " + uri);

       ContRequest.logMessage(3,"-java-> internal handler run.");
       ContRequest.setResponseTuple("Java-Version","v.0.0.0");
       ContRequest.startResponse(200);
       ContRequest.write("Hello World");
     }
 }
