[zeromq-dev] Java binding proposed changes
gonzalo diethelm
gdiethelm at dcv.cl
Tue Mar 30 18:10:13 CEST 2010
> > 1. The ZMQ namespace and 0MQ's constants: the current binding has
> > constants under org.zmq.Context (POLL), org.zmq.Socket (lots of
them)
> > and org.zmq.Poller (POLLIN, POLLOUT and POLLERR). They should all be
> > placed under a single ZMQ namespace; how do we do this? One way
could be
> > to create org.zmq.ZMQ as an empty class with just the constants.
Anybody
> > can suggest something else?
>
> Wouldn't it be possible to have static ZMQ class with the constants
> _and_ subclasses Context and Socket?
>
> Implementing subclass in JNI can be a bit tricky but I've already done
> it in 0MQ/1.0 Java binding (InboundData subclass) so you can get the
> idea here:
>
> http://github.com/sustrik/zeromq1/tree/master/libjzmq/
This looks like a good solution. I will work on it (looking at the code
you cite) and let everybody know how it looks.
> > 3. I will add a socket() function to org.zmq.Context, so that
sockets
> > will be created by calling this function. They can also be created
by
> > creating a new org.zmq.Socket object, as it is now. I will also add
a
> > poller() function.
>
> What will the poller function do?
Create a org.zmq.Poller object?
> > 4. I would like to review the use of assert() in the native
functions; I
> > am not sure whether they should stay the way they are, or they
should be
> > turned into raising exceptions, so that every single error condition
in
> > native code ends up being reported to the calling Java code.
>
> The rule of the thumb is: When the problem shouldn't happen - i.e.
> there's a bug in 0MQ of Java binding - assert. If the problem can be
> caused by the user raise an exception.
Ok, if that is the rule there are several assert() calls that will stay
the same; perhaps all of them. I will report back.
--
Gonzalo Diethelm
-----------------------------------------
Declaración de confidencialidad: Este Mensaje esta destinado para
el uso de la o las personas o entidades a quien ha sido dirigido y
puede contener información reservada y confidencial que no puede
ser divulgada, difundida, ni aprovechada en forma alguna. El uso no
autorizado de la información contenida en este correo podrá ser
sancionado de conformidad con la ley chilena.
Si usted ha recibido este correo electrónico por error, le pedimos
eliminarlo junto con los archivos adjuntos y avisar inmediatamente
al remitente, respondiendo este mensaje.
"Before printing this e-mail think if is really necesary".
Disclosure: This Message is to be used by the individual,
individuals or entities that it is addressed to and may include
private and confidential information that may not be disclosed,
made public nor used in any way at all. Unauthorized use of the
information in this electronic mail message may be subject to the
penalties set forth by Chilean law.
If you have received this electronic mail message in error, we ask
you to destroy the message and its attached file(s) and to
immediately notify the sender by answering this message.
More information about the zeromq-dev
mailing list