/** * Create new {@link TyrusServerConfiguration}. * * @param classes classes to be included in this application instance. Can contain any combination of * annotated endpoints (see {@link ServerEndpoint}). Cannot be {@code null}. * @param serverEndpointConfigs List of instances of {@link ServerEndpointConfig} to be deployed. * @throws IllegalArgumentException when any of the arguments is {@code null}. */ public TyrusServerConfiguration(Set<Class<?>> classes, Set<ServerEndpointConfig> serverEndpointConfigs) { this(classes, Collections.<Class<?>>emptySet(), serverEndpointConfigs, new ErrorCollector()); }
/** * Create new {@link TyrusServerConfiguration}. * * @param classes classes to be included in this application instance. Can contain any combination of * annotated endpoints (see {@link ServerEndpoint}). Cannot be {@code null}. * @param serverEndpointConfigs List of instances of {@link ServerEndpointConfig} to be deployed. * @throws IllegalArgumentException when any of the arguments is {@code null}. */ public TyrusServerConfiguration(Set<Class<?>> classes, Set<ServerEndpointConfig> serverEndpointConfigs) { this(classes, Collections.<Class<?>>emptySet(), serverEndpointConfigs, new ErrorCollector()); }
/** * Create new {@link TyrusServerContainer} using already created {@link ServerApplicationConfig} instance. * * @param serverApplicationConfig provided application config. */ public TyrusServerContainer(ServerApplicationConfig serverApplicationConfig) { this.collector = new ErrorCollector(); this.classes = new HashSet<Class<?>>(); this.dynamicallyAddedClasses = new HashSet<Class<?>>(); this.dynamicallyAddedEndpointConfigs = new HashSet<ServerEndpointConfig>(); this.serverApplicationConfig = serverApplicationConfig; }
/** * Create new {@link TyrusServerContainer} using already created {@link ServerApplicationConfig} instance. * * @param serverApplicationConfig provided application config. */ public TyrusServerContainer(ServerApplicationConfig serverApplicationConfig) { this.collector = new ErrorCollector(); this.classes = new HashSet<Class<?>>(); this.dynamicallyAddedClasses = new HashSet<Class<?>>(); this.dynamicallyAddedEndpointConfigs = new HashSet<ServerEndpointConfig>(); this.serverApplicationConfig = serverApplicationConfig; }
/** * Create new {@link TyrusServerContainer}. * * @param classes classes to be included in this application instance. Can contain any combination of annotated * endpoints (see {@link javax.websocket.server.ServerEndpoint}) or {@link javax.websocket.Endpoint} * descendants. */ public TyrusServerContainer(Set<Class<?>> classes) { this.collector = new ErrorCollector(); this.classes = classes == null ? Collections.<Class<?>>emptySet() : new HashSet<Class<?>>(classes); this.dynamicallyAddedClasses = new HashSet<Class<?>>(); this.dynamicallyAddedEndpointConfigs = new HashSet<ServerEndpointConfig>(); this.serverApplicationConfig = null; }
/** * Create new {@link TyrusServerContainer}. * * @param classes classes to be included in this application instance. Can contain any combination of annotated * endpoints (see {@link javax.websocket.server.ServerEndpoint}) or {@link javax.websocket.Endpoint} * descendants. */ public TyrusServerContainer(Set<Class<?>> classes) { this.collector = new ErrorCollector(); this.classes = classes == null ? Collections.<Class<?>>emptySet() : new HashSet<Class<?>>(classes); this.dynamicallyAddedClasses = new HashSet<Class<?>>(); this.dynamicallyAddedEndpointConfigs = new HashSet<ServerEndpointConfig>(); this.serverApplicationConfig = null; }
private ClientManager(String containerProviderClassName, WebSocketContainer webSocketContainer) { final ErrorCollector collector = new ErrorCollector(); componentProvider = ComponentProviderService.createClient(); Class engineProviderClazz;
private ClientManager(String containerProviderClassName, WebSocketContainer webSocketContainer) { final ErrorCollector collector = new ErrorCollector(); componentProvider = ComponentProviderService.createClient(); Class engineProviderClazz;
private Object callMethod(Method method, ParameterExtractor[] extractors, Session session, boolean callOnError, Object... params) { ErrorCollector collector = new ErrorCollector(); Object[] paramValues = new Object[extractors.length];
private Object callMethod(Method method, ParameterExtractor[] extractors, Session session, boolean callOnError, Object... params) { ErrorCollector collector = new ErrorCollector(); Object[] paramValues = new Object[extractors.length];
private <T> Object getCoderInstance(Session session, CoderWrapper<T> wrapper) { final Object coder = wrapper.getCoder(); if (coder == null) { ErrorCollector collector = new ErrorCollector(); final Object coderInstance = this.componentProvider .getCoderInstance(wrapper.getCoderClass(), session, getEndpointConfig(), collector); if (!collector.isEmpty()) { final DeploymentException deploymentException = collector.composeComprehensiveException(); LOGGER.log(Level.WARNING, deploymentException.getMessage(), deploymentException); return null; } return coderInstance; } return coder; }
private <T> Object getCoderInstance(Session session, CoderWrapper<T> wrapper) { final Object coder = wrapper.getCoder(); if (coder == null) { ErrorCollector collector = new ErrorCollector(); final Object coderInstance = this.componentProvider .getCoderInstance(wrapper.getCoderClass(), session, getEndpointConfig(), collector); if (!collector.isEmpty()) { final DeploymentException deploymentException = collector.composeComprehensiveException(); LOGGER.log(Level.WARNING, deploymentException.getMessage(), deploymentException); return null; } return coderInstance; } return coder; }
} catch (Throwable t) { if (!processThrowable(t, session)) { ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector);
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector);
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector);
parallelBroadcastEnabled); } else { final ErrorCollector collector = new ErrorCollector();
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector);
parallelBroadcastEnabled); } else { final ErrorCollector collector = new ErrorCollector();
@Override public void register(Class<?> endpointClass, String contextPath) throws DeploymentException { final ErrorCollector collector = new ErrorCollector(); EndpointEventListenerWrapper endpointEventListenerWrapper = new EndpointEventListenerWrapper(); AnnotatedEndpoint endpoint = AnnotatedEndpoint .fromClass(endpointClass, componentProviderService, true, incomingBufferSize, collector, endpointEventListenerWrapper); EndpointConfig config = endpoint.getEndpointConfig(); TyrusEndpointWrapper endpointWrapper = new TyrusEndpointWrapper( endpoint, config, componentProviderService, webSocketContainer, contextPath, config instanceof ServerEndpointConfig ? ((ServerEndpointConfig) config).getConfigurator() : null, sessionListener, clusterContext, endpointEventListenerWrapper, parallelBroadcastEnabled); if (collector.isEmpty()) { register(endpointWrapper); } else { throw collector.composeComprehensiveException(); } String endpointPath = config instanceof ServerEndpointConfig ? ((ServerEndpointConfig) config).getPath() : null; EndpointEventListener endpointEventListener = applicationEventListener.onEndpointRegistered(endpointPath, endpointClass); endpointEventListenerWrapper.setEndpointEventListener(endpointEventListener); }
@Override public void register(Class<?> endpointClass, String contextPath) throws DeploymentException { final ErrorCollector collector = new ErrorCollector(); EndpointEventListenerWrapper endpointEventListenerWrapper = new EndpointEventListenerWrapper(); AnnotatedEndpoint endpoint = AnnotatedEndpoint .fromClass(endpointClass, componentProviderService, true, incomingBufferSize, collector, endpointEventListenerWrapper); EndpointConfig config = endpoint.getEndpointConfig(); TyrusEndpointWrapper endpointWrapper = new TyrusEndpointWrapper( endpoint, config, componentProviderService, webSocketContainer, contextPath, config instanceof ServerEndpointConfig ? ((ServerEndpointConfig) config).getConfigurator() : null, sessionListener, clusterContext, endpointEventListenerWrapper, parallelBroadcastEnabled); if (collector.isEmpty()) { register(endpointWrapper); } else { throw collector.composeComprehensiveException(); } String endpointPath = config instanceof ServerEndpointConfig ? ((ServerEndpointConfig) config).getPath() : null; EndpointEventListener endpointEventListener = applicationEventListener.onEndpointRegistered(endpointPath, endpointClass); endpointEventListenerWrapper.setEndpointEventListener(endpointEventListener); }