mirror of
				https://github.com/spring-projects/spring-security.git
				synced 2025-10-31 06:38:42 +00:00 
			
		
		
		
	Enhanced error detection at startup time. Changed no-arg constructor to better support unit testing. JavaDoced method.
This commit is contained in:
		
							parent
							
								
									c5951ff1c0
								
							
						
					
					
						commit
						71a0faf829
					
				| @ -73,6 +73,24 @@ public final class JettyAcegiUserRealm implements UserRealm { | |||||||
|         this.realm = realm; |         this.realm = realm; | ||||||
|         this.key = providerKey; |         this.key = providerKey; | ||||||
| 
 | 
 | ||||||
|  |         if ((realm == null) || "".equals(realm)) { | ||||||
|  |             throw new IllegalArgumentException("realm must be specified"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if ((key == null) || "".equals(key)) { | ||||||
|  |             throw new IllegalArgumentException("key must be specified"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if ((appContextLocation == null) || "".equals(appContextLocation)) { | ||||||
|  |             throw new IllegalArgumentException( | ||||||
|  |                 "appContextLocation must be specified"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if (Thread.currentThread().getContextClassLoader().getResource(appContextLocation) == null) { | ||||||
|  |             throw new IllegalArgumentException("Cannot locate " | ||||||
|  |                 + appContextLocation); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(appContextLocation); |         ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(appContextLocation); | ||||||
|         Map beans = ctx.getBeansOfType(AuthenticationManager.class, true, true); |         Map beans = ctx.getBeansOfType(AuthenticationManager.class, true, true); | ||||||
| 
 | 
 | ||||||
| @ -85,8 +103,8 @@ public final class JettyAcegiUserRealm implements UserRealm { | |||||||
|         authenticationManager = (AuthenticationManager) beans.get(beanName); |         authenticationManager = (AuthenticationManager) beans.get(beanName); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private JettyAcegiUserRealm() { |     protected JettyAcegiUserRealm() { | ||||||
|         super(); |         throw new IllegalArgumentException("Cannot use default constructor"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     //~ Methods ================================================================ |     //~ Methods ================================================================ | ||||||
| @ -96,7 +114,7 @@ public final class JettyAcegiUserRealm implements UserRealm { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * DOCUMENT ME! |      * Accesses the realm name. | ||||||
|      * |      * | ||||||
|      * @return the name of the realm as defined when |      * @return the name of the realm as defined when | ||||||
|      *         <code>SpringUserRealm</code> was created |      *         <code>SpringUserRealm</code> was created | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user