/** * Get typed property from generic property map. * * @param properties property map. * @param key key of value to be retrieved. * @param type type of value to be retrieved. * @param <T> type of value to be retrieved. * @return typed value or {@code null} if property is not set or value is not assignable. */ public static <T> T getProperty(Map<String, Object> properties, String key, Class<T> type) { return getProperty(properties, key, type, null); }
/** * Get typed property from generic property map. * * @param properties property map. * @param key key of value to be retrieved. * @param type type of value to be retrieved. * @param <T> type of value to be retrieved. * @return typed value or {@code null} if property is not set or value is not assignable. */ public static <T> T getProperty(Map<String, Object> properties, String key, Class<T> type) { return getProperty(properties, key, type, null); }
this.connectToServerUriParam = connectToServerUriParam; MaskingKeyGenerator maskingKeyGenerator = Utils.getProperty(properties, ClientProperties .MASKING_KEY_GENERATOR, MaskingKeyGenerator.class, null); protocolHandler = DEFAULT_VERSION.createHandler(true, maskingKeyGenerator); this.redirectEnabled = Utils.getProperty(properties, ClientProperties.REDIRECT_ENABLED, Boolean.class, false); Integer redirectThreshold = Utils.getProperty(properties, ClientProperties.REDIRECT_THRESHOLD, Integer.class, DEFAULT_REDIRECT_THRESHOLD); if (redirectThreshold == null) { Utils.getProperty(properties, ClientProperties.LOG_HTTP_UPGRADE, Boolean.class, false);
this.connectToServerUriParam = connectToServerUriParam; MaskingKeyGenerator maskingKeyGenerator = Utils.getProperty(properties, ClientProperties .MASKING_KEY_GENERATOR, MaskingKeyGenerator.class, null); protocolHandler = DEFAULT_VERSION.createHandler(true, maskingKeyGenerator); this.redirectEnabled = Utils.getProperty(properties, ClientProperties.REDIRECT_ENABLED, Boolean.class, false); Integer redirectThreshold = Utils.getProperty(properties, ClientProperties.REDIRECT_THRESHOLD, Integer.class, DEFAULT_REDIRECT_THRESHOLD); if (redirectThreshold == null) { Utils.getProperty(properties, ClientProperties.LOG_HTTP_UPGRADE, Boolean.class, false);
private Map<String, String> getProxyHeaders(Map<String, Object> properties) throws DeploymentException { Map<String, String> proxyHeaders = Utils.getProperty(properties, ClientProperties.PROXY_HEADERS, Map.class);
private static Map<String, String> getProxyHeaders(Map<String, Object> properties) throws DeploymentException { Map<String, String> proxyHeaders = Utils.getProperty(properties, ClientProperties.PROXY_HEADERS, Map.class);
private Map<String, String> getProxyHeaders(Map<String, Object> properties) throws DeploymentException { Map<String, String> proxyHeaders = Utils.getProperty(properties, ClientProperties.PROXY_HEADERS, Map.class);
this.workerThreadPoolConfig = getWorkerThreadPoolConfig(properties); this.selectorThreadPoolConfig = Utils.getProperty(properties, GrizzlyClientProperties.SELECTOR_THREAD_POOL_CONFIG, ThreadPoolConfig.class); Boolean shared = Utils.getProperty(properties, ClientProperties.SHARED_CONTAINER, Boolean.class); if (shared == null || !shared) { Utils.getProperty(properties, ClientProperties.SHARED_CONTAINER_IDLE_TIMEOUT, Integer.class);
this.workerThreadPoolConfig = getWorkerThreadPoolConfig(properties); this.selectorThreadPoolConfig = Utils.getProperty(properties, GrizzlyClientProperties.SELECTOR_THREAD_POOL_CONFIG, ThreadPoolConfig.class); Boolean shared = Utils.getProperty(properties, ClientProperties.SHARED_CONTAINER, Boolean.class); if (shared == null || !shared) { Utils.getProperty(properties, ClientProperties.SHARED_CONTAINER_IDLE_TIMEOUT, Integer.class);
Utils.getProperty(properties, ClientProperties.WORKER_THREAD_POOL_CONFIG, ThreadPoolConfig.class); if (threadPoolConfig == null) { threadPoolConfig = ThreadPoolConfig.defaultConfig(); Utils.getProperty(properties, ClientProperties.SHARED_CONTAINER_IDLE_TIMEOUT, Integer.class);
Utils.getProperty(localProperties, TyrusWebSocketEngine.INCOMING_BUFFER_SIZE, Integer.class); final ClusterContext clusterContext = Utils.getProperty(localProperties, ClusterContext.CLUSTER_CONTEXT, ClusterContext.class); final ApplicationEventListener applicationEventListener = Utils.getProperty(localProperties, ApplicationEventListener.APPLICATION_EVENT_LISTENER, ApplicationEventListener.class); final Integer maxSessionsPerApp = Utils.getProperty(localProperties, TyrusWebSocketEngine.MAX_SESSIONS_PER_APP, Integer.class); final Integer maxSessionsPerRemoteAddr = Utils.getProperty(localProperties, TyrusWebSocketEngine.MAX_SESSIONS_PER_REMOTE_ADDR, Integer.class); final Boolean parallelBroadcastEnabled = Utils.getProperty(localProperties, TyrusWebSocketEngine.PARALLEL_BROADCAST_ENABLED, Boolean.class); final DebugContext.TracingType tracingType = Utils.getProperty(localProperties, TyrusWebSocketEngine.TRACING_TYPE, DebugContext.TracingType.class, DebugContext.TracingType.OFF); final DebugContext.TracingThreshold tracingThreshold = Utils.getProperty(localProperties, TyrusWebSocketEngine.TRACING_THRESHOLD, DebugContext.TracingThreshold.class, DebugContext.TracingThreshold.TRACE);
private ThreadPoolConfig getWorkerThreadPoolConfig(Map<String, Object> properties) { if (properties.containsKey(GrizzlyClientProperties.WORKER_THREAD_POOL_CONFIG)) { return Utils .getProperty(properties, GrizzlyClientProperties.WORKER_THREAD_POOL_CONFIG, ThreadPoolConfig.class); } else if (properties.containsKey(ClientProperties.WORKER_THREAD_POOL_CONFIG)) { Object threadPoolConfig = Utils.getProperty(properties, ClientProperties.WORKER_THREAD_POOL_CONFIG, Object.class);
private ThreadPoolConfig getWorkerThreadPoolConfig(Map<String, Object> properties) { if (properties.containsKey(GrizzlyClientProperties.WORKER_THREAD_POOL_CONFIG)) { return Utils .getProperty(properties, GrizzlyClientProperties.WORKER_THREAD_POOL_CONFIG, ThreadPoolConfig.class); } else if (properties.containsKey(ClientProperties.WORKER_THREAD_POOL_CONFIG)) { Object threadPoolConfig = Utils.getProperty(properties, ClientProperties.WORKER_THREAD_POOL_CONFIG, Object.class);
Utils.getProperty(copiedProperties, ClientProperties.INCOMING_BUFFER_SIZE, Integer.class); Integer wlsIncomingBufferSize = configuration == null ? null : Utils.getProperty(configuration.getUserProperties(), ClientContainer.WLS_INCOMING_BUFFER_SIZE, Integer.class); final int incomingBufferSize; Utils.getProperty(copiedProperties, ClientProperties.RETRY_AFTER_SERVICE_UNAVAILABLE, Boolean.class, false); final ReconnectHandler userReconnectHandler = Utils.getProperty(copiedProperties, ClientProperties.RECONNECT_HANDLER, ReconnectHandler.class);
Utils.getProperty(copiedProperties, ClientProperties.INCOMING_BUFFER_SIZE, Integer.class); Integer wlsIncomingBufferSize = configuration == null ? null : Utils.getProperty(configuration.getUserProperties(), ClientContainer.WLS_INCOMING_BUFFER_SIZE, Integer.class); final int incomingBufferSize; Utils.getProperty(copiedProperties, ClientProperties.RETRY_AFTER_SERVICE_UNAVAILABLE, Boolean.class, false); final ReconnectHandler userReconnectHandler = Utils.getProperty(copiedProperties, ClientProperties.RECONNECT_HANDLER, ReconnectHandler.class);
Utils.getProperty(localProperties, WORKER_THREAD_POOL_CONFIG, ThreadPoolConfig.class); ThreadPoolConfig selectorThreadPoolConfig = Utils.getProperty(localProperties, SELECTOR_THREAD_POOL_CONFIG, ThreadPoolConfig.class);
AuthConfig authConfig = Utils.getProperty(properties, ClientProperties.AUTH_CONFIG, AuthConfig.class, AuthConfig.Builder.create().build());
AuthConfig authConfig = Utils.getProperty(properties, ClientProperties.AUTH_CONFIG, AuthConfig.class, AuthConfig.Builder.create().build());
Integer tyrusIncomingBufferSize = Utils.getProperty(properties, ClientProperties.INCOMING_BUFFER_SIZE, Integer.class); Integer wlsIncomingBufferSize = Utils.getProperty(endpointWrapper.getEndpointConfig().getUserProperties(), ClientContainer.WLS_INCOMING_BUFFER_SIZE, Integer.class); final Integer incomingBufferSize;
Integer tyrusIncomingBufferSize = Utils.getProperty(properties, ClientProperties.INCOMING_BUFFER_SIZE, Integer.class); Integer wlsIncomingBufferSize = Utils.getProperty(endpointWrapper.getEndpointConfig().getUserProperties(), ClientContainer.WLS_INCOMING_BUFFER_SIZE, Integer.class); final Integer incomingBufferSize;