Nuxeo Enterprise Platform 5.3

org.nuxeo.ecm.platform.convert.ooolauncher
Class OOoLauncherComponent

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.convert.ooolauncher.OOoLauncherComponent
All Implemented Interfaces:
EventListener, OOoConnectionManager, OOoLauncherService, Adaptable, Component, Extensible, org.osgi.framework.FrameworkListener

public class OOoLauncherComponent
extends DefaultComponent
implements OOoLauncherService, OOoConnectionManager, org.osgi.framework.FrameworkListener


Nested Class Summary
protected  class OOoLauncherComponent.OOoConnectorThread
           
 
Field Summary
protected  Boolean canGetConnection
           
protected static String CONFIG_EP
           
protected  OOoConfigHelper configHelper
           
protected  int connUsageNb
           
protected  OOoLauncherDescriptor descriptor
           
protected  boolean failedToConnect
           
protected  Log log
           
protected static int maxConnUsage
           
protected  Process OOoProcess
           
protected  com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection sharedConnection
           
protected  boolean started
           
 
Constructor Summary
OOoLauncherComponent()
           
 
Method Summary
 void activate(ComponentContext context)
          Activates the component.
 boolean canGetConnection()
           
 void deactivate(ComponentContext context)
          Deactivates the component.
 void frameworkEvent(org.osgi.framework.FrameworkEvent event)
           
protected  OOoConfigHelper getConfigHelper()
           
 com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection getConnection()
           
 OOoLauncherDescriptor getDescriptor()
           
 Integer getProcessExitCode()
           
 boolean isAvailable()
           
 boolean isConfigured()
          Tells if OOoLauncherService is configured correctly (if a valide OOo installation has been found)
 boolean isEnabled()
           
 boolean isOOoLaunched()
          Tells if OOo server has been started by the launcher
 boolean isOOoListening()
          Tells if an OOo server is listening on target port
protected  boolean isPortFree()
           
 void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 void releaseConnection(com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection connection)
           
protected  com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection safeGetConnection()
           
 boolean startOOo()
          Starts the OOo server process
 boolean startOOoAndWaitTillReady()
          Starts the OOo server process and wait till ready to accept connection
 boolean startOOoAndWaitTillReady(int timeOutS)
          Starts the OOo server process and wait till ready to accept connection
 boolean stopOOo()
          Stops the OOo server process
 boolean stopOooAndWait(int timeOutS)
           
 boolean waitTillReady()
          Blocks until OOo server is ready to accept connections
 boolean waitTillReady(int timeOutS)
          Blocks until OOo server is ready to accept connections
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
getAdapter, registerExtension, unregisterContribution, unregisterExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_EP

protected static String CONFIG_EP

descriptor

protected OOoLauncherDescriptor descriptor

configHelper

protected OOoConfigHelper configHelper

log

protected Log log

OOoProcess

protected Process OOoProcess

started

protected boolean started

connUsageNb

protected int connUsageNb

maxConnUsage

protected static final int maxConnUsage
See Also:
Constant Field Values

failedToConnect

protected boolean failedToConnect

canGetConnection

protected Boolean canGetConnection

sharedConnection

protected com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection sharedConnection
Constructor Detail

OOoLauncherComponent

public OOoLauncherComponent()
Method Detail

getDescriptor

public OOoLauncherDescriptor getDescriptor()

getConfigHelper

protected OOoConfigHelper getConfigHelper()

isOOoLaunched

public boolean isOOoLaunched()
Description copied from interface: OOoLauncherService
Tells if OOo server has been started by the launcher

Specified by:
isOOoLaunched in interface OOoLauncherService
Returns:

registerContribution

public void registerContribution(Object contribution,
                                 String extensionPoint,
                                 ComponentInstance contributor)
                          throws Exception
Overrides:
registerContribution in class DefaultComponent
Throws:
Exception

activate

public void activate(ComponentContext context)
              throws Exception
Description copied from interface: Component
Activates the component.

This method is called by the runtime when a component is activated.

Specified by:
activate in interface Component
Overrides:
activate in class DefaultComponent
Parameters:
context - the runtime context
Throws:
Exception - if an error occurs during activation

deactivate

public void deactivate(ComponentContext context)
                throws Exception
Description copied from interface: Component
Deactivates the component.

This method is called by the runtime when a component is deactivated.

Specified by:
deactivate in interface Component
Overrides:
deactivate in class DefaultComponent
Parameters:
context - the runtime context
Throws:
Exception - if an error occurs during activation

waitTillReady

public boolean waitTillReady()
Description copied from interface: OOoLauncherService
Blocks until OOo server is ready to accept connections

Specified by:
waitTillReady in interface OOoLauncherService
Returns:

getProcessExitCode

public Integer getProcessExitCode()

waitTillReady

public boolean waitTillReady(int timeOutS)
Description copied from interface: OOoLauncherService
Blocks until OOo server is ready to accept connections

Specified by:
waitTillReady in interface OOoLauncherService
Returns:

isPortFree

protected boolean isPortFree()

safeGetConnection

protected com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection safeGetConnection()

isOOoListening

public boolean isOOoListening()
Description copied from interface: OOoLauncherService
Tells if an OOo server is listening on target port

Specified by:
isOOoListening in interface OOoLauncherService
Returns:

startOOoAndWaitTillReady

public boolean startOOoAndWaitTillReady()
Description copied from interface: OOoLauncherService
Starts the OOo server process and wait till ready to accept connection

Specified by:
startOOoAndWaitTillReady in interface OOoLauncherService
Returns:

startOOoAndWaitTillReady

public boolean startOOoAndWaitTillReady(int timeOutS)
Description copied from interface: OOoLauncherService
Starts the OOo server process and wait till ready to accept connection

Specified by:
startOOoAndWaitTillReady in interface OOoLauncherService
Returns:

startOOo

public boolean startOOo()
Description copied from interface: OOoLauncherService
Starts the OOo server process

Specified by:
startOOo in interface OOoLauncherService
Returns:

stopOooAndWait

public boolean stopOooAndWait(int timeOutS)
Specified by:
stopOooAndWait in interface OOoLauncherService

stopOOo

public boolean stopOOo()
Description copied from interface: OOoLauncherService
Stops the OOo server process

Specified by:
stopOOo in interface OOoLauncherService
Returns:

isAvailable

public boolean isAvailable()

isEnabled

public boolean isEnabled()

isConfigured

public boolean isConfigured()
Description copied from interface: OOoLauncherService
Tells if OOoLauncherService is configured correctly (if a valide OOo installation has been found)

Specified by:
isConfigured in interface OOoLauncherService
Returns:

canGetConnection

public boolean canGetConnection()
Specified by:
canGetConnection in interface OOoConnectionManager

getConnection

public com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection getConnection()
Specified by:
getConnection in interface OOoConnectionManager

releaseConnection

public void releaseConnection(com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection connection)
Specified by:
releaseConnection in interface OOoConnectionManager

frameworkEvent

public void frameworkEvent(org.osgi.framework.FrameworkEvent event)
Specified by:
frameworkEvent in interface org.osgi.framework.FrameworkListener

Nuxeo Enterprise Platform 5.3

Copyright © 2010 Nuxeo SAS. All Rights Reserved.