Search in sources :

Example 1 with PicoCLIOptions

use of org.hyperledger.besu.plugin.services.PicoCLIOptions in project besu by hyperledger.

the class BadCLIOptionsPlugin method register.

@Override
public void register(final BesuContext context) {
    LOG.info("Registering BadCliOptionsPlugin");
    callbackDir = new File(System.getProperty("besu.plugins.dir", "plugins"));
    writeStatus("init");
    if (System.getProperty("TEST_BAD_CLI", "false").equals("true")) {
        context.getService(PicoCLIOptions.class).ifPresent(picoCLIOptions -> picoCLIOptions.addPicoCLIOptions("bad-cli", BadCLIOptionsPlugin.this));
    }
    writeStatus("register");
}
Also used : PicoCLIOptions(org.hyperledger.besu.plugin.services.PicoCLIOptions) File(java.io.File)

Example 2 with PicoCLIOptions

use of org.hyperledger.besu.plugin.services.PicoCLIOptions in project besu by hyperledger.

the class TestPicoCLIPlugin method register.

@Override
public void register(final BesuContext context) {
    LOG.info("Registering.  Test Option is '{}'", testOption);
    state = "registering";
    if ("FAILREGISTER".equals(testOption)) {
        state = "failregister";
        throw new RuntimeException("I was told to fail at registration");
    }
    context.getService(PicoCLIOptions.class).ifPresent(picoCLIOptions -> picoCLIOptions.addPicoCLIOptions("test", this));
    callbackDir = new File(System.getProperty("besu.plugins.dir", "plugins"));
    writeSignal("registered");
    state = "registered";
}
Also used : PicoCLIOptions(org.hyperledger.besu.plugin.services.PicoCLIOptions) File(java.io.File)

Aggregations

File (java.io.File)2 PicoCLIOptions (org.hyperledger.besu.plugin.services.PicoCLIOptions)2