Library and utilities supporting rapid development and centralized management of common development practices.
This section desribed how to integrate susceptor in your development workflow and where and how it can help you developing plugins.
This brievly describes the core features of this library. You can find further information in the correspondign sub directories.
Implemented in susceptor-dependency-injection.
Susceptor defines Google Guice as a dependency injection framework.
Implemented in susceptor-persistence.
The persistence module introduces MongoDB as a database and uses Morphia as orm for MongoDB.
For getting started you should take a look at the PersistenceModule. This module contains several bindings for bootstrapping your persistence layer with MongoDB. The usage is pretty straight forward:
var config = PersistenceConfig.newBuilder()
.withMongoConnectionString("")
.withMongoUser("")
.withMongoPassword("")
.withMongoSource("")
.build();
var injector = Guice.createInjector(PersistenceModule.create(config));
The injector prepares a MongoDB Client that can be easily used via the DatastoreFactory:
var datastoreFactory = injector.getInstance(DatastoreFactory.class);
datastoreFactory.createDatastore("test_database");
Ready, Steady, Go!