|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zeromq.ZContext
public class ZContext
ZContext provides a high-level ZeroMQ context management class The ZContext class wraps java org.zeromq.Context objects, which in turn wrap native 0MQ contexts. It manages open sockets in the context and automatically closes these before terminating the context. It provides a simple way to set the linger timeout on sockets, and configure contexts for number of I/O threads. Sets-up signal (interrupt) handling for the process.
http://github.com/zeromq/czmq/blob/master/src/zctx.c
Constructor Summary | |
---|---|
ZContext()
Class Constructor |
Method Summary | |
---|---|
void |
close()
|
ZMQ.Socket |
createSocket(int type)
Creates a new managed socket within this ZContext instance. |
void |
destroy()
Destructor. |
void |
destroySocket(ZMQ.Socket s)
Destroys managed socket within this context and remove from sockets list |
ZMQ.Context |
getContext()
|
int |
getIoThreads()
|
int |
getLinger()
|
List<ZMQ.Socket> |
getSockets()
|
boolean |
isMain()
|
void |
setContext(ZMQ.Context ctx)
|
void |
setIoThreads(int ioThreads)
|
void |
setLinger(int linger)
|
void |
setMain(boolean main)
|
static ZContext |
shadow(ZContext ctx)
Creates new shadow context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZContext()
Method Detail |
---|
public void destroy()
public ZMQ.Socket createSocket(int type)
type
- socket type (see ZMQ static class members)
public void destroySocket(ZMQ.Socket s)
s
- org.zeromq.Socket object to destroypublic static ZContext shadow(ZContext ctx)
ctx
- Original ZContext to create shadow of
public int getIoThreads()
public void setIoThreads(int ioThreads)
ioThreads
- the ioThreads to setpublic int getLinger()
public void setLinger(int linger)
linger
- the linger to setpublic boolean isMain()
public void setMain(boolean main)
main
- the main to setpublic ZMQ.Context getContext()
public void setContext(ZMQ.Context ctx)
ctx
- sets the underlying org.zeromq.Context associated with this ZContext wrapper objectpublic List<ZMQ.Socket> getSockets()
public void close() throws IOException
close
in interface Closeable
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |