class ExternalOfficeManager extends Object implements OfficeManager
OfficeManager implementation that connects to an external Office process.
The external Office process needs to be started manually, e.g. from the command line with
soffice -accept="socket,host=127.0.0.1,port=2002;urp;"
Since this implementation does not manage the Office process, it does not support auto-restarting the process if it exits unexpectedly.
It will however auto-reconnect to the external process if the latter is manually restarted.
This OfficeManager implementation basically provides the same behaviour as JODConverter 2.x, including using synchronized blocks for serialising office
operations.
| 限定符和类型 | 字段和说明 |
|---|---|
private OfficeConnection |
connection |
private boolean |
connectOnStart |
| 构造器和说明 |
|---|
ExternalOfficeManager(UnoUrl unoUrl,
boolean connectOnStart) |
private final OfficeConnection connection
private final boolean connectOnStart
public ExternalOfficeManager(UnoUrl unoUrl, boolean connectOnStart)
unoUrl - connectOnStart - should a connection be attempted on start()? Default is true. If false, a connection will only be attempted the first time an
OfficeTask is executed.public void start()
throws OfficeException
start 在接口中 OfficeManagerOfficeExceptionpublic void stop()
stop 在接口中 OfficeManagerpublic void execute(OfficeTask task) throws OfficeException
execute 在接口中 OfficeManagerOfficeExceptionprivate void connect()
public boolean isRunning()
isRunning 在接口中 OfficeManagerCopyright © 2019. All rights reserved.