code: public static <A> A getRequiredAttachment( final Deployment dep, final Class< A > key )
     {
        final A value = dep.getAttachment( key );
        if ( value == null )
        {
           throw Messages.MESSAGES.cannotFindAttachmentInDeployment(key, dep.getSimpleName());
        }
        return value;
     }
docs: Returns required attachment value from webservice deployment.
  
  @param <A> expected value
  @param dep webservice deployment
  @param key attachment key
  @return required attachment
  @throws IllegalStateException if attachment value is null