class CollectionNamePlugin implements IPlugin {

    @Override
    public void load() throws PluginException {

        try {
            IBootstrapItem<String> item = new BootstrapItem("CollectionNamePlugin");
            item
//                .after("IOC")
//                .before("starter")
                .process(() -> {
                    try {
                        IKey collectionNameKey = Keys.getOrAdd(CollectionName.class.getCanonicalName());
                        IOC.register(collectionNameKey, new ResolveByNameIocStrategy(
                            (args) -> {
                                String name = String.valueOf(args[0]);
                                try {
                                    return CollectionName.fromString(name);
                                } catch (StorageException e) {
                                    throw new RuntimeException("Can't resolve collection name: ", e);
                                }
                            }));
                    } catch (ResolutionException e) {
                        throw new ActionExecuteException("CollectionName plugin can't load: can't get CollectionName key", e);
                    } catch (InvalidArgumentException e) {
                        throw new ActionExecuteException("CollectionName plugin can't load: can't create strategy", e);
                    } catch (RegistrationException e) {
                        throw new ActionExecuteException("CollectionName plugin can't load: can't register new strategy", e);
                    }
                });
            bootstrap.add(item);
        } catch (InvalidArgumentException e) {
            throw new PluginException("Can't load collection name plugin", e);
        }
    }

    public  CollectionNamePlugin(final IBootstrap<IBootstrapItem<String>> bootstrap);

}