KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > server > ApplicationServer


1 package org.enhydra.server;
2
3 import java.util.Hashtable JavaDoc;
4 /**
5  *
6  * <p>Description: This interface bridges the gap between Application
7  * Server (Servlet Container) and Enhydra Server. Application Server must have
8  * appropriate class, that implement this interface. That class is responsible
9  * to call <code>EnhydraServer.startup()</code> after application server
10  * initialization. It enable EnhydraServer to add/remove connections and
11  * start/stop applications into Application Server.</p>
12  * <p>Copyright: Copyright (c) 2002</p>
13  * <p>Company: </p>
14  * @author Damir Milovic, damir@uns.ns.ac.yu
15  * @version 1.1 date: 9.12.2002
16  */

17
18 public interface ApplicationServer {
19   /**
20    * @return Application Server name.
21    */

22   public String JavaDoc getName() ;
23
24   /**
25    *
26    * @return Application Server version.
27    */

28   public String JavaDoc getVersion();
29   /**
30    * @return Application Server short description.
31    */

32   public String JavaDoc getInfo();
33   /**
34    * Start application.
35    * @param appName Application name.
36    * @return <code>true</code> if succeed, else <code>false</code>.
37    */

38   public boolean startApp(String JavaDoc appName);
39   /**
40    * Stop application.
41    * @param appName application name.
42    * @return <code>true</code> if succeed, else <code>false</code>.
43    */

44   public boolean stopApp(String JavaDoc appName);
45   /**
46    * @return String representation of connection types that application server support.
47    */

48   public String JavaDoc[] getConnectionTypes();
49   /**
50    * Add a new connection for listening requests.
51    * @param type connection type (e.g "http")
52    * @param portNumber port number.
53    * @return <code>true</code> if succeed, else <code>false</code>.
54    */

55   public boolean addConnection(String JavaDoc type,String JavaDoc portNumber);
56   /**
57    * Add a new https connection for listening requests
58    * @param type connection type (e.g "https")
59    * @param portNumber port number.
60    * @param password password needed for "https" connection.
61    * @param pathToKeyStoreFile pathname of the keystore file where you have
62    * stored the server certificate to be loaded
63    * @return <code>true</code> if succeed, else <code>false</code>.
64    */

65   public boolean addConnection(String JavaDoc type, String JavaDoc portNumber, String JavaDoc password, String JavaDoc pathToKeyStoreFile);
66   /**
67    * Remove connection for listening requests.
68    * @param port connection port number.
69    * @return <code>true</code> if succeed, else <code>false</code>.
70    */

71   public boolean removeConnection(String JavaDoc portNumber);
72   /**
73    * Get currently active connections.
74    * @return key,value pairs (key = port, value = value)
75    */

76   public Hashtable JavaDoc getConnections();
77   /**
78    * Shutdown Application Server
79    */

80   public void stop();
81
82 }
Popular Tags