Issue #4691 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
04cc21fe40
commit
c0b6d9f677
|
@ -373,7 +373,6 @@ public class JavaxWebSocketFrameHandler implements FrameHandler
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// TODO: move methodhandle lookup to container?
|
|
||||||
MethodHandles.Lookup lookup = JavaxWebSocketFrameHandlerFactory.getServerMethodHandleLookup();
|
MethodHandles.Lookup lookup = JavaxWebSocketFrameHandlerFactory.getServerMethodHandleLookup();
|
||||||
MethodHandle partialMessageHandler = lookup
|
MethodHandle partialMessageHandler = lookup
|
||||||
.findVirtual(MessageHandler.Partial.class, "onMessage", MethodType.methodType(void.class, Object.class, boolean.class));
|
.findVirtual(MessageHandler.Partial.class, "onMessage", MethodType.methodType(void.class, Object.class, boolean.class));
|
||||||
|
@ -431,7 +430,6 @@ public class JavaxWebSocketFrameHandler implements FrameHandler
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// TODO: move MethodHandle lookup to container?
|
|
||||||
MethodHandles.Lookup lookup = JavaxWebSocketFrameHandlerFactory.getServerMethodHandleLookup();
|
MethodHandles.Lookup lookup = JavaxWebSocketFrameHandlerFactory.getServerMethodHandleLookup();
|
||||||
MethodHandle wholeMsgMethodHandle = lookup.findVirtual(MessageHandler.Whole.class, "onMessage", MethodType.methodType(void.class, Object.class));
|
MethodHandle wholeMsgMethodHandle = lookup.findVirtual(MessageHandler.Whole.class, "onMessage", MethodType.methodType(void.class, Object.class));
|
||||||
wholeMsgMethodHandle = wholeMsgMethodHandle.bindTo(handler);
|
wholeMsgMethodHandle = wholeMsgMethodHandle.bindTo(handler);
|
||||||
|
|
|
@ -708,14 +708,14 @@ public abstract class JavaxWebSocketFrameHandlerFactory
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Gives a {@link MethodHandles.Lookup} instance to be used to find methods in server classes.
|
* Gives a {@link MethodHandles.Lookup} instance to be used to find methods in server classes.
|
||||||
* For lookups on application classes use {@link #getApplicationMethodHandleLookup(Class)} ()} instead.
|
* For lookups on application classes use {@link #getApplicationMethodHandleLookup(Class)} instead.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* This uses the caller sensitive {@link MethodHandles#lookup()}, this will allow MethodHandle access
|
* This uses the caller sensitive {@link MethodHandles#lookup()}, this will allow MethodHandle access
|
||||||
* to server classes we need to use and will give access permissions to private methods as well.
|
* to server classes we need to use and will give access permissions to private methods as well.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return
|
* @return a lookup object to be used to find methods on server classes.
|
||||||
*/
|
*/
|
||||||
public static MethodHandles.Lookup getServerMethodHandleLookup()
|
public static MethodHandles.Lookup getServerMethodHandleLookup()
|
||||||
{
|
{
|
||||||
|
|
|
@ -460,14 +460,14 @@ public class JettyWebSocketFrameHandlerFactory extends ContainerLifeCycle
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Gives a {@link MethodHandles.Lookup} instance to be used to find methods in server classes.
|
* Gives a {@link MethodHandles.Lookup} instance to be used to find methods in server classes.
|
||||||
* For lookups on application classes use {@link #getApplicationMethodHandleLookup(Class)} ()} instead.
|
* For lookups on application classes use {@link #getApplicationMethodHandleLookup(Class)} instead.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* This uses the caller sensitive {@link MethodHandles#lookup()}, this will allow MethodHandle access
|
* This uses the caller sensitive {@link MethodHandles#lookup()}, this will allow MethodHandle access
|
||||||
* to server classes we need to use and will give access permissions to private methods as well.
|
* to server classes we need to use and will give access permissions to private methods as well.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return
|
* @return a lookup object to be used to find methods on server classes.
|
||||||
*/
|
*/
|
||||||
public static MethodHandles.Lookup getServerMethodHandleLookup()
|
public static MethodHandles.Lookup getServerMethodHandleLookup()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue