public class BGSyncControl
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
STOP_TIMEOUT
Default timeout for stopping sync agent.
|
Constructor and Description |
---|
BGSyncControl()
Create an instance of BGSyncControl class.
|
BGSyncControl(java.lang.String mu)
Create an instance of BGSyncControl class.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelMessage()
Cancel reading of messages from another thread (when called on the
same BGSyncControl object used in the read loop).
|
void |
close()
Close BGSyncControl object.
|
void |
createMsgQ()
Create message queue inside the BGSyncControl object to allow
receiving application messages from sync agent.
|
void |
disable()
Disable sync agent.
|
void |
enable()
Enable sync agent.
|
void |
finalize() |
BGSyncMsg |
getMessage()
Get application message from sync agent.
|
BGSyncStatus |
getStatus()
Get automatic synchronization status.
|
boolean |
isEnabled()
Tells whether sync agent is enabled.
|
void |
kill()
Terminate sync agent instead of stopping it gracefully.
|
void |
start()
Start sync agent.
|
void |
stop()
Stop sync agent.
|
void |
stop(long timeout)
Stop sync agent.
|
public static final int STOP_TIMEOUT
stop
,
Constant Field Valuespublic BGSyncControl() throws SyncException
SyncException
- - if internal error occurred.public BGSyncControl(java.lang.String mu) throws SyncException
mu
- - connection string to miniserver (if this instance
is to control automatic sync remotely) in the format host:port,
like "mymachine.oracle.com:1160". If port is omitted, default
port for miniserver (1160) will be used.
If mu is empty string or null, this instance will control
automatic sync locally (on the same machine).SyncException
- - if connection to the miniserver could not
be established or internal error occurred.public void cancelMessage()
public void close()
public void createMsgQ() throws SyncException
SyncExceptin
- - if internal error occurred.SyncException
public void disable() throws SyncException
SyncException
- - if the internal error occurred.public void enable() throws SyncException
SyncException
- - if the internal error occurred.public void finalize()
finalize
in class java.lang.Object
public BGSyncMsg getMessage() throws SyncException
SyncException
- - if internal error occurred.public BGSyncStatus getStatus() throws SyncException
SyncException
- - if the status could not be obtained
due to internal error in sync agent.public boolean isEnabled() throws SyncException
SyncException
- - if internal error occurred.public void kill() throws SyncException
SyncException
- - if the sync agent process could not be killed
due to some system conditions.public void start() throws SyncException
SyncException
- - if the sync agent could not be started.public void stop() throws SyncException
SyncException
stop
public void stop(long timeout) throws SyncException
timeout
- - timeout in milliseconds to wait for sync agent
to stop gracefully.SyncException
- - if the timeout expired or internal error
occurred.