private void handleAuthenticationType ( final Object authenticationType ) { if ( request != null ) { if ( authenticationType != null ) { // be defensive if ( ! ( authenticationType instanceof String ) ) { final String message = "Attribute " + HttpContext . AUTHENTICATION_TYPE + " expected to be a String but was an [" + authenticationType . getClass ( ) + "]" ; LOG . error ( message ) ; throw new IllegalArgumentException ( message ) ; } } getOsgiAuth ( ) . setAuthMethod ( ( String ) authenticationType ) ; } else { LOG . warn ( "Authentication type cannot be set to " + authenticationType + ". HttpService specific authentication is disabled because the ServletRequest object cannot be used: " + "Expected to be an instance of " + Request . class . getName ( ) + " but got " + originalRequest . getClass ( ) . getName ( ) + "." ) ; } }
Handles setting of authentication type attribute .