@@ -46,6 +46,7 @@ private void load(Handler<AsyncResult<AsyncStorage<Value>>> handler) {
4646 promise .future ().onComplete (handler );
4747
4848 prepare ();
49+
4950 StorageContext <Value > storage = new StorageContext <Value >(context )
5051 .setDatabase (database )
5152 .setCollection (collection )
@@ -58,7 +59,7 @@ private void load(Handler<AsyncResult<AsyncStorage<Value>>> handler) {
5859 blocking .complete ();
5960
6061 } catch (Throwable e ) {
61- logger .log (CoreStrings .getStorageLoaderError (plugin , database , collection ), Level .ERROR );
62+ logger .log (CoreStrings .getStorageLoaderError (pluginString , database , collection ), Level .ERROR );
6263 logger .onError (e );
6364 blocking .fail (e );
6465 }
@@ -71,12 +72,11 @@ private void load(Handler<AsyncResult<AsyncStorage<Value>>> handler) {
7172
7273 @ SuppressWarnings ("unchecked" )
7374 private void prepare () throws ClassNotFoundException {
74- checkIsSet (context , ID_CONTEXT );
75- checkIsSet (valueClass , ID_CLASS );
76-
77- if (pluginString != null )
75+ if (plugin == null ) {
7876 this .plugin = (Class <? extends AsyncStorage >) Class .forName (pluginString );
79-
77+ } else if (pluginString == null ) {
78+ this .pluginString = plugin .getSimpleName ();
79+ }
8080
8181 if (collection == null ) {
8282 this .collection = valueClass .getSimpleName ();
@@ -85,6 +85,9 @@ private void prepare() throws ClassNotFoundException {
8585 if (database == null ) {
8686 database = Configurations .storage ().getSettingsForPlugin (plugin ).getDatabase ();
8787 }
88+
89+ checkIsSet (context , ID_CONTEXT );
90+ checkIsSet (valueClass , ID_CLASS );
8891 checkIsSet (plugin , ID_PLUGIN );
8992 }
9093
0 commit comments