[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Tom Elrod
tom.elrod at jboss.com
Thu Jul 20 12:58:31 EDT 2006
User: telrod
Date: 06/07/20 12:58:31
Modified: src/main/org/jboss/remoting InvokerRegistry.java
Log:
JBREM-552 - fixed problem with setting cause in exception being thrown when creating new client or server invoker.
Revision Changes Path
1.34 +9 -73 JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InvokerRegistry.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- InvokerRegistry.java 12 Jul 2006 04:49:51 -0000 1.33
+++ InvokerRegistry.java 20 Jul 2006 16:58:31 -0000 1.34
@@ -48,7 +48,7 @@
*
* @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
* @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
- * @version $Revision: 1.33 $
+ * @version $Revision: 1.34 $
*/
public class InvokerRegistry
{
@@ -412,49 +412,17 @@
holder.incrementCount();
}
- private static ClientInvoker loadClientInvoker(String protocol, InvokerLocator locator, Map configuration) throws ClassNotFoundException
+ private static ClientInvoker loadClientInvoker(String protocol, InvokerLocator locator, Map configuration) throws Exception
{
ClientInvoker clientInvoker = null;
Class transportFactoryClass = getTransportClientFactory(protocol);
if(transportFactoryClass != null)
{
- try
- {
ClientFactory transportFactory = (ClientFactory)transportFactoryClass.newInstance();
Method getClientInvokerMethod = transportFactoryClass.getMethod("createClientInvoker", new Class[] {InvokerLocator.class, Map.class});
clientInvoker = (ClientInvoker)getClientInvokerMethod.invoke(transportFactory, new Object[] {locator, configuration});
}
- catch (ClassCastException e)
- {
- ClassNotFoundException cnfex = new ClassNotFoundException("Return from invoke on loadClientInvokerClass method is not of type Class");
- cnfex.initCause(e);
- throw cnfex;
- }
- catch (NoSuchMethodException e)
- {
- throw new ClassNotFoundException("Class '" + transportFactoryClass.getName() + " not of type " + ClientFactory.class.getName());
- }
- catch (IllegalAccessException e)
- {
- ClassNotFoundException cnfex = new ClassNotFoundException("Can not invoke loadClientInvokerClass method on " + transportFactoryClass);
- cnfex.initCause(e);
- throw cnfex;
- }
- catch (InvocationTargetException e)
- {
- ClassNotFoundException cnfex = new ClassNotFoundException("Can not invoke loadClientInvokerClass method on " + transportFactoryClass);
- cnfex.initCause(e);
- throw cnfex;
- }
- catch (InstantiationException e)
- {
- ClassNotFoundException cnfex = new ClassNotFoundException("Can not create a new instance of " + transportFactoryClass + " with void constructor.");
- cnfex.initCause(e);
- throw cnfex;
- }
-
- }
else
{
throw new ClassNotFoundException("Could not find class " + transportFactoryClass);
@@ -463,49 +431,17 @@
return clientInvoker;
}
- private static ServerInvoker loadServerInvoker(String protocol, InvokerLocator locator, Map configuration) throws ClassNotFoundException
+ private static ServerInvoker loadServerInvoker(String protocol, InvokerLocator locator, Map configuration) throws Exception
{
ServerInvoker serverInvoker = null;
Class transportFactoryClass = getTransportServerFactory(protocol);
if(transportFactoryClass != null)
{
- try
- {
ServerFactory transportFactory = (ServerFactory)transportFactoryClass.newInstance();
Method getClientInvokerMethod = transportFactoryClass.getMethod("createServerInvoker", new Class[] {InvokerLocator.class, Map.class});
serverInvoker = (ServerInvoker)getClientInvokerMethod.invoke(transportFactory, new Object[] {locator, configuration});
}
- catch (ClassCastException e)
- {
- ClassNotFoundException cnfex = new ClassNotFoundException("Return from invoke on loadServerInvokerClass method is not of type Class");
- cnfex.initCause(e);
- throw cnfex;
- }
- catch (NoSuchMethodException e)
- {
- throw new ClassNotFoundException("Class '" + transportFactoryClass.getName() + " not of type " + ClientFactory.class.getName());
- }
- catch (IllegalAccessException e)
- {
- ClassNotFoundException cnfex = new ClassNotFoundException("Can not invoke loadServerInvokerClass method on " + transportFactoryClass);
- cnfex.initCause(e);
- throw cnfex;
- }
- catch (InvocationTargetException e)
- {
- ClassNotFoundException cnfex = new ClassNotFoundException("Can not invoke loadServerInvokerClass method on " + transportFactoryClass);
- cnfex.initCause(e);
- throw cnfex;
- }
- catch (InstantiationException e)
- {
- ClassNotFoundException cnfex = new ClassNotFoundException("Can not can not create instance of " + transportFactoryClass + " using void constructor.");
- cnfex.initCause(e);
- throw cnfex;
- }
-
- }
else
{
throw new ClassNotFoundException("Could not find class " + transportFactoryClass);
More information about the jboss-cvs-commits
mailing list