tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitrijs Litajevs <dmitrij...@balticom.eu>
Subject How to get client remote ip in stateless bean?
Date Fri, 07 Mar 2014 13:40:51 GMT
I have a remote stateless bean
@Remote
public interface HelloRemote {
   public void hello();
}

@Stateless
public class Hello {
   public void hello(){
      // some ip based logic
   }
}

and i call it from jse client

Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
p.put("java.naming.provider.url", "http://localhost:8080/tomee/ejb");
p.setProperty(Context.SECURITY_PRINCIPAL, "usr");
p.setProperty(Context.SECURITY_CREDENTIALS, "pass_hash");

InitialContext ctx = new InitialContext(p);
HelloRemote facade = (HelloRemote ) ctx.lookup("HelloRemote ");
facade.hello();

How to get client remote ip in stateless bean?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message