[jboss-cvs] JBossAS SVN: r95920 - projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Nov 2 10:11:00 EST 2009
Author: alesj
Date: 2009-11-02 10:10:59 -0500 (Mon, 02 Nov 2009)
New Revision: 95920
Modified:
projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JndiBinderDeployer.java
Log:
Expose initial context creation - can be mocked.
Modified: projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JndiBinderDeployer.java
===================================================================
--- projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JndiBinderDeployer.java 2009-11-02 15:03:47 UTC (rev 95919)
+++ projects/weld-int/trunk/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JndiBinderDeployer.java 2009-11-02 15:10:59 UTC (rev 95920)
@@ -98,12 +98,17 @@
this.thisName = thisName;
}
+ protected Context createContext() throws NamingException
+ {
+ return new InitialContext(jndiEnvironment);
+ }
+
public void create() throws Exception
{
if (jndiEnvironment != null)
addNonSerializableFactory(jndiEnvironment); // is here OK?
- Context context = new InitialContext(jndiEnvironment);
+ Context context = createContext();
beanManagerContext = context.createSubcontext(BEAN_MANAGER_JNDI_SUBCONTEXT);
}
@@ -111,7 +116,7 @@
{
try
{
- Context context = new InitialContext(jndiEnvironment);
+ Context context = createContext();
context.destroySubcontext(BEAN_MANAGER_JNDI_SUBCONTEXT);
}
catch (Exception ignore)
More information about the jboss-cvs-commits
mailing list