Class JeroMQInstanceConnectionService
java.lang.Object
dev.getelements.elements.rt.remote.jeromq.JeroMQInstanceConnectionService
- All Implemented Interfaces:
InstanceConnectionService
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.getelements.elements.rt.remote.InstanceConnectionService
InstanceConnectionService.InstanceBinding, InstanceConnectionService.InstanceConnection -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets aList<InstanceConnectionService.InstanceConnection>representing all active connections.Gets theInstanceIdfor thisInstanceConnectionService.Returns the local control address.longjakarta.inject.Provider<RemoteInvoker> org.zeromq.ZContextopenBinding(NodeId nodeId) Gets anInstanceConnectionService.InstanceBindingwhich a node can then use to receive incoming data.voidrefresh()Forces a refresh from the latest source of data immediately.voidsetAsyncControlClientFactory(AsyncControlClient.Factory asyncControlClientFactory) voidsetBindAddress(String bindAddress) voidsetInstanceDiscoveryService(InstanceDiscoveryService instanceDiscoveryService) voidsetInstanceId(InstanceId instanceId) voidsetRefreshIntervalInSeconds(long refreshIntervalInSeconds) voidsetRemoteInvokerProvider(jakarta.inject.Provider<RemoteInvoker> remoteInvokerProvider) voidsetSecurityChain(JeroMQSecurity securityChain) voidsetzContext(org.zeromq.ZContext zContext) voidstart()Starts the service.voidstop()Stops the service.Adds aConsumer<InstanceConnectionService.InstanceConnection>that will be called when a new instance has connected to thisInstanceConnectionService.Adds aConsumer<InstanceConnectionService.InstanceConnection>that will be called when a an instance has disconnected from thisInstanceConnectionService.
-
Field Details
-
JEROMQ_CLUSTER_BIND_ADDRESS
- See Also:
-
JEROMQ_CONNECTION_SERVICE_REFRESH_INTERVAL_SECONDS
- See Also:
-
-
Constructor Details
-
JeroMQInstanceConnectionService
public JeroMQInstanceConnectionService()
-
-
Method Details
-
start
public void start()Description copied from interface:InstanceConnectionServiceStarts the service.- Specified by:
startin interfaceInstanceConnectionService
-
stop
public void stop()Description copied from interface:InstanceConnectionServiceStops the service.- Specified by:
stopin interfaceInstanceConnectionService
-
refresh
public void refresh()Description copied from interface:InstanceConnectionServiceForces a refresh from the latest source of data immediately. This will ensure that newInstanceConnectionService.InstanceConnections are added and stale ones removed immediately. All necessary events will be driven as part of this call.- Specified by:
refreshin interfaceInstanceConnectionService
-
openBinding
Description copied from interface:InstanceConnectionServiceGets anInstanceConnectionService.InstanceBindingwhich a node can then use to receive incoming data. If a binding already exists for the suppliedNodeId, then an exception will be thrown.- Specified by:
openBindingin interfaceInstanceConnectionService- Parameters:
nodeId- theNodeIdfor which the binding will be used.- Returns:
- the
InstanceConnectionService.InstanceBinding
-
getActiveConnections
Description copied from interface:InstanceConnectionServiceGets aList<InstanceConnectionService.InstanceConnection>representing all active connections.- Specified by:
getActiveConnectionsin interfaceInstanceConnectionService- Returns:
- the list of all active
InstanceConnectionService.InstanceConnections
-
subscribeToConnect
public Subscription subscribeToConnect(Consumer<InstanceConnectionService.InstanceConnection> onConnect) Description copied from interface:InstanceConnectionServiceAdds aConsumer<InstanceConnectionService.InstanceConnection>that will be called when a new instance has connected to thisInstanceConnectionService.- Specified by:
subscribeToConnectin interfaceInstanceConnectionService- Parameters:
onConnect- theConsumer<InstanceConnectionService.InstanceConnection>- Returns:
- a
Subscriptionthat can be cancled later.
-
subscribeToDisconnect
public Subscription subscribeToDisconnect(Consumer<InstanceConnectionService.InstanceConnection> onDisconnect) Description copied from interface:InstanceConnectionServiceAdds aConsumer<InstanceConnectionService.InstanceConnection>that will be called when a an instance has disconnected from thisInstanceConnectionService.- Specified by:
subscribeToDisconnectin interfaceInstanceConnectionService- Parameters:
onDisconnect- theConsumer<InstanceConnectionService.InstanceConnection>- Returns:
- a
Subscriptionthat can be cancled later.
-
getLocalControlAddress
Description copied from interface:InstanceConnectionServiceReturns the local control address. This is an address through which the a control client may be used to control the instance from within the local process space.- Specified by:
getLocalControlAddressin interfaceInstanceConnectionService- Returns:
- the local control address.
-
getInstanceId
Description copied from interface:InstanceConnectionServiceGets theInstanceIdfor thisInstanceConnectionService.- Specified by:
getInstanceIdin interfaceInstanceConnectionService- Returns:
- the
InstanceId
-
setInstanceId
-
getzContext
public org.zeromq.ZContext getzContext() -
setzContext
@Inject public void setzContext(org.zeromq.ZContext zContext) -
getBindAddress
-
setBindAddress
@Inject public void setBindAddress(@Named("dev.getelements.elements.rt.remote.jeromq.bind.addr") String bindAddress) -
getRemoteInvokerProvider
-
setRemoteInvokerProvider
@Inject public void setRemoteInvokerProvider(jakarta.inject.Provider<RemoteInvoker> remoteInvokerProvider) -
getRefreshIntervalInSeconds
public long getRefreshIntervalInSeconds() -
setRefreshIntervalInSeconds
@Inject public void setRefreshIntervalInSeconds(@Named("dev.getelements.elements.rt.remote.jeromq.connection.service.refresh.interval.sec") long refreshIntervalInSeconds) -
getInstanceDiscoveryService
-
setInstanceDiscoveryService
-
getAsyncControlClientFactory
-
setAsyncControlClientFactory
@Inject public void setAsyncControlClientFactory(AsyncControlClient.Factory asyncControlClientFactory) -
getSecurityChain
-
setSecurityChain
-