2011/08/05 - Jakarta Cactus has been retired.

For more information, please explore the Attic.

Clover coverage report - Cactus 1.8dev for J2EE API 1.3
Coverage timestamp: Sun Mar 26 2006 18:50:18 BRT
file stats: LOC: 105   Methods: 4
NCLOC: 49   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
EnhydraRun.java - 0% 0% 0%
coverage
 1   
 /* 
 2   
  * ========================================================================
 3   
  * 
 4   
  * Copyright 2001-2003 The Apache Software Foundation.
 5   
  *
 6   
  * Licensed under the Apache License, Version 2.0 (the "License");
 7   
  * you may not use this file except in compliance with the License.
 8   
  * You may obtain a copy of the License at
 9   
  * 
 10   
  *   http://www.apache.org/licenses/LICENSE-2.0
 11   
  * 
 12   
  * Unless required by applicable law or agreed to in writing, software
 13   
  * distributed under the License is distributed on an "AS IS" BASIS,
 14   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15   
  * See the License for the specific language governing permissions and
 16   
  * limitations under the License.
 17   
  * 
 18   
  * ========================================================================
 19   
  */
 20   
 package org.apache.cactus.integration.ant.container.enhydra;
 21   
 
 22   
 import java.lang.reflect.Method;
 23   
 
 24   
 import org.apache.cactus.integration.ant.container.AbstractServerRun;
 25   
 
 26   
 /**
 27   
  * Starts/stop Enhydra by setting up a listener socket.
 28   
  *
 29   
  * @version $Id: EnhydraRun.java 238918 2004-04-18 12:21:50Z vmassol $
 30   
  * @see AbstractServerRun
 31   
  */
 32   
 public class EnhydraRun extends AbstractServerRun
 33   
 {
 34   
     /**
 35   
      * @param theArgs the command line arguments
 36   
      */
 37  0
     public EnhydraRun(String[] theArgs)
 38   
     {
 39  0
         super(theArgs);
 40   
     }
 41   
 
 42   
     /**
 43   
      * Entry point to start/stop the Enhydra server.
 44   
      *
 45   
      * @param theArgs the command line arguments
 46   
      */
 47  0
     public static void main(String[] theArgs)
 48   
     {
 49  0
         EnhydraRun enhydra = new EnhydraRun(theArgs);
 50   
 
 51  0
         enhydra.doRun();
 52   
     }
 53   
 
 54   
     /**
 55   
      * Start the Enhydra server. We use reflection so that the Enhydra jars do
 56   
      * not need to be in the classpath to compile this class.
 57   
      * 
 58   
      * @see AbstractServerRun#doStartServer
 59   
      */
 60  0
     protected final Thread doStartServer(String[] theArgs)
 61   
     {
 62  0
         try
 63   
         {
 64  0
             Class enhydraClass = 
 65   
                 Class.forName("com.lutris.multiServer.MultiServer");
 66  0
             Method initMethod = enhydraClass.getMethod("main", 
 67   
                 new Class[] {theArgs.getClass()});
 68   
 
 69  0
             initMethod.invoke(null, new Object[] {theArgs});
 70   
         }
 71   
         catch (Exception e)
 72   
         {
 73  0
             e.printStackTrace();
 74  0
             throw new RuntimeException("Cannot create instance of MultiServer");
 75   
         }
 76   
         
 77  0
         return this;
 78   
     }
 79   
 
 80   
     /**
 81   
      * Stops the Enhydra server. We use reflection so that the Enhydra jars do
 82   
      * not need to be in the classpath to compile this class.
 83   
      * 
 84   
      * @see AbstractServerRun#doStopServer
 85   
      */
 86  0
     protected final void doStopServer(String[] theArgs,
 87   
         Thread theRunningServerThread) throws Exception
 88   
     {
 89  0
         try
 90   
         {
 91  0
             Class enhydraClass = 
 92   
                 Class.forName("com.lutris.multiServer.MultiServer");
 93  0
             Method shutDownMethod = enhydraClass.getMethod("shutdown", null);
 94   
 
 95  0
             shutDownMethod.invoke(null, null);
 96   
         }
 97   
         catch (Exception e)
 98   
         {
 99  0
             e.printStackTrace();
 100  0
             throw new RuntimeException("Cannot stop running instance of "
 101   
                 + "MultiServer");
 102   
         }
 103   
     }
 104   
 }
 105