Fix websocket compatibility with Tyrus 1.9 - 1.12
As of Tyrus 1.9, `TyrusEndpointWrapper`'s constructor has a new Boolean argument (which is mandatory). This commit reflectively chooses the right constructor method for Tyrus 1.9+ versions. Issue: SPR-13566
This commit is contained in:
parent
59637ee708
commit
b7e75c5db4
|
@ -216,8 +216,14 @@ public abstract class AbstractTyrusRequestUpgradeStrategy extends AbstractStanda
|
|||
Object sessionListener = accessor.getPropertyValue("sessionListener");
|
||||
Object clusterContext = accessor.getPropertyValue("clusterContext");
|
||||
try {
|
||||
return constructor.newInstance(registration.getEndpoint(), registration, provider, container,
|
||||
"/", registration.getConfigurator(), sessionListener, clusterContext, null);
|
||||
if (constructor.getParameterCount() == 9) {
|
||||
return constructor.newInstance(registration.getEndpoint(), registration, provider, container,
|
||||
"/", registration.getConfigurator(), sessionListener, clusterContext, null);
|
||||
}
|
||||
else {
|
||||
return constructor.newInstance(registration.getEndpoint(), registration, provider, container,
|
||||
"/", registration.getConfigurator(), sessionListener, clusterContext, null, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new HandshakeFailureException("Failed to register " + registration, ex);
|
||||
|
|
Loading…
Reference in New Issue