class IFieldPlugin implements IPlugin {

    @Override
    public void load() throws PluginException {

        try {
            BootstrapItem item = new BootstrapItem("IFieldPlugin");
            item
                .after("IOC")
                .process(() -> {
                    try {
                        IKey fieldKey = Keys.getOrAdd(IField.class.getCanonicalName());
                        IOC.register(fieldKey, new ResolveByNameIocStrategy(
                            (args) -> {
                                String fieldName = String.valueOf(args[0]);
                                try {
                                    return new Field(IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), fieldName));
                                } catch (InvalidArgumentException | ResolutionException e) {
                                    throw new RuntimeException("Can't resolve IField: ", e);
                                }
                            }));
                    } catch (ResolutionException e) {
                        throw new ActionExecuteException("IField plugin can't load: can't get IField key", e);
                    } catch (InvalidArgumentException e) {
                        throw new ActionExecuteException("IField plugin can't load: can't create strategy", e);
                    } catch (RegistrationException e) {
                        throw new ActionExecuteException("IField plugin can't load: can't register new strategy", e);
                    }
                });
            bootstrap.add(item);
        } catch (InvalidArgumentException e) {
            throw new PluginException("Can't load IField plugin", e);
        }
    }

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

}