Class SyncHybrid
- All Implemented Interfaces:
Closeable
,AutoCloseable
It is typically used in local cluster setups, in which a "hybrid" functions as a client and cluster peer (server).
Call getStore()
to retrieve the store. To set sync listeners use the SyncClient
that is available
from getClient()
.
This class implements the Closeable
interface, ensuring that resources are cleaned up properly.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes and cleans up all resources used by this Sync hybrid.protected void
finalize()
Users of this class should explicitly callclose()
instead to avoid expensive finalization.Returns theSyncClient
of this hybrid, typically only to set Sync listeners.Returns theSyncServer
of this hybrid.getStore()
void
stop()
Stops the client and server.
-
Method Details
-
getStore
-
getClient
Returns theSyncClient
of this hybrid, typically only to set Sync listeners.Note: do not stop or close the client directly. Instead, use the
stop()
andclose()
methods of this hybrid. -
getServer
Returns theSyncServer
of this hybrid.Typically, the server should not be touched. Yet, it is still exposed for advanced use cases.
Note: do not stop or close the server directly. Instead, use the
stop()
andclose()
methods of this hybrid. -
stop
public void stop()Stops the client and server. -
close
public void close()Closes and cleans up all resources used by this Sync hybrid.It can no longer be used afterward, build a new one instead.
Does nothing if this has already been closed.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
finalize
Users of this class should explicitly callclose()
instead to avoid expensive finalization.
-