Skip to content

Instantly share code, notes, and snippets.

@collinvandyck
Created September 12, 2012 19:44
Show Gist options
  • Select an option

  • Save collinvandyck/3709387 to your computer and use it in GitHub Desktop.

Select an option

Save collinvandyck/3709387 to your computer and use it in GitHub Desktop.
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