1 43 package org.exolab.jms.server; 44 45 import javax.jms.JMSException ; 46 import javax.jms.JMSSecurityException ; 47 48 import org.apache.commons.logging.Log; 49 import org.apache.commons.logging.LogFactory; 50 51 import org.exolab.jms.authentication.AuthenticationMgr; 52 import org.exolab.jms.server.AdminConnection; 53 54 67 public class AdminConnectionManager { 68 69 72 private static AdminConnectionManager _instance = 73 new AdminConnectionManager(); 74 75 78 private AdminConnectionManager() { 79 } 80 81 86 public static AdminConnectionManager instance() { 87 return _instance; 88 } 89 90 99 public AdminConnection createConnection(String username, String password) 100 throws JMSSecurityException , JMSException { 101 102 if (!AuthenticationMgr.instance().validateUser(username, password)) { 103 throw new JMSSecurityException ("Failed to authenticate user " 104 + username); 105 } 106 107 return new AdminConnection(); 108 } 109 110 } 111 112 | Popular Tags |