[jboss-cvs] JBossAS SVN: r73364 - projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/plugin/jndi/registry.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue May 13 15:12:45 EDT 2008
Author: ALRubinger
Date: 2008-05-13 15:12:45 -0400 (Tue, 13 May 2008)
New Revision: 73364
Modified:
projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/plugin/jndi/registry/JndiProxyFactoryRegistry.java
Log:
[EJBTHREE-1345] Fixed JNDI ProxyFactoryRegistry as failures were exposed in tests
Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/plugin/jndi/registry/JndiProxyFactoryRegistry.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/plugin/jndi/registry/JndiProxyFactoryRegistry.java 2008-05-13 19:01:55 UTC (rev 73363)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/plugin/jndi/registry/JndiProxyFactoryRegistry.java 2008-05-13 19:12:45 UTC (rev 73364)
@@ -33,6 +33,7 @@
import org.jboss.ejb3.proxy.spi.registry.SetBackedProxyFactoryRegistry;
import org.jboss.logging.Logger;
import org.jboss.naming.Util;
+import org.jboss.util.naming.NonSerializableFactory;
/**
* JndiProxyFactoryRegistry
@@ -107,7 +108,7 @@
// Bind to JNDI at the specified key
try
{
- Util.rebind(context, key, value);
+ NonSerializableFactory.rebind(context, key, value);
}
catch (NamingException ne)
{
@@ -138,14 +139,21 @@
*/
public void deregisterProxyFactory(String key) throws ProxyFactoryNotRegisteredException
{
- // Deregister
- super.deregisterProxyFactoryFromBackingSet(key);
+ // See if registered
+ if (!this.isRegistered(key))
+ {
+ throw new ProxyFactoryNotRegisteredException("No " + ProxyFactory.class.getSimpleName()
+ + " is registered under key \"" + key + "\" in " + this);
+ }
// Obtain
ProxyFactory factory = this.getProxyFactory(key);
assert factory != null : ProxyFactory.class.getSimpleName() + " at key \"" + key
+ "\" found as registered, but was null when obtained";
+ // Deregister
+ super.deregisterProxyFactoryFromBackingSet(key);
+
// Remove from JNDI
try
{
More information about the jboss-cvs-commits
mailing list