public class ComponentProviderService extends Object
ComponentProviders which are used to provide instances.| Constructor and Description |
|---|
ComponentProviderService(ComponentProviderService componentProviderService)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static ComponentProviderService |
create()
Create new instance of
ComponentProviderService. |
<T> T |
getCoderInstance(Class<T> c,
javax.websocket.Session session,
javax.websocket.EndpointConfig endpointConfig,
ErrorCollector collector)
Provide an instance of
Encoder or Decoder descendant which is coupled to Session. |
<T> T |
getEndpointInstance(Class<T> endpointClass)
This method is called by the container each time a new client
connects to the logical endpoint this configurator configures.
|
<T> T |
getInstance(Class<T> c,
javax.websocket.Session session,
ErrorCollector collector)
Provide an instance of class which is coupled to
Session. |
void |
removeSession(javax.websocket.Session session)
Remove
Session from cache. |
public ComponentProviderService(ComponentProviderService componentProviderService)
componentProviderService - original instance.public static ComponentProviderService create()
ComponentProviderService.
Searches for registered ComponentProviders and registers them with this service.
DefaultComponentProvider is always added to found providers.ComponentProviderService.public <T> T getInstance(Class<T> c, javax.websocket.Session session, ErrorCollector collector)
Session.
The first time the method is called the provider creates an instance and caches it.
Next time the method is called the cached instance is returned.T - type of the provided instance.c - Class whose instance will be provided.collector - error collector.public <T> T getCoderInstance(Class<T> c, javax.websocket.Session session, javax.websocket.EndpointConfig endpointConfig, ErrorCollector collector)
Encoder or Decoder descendant which is coupled to Session.
The first time the method is called the provider creates an instance, calls Encoder.init(javax.websocket.EndpointConfig)
or Decoder.init(javax.websocket.EndpointConfig) and caches it.
Next time the method is called the cached instance is returned.T - type of the provided instance.c - Class whose instance will be provided.collector - error collector.endpointConfig - configuration corresponding to current context. Used for
Encoder.init(javax.websocket.EndpointConfig) and
Decoder.init(javax.websocket.EndpointConfig)public void removeSession(javax.websocket.Session session)
Session from cache.session - to be removed.public <T> T getEndpointInstance(Class<T> endpointClass) throws InstantiationException
T - the type of the endpoint.endpointClass - the class of the endpoint.InstantiationException - if there was an error producing the
endpoint instance.ServerEndpointConfig.Configurator.getEndpointInstance(Class)Copyright © 2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.