[Design of EJB 3.0] - Re: EJBTHREE-1396 MockServer must report startup / shutdown
by jaikiran
"ALRubinger" wrote :
|
| * I neglected to provide facility for parent CLs in my Hack CLs that do the jndi.properties replacements.
|
| * Always reset TCL to the original in a "finally" block.
|
| S,
| ALR
Andrew,
>From what i see in the code and understand from the comments, the purpose of JndiPropertiesToJndiRemotePropertiesHackCl is to
anonymous wrote : switch requests for "jndi.properties" to use "jndi-remote.properties"
// Switch up to the hacky CL so that "jndi.properties" is not loaded, and uses instead "jndi-remote.properties"
| ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
| Thread.currentThread().setContextClassLoader(new JndiPropertiesToJndiRemotePropertiesHackCl());
|
| RemoteAccessTestCase.setContext(new InitialContext());
Any specific reason for using a different classloader, instead of something like this:
// get the input stream for jndi-remote.properties file, which will be available
| // in classpath
| InputStream inputStream = RemoteAccessTestCase.class.getClassLoader().getResourceAsStream("jndi-remote.properties");
|
| // load the jndi-remote.properties
| Properties jndiRemoteProperties = new Properties();
| jndiRemoteProperties.load(inputStream);
|
| // Use the non-default constructor of InitialContext and pass the
| // properties
| RemoteAccessTestCase.setContext(new InitialContext(jndiRemoteProperties));
Am i missing something here (which is very likely)?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192500#4192500
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192500
15 years, 7 months