|
From: Dejan K. <dej...@ya...> - 2003-04-21 19:29:17
|
I am writing this from home where I don't have a source code (ok I could download from SourceForge's CVS but I am too lazy and have only 56 k modem) but I'll try to help you. --- ek...@ba... wrote: > I have noticed that the following methods in > PipelineStageFactory discard > exceptions when they are encountered. As a result, > the "test" Pipeline > that ships as an example with Babeldoc ends up > throwing 3 exceptions in > this class that are discarded. I am trying to > "tighten up" error and > exception handling in order to deploy this product > in a production state > for my company. Can someone indicate if the > following methods from this > class should be discarding exceptions? If so, I > will move on; if not, I > would like to address them. Thanks. > > public IPipelineStage getPipelineStage(String > stageName) I guess this method should throw an exception if pipeline stage with the given name not found. I am not sure what is current behaviour when pipeline stage not found (wrong nextStage property in pipeline configuration)... > public String[] getAllInstanceNames() I am not sure about this one, but it seems to me that no exception should be thrown. If no pipeline stage found it should simply return null, right?! > private void trackDocument(String name, > IJournalTicket ticket, > PipelineDocument document) Hmmm. I guess this should throw exception. This method should write document into database. If some error occurs I guess it should throw exception since user will expect that document is written... > public boolean isStageTracked(String stageName) This method returns true or false. If tracked property is true it will return true. In other situations it should just return false. No need for exceptions. BTW, I tought I have moved this method to PipelineStage class. It really belongs there. > public boolean handleError(IPipelineStage stage, > PipelineException pe) No exceptions here. This is method of the ErrorHandler interface which is used for handling errors. PipelineStageFactory implements this interface and provides default error handling implementation. You can provide your own error handler class which should do whatever you think it should do when an exception occured during processing. One question Erik. When exception is thrown from PipeilneStageFactory methods, where it should be catched? In feeder? What is the real benefit of catching exception in feeder and not in PipelineStageFactory? Maybe you could get arround with your own ErrorHandler? Best Regards, Dejan > > Erik > > ________________________________________________________________________ > The information in this e-mail, and any attachment > therein, is confidential and for use by the > addressee only. If you are not the intended > recipient, please return the e-mail to the sender > and delete it from your computer. Although The Bank > of New York attempts to sweep e-mail and attachments > for viruses, it does not guarantee that either are > virus-free and accepts no liability for any damage > sustained as a result of viruses. __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com |