1 Reply Latest reply on Nov 12, 2007 10:06 PM by Ron Sigal

    Capturing Client IP Address

    Kevin Pauli Newbie

      I have a requirement to capture and log the IP addresses of remote clients connecting to the JBoss server over RMI/JRMP to execute SLSBs.

      Can anyone give me some ideas how I might accomplish this? Would I extend the server invoker with my own implementation, or one of the connectors, or perhaps insert some new handler into the config in jboss-service.xml?

      If anyone has an idea please don't hesitate to be specific or overly pedantic in your response as I'm new to JBoss Remoting and don't have all the lingo down, so every detail will help.

        • 1. Re: Capturing Client IP Address
          Ron Sigal Master

          Actually, the JRMPInvoker is not part of the Remoting project - it's "legacy" code in the Application Server. Are you sure that's what you want? The current versions of the Application Server, 4.2.x, no longer use the JRPMInvoker by default. Instead, they use the Remoting based UnifiedInvoker. Moreover, the EJB3 implementation uses the UnifiedInvoker, even in the older versions of the AS.

          So, if you're using an older AS and EJB 2.x beans and your question really is about the JRPMInvoker, I would suggest the EJB forum (http://www.jboss.com/index.html?module=bb&op=viewforum&f=47).

          On the other hand, if you're using a current release, then you probably want to ask about the UnifiedInvoker. In that case I can tell you that there is currently no facility for doing what you ask, though one is scheduled for the 2.4.0 release of Remoting. See JIRA issue JBREM-758 "Associate remote socket address with the invocation" (http://jira.jboss.com/jira/browse/JBREM-758).

          If you wanted to roll your own, then the changes are transport dependent. The default transport used by EJB 2.x (in current releases of the AS) and EJB3 is the socket transport, and in that case you would want to look at org.jboss.remoting.transport.socket.ServerThread.processInvocation(). That's the code that reads from the socket and passes the invocation to the invocation handler.