Skip to content

Ability to produce a MongoClient #7

Description

@emmanuelbernard

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();
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions