-
1. Re: Programmatically configure ejb client properties jboss 7.1.1
jaikiran Jun 10, 2012 9:12 AM (in response to surajchhetry)suraj chhetry wrote:
I want to configure ejb client programmetically instead of using jboss-ejb-clinet.properties is that possible in Jboss 7.1.1 ?
Using JBoss EJB client APIs? Yes, that's possible. If you tell us more about what you are trying to do then I can point you to some testcases where a similar thing is done.
-
2. Re: Programmatically configure ejb client properties jboss 7.1.1
jaysensharma Jun 10, 2012 12:09 PM (in response to jaikiran)Hi Suraj,
Try using "EJBClientConfiguration" to avoid using the "jboss-ejb-clinet.properties"
Properties clientProp = new Properties();
clientProp.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
clientProp.put("remote.connections", "default");
clientProp.put("remote.connection.default.port", "4447");
clientProp.put("remote.connection.default.host", "localhost");
clientProp.put("remote.connection.default.username", "ejbUser");
clientProp.put("remote.connection.default.password", "ejbPassword");
clientProp.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(p);
ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);
EJBClientContext.setSelector(selector);
Properties props = new Properties();
props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
Context ctx = new InitialContext(props);
-
3. Re: Programmatically configure ejb client properties jboss 7.1.1
surajchhetry Jun 10, 2012 8:34 PM (in response to jaysensharma)Dear JaiKiran,
I just want to configure ejb client properties at runtime so that based on some condition I can change Remote connection URL.
Dear Jay,
Thank you for your soution that what I was looking for.
Thank you guys for helping me.
-
4. Re: Programmatically configure ejb client properties jboss 7.1.1
andilog Dec 9, 2014 6:51 AM (in response to jaysensharma)Thank you Jay Kumar SenSharma.
Could not find this somewhere else.
Very helpful!