-
1. Re: Dynamic change to jboss-ejb-client.properties
prasad.deshpande Nov 23, 2011 5:09 AM (in response to prasad.deshpande)Anyone, any thoughts?
-
2. Re: Dynamic change to jboss-ejb-client.properties
jaikiran Nov 23, 2011 5:22 AM (in response to prasad.deshpande)1 of 1 people found this helpfulRight now we don't have that support. That file is read when the EJB client API is bootstraped (i.e first invocation to the EJBClientContext class).
Prasad Deshpande wrote:
these properties based on user input & then do an EJB lookup, is there any way to do it (just like passing Context.PROVIDER_URL through jndi.properties & to constructor of InitialContext)?
We could add some kind of flexibility with those properties (but not necessarily tie them with JNDI). Could you please create a JIRA for this feature here https://issues.jboss.org/browse/EJBCLIENT
-
3. Re: Dynamic change to jboss-ejb-client.properties
prasad.deshpande Nov 23, 2011 5:49 AM (in response to jaikiran)Thanks Jaikiran, I've created a JIRA https://issues.jboss.org/browse/EJBCLIENT-12. Need to convince Dave & Jason to include in 7.1. beta.
-
4. Re: Dynamic change to jboss-ejb-client.properties
jaikiran Nov 23, 2011 5:51 AM (in response to prasad.deshpande)Prasad Deshpande wrote:
Need to convince Dave & Jason to include in 7.1. beta.
Looks like you missed the announcement at the top of this forum
-
5. Re: Dynamic change to jboss-ejb-client.properties
prasad.deshpande Nov 23, 2011 5:55 AM (in response to jaikiran)jaikiran pai wrote:
Looks like you missed the announcement at the top of this forum
lol.. not a bad idea..
-
6. Re: Dynamic change to jboss-ejb-client.properties
markus78 Dec 22, 2011 12:01 PM (in response to jaikiran)Hi, Any news on this? Is this implemented in the recent 7.1 CR1?
thanks, /Markus
-
7. Re: Dynamic change to jboss-ejb-client.properties
jaikiran Dec 22, 2011 9:32 PM (in response to markus78)markus78 wrote:
Hi, Any news on this? Is this implemented in the recent 7.1 CR1?
No it's not in CR1. We have some EJB client related changes lined up for Final. I'll be taking a look at this for the next release.
-
8. Re: Dynamic change to jboss-ejb-client.properties
ktfan Mar 14, 2012 3:02 AM (in response to jaikiran)Hi Jaikiran Pai, Is this in 7.1.1 Final ? any further info I can refer to ?
-
9. Re: Dynamic change to jboss-ejb-client.properties
jaikiran Mar 14, 2012 3:39 AM (in response to ktfan)Yes, it is available in 7.1.1.Final.
-
10. Re: Dynamic change to jboss-ejb-client.properties
ktfan Mar 14, 2012 3:51 AM (in response to jaikiran)Can you point me to the right documentation on this ?
-
11. Re: Dynamic change to jboss-ejb-client.properties
jaikiran Mar 14, 2012 4:03 AM (in response to ktfan)fan kam thong wrote:
Can you point me to the right documentation on this ?
The documentation isn't ready. In the meantime, if you have a specific question then feel free to ask in a separate thread.
-
12. Re: Dynamic change to jboss-ejb-client.properties
ktfan Mar 14, 2012 4:53 AM (in response to jaikiran)can you place some same codes here so that I can try it out first before the documentation ?
-
13. Re: Dynamic change to jboss-ejb-client.properties
jaikiran Mar 14, 2012 5:02 AM (in response to ktfan)fan kam thong wrote:
can you place some same codes here so that I can try it out first before the documentation ?
This is one example https://github.com/jbossas/jboss-ejb-client/blob/master/src/test/java/org/jboss/ejb/client/test/invocation/retry/StatelessApplicationUndeploymentFailoverTestCase.java#L89
-
14. Re: Dynamic change to jboss-ejb-client.properties
ktfan Mar 14, 2012 11:05 PM (in response to jaikiran)I managed to invoke the EJB service with self-defined properties file. Here is the sample codes I have after rounds of searching in the discussion threads. However it does not dynamically change the property values in the properties file.
1) Still I wonder if there is a way to change the properties value programmatically ?
2) And I also wonder how does the ejbClientContextSelector and previousSelector work ?
final String clientPropsName = "my-ejb-client.properties";
System.out.println("reading my-ejb-client.properties");
final InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(clientPropsName);
if (inputStream == null) {
throw new RuntimeException("Could not find EJB client configuration properties at " + clientPropsName + " using classloader " + this.getClass().getClassLoader());
}
final Properties clientProps = new Properties();
clientProps.load(inputStream);
final EJBClientConfiguration clientConfiguration = new PropertiesBasedEJBClientConfiguration(clientProps);
// EJB client context selection is based on selectors. So let's create a ConfigBasedEJBClientContextSelector which uses our EJBClientConfiguration created in previous step
final ContextSelector<EJBClientContext> ejbClientContextSelector = new ConfigBasedEJBClientContextSelector(clientConfiguration);
// Now let's setup the EJBClientContext to use this selector
final ContextSelector<EJBClientContext> previousSelector = EJBClientContext.setSelector(ejbClientContextSelector);
StatelessEJBLocator<testEJBRemote> locator = new StatelessEJBLocator(testEJBRemote.class, "", "test-web-service", "testEJBBean", "");
return org.jboss.ejb.client.EJBClient.createProxy(locator);