Nuxeo Enterprise Platform 5.3

org.nuxeo.ecm.platform.convert.oooserver
Class OOoDaemonManagerComponent

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.convert.oooserver.OOoDaemonManagerComponent
All Implemented Interfaces:
EventListener, OOoDaemonService, Adaptable, Component, Extensible, org.osgi.framework.FrameworkListener

public class OOoDaemonManagerComponent
extends DefaultComponent
implements OOoDaemonService, org.osgi.framework.FrameworkListener


Nested Class Summary
protected  class OOoDaemonManagerComponent.ThreadExceptionHandler
           
 
Field Summary
protected static boolean configured
           
protected static Config daemonConfig
           
protected static int MAX_TRY
           
protected static Thread runner
           
protected static String SERVER_CONFIG_EP
           
protected static OOoServerDescriptor serverDescriptor
           
protected  boolean started
           
 
Constructor Summary
OOoDaemonManagerComponent()
           
 
Method Summary
 void activate(ComponentContext context)
          Activates the component.
 void deactivate(ComponentContext context)
          Deactivates the component.
 void frameworkEvent(org.osgi.framework.FrameworkEvent event)
          Startup listener.
 int getNbWorkers()
           
protected static Config getOrBuildConfig()
           
protected  boolean isAvailable()
           
 boolean isConfigured()
           
 boolean isEnabled()
           
 boolean isRunning()
           
 void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 int startDaemon()
          Starts the daemon and returns immediately.
 boolean startDaemonAndWaitUntilReady()
          Starts the Daemon and wait until Daemon is ready to accept calls.
 void stopDaemon()
          Stops the Daemon and returns immediately.
 boolean stopDaemonAndWaitForCompletion()
          Stops the Daemon and wait until it exists.
 void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
getAdapter, registerExtension, unregisterExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

runner

protected static Thread runner

serverDescriptor

protected static OOoServerDescriptor serverDescriptor

daemonConfig

protected static Config daemonConfig

configured

protected static boolean configured

SERVER_CONFIG_EP

protected static String SERVER_CONFIG_EP

MAX_TRY

protected static int MAX_TRY

started

protected boolean started
Constructor Detail

OOoDaemonManagerComponent

public OOoDaemonManagerComponent()
Method Detail

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

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

registerContribution

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

unregisterContribution

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

getOrBuildConfig

protected static Config getOrBuildConfig()

isConfigured

public boolean isConfigured()
Specified by:
isConfigured in interface OOoDaemonService
Returns:
true if OpenOffice is configured and found.

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface OOoDaemonService
Returns:
true in built-in Daemon is Enabled by configuration.

isAvailable

protected boolean isAvailable()

isRunning

public boolean isRunning()
Specified by:
isRunning in interface OOoDaemonService
Returns:
true if Daemon is running.

startDaemon

public int startDaemon()
Description copied from interface: OOoDaemonService
Starts the daemon and returns immediately.

Specified by:
startDaemon in interface OOoDaemonService

startDaemonAndWaitUntilReady

public boolean startDaemonAndWaitUntilReady()
Description copied from interface: OOoDaemonService
Starts the Daemon and wait until Daemon is ready to accept calls.

Specified by:
startDaemonAndWaitUntilReady in interface OOoDaemonService

stopDaemon

public void stopDaemon()
Description copied from interface: OOoDaemonService
Stops the Daemon and returns immediately.

Specified by:
stopDaemon in interface OOoDaemonService

stopDaemonAndWaitForCompletion

public boolean stopDaemonAndWaitForCompletion()
Description copied from interface: OOoDaemonService
Stops the Daemon and wait until it exists.

Specified by:
stopDaemonAndWaitForCompletion in interface OOoDaemonService

getNbWorkers

public int getNbWorkers()
Specified by:
getNbWorkers in interface OOoDaemonService
Returns:
the number of OpenOffice workers.

frameworkEvent

public void frameworkEvent(org.osgi.framework.FrameworkEvent event)
Startup listener.

Specified by:
frameworkEvent in interface org.osgi.framework.FrameworkListener

Nuxeo Enterprise Platform 5.3

Copyright © 2010 Nuxeo SAS. All Rights Reserved.