I am building a prototype batch file processor using a Spring Batch M3 snapshot build. My prototype is almost done and I have only implemented 3 classes, so I think the Spring Batch developers are on the right track
In my processing part different kinds of Exceptions can be thrown, some that should simply be logged and some that should stop the processing of the file. I want to use the LogOrRethrowExceptionHandler to provide me this behaviour and I want to inject the SubclassExceptionClassifier to classify the Exceptions that might occur.
The SubclassExceptionClassifier has a typeMap parameter which is a Map with a java.lang.Class key and a java.lang.Object value, but I have no idea how to inject an instance of java.lang.Class for the Exception that I want to classify.
I have tried:
But this injects a String not an instance of java.lang.Class.Code:<map> <entry key="java.lang.Exception" value="error" /> </map>
Also:
Did not have the desired effect. It injects an instance of java.lang.Exception which is not instance of java.lang.Class.Code:<bean id="exception" class="java.lang.Exception"/> <map> <entry key-ref="exception" value="error" /> </map>
Does anyone know how to inject the instance of java.lang.Class?



Reply With Quote
