Something like this:

  | @Name("managedRemoteServer")
  | @Scope(ScopeType.STATELESS)
  | public class ManagedRemoteServer
  | {
  | 
  |     @Unwrap
  |     public ManagementService getRemoteServer()
  |     {
  |             try
  |             {
  |                     Properties env = new Properties();
  |                     env.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.jnp.interfaces.NamingContextFactory");
  |                     env.put(Context.URL_PKG_PREFIXES, 
"org.jboss.naming:org.jnp.interfaces");
  |                     env.put(Context.PROVIDER_URL, "jnp://192.168.1.1:1099");
  | 
  |                     Context ctx = new InitialContext(env);
  | 
  |                     return (ManagementService) 
ctx.lookup("tlon/ManagementServiceBean/remote");
  |             }
  |             catch (Exception e)
  |             {
  |                     e.printStackTrace();
  |             }
  | 
  |             return null;
  |     }
  | 
  | }
  | 

And:


  | 
  |     @In
  |     private ManagementService remoteServer;
  | 
  | 

Obs.: I didn't test this...

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117586#4117586

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117586
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to