Skip to content

Commit

Permalink
Revert "revert to unchanged plugin interface signature (hyperledger#7938
Browse files Browse the repository at this point in the history
)"

This reverts commit f08147a.

# Conflicts:
#	plugin-api/build.gradle
  • Loading branch information
fab-10 committed Nov 28, 2024
1 parent 607e48a commit 44d0f9d
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import static java.nio.charset.StandardCharsets.UTF_8;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.PicoCLIOptions;

import java.io.File;
Expand All @@ -39,8 +39,7 @@ public class BadCLIOptionsPlugin implements BesuPlugin {
private File callbackDir;

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
LOG.info("Registering BadCliOptionsPlugin");
callbackDir = new File(System.getProperty("besu.plugins.dir", "plugins"));
writeStatus("init");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package org.hyperledger.besu.tests.acceptance.plugins;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.data.BlockHeader;
Expand Down Expand Up @@ -43,8 +42,7 @@ public class TestBesuEventsPlugin implements BesuPlugin {
private File callbackDir;

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
this.context = context;
LOG.info("Registered");
callbackDir = new File(System.getProperty("besu.plugins.dir", "plugins"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonRpcParameter;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.data.BlockContext;
import org.hyperledger.besu.plugin.services.BlockchainService;
import org.hyperledger.besu.plugin.services.RpcEndpointService;
Expand All @@ -40,8 +40,7 @@ public class TestBlockchainServiceFinalizedPlugin implements BesuPlugin {
private static final String RPC_METHOD_SAFE_BLOCK = "updateSafeBlockV1";

@Override
@SuppressWarnings("removal")
public void register(final BesuContext serviceManager) {
public void register(final ServiceManager serviceManager) {
LOG.trace("Registering plugin ...");

final RpcEndpointService rpcEndpointService =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package org.hyperledger.besu.tests.acceptance.plugins;

import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.PicoCLIOptions;
import org.hyperledger.besu.plugin.services.RpcEndpointService;
import org.hyperledger.besu.plugin.services.rpc.RpcResponseType;
Expand All @@ -36,8 +36,7 @@ public class TestInProcessRpcServicePlugin implements BesuPlugin {
long minGasPrice = -1;

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
final PicoCLIOptions cmdlineOptions =
context
.getService(PicoCLIOptions.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package org.hyperledger.besu.tests.acceptance.plugins;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.MetricsSystem;
Expand All @@ -34,8 +33,7 @@ public class TestMetricsPlugin implements BesuPlugin {
private ServiceManager serviceManager;

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
LOG.info("Registering TestMetricsPlugin");
serviceManager = context;
context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
package org.hyperledger.besu.tests.acceptance.plugins;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.PermissioningService;
import org.hyperledger.besu.plugin.services.PicoCLIOptions;

Expand All @@ -40,8 +40,7 @@ public class TestPermissioningPlugin implements BesuPlugin {
PermissioningService service;

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
context.getService(PicoCLIOptions.class).orElseThrow().addPicoCLIOptions("permissioning", this);
service = context.getService(PermissioningService.class).orElseThrow();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
package org.hyperledger.besu.tests.acceptance.plugins;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.PicoCLIOptions;

import java.io.File;
Expand Down Expand Up @@ -57,8 +57,7 @@ public class TestPicoCLIPlugin implements BesuPlugin {
private File callbackDir;

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
LOG.info("Registering. Test Option is '{}'", testOption);
state = "registering";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package org.hyperledger.besu.tests.acceptance.plugins;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.PicoCLIOptions;
Expand All @@ -41,8 +40,7 @@ public class TestPrivacyServicePlugin implements BesuPlugin {
new TestSigningPrivateMarkerTransactionFactory();

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
this.context = context;

context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import static com.google.common.base.Preconditions.checkArgument;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.RpcEndpointService;
import org.hyperledger.besu.plugin.services.rpc.PluginRpcRequest;

Expand Down Expand Up @@ -51,8 +51,7 @@ private String throwException(final PluginRpcRequest request) {
}

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
context
.getService(RpcEndpointService.class)
.ifPresent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static com.google.common.base.Preconditions.checkState;

import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration;
import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.BesuService;
Expand Down Expand Up @@ -50,8 +49,7 @@
import org.slf4j.LoggerFactory;

/** The Besu plugin context implementation. */
@SuppressWarnings("removal")
public class BesuPluginContextImpl implements BesuContext, ServiceManager, PluginVersionsProvider {
public class BesuPluginContextImpl implements ServiceManager, PluginVersionsProvider {

private static final Logger LOG = LoggerFactory.getLogger(BesuPluginContextImpl.class);

Expand Down
2 changes: 1 addition & 1 deletion plugin-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Calculated : ${currentHash}
tasks.register('checkAPIChanges', FileStateChecker) {
description = "Checks that the API for the Plugin-API project does not change without deliberate thought"
files = sourceSets.main.allJava.files
knownHash = 'f6fi+lsYVZtFjmGOyiMPPCfNDie4SIPpj6HVgXRxF8Q='
knownHash = 'GLoCdxUZsPJeHjt1lnwCbXQluLwhgkpKdIhFzrQO3gg='
}
check.dependsOn('checkAPIChanges')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ default Optional<String> getName() {
*
* @param context the context that provides access to Besu services.
*/
@SuppressWarnings("removal")
void register(BesuContext context);
void register(ServiceManager context);

/**
* Called once when besu has loaded configuration but before external services have been started
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package org.hyperledger.besu.plugin.services.storage.rocksdb;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.PicoCLIOptions;
Expand Down Expand Up @@ -60,8 +59,7 @@ public void addIgnorableSegmentIdentifier(final SegmentIdentifier ignorable) {
}

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
LOG.debug("Registering plugin");
this.context = context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package org.hyperledger.besu.services.kvstore;

import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.BesuConfiguration;
Expand Down Expand Up @@ -45,8 +44,7 @@ public class InMemoryStoragePlugin implements BesuPlugin {
public InMemoryStoragePlugin() {}

@Override
@SuppressWarnings("removal")
public void register(final BesuContext context) {
public void register(final ServiceManager context) {
LOG.debug("Registering plugin");
this.context = context;

Expand Down

0 comments on commit 44d0f9d

Please sign in to comment.