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
|
||||
{
|
||||
// TODO: move methodhandle lookup to container?
|
||||
MethodHandles.Lookup lookup = JavaxWebSocketFrameHandlerFactory.getServerMethodHandleLookup();
|
||||
MethodHandle partialMessageHandler = lookup
|
||||
.findVirtual(MessageHandler.Partial.class, "onMessage", MethodType.methodType(void.class, Object.class, boolean.class));
|
||||
|
@ -431,7 +430,6 @@ public class JavaxWebSocketFrameHandler implements FrameHandler
|
|||
{
|
||||
try
|
||||
{
|
||||
// TODO: move MethodHandle lookup to container?
|
||||
MethodHandles.Lookup lookup = JavaxWebSocketFrameHandlerFactory.getServerMethodHandleLookup();
|
||||
MethodHandle wholeMsgMethodHandle = lookup.findVirtual(MessageHandler.Whole.class, "onMessage", MethodType.methodType(void.class, Object.class));
|
||||
wholeMsgMethodHandle = wholeMsgMethodHandle.bindTo(handler);
|
||||
|
|
|
@ -708,14 +708,14 @@ public abstract class JavaxWebSocketFrameHandlerFactory
|
|||
/**
|
||||
* <p>
|
||||
* 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>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* @return
|
||||
* @return a lookup object to be used to find methods on server classes.
|
||||
*/
|
||||
public static MethodHandles.Lookup getServerMethodHandleLookup()
|
||||
{
|
||||
|
|
|
@ -460,14 +460,14 @@ public class JettyWebSocketFrameHandlerFactory extends ContainerLifeCycle
|
|||
/**
|
||||
* <p>
|
||||
* 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>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* @return
|
||||
* @return a lookup object to be used to find methods on server classes.
|
||||
*/
|
||||
public static MethodHandles.Lookup getServerMethodHandleLookup()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue