Skip to content

Ability to produce a MongoClient #7

@emmanuelbernard

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions