public class ContextManagerImpl extends java.lang.Object implements ContextManager
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ContextManagerImpl.ZMQLibraryInitializer
Initializes the ZeroMQ library on Windows and Linux.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.fabric3.api.host.runtime.HostInfo |
hostInfo |
| Constructor and Description |
|---|
ContextManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
org.zeromq.ZMQ.Socket |
createControlSocket()
Creates and returns a connected socket for receiving control messages such as shutdown.
|
void |
destroy()
Closes the ZeroMQ context after all socket clients have released their locks.
|
org.zeromq.ZMQ.Context |
getContext()
Returns the active ZeroMQ context.
|
void |
init() |
protected void |
loadLibrary(org.fabric3.api.host.runtime.HostInfo hostInfo)
Uses the OperatingSystem information of the HostInfo to decide what library to load.
|
void |
release(java.lang.String id)
Releases a socket lease.
|
void |
reserve(java.lang.String id)
Reserves a socket lease.
|
public org.zeromq.ZMQ.Context getContext()
ContextManagergetContext in interface ContextManagerpublic org.zeromq.ZMQ.Socket createControlSocket()
ContextManagercreateControlSocket in interface ContextManagerpublic void reserve(java.lang.String id)
ContextManagerreserve in interface ContextManagerid - the unique client idpublic void release(java.lang.String id)
ContextManagerrelease in interface ContextManagerid - the unique client id used to obtain the lease.public void init()
public void destroy()
protected void loadLibrary(org.fabric3.api.host.runtime.HostInfo hostInfo)
hostInfo - Based on the OperatingSystem member the needed Library will be loaded.