Class MainDelegate
- java.lang.Object
-
- org.apache.sling.launchpad.base.app.MainDelegate
-
- All Implemented Interfaces:
Launcher
public class MainDelegate extends Object implements Launcher
TheMainclass is a simple Java Application which interprests the command line and creates theSlinglauncher class and thus starts the OSGi framework. In addition a shutdown thread is registered to ensure proper shutdown on VM termination.The supported command line options are:
- -l loglevel
- Sets the initial loglevel as an integer in the range 0 to 4 or as one of
the well known level strings FATAL, ERROR, WARN, INFO or DEBUG. This option
overwrites the
org.apache.sling.osg.log.levelsetting thesling.propertiesfile. - -f logfile
- The log file, \"-\" for stdout (default logs/error.log). This option
overwrites the
org.apache.sling.osg.log.filesetting thesling.propertiesfile. - -c slinghome
- The directory in which Sling locates its initial configuration file
sling.propertiesand where files of Sling itself such as the Apache Felix bundle archive or the JCR repository files are stored (default sling). - -a address
- The interfact to bind to (use 0.0.0.0 for any). This option is not implemented yet.
- -p port
- The port to listen (default 8080) to handle HTTP requests. This option
overwrites the
org.osgi.service.http.portsetting thesling.propertiesfile. - -h
- Prints a simple usage message listing all available command line options.
-
-
Constructor Summary
Constructors Constructor Description MainDelegate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetCommandLine(Map<String,String> args)The commandline provided from the standalone launch case.voidsetNotifiable(Notifiable notifiable)TheNotifiableto notify on framework stop or updatevoidsetSlingHome(String slingHome)Sets the sling.home to be used for starting the framework.booleanstart()Starts the framework and returnstrueif successfull.voidstop()Stops the framework.
-
-
-
Method Detail
-
setNotifiable
public void setNotifiable(Notifiable notifiable)
Description copied from interface:LauncherTheNotifiableto notify on framework stop or update- Specified by:
setNotifiablein interfaceLauncher- Parameters:
notifiable- The notifiable
-
setCommandLine
public void setCommandLine(Map<String,String> args)
Description copied from interface:LauncherThe commandline provided from the standalone launch case.- Specified by:
setCommandLinein interfaceLauncher- Parameters:
args- The commandline
-
setSlingHome
public void setSlingHome(String slingHome)
Description copied from interface:LauncherSets the sling.home to be used for starting the framework. This method must be called with a non-nullargument before trying to start the framework.- Specified by:
setSlingHomein interfaceLauncher- Parameters:
slingHome- The sling.home directory
-
start
public boolean start()
Description copied from interface:LauncherStarts the framework and returnstrueif successfull.
-
-