Skip to content

Commit

Permalink
Removed nonexisting import in Grizzly 4.0.1
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Oct 5, 2023
1 parent 9ad71cc commit 4edb578
Showing 1 changed file with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2023 Contributors to the Eclipse Foundation
* Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -22,7 +23,6 @@
import org.glassfish.grizzly.Connection;
import org.glassfish.grizzly.Grizzly;
import org.glassfish.grizzly.attributes.Attribute;
import org.glassfish.grizzly.attributes.NullaryFunction;
import org.glassfish.grizzly.filterchain.BaseFilter;
import org.glassfish.grizzly.filterchain.FilterChainContext;
import org.glassfish.grizzly.filterchain.NextAction;
Expand All @@ -42,8 +42,8 @@
*
* Message Body is composed of following fields. payload byte[messageLen]
*
* MessageHeader {@link Message#parseHeader(com.sun.enterprise.mgmt.transport.Buffer, int)} MessageBody
* {@link Message#parseMessage(com.sun.enterprise.mgmt.transport.Buffer, int, int)}
* MessageHeader {@link Message#parseHeader(com.sun.enterprise.mgmt.transport.buffers.Buffer, int)}
* MessageBody {@link Message#parseMessage(com.sun.enterprise.mgmt.transport.buffers.Buffer, int, int)}
*
* @author Bongjae Chang
* @author Joe Fialli
Expand All @@ -52,17 +52,11 @@
public class MessageFilter extends BaseFilter {

private final Attribute<MessageParsingState> preparsedMessageAttr = Grizzly.DEFAULT_ATTRIBUTE_BUILDER
.createAttribute(MessageFilter.class + ".preparsedMessageAttr", new NullaryFunction<MessageParsingState>() {

@Override
public MessageParsingState evaluate() {
return new MessageParsingState();
}
});
.createAttribute(MessageFilter.class + ".preparsedMessageAttr", MessageParsingState::new);

@Override
public NextAction handleRead(final FilterChainContext ctx) throws IOException {
final Connection connection = ctx.getConnection();
final Connection<?> connection = ctx.getConnection();
final Buffer buffer = ctx.getMessage();

final MessageParsingState parsingState = preparsedMessageAttr.get(connection);
Expand All @@ -83,8 +77,9 @@ public NextAction handleRead(final FilterChainContext ctx) throws IOException {
gmsBuffer.recycle();

if (messageLength + MessageImpl.HEADER_LENGTH > MessageImpl.getMaxMessageLength()) {
throw new IllegalStateException("too large message." + " request-size=" + (messageLength + MessageImpl.HEADER_LENGTH) + " max-size="
+ MessageImpl.getMaxMessageLength());
throw new IllegalStateException("too large message."
+ " request-size=" + (messageLength + MessageImpl.HEADER_LENGTH)
+ " max-size=" + MessageImpl.getMaxMessageLength());
}

parsingState.isHeaderParsed = true;
Expand Down Expand Up @@ -121,7 +116,7 @@ public NextAction handleRead(final FilterChainContext ctx) throws IOException {
public NextAction handleWrite(final FilterChainContext ctx) throws IOException {
final Message message = ctx.getMessage();

final MemoryManager mm = ctx.getConnection().getTransport().getMemoryManager();
final MemoryManager<?> mm = ctx.getConnection().getTransport().getMemoryManager();

com.sun.enterprise.mgmt.transport.buffers.Buffer buffer = message.getPlainBuffer(Grizzly2ExpandableBufferWriter.createFactory(mm));

Expand Down

0 comments on commit 4edb578

Please sign in to comment.