public class OfficeConnection extends Object implements LocalOfficeContext, com.sun.star.lang.XEventListener
| Constructor and Description |
|---|
OfficeConnection(@NonNull org.jodconverter.local.office.OfficeUrl officeUrl)
Constructs a new connection for the specified UNO URL.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionEventListener(@NonNull org.jodconverter.local.office.OfficeConnectionEventListener connectionEventListener)
Adds a listener to the connection event listener list of this connection.
|
void |
connect()
Establishes the connection to an office instance.
|
void |
disconnect()
Closes the connection.
|
void |
disposing(@NonNull com.sun.star.lang.EventObject eventObject) |
@Nullable com.sun.star.uno.XComponentContext |
getComponentContext()
Gets the ComponentContext interface of the remote component context.
|
@Nullable com.sun.star.frame.XComponentLoader |
getComponentLoader()
Gets the office component loader for this context.
|
@Nullable com.sun.star.frame.XDesktop |
getDesktop()
Gets the Desktop interface of the desktop service.
|
@Nullable com.sun.star.lang.XMultiComponentFactory |
getServiceManager()
Gets the MultiComponentFactory interface of the remote service manager.
|
boolean |
isConnected()
Gets whether we are connected to an office instance.
|
public OfficeConnection(@NonNull org.jodconverter.local.office.OfficeUrl officeUrl)
officeUrl - The URL for which the connection is created.public void addConnectionEventListener(@NonNull org.jodconverter.local.office.OfficeConnectionEventListener connectionEventListener)
connectionEventListener - The listener to add. It will be notified when a connection is
established with an office process and when a connection is lost.public void connect()
throws OfficeConnectionException
OfficeConnectionException - If the connection could not be established.public void disconnect()
public void disposing(@NonNull com.sun.star.lang.EventObject eventObject)
disposing in interface com.sun.star.lang.XEventListenerpublic @Nullable com.sun.star.uno.XComponentContext getComponentContext()
LocalOfficeContextgetComponentContext in interface LocalOfficeContextXComponentContext.public @Nullable com.sun.star.lang.XMultiComponentFactory getServiceManager()
LocalOfficeContextgetServiceManager in interface LocalOfficeContextXMultiComponentFactory.public @Nullable com.sun.star.frame.XComponentLoader getComponentLoader()
LocalOfficeContextgetComponentLoader in interface LocalOfficeContextXComponentLoader.public @Nullable com.sun.star.frame.XDesktop getDesktop()
LocalOfficeContextgetDesktop in interface LocalOfficeContextXDesktop.public boolean isConnected()
true if we are connected to an office instance; false otherwise.Copyright © 2016 - present; JODConverter.org. All rights reserved.