/** * This method is called by the container each time a new client * connects to the logical endpoint this configurator configures. * Developers may override this method to control instantiation of * endpoint instances in order to customize the initialization * of the endpoint instance, or manage them in some other way. * If the developer overrides this method, services like * dependency injection that are otherwise supported, for example, when * the implementation is part of the Java EE platform * may not be available. * The platform default implementation of this method returns a new * endpoint instance per call, thereby ensuring that there is one * endpoint instance per client, the default deployment cardinality. * * @param endpointClass the class of the endpoint. * @param <T> the type of the endpoint. * @return an instance of the endpoint that will handle all * interactions from a new client. * @throws InstantiationException if there was an error producing the * endpoint instance. * @see javax.websocket.server.ServerEndpointConfig.Configurator#getEndpointInstance(Class) */ public <T> Object getEndpointInstance(Class<T> endpointClass) throws InstantiationException { return getInstance(endpointClass); } }
/** * This method is called by the container each time a new client * connects to the logical endpoint this configurator configures. * Developers may override this method to control instantiation of * endpoint instances in order to customize the initialization * of the endpoint instance, or manage them in some other way. * If the developer overrides this method, services like * dependency injection that are otherwise supported, for example, when * the implementation is part of the Java EE platform * may not be available. * The platform default implementation of this method returns a new * endpoint instance per call, thereby ensuring that there is one * endpoint instance per client, the default deployment cardinality. * * @param endpointClass the class of the endpoint. * @param <T> the type of the endpoint. * @return an instance of the endpoint that will handle all * interactions from a new client. * @throws InstantiationException if there was an error producing the * endpoint instance. * @see javax.websocket.server.ServerEndpointConfig.Configurator#getEndpointInstance(Class) */ public <T> Object getEndpointInstance(Class<T> endpointClass) throws InstantiationException { return getInstance(endpointClass); } }
loaded = classObjectMap.get(c); } else { loaded = getInstance(c); if (loaded != null) { if (loaded instanceof Encoder) { loaded = getInstance(c); if (loaded != null) { if (loaded instanceof Encoder) {
loaded = classObjectMap.get(c); } else { loaded = getInstance(c); if (loaded != null) { if (loaded instanceof Encoder) { loaded = getInstance(c); if (loaded != null) { if (loaded instanceof Encoder) {
final Object endpoint = annotatedInstance != null ? annotatedInstance : componentProvider.getInstance(annotatedClass, session, collector);
final Object endpoint = annotatedInstance != null ? annotatedInstance : componentProvider.getInstance(annotatedClass, session, collector);
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
: componentProvider.getInstance(endpointClass, session, collector);
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
: componentProvider.getInstance(endpointClass, session, collector);
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
: componentProvider.getInstance(endpointClass, session, collector);
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
: componentProvider.getInstance(endpointClass, session, collector);
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {
ErrorCollector collector = new ErrorCollector(); final Object toCall = programmaticEndpoint ? endpoint : componentProvider.getInstance(endpointClass, session, collector); if (toCall != null) { if (programmaticEndpoint) {