better align client and server impls

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2021-03-22 10:17:59 +01:00 committed by Simone Bordet
parent 2fcaad0cd8
commit c8d7bf01e1
2 changed files with 18 additions and 18 deletions

View File

@ -61,7 +61,7 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS
@Override
public String toString()
{
return String.format("%s:%s:%s", this, _operation, getInvocationType());
return String.format("%s:%s:%s", ClientDatagramEndPoint.this, _operation, getInvocationType());
}
}
@ -77,11 +77,11 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS
{
try
{
this.close();
ClientDatagramEndPoint.this.close();
}
catch (Throwable x)
{
LOG.warn("Unable to close {}", this, x);
LOG.warn("Unable to close {}", ClientDatagramEndPoint.this, x);
}
}
}
@ -91,7 +91,7 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS
private final Runnable _runFillable = new RunnableCloseable("runFillable")
{
@Override
public Invocable.InvocationType getInvocationType()
public InvocationType getInvocationType()
{
return getFillInterest().getCallbackInvocationType();
}
@ -106,7 +106,7 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS
private final Runnable _runCompleteWrite = new RunnableCloseable("runCompleteWrite")
{
@Override
public Invocable.InvocationType getInvocationType()
public InvocationType getInvocationType()
{
return getWriteFlusher().getCallbackInvocationType();
}
@ -120,27 +120,27 @@ public class ClientDatagramEndPoint extends AbstractEndPoint implements ManagedS
@Override
public String toString()
{
return String.format("%s:%s:%s->%s", this, _operation, getInvocationType(), getWriteFlusher());
return String.format("%s:%s:%s->%s", ClientDatagramEndPoint.this, _operation, getInvocationType(), getWriteFlusher());
}
};
private final Runnable _runCompleteWriteFillable = new RunnableCloseable("runCompleteWriteFillable")
{
@Override
public Invocable.InvocationType getInvocationType()
public InvocationType getInvocationType()
{
Invocable.InvocationType fillT = getFillInterest().getCallbackInvocationType();
Invocable.InvocationType flushT = getWriteFlusher().getCallbackInvocationType();
InvocationType fillT = getFillInterest().getCallbackInvocationType();
InvocationType flushT = getWriteFlusher().getCallbackInvocationType();
if (fillT == flushT)
return fillT;
if (fillT == Invocable.InvocationType.EITHER && flushT == Invocable.InvocationType.NON_BLOCKING)
return Invocable.InvocationType.EITHER;
if (fillT == InvocationType.EITHER && flushT == InvocationType.NON_BLOCKING)
return InvocationType.EITHER;
if (fillT == Invocable.InvocationType.NON_BLOCKING && flushT == Invocable.InvocationType.EITHER)
return Invocable.InvocationType.EITHER;
if (fillT == InvocationType.NON_BLOCKING && flushT == InvocationType.EITHER)
return InvocationType.EITHER;
return Invocable.InvocationType.BLOCKING;
return InvocationType.BLOCKING;
}
@Override

View File

@ -65,7 +65,7 @@ public class ServerDatagramEndPoint extends AbstractEndPoint implements ManagedS
}
}
private abstract class RunnableCloseable extends ServerDatagramEndPoint.RunnableTask implements Closeable
private abstract class RunnableCloseable extends RunnableTask implements Closeable
{
protected RunnableCloseable(String op)
{
@ -88,7 +88,7 @@ public class ServerDatagramEndPoint extends AbstractEndPoint implements ManagedS
private final ManagedSelector.SelectorUpdate _updateKeyAction = this::updateKeyAction;
private final Runnable _runFillable = new ServerDatagramEndPoint.RunnableCloseable("runFillable")
private final Runnable _runFillable = new RunnableCloseable("runFillable")
{
@Override
public InvocationType getInvocationType()
@ -103,7 +103,7 @@ public class ServerDatagramEndPoint extends AbstractEndPoint implements ManagedS
}
};
private final Runnable _runCompleteWrite = new ServerDatagramEndPoint.RunnableCloseable("runCompleteWrite")
private final Runnable _runCompleteWrite = new RunnableCloseable("runCompleteWrite")
{
@Override
public InvocationType getInvocationType()
@ -124,7 +124,7 @@ public class ServerDatagramEndPoint extends AbstractEndPoint implements ManagedS
}
};
private final Runnable _runCompleteWriteFillable = new ServerDatagramEndPoint.RunnableCloseable("runCompleteWriteFillable")
private final Runnable _runCompleteWriteFillable = new RunnableCloseable("runCompleteWriteFillable")
{
@Override
public InvocationType getInvocationType()