public interface NetworkConnectionInterceptor { // Called when a {@link Socket} is accepted by a {@link ServerSocket} boolean onAccept(Socket acceptedSocket); // Called when a {@link SocketChannel} is accepted by a {@link ServerSocketChannel} boolean onAccept(SocketChannel acceptedSocket); // Called when a {@link Socket} is connected boolean onConnect(Socket connectedSocket);}
I'd be using a different protocol than jmxmp, a custom one which includes auth.
you need to call Security.addProvider
and env.put("jmx.remote.profiles", XX)
Our approach here is to define a MBeanServerForwarder
So if jppf supported pluggable JMX connector providers too then the authenticated JMX story is good.
But does it work on the visualvm/jconsole side too
I may need to instantiate my own forwarder impl in order to inject the network resource it requires to do permission lookups, so the config property may not be sufficient
you can call Security.addProvider() from within a pluggable forwarder's constructor
as long as you can add the jar with your implementation of JMXClientEnvironmentProvider to the tool's classpath
Do you have a use case or example that is not covered by the feature request?
if you sent me instruction to replicate the annoying visualvm popup on my end it would be more clear what you suggest.
It requires a hostport and some other config. If you instantiate my forwarder using reflection, who will supply it the hostport?
jppf.management.server.forwarder = my.forwarder.Implementation param1 ... paramN
perhaps there could be a way to programmatically fetch a reference to the forwarder after construction/installation, at which time I could do a late injection of required dependencies?
MBeanServerForwarder myForwarder = JPPFDriver.getInstance().getJMXServer(false).getMBeanServerForwarder();
Will this be ok?
Would you also add an API to obtain a reference to the network interceptor?
Since the list is unmodifiable, it can be safely read by as many threads as you wish.
In your case we're fine because its unmodifiable and immutable.
It might make sense for AbstractNetworkConnectionInterceptor to keep the Socket overloads abstract and just implement the SocketChannel overloads with onX(channel.socket())
I don't see onAccept/onConnect even getting called in driver
log4j.logger.org.jppf.comm.interceptor=DEBUG