Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, flavors, hints, sessionContext);
ImageHandler basicHandler = imageHandlerRegistry.getHandler(formContext, img);
if (basicHandler == null) {
throw new UnsupportedOperationException(
"No ImageHandler available for image: "
+ img.getInfo() + " (" + img.getClass().getName() + ")");
}
if (!(basicHandler instanceof PSImageHandler)) {
throw new IllegalStateException(
"ImageHandler implementation doesn't behave properly."
+ " It should have returned false in isCompatible(). Class: "
+ basicHandler.getClass().getName());
}
PSImageHandler handler = (PSImageHandler)basicHandler;
if (log.isTraceEnabled()) {
log.trace("Using ImageHandler: " + handler.getClass().getName());
}