FileDocCategorySizeDatePackage
StatementInterceptor.javaAPI DocJBoss 4.2.12112Fri Jul 13 21:01:14 BST 2007org.jboss.resource.adapter.jdbc.remote

StatementInterceptor

public class StatementInterceptor extends org.jboss.proxy.Interceptor
author
Tom Elrod
version
$Revision: 57189 $

Fields Summary
static final long
serialVersionUID
Constructors Summary
Methods Summary
public java.lang.Objectinvoke(org.jboss.invocation.Invocation mi)


        
   
      Method m = mi.getMethod();
      String methodName = m.getName();

      if (methodName.equals("setAsciiStream") ||
            methodName.equals("setBinaryStream"))
      {
         Object[] args = mi.getArguments();
         InputStream ins = (InputStream) args[1];
         args[1] = new SerializableInputStream(ins);
      }
      else if (methodName.equals("setCharacterStream"))
      {
         Object[] args = mi.getArguments();
         Reader rdr = (Reader) args[1];
         args[1] = new SerializableReader(rdr);
      }

      return getNext().invoke(mi);