protected gov.nih.nci.cagrid.metadata.ServiceMetadata getServiceMetadataMD() {
   BaseResource serviceBaseResource;
   try {
     serviceBaseResource = (BaseResource) ResourceContext.getResourceContext().getResource();
   } catch (ResourceContextException e) {
     return null;
   } catch (ResourceException e) {
     return null;
   }
   return serviceBaseResource.getServiceMetadataMD();
 }
 protected Object getMetadata(QName metadataQName) {
   BaseResource serviceBaseResource = null;
   try {
     serviceBaseResource = (BaseResource) ResourceContext.getResourceContext().getResource();
   } catch (ResourceContextException e) {
     return null;
   } catch (ResourceException e) {
     return null;
   }
   ResourcePropertySet resourcePropertySet = serviceBaseResource.getResourcePropertySet();
   if (resourcePropertySet != null) {
     ResourceProperty property = resourcePropertySet.get(metadataQName);
     if (property != null) {
       return property.get(0);
     }
   }
   return null;
 }