Skip to content

Commit

Permalink
[Java] Rename IngressAdapter onFragment to onMessage and remove inter…
Browse files Browse the repository at this point in the history
…face to provide more appropriate naming.
  • Loading branch information
mikeb01 committed Dec 19, 2024
1 parent 98248d2 commit 6a68e33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.agrona.DirectBuffer;
import org.agrona.collections.ArrayUtil;

class IngressAdapter implements ControlledFragmentHandler, AutoCloseable
class IngressAdapter implements AutoCloseable
{
private final int fragmentPollLimit;
private final MessageHeaderDecoder messageHeaderDecoder = new MessageHeaderDecoder();
Expand All @@ -34,7 +34,7 @@ class IngressAdapter implements ControlledFragmentHandler, AutoCloseable
private final SessionKeepAliveDecoder sessionKeepAliveDecoder = new SessionKeepAliveDecoder();
private final ChallengeResponseDecoder challengeResponseDecoder = new ChallengeResponseDecoder();
private final AdminRequestDecoder adminRequestDecoder = new AdminRequestDecoder();
private final ControlledFragmentAssembler fragmentAssembler = new ControlledFragmentAssembler(this);
private final ControlledFragmentAssembler fragmentAssembler = new ControlledFragmentAssembler(this::onMessage);
private final ConsensusModuleAgent consensusModuleAgent;
private Subscription subscription;
private Subscription ipcSubscription;
Expand Down Expand Up @@ -67,7 +67,8 @@ public void close()
}

@SuppressWarnings("MethodLength")
public Action onFragment(final DirectBuffer buffer, final int offset, final int length, final Header header)
public ControlledFragmentHandler.Action onMessage(
final DirectBuffer buffer, final int offset, final int length, final Header header)
{
messageHeaderDecoder.wrap(buffer, offset);

Expand Down Expand Up @@ -194,7 +195,7 @@ public Action onFragment(final DirectBuffer buffer, final int offset, final int
}
}

return Action.CONTINUE;
return ControlledFragmentHandler.Action.CONTINUE;
}

void connect(final Subscription subscription, final Subscription ipcSubscription)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void shouldDelegateToConsensusModuleAgent(

final int length = MessageHeaderDecoder.ENCODED_LENGTH + blockLength;

adapter.onFragment(buffer, 0, length, null);
adapter.onMessage(buffer, 0, length, null);

expectation.expect(verify(consensusModuleAgent), buffer);
}
Expand Down

0 comments on commit 6a68e33

Please sign in to comment.