Created
September 12, 2012 19:44
-
-
Save collinvandyck/3709387 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AuthService extends Service<AuthConfiguration> { | |
| // methods elided | |
| @Override | |
| protected void initialize(AuthConfiguration config, Environment environment) throws Exception { | |
| final DatabaseFactory factory = new DatabaseFactory(environment); | |
| final Database db = factory.build(config.getDatabaseConfiguration(), "postgresql"); | |
| final UserDAO userDAO = db.onDemand(UserDAO.class); | |
| environment.addResource(new AuthResource(userDAO)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment