es.caib.ibkey.oppenoffice.helper
Class OOoServer

java.lang.Object
  extended by es.caib.ibkey.oppenoffice.helper.OOoServer

public class OOoServer
extends java.lang.Object

Starts and stops an OOo server. Most of the source code in this class has been taken from the Java class "Bootstrap.java" (Revision: 1.15) from the UDK projekt (Uno Software Develop- ment Kit) from OpenOffice.org (http://udk.openoffice.org/). The source code is available for example through a browser based online version control access at http://udk.openoffice.org/source/browse/udk/. The Java class "Bootstrap.java" is there available at http://udk.openoffice.org/source/browse/udk/javaunohelper/com/sun/star/comp/helper/Bootstrap.java?view=markup


Field Summary
 org.apache.log4j.Logger log
           
 
Constructor Summary
OOoServer(java.lang.String oooInstallFolder)
          Constructs an OOo server which uses the folder of the OOo installation containing the soffice executable and a list of default options to start OOo.
OOoServer(java.lang.String oooInstallFolder, java.util.List oooOptions)
          Constructs an OOo server which uses the folder of the OOo installation containing the soffice executable and a given list of options to start OOo.
 
Method Summary
 void disconnect()
           
static java.util.List getDefaultOOoOptions()
          Returns the list of default options.
 void kill()
          Kills the OOo server process from the previous start.
 void start(java.lang.String oooAcceptOption)
          Starts an OOo server which uses the specified accept option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public org.apache.log4j.Logger log
Constructor Detail

OOoServer

public OOoServer(java.lang.String oooInstallFolder)
Constructs an OOo server which uses the folder of the OOo installation containing the soffice executable and a list of default options to start OOo.

Parameters:
oooInstallFolder - The folder of the OOo installation containing the soffice executable

OOoServer

public OOoServer(java.lang.String oooInstallFolder,
                 java.util.List oooOptions)
Constructs an OOo server which uses the folder of the OOo installation containing the soffice executable and a given list of options to start OOo.

Parameters:
oooInstallFolder - The folder of the OOo installation containing the soffice executable
oooOptions - The list of options
Method Detail

start

public void start(java.lang.String oooAcceptOption)
           throws java.lang.Exception
Starts an OOo server which uses the specified accept option. The accept option can be used for two different types of connections: 1) The socket connection 2) The named pipe connection To create a socket connection a host and port must be provided. For example using the host "localhost" and the port "8100" the accept option looks like this: - accept option : -accept=socket,host=localhost,port=8100;urp; To create a named pipe a pipe name must be provided. For example using the pipe name "oooPipe" the accept option looks like this: - accept option : -accept=pipe,name=oooPipe;urp;

Parameters:
oooAcceptOption - The accept option
Throws:
java.lang.Exception

kill

public void kill()
Kills the OOo server process from the previous start. If there has been no previous start of the OOo server, the kill does nothing. If there has been a previous start, kill destroys the process.


getDefaultOOoOptions

public static java.util.List getDefaultOOoOptions()
Returns the list of default options.

Returns:
The list of default options

disconnect

public void disconnect()


Copyright © 2012 Direcció General de Tecnologia i Comunicacions. Govern de les Illes Balears. All Rights Reserved.