/** * @param type * @param resource * @return * @throws IllegalArgumentException If no ResourceProvider found for Type * @throws RuntimeException If ResourceProvider return null */ private Object lookupContext(Class<?> type, ContainerResource resource, Annotation... qualifiers) { try { final Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); env.put(Context.PROVIDER_URL, managementClient.get().getRemoteEjbURL().toString()); env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false"); env.put("jboss.naming.client.security.callback.handler.class", Authentication.CallbackHandler.class.getName()); return new InitialContext(env); } catch (NamingException e) { throw new RuntimeException(e); } }
/** * @param type * @param resource * @return * @throws IllegalArgumentException If no ResourceProvider found for Type * @throws RuntimeException If ResourceProvider return null */ private Object lookupContext(Class<?> type, ContainerResource resource, Annotation... qualifiers) { try { final Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); env.put(Context.PROVIDER_URL, managementClient.get().getRemoteEjbURL().toString()); env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false"); env.put("jboss.naming.client.security.callback.handler.class", Authentication.CallbackHandler.class.getName()); return new InitialContext(env); } catch (NamingException e) { throw new RuntimeException(e); } }
/** * @param type * @param resource * @return * @throws IllegalArgumentException If no ResourceProvider found for Type * @throws RuntimeException If ResourceProvider return null */ private Object lookupContext(Class<?> type, ContainerResource resource, Annotation... qualifiers) { try { final Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); env.put(Context.PROVIDER_URL, managementClient.get().getRemoteEjbURL().toString()); env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false"); env.put("jboss.naming.client.security.callback.handler.class", Authentication.CallbackHandler.class.getName()); return new InitialContext(env); } catch (NamingException e) { throw new RuntimeException(e); } }
/** * @param type * @param resource * @return * @throws IllegalArgumentException If no ResourceProvider found for Type * @throws RuntimeException If ResourceProvider return null */ private Object lookupContext(Class<?> type, ContainerResource resource, Annotation... qualifiers) { try { final Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); env.put(Context.PROVIDER_URL, managementClient.get().getRemoteEjbURL().toString()); env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false"); env.put("jboss.naming.client.security.callback.handler.class", Authentication.CallbackHandler.class.getName()); return new InitialContext(env); } catch (NamingException e) { throw new RuntimeException(e); } }