org.nuiton.util.war
Class WinstoneLauncher

java.lang.Object
  extended by org.nuiton.util.war.WinstoneLauncher
All Implemented Interfaces:
ActionListener, MouseListener, EventListener

public class WinstoneLauncher
extends Object
implements ActionListener, MouseListener

War main class launcher (winstone based). Based on winstone micro container. To use it : java -jar app-xxx.war

Since:
1.1.2 Last update : $Date: 2010-11-17 22:31:00 +0100 (mer., 17 nov. 2010) $ By :
Version:
$Revision: 1948 $
Author:
chatellier

Field Summary
protected  String serverName
          Server name.
protected  URI serverUri
          Server URI.
protected  winstone.Launcher winstone
          Winstone server instance.
 
Constructor Summary
WinstoneLauncher()
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
protected  void installSystemTray()
          Install system tray to stop server.
static void main(String[] args)
          Main method (used by war in manifest).
 void mouseClicked(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
protected  void openBrowser()
          Open browser.
protected  String readAsString(InputStream stream)
          Read input stream as string.
protected  void readInformation()
          Parse WEB-INF/web.xml file and get server display name.
protected  void startServer(String[] args)
          Launch servlet container.
protected  void stopServer()
          Shutdown server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

winstone

protected winstone.Launcher winstone
Winstone server instance.


serverUri

protected URI serverUri
Server URI.


serverName

protected String serverName
Server name.

Constructor Detail

WinstoneLauncher

public WinstoneLauncher()
Method Detail

main

public static void main(String[] args)
                 throws IOException
Main method (used by war in manifest).

Parameters:
args - args
Throws:
IOException

readInformation

protected void readInformation()
Parse WEB-INF/web.xml file and get server display name.

Since:
1.1.3

readAsString

protected String readAsString(InputStream stream)
Read input stream as string. Code from commons io.

Parameters:
stream - stream to read
Returns:
content as string
Since:
1.1.3

startServer

protected void startServer(String[] args)
                    throws IOException
Launch servlet container.

Parameters:
args - args
Throws:
IOException

stopServer

protected void stopServer()
Shutdown server.


installSystemTray

protected void installSystemTray()
Install system tray to stop server.


actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

openBrowser

protected void openBrowser()
Open browser.

Throws:
IOException

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener


Copyright © 2004-2010 CodeLutin. All Rights Reserved.