Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

safejdbc
Class ResultSetIterator.ProtectedResultSetHandler  view ResultSetIterator.ProtectedResultSetHandler download ResultSetIterator.ProtectedResultSetHandler.java

java.lang.Object
  extended bysafejdbc.ResultSetIterator.ProtectedResultSetHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler
Enclosing class:
ResultSetIterator

private static class ResultSetIterator.ProtectedResultSetHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

This class uses dynamic proxy functionality to prevent calls to "next" or "close" on a ResultSet. A dynamic proxy was used instead of a "conventional" Decorator pattern because ResultSet has very many methods and this is shorter. It also has better testability.


Field Summary
private  java.util.Collection _forbiddenMethodNames
           
private  java.sql.ResultSet _inner
           
 
Constructor Summary
ResultSetIterator.ProtectedResultSetHandler(java.sql.ResultSet inner)
           
 
Method Summary
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          When a method is invoked on a proxy instance, it is wrapped and this method is called instead, so that you may decide at runtime how the original method should behave.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_inner

private final java.sql.ResultSet _inner

_forbiddenMethodNames

private final java.util.Collection _forbiddenMethodNames
Constructor Detail

ResultSetIterator.ProtectedResultSetHandler

public ResultSetIterator.ProtectedResultSetHandler(java.sql.ResultSet inner)
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Description copied from interface: java.lang.reflect.InvocationHandler
When a method is invoked on a proxy instance, it is wrapped and this method is called instead, so that you may decide at runtime how the original method should behave.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler