org.objectweb.dsrg.sofa.repository.server
Class RepositoryServer

java.lang.Object
  extended by org.objectweb.dsrg.sofa.repository.server.RepositoryServer

public class RepositoryServer
extends java.lang.Object

Primitive Winstone servlet container launcher for Sofa repository.


Field Summary
static java.lang.String REPOSITORY_DEFAULT_PORT
          Default port the repository listening on
static java.lang.String REPOSITORY_PATH_PROPERTY
          System property name for setting repository directory root.
static java.lang.String REPOSITORY_PORT_PROPERTY
          System property name for setting repository server listening port.
static java.lang.String REPOSITORY_WEBAPP_PATH_PROPERTY
          System property name for setting repository web application war path
 
Constructor Summary
RepositoryServer()
           
 
Method Summary
static int getFreePort(int startingPort)
          check that the port is free and otherwise get a free one
static void main(java.lang.String[] args)
           
static boolean startNewAutoconfiguredServer(int repositoryPort, int zeroConfPort)
          Launches the repository server and registers it to a new ZeroConf server.
static boolean startNewAutoconfiguredServer(java.lang.String repositoryPath, java.lang.String webappPath, int repositoryPort, int zeroConfPort)
          Launches the repository server and registers it to a new ZeroConf server.
static boolean startNewServer()
          Launches the repository server.
static boolean startNewServer(java.lang.String repositoryPath, java.lang.String webappPath, java.lang.String repositoryPort)
          Launches the repository server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPOSITORY_PATH_PROPERTY

public static final java.lang.String REPOSITORY_PATH_PROPERTY
System property name for setting repository directory root.

See Also:
Constant Field Values

REPOSITORY_PORT_PROPERTY

public static final java.lang.String REPOSITORY_PORT_PROPERTY
System property name for setting repository server listening port.

See Also:
Constant Field Values

REPOSITORY_WEBAPP_PATH_PROPERTY

public static final java.lang.String REPOSITORY_WEBAPP_PATH_PROPERTY
System property name for setting repository web application war path

See Also:
Constant Field Values

REPOSITORY_DEFAULT_PORT

public static final java.lang.String REPOSITORY_DEFAULT_PORT
Default port the repository listening on

See Also:
Constant Field Values
Constructor Detail

RepositoryServer

public RepositoryServer()
Method Detail

startNewServer

public static boolean startNewServer()
Launches the repository server. Repository path, port and warfile path are taken from system properties. Repository port defaults to 8173, warfile path to "repositorywebapp.war"

Returns:
true if the repository has been successfully launched

startNewServer

public static boolean startNewServer(java.lang.String repositoryPath,
                                     java.lang.String webappPath,
                                     java.lang.String repositoryPort)
Launches the repository server. Repository path, port and web application path are taken from system properties.

Parameters:
repositoryPath - Relative path to repository directory.
webappPath - Path to warfile. Default "repositorywebapp.war".
repositoryPort - Port on which the server will run. Default 8173.
Returns:
true if the repository has been successfully launched

getFreePort

public static int getFreePort(int startingPort)
check that the port is free and otherwise get a free one


startNewAutoconfiguredServer

public static boolean startNewAutoconfiguredServer(int repositoryPort,
                                                   int zeroConfPort)
Launches the repository server and registers it to a new ZeroConf server. The repositoryPath and webappPath are taken from system properties.

Parameters:
repositoryPort - Port on which the server will run. Default 8173.
Returns:
true if the repository has been successfully launched

startNewAutoconfiguredServer

public static boolean startNewAutoconfiguredServer(java.lang.String repositoryPath,
                                                   java.lang.String webappPath,
                                                   int repositoryPort,
                                                   int zeroConfPort)
Launches the repository server and registers it to a new ZeroConf server.

Parameters:
repositoryPath - Relative path to repository directory.
webappPath - Path to warfile. Default "repositorywebapp.war".
repositoryPort - Port on which the server will run. Default 8173.
Returns:
true if the repository has been successfully launched

main

public static void main(java.lang.String[] args)
Parameters:
args - 0 - zeroConfPort - not mandatory