}
private AuthenticationProtocolHandler getAuthHandlerInstance(String
authType) throws UnsupportedAuthTypeException {
if (authType == null) {
throw new UnsupportedAuthTypeException("authType is null" +
this.getUserBrokerInfo());
}
if (authType.equals(AUTHTYPE_JMQBASIC)) {
return new com.sun.messaging.jmq.auth.handlers.BasicAuthenticationHandler();
}
if (authType.equals(AUTHTYPE_JMQDIGEST)) {
return new com.sun.messaging.jmq.auth.handlers.DigestAuthenticationHandler();
}
if (authType.equals(AUTHTYPE_JMQADMINKEY)) {
return new com.sun.messaging.jmq.jmsclient.auth.
JMQAdminKeyAuthenticationHandler();
}
String c = connection.getProperty("JMQAuthClass" + "." + authType, "");
if (c == null || c.trim().equals("") ||
c.trim().equals(AUTHTYPE_JMQADMINKEY)) {
throw new UnsupportedAuthTypeException(authType + ": " + c +
this.getUserBrokerInfo());
}
try {
return (AuthenticationProtocolHandler) Class.forName(c).newInstance();
} catch (Exception e) {
ExceptionHandler.logCaughtException(e);
throw new
UnsupportedAuthTypeException(authType + " " + e.getMessage() +
this.getUserBrokerInfo());
}
}