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 sessionListener = accessor.getPropertyValue("sessionListener");
|
||||||
Object clusterContext = accessor.getPropertyValue("clusterContext");
|
Object clusterContext = accessor.getPropertyValue("clusterContext");
|
||||||
try {
|
try {
|
||||||
return constructor.newInstance(registration.getEndpoint(), registration, provider, container,
|
if (constructor.getParameterCount() == 9) {
|
||||||
"/", registration.getConfigurator(), sessionListener, clusterContext, null);
|
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) {
|
catch (Exception ex) {
|
||||||
throw new HandshakeFailureException("Failed to register " + registration, ex);
|
throw new HandshakeFailureException("Failed to register " + registration, ex);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue