int maxTextMessage = getMaxMessageSize(policy.getMaxTextMessageSize(),metadata.onText,metadata.onTextStream);
policy.setMaxBinaryMessageSize(maxBinaryMessage);
policy.setMaxTextMessageSize(maxTextMessage);
JsrAnnotatedEventDriver driver = new JsrAnnotatedEventDriver(policy,ei,events);
// Handle @PathParam values
ServerEndpointConfig config = (ServerEndpointConfig)ei.getConfig();
if (config instanceof PathParamServerEndpointConfig)
{
PathParamServerEndpointConfig ppconfig = (PathParamServerEndpointConfig)config;
driver.setPathParameters(ppconfig.getPathParamMap());
}
return driver;
}