BasicContext.java
01 package net.sf.annocon.examples.basic.authentication;
02 
03 import net.sf.annocon.annotations.Context;
04 import net.sf.annocon.annotations.Service;
05 
06 /**
07  * Basic example of a context class. Defines an authentication service
08  * that is linked with a user manager service
09  *
10  @author Achim Huegen
11  */
12 @Context 
13 public class BasicContext
14 {
15   @Service(id = "AuthenticationService")
16   public AuthenticationService getAuthenticationService()
17   {
18     AuthenticationService service = new AuthenticationService();
19     service.setUserManager(getUserManager());
20     return service;
21   }
22   
23   @Service(id = "UserManager")
24   public UserManager getUserManager()
25   {
26     return new SimpleUserManager();
27   }
28 }