net.sf.fikin.sql.core
Class PipeCanceler

java.lang.Object
  extended by net.sf.fikin.sql.SQLPipeElement
      extended by net.sf.fikin.sql.core.PipeCanceler

public class PipeCanceler
extends SQLPipeElement

A pipe element which can cancel commands if set to true or pass them on to the next in the pipe if set to false.

created on Dec 16, 2006

Since:
Version:
$Revision: 1.3 $
Author:
fiykov

Constructor Summary
PipeCanceler()
          create an element catching all exceptions and ignoring them
PipeCanceler(boolean cancel)
          create an element able to cancel the pipe
 
Method Summary
 void execute(java.lang.String cmd)
          cancel the sql cmd execution if getCancel() is true
 boolean getCancel()
          get current flag, if true all exceptions are ignored, otherwise false
 void setCancel(boolean flg)
           
 
Methods inherited from class net.sf.fikin.sql.SQLPipeElement
getBaseClassName, getId, getNext, getPipe, setNext, setPipe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipeCanceler

public PipeCanceler()
create an element catching all exceptions and ignoring them


PipeCanceler

public PipeCanceler(boolean cancel)
create an element able to cancel the pipe

Parameters:
cancel - if true all commands are canceled here, if false they are passed to next in the pipe
Method Detail

getCancel

public boolean getCancel()
get current flag, if true all exceptions are ignored, otherwise false

Returns:
true or false

setCancel

public void setCancel(boolean flg)

execute

public void execute(java.lang.String cmd)
             throws java.sql.SQLException
cancel the sql cmd execution if getCancel() is true

Specified by:
execute in class SQLPipeElement
Parameters:
cmd - to execute
Throws:
java.sql.SQLException - in case of error


Copyright © 2003-2007 Nikolay Fiykov. All Rights Reserved.