Search in sources :

Example 1 with EmptyClientEndpointConfig

use of org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig in project jetty.project by eclipse.

the class ClientContainer method doStart.

@Override
protected void doStart() throws Exception {
    super.doStart();
    // Initialize the default decoder / encoder factories
    EmptyClientEndpointConfig empty = new EmptyClientEndpointConfig();
    this.decoderFactory.init(empty);
    this.encoderFactory.init(empty);
}
Also used : EmptyClientEndpointConfig(org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig)

Example 2 with EmptyClientEndpointConfig

use of org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig in project jetty.project by eclipse.

the class ClientContainer method newClientEndpointInstance.

public EndpointInstance newClientEndpointInstance(Object endpoint, ClientEndpointConfig config) {
    EndpointMetadata metadata = getClientEndpointMetadata(endpoint.getClass(), config);
    ClientEndpointConfig cec = config;
    if (config == null) {
        if (metadata instanceof AnnotatedClientEndpointMetadata) {
            cec = ((AnnotatedClientEndpointMetadata) metadata).getConfig();
        } else {
            cec = new EmptyClientEndpointConfig();
        }
    }
    return new EndpointInstance(endpoint, cec, metadata);
}
Also used : EmptyClientEndpointConfig(org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig) EndpointInstance(org.eclipse.jetty.websocket.jsr356.endpoints.EndpointInstance) EmptyClientEndpointConfig(org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig) ClientEndpointConfig(javax.websocket.ClientEndpointConfig) AnnotatedClientEndpointMetadata(org.eclipse.jetty.websocket.jsr356.client.AnnotatedClientEndpointMetadata) SimpleEndpointMetadata(org.eclipse.jetty.websocket.jsr356.client.SimpleEndpointMetadata) AnnotatedClientEndpointMetadata(org.eclipse.jetty.websocket.jsr356.client.AnnotatedClientEndpointMetadata) EndpointMetadata(org.eclipse.jetty.websocket.jsr356.metadata.EndpointMetadata)

Example 3 with EmptyClientEndpointConfig

use of org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig in project jetty.project by eclipse.

the class JsrSessionTest method initSession.

@Before
public void initSession() {
    container = new ClientContainer();
    String id = JsrSessionTest.class.getSimpleName();
    URI requestURI = URI.create("ws://localhost/" + id);
    WebSocketPolicy policy = WebSocketPolicy.newClientPolicy();
    ClientEndpointConfig config = new EmptyClientEndpointConfig();
    DummyEndpoint websocket = new DummyEndpoint();
    SimpleEndpointMetadata metadata = new SimpleEndpointMetadata(websocket.getClass());
    // Executor executor = null;
    EndpointInstance ei = new EndpointInstance(websocket, config, metadata);
    EventDriver driver = new JsrEndpointEventDriver(policy, ei);
    DummyConnection connection = new DummyConnection();
    session = new JsrSession(container, id, requestURI, driver, connection);
}
Also used : WebSocketPolicy(org.eclipse.jetty.websocket.api.WebSocketPolicy) DummyEndpoint(org.eclipse.jetty.websocket.jsr356.samples.DummyEndpoint) SimpleEndpointMetadata(org.eclipse.jetty.websocket.jsr356.client.SimpleEndpointMetadata) DummyConnection(org.eclipse.jetty.websocket.common.test.DummyConnection) EndpointInstance(org.eclipse.jetty.websocket.jsr356.endpoints.EndpointInstance) URI(java.net.URI) EmptyClientEndpointConfig(org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig) EventDriver(org.eclipse.jetty.websocket.common.events.EventDriver) JsrEndpointEventDriver(org.eclipse.jetty.websocket.jsr356.endpoints.JsrEndpointEventDriver) JsrEndpointEventDriver(org.eclipse.jetty.websocket.jsr356.endpoints.JsrEndpointEventDriver) EmptyClientEndpointConfig(org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig) ClientEndpointConfig(javax.websocket.ClientEndpointConfig) Before(org.junit.Before)

Aggregations

EmptyClientEndpointConfig (org.eclipse.jetty.websocket.jsr356.client.EmptyClientEndpointConfig)3 ClientEndpointConfig (javax.websocket.ClientEndpointConfig)2 SimpleEndpointMetadata (org.eclipse.jetty.websocket.jsr356.client.SimpleEndpointMetadata)2 EndpointInstance (org.eclipse.jetty.websocket.jsr356.endpoints.EndpointInstance)2 URI (java.net.URI)1 WebSocketPolicy (org.eclipse.jetty.websocket.api.WebSocketPolicy)1 EventDriver (org.eclipse.jetty.websocket.common.events.EventDriver)1 DummyConnection (org.eclipse.jetty.websocket.common.test.DummyConnection)1 AnnotatedClientEndpointMetadata (org.eclipse.jetty.websocket.jsr356.client.AnnotatedClientEndpointMetadata)1 JsrEndpointEventDriver (org.eclipse.jetty.websocket.jsr356.endpoints.JsrEndpointEventDriver)1 EndpointMetadata (org.eclipse.jetty.websocket.jsr356.metadata.EndpointMetadata)1 DummyEndpoint (org.eclipse.jetty.websocket.jsr356.samples.DummyEndpoint)1 Before (org.junit.Before)1