[jboss-cvs] JBossAS SVN: r111879 - projects/ejb3/branches/jboss-ejb3-proxy-impl-1.0.6.SP/src/main/java/org/jboss/ejb3/proxy/impl/jndiregistrar.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jul 28 17:49:11 EDT 2011
Author: dereed
Date: 2011-07-28 17:49:11 -0400 (Thu, 28 Jul 2011)
New Revision: 111879
Modified:
projects/ejb3/branches/jboss-ejb3-proxy-impl-1.0.6.SP/src/main/java/org/jboss/ejb3/proxy/impl/jndiregistrar/JndiSessionRegistrarBase.java
Log:
[JBPAPP-6789] Don't bind default proxy factory if it conflicts with a @RemoteBinding
Modified: projects/ejb3/branches/jboss-ejb3-proxy-impl-1.0.6.SP/src/main/java/org/jboss/ejb3/proxy/impl/jndiregistrar/JndiSessionRegistrarBase.java
===================================================================
--- projects/ejb3/branches/jboss-ejb3-proxy-impl-1.0.6.SP/src/main/java/org/jboss/ejb3/proxy/impl/jndiregistrar/JndiSessionRegistrarBase.java 2011-07-28 21:15:34 UTC (rev 111878)
+++ projects/ejb3/branches/jboss-ejb3-proxy-impl-1.0.6.SP/src/main/java/org/jboss/ejb3/proxy/impl/jndiregistrar/JndiSessionRegistrarBase.java 2011-07-28 21:49:11 UTC (rev 111879)
@@ -199,6 +199,8 @@
boolean hasLocalView = (localHome != null || hasLocalBusinessView);
boolean hasRemoteView = (remoteHome != null || hasRemoteBusinessView);
+ boolean bindDefaultFactory = true;
+
/*
* Create and Register Proxy Factories
*/
@@ -242,16 +244,6 @@
// Create and register a remote proxy factory
String defaultRemoteProxyFactoryKey = this.getProxyFactoryRegistryKey(defaultRemoteJndiName, smd, false);
- ProxyFactory factory = this.createRemoteProxyFactory(defaultRemoteProxyFactoryKey, containerName,
- containerGuid, smd, cl, defaultClientBindUrl, advisor, null);
- try
- {
- this.registerProxyFactory(defaultRemoteProxyFactoryKey, factory, smd);
- }
- catch (DuplicateBindException dbe)
- {
- throw new RuntimeException(dbe);
- }
// Get Classname to set for Reference
String defaultRemoteClassName = this.getHumanReadableListOfInterfacesInRefAddrs(refAddrsForRemote);
@@ -260,8 +252,6 @@
Reference defaultRemoteRef = createStandardReference(JndiSessionRegistrarBase.OBJECT_FACTORY_CLASSNAME_PREFIX
+ defaultRemoteClassName, defaultRemoteProxyFactoryKey, containerName, false);
- // Also bind remote proxy factory to jndi
- this.bindRemoteProxyFactory(context, defaultRemoteProxyFactoryKey, defaultClientBindUrl, factory, cl, smd);
/*
* Set up references for Home
*/
@@ -403,6 +393,9 @@
// Create and register a remote proxy factory specific to this binding
String remoteBindingProxyFactoryKey = this.getProxyFactoryRegistryKey(remoteBindingJndiName, smd, false);
+ if ( defaultRemoteProxyFactoryKey.equals ( remoteBindingProxyFactoryKey ) )
+ bindDefaultFactory = false;
+
ProxyFactory remoteBindingProxyFactory = null;
boolean reregister = true;
try
@@ -475,6 +468,24 @@
}
}
+ // Only bind the default if there are no remote bindings defined.
+ if (bindDefaultFactory)
+ {
+ ProxyFactory factory = this.createRemoteProxyFactory(defaultRemoteProxyFactoryKey, containerName,
+ containerGuid, smd, cl, defaultClientBindUrl, advisor, null);
+ try
+ {
+ this.registerProxyFactory(defaultRemoteProxyFactoryKey, factory, smd);
+ }
+ catch (DuplicateBindException dbe)
+ {
+ throw new RuntimeException(dbe);
+ }
+
+ // Also bind remote proxy factory to jndi
+ this.bindRemoteProxyFactory(context, defaultRemoteProxyFactoryKey, defaultClientBindUrl, factory, cl, smd);
+ }
+
// Bind ObjectFactory specific to each Remote Business Interface
if (businessRemotes != null)
{
More information about the jboss-cvs-commits
mailing list