try {
// Open a new context.
Context context = ContextUtil.obtainContext(objectModel);
// Determine which adapter to use
AbstractAdapter adapter = resolveAdapter(context);
if (adapter == null)
throw new ResourceNotFoundException("Unable to locate object.");
// Configure the adapter for this request.
configureAdapter(adapter);
// Generate the METS document
contentHandler.startDocument();
adapter.renderMETS(contentHandler,lexicalHandler);
contentHandler.endDocument();
} catch (WingException we) {
throw new ProcessingException(we);
} catch (CrosswalkException ce) {