Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to produce a MongoClient #7

Open
emmanuelbernard opened this issue Jan 27, 2015 · 0 comments
Open

Ability to produce a MongoClient #7

emmanuelbernard opened this issue Jan 27, 2015 · 0 comments

Comments

@emmanuelbernard
Copy link
Collaborator

The MongoClientDefinition definition is a good start but additional requirements for configuration will arise. We need to be able to allow a user to do the following

class DatabaseAccessProducer {
    @MongoClientDefinition(name="retail") @Produces
    @ApplicationScope //TODO can the scope be inferred?
    public MongoClient buildMongoClient() {
       return new MongoClient(...);
    }

    //TODO can this whole code be inferred?
    public MongoClient disposeMongoClient(
        @MongoClientDefinition(name="retail") @Disposes MongoClient mongoClient) {
        mongoClient.close();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant