aboutsummaryrefslogtreecommitdiffstats
path: root/application/src/test/java/com/yahoo/application/container/handlers/TestHandler.java
blob: 4014e945ba2c8a8ab22fa0bff90f474a11356897 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.application.container.handlers;

import com.yahoo.jdisc.handler.AbstractRequestHandler;
import com.yahoo.jdisc.handler.ContentChannel;
import com.yahoo.jdisc.handler.FastContentWriter;
import com.yahoo.jdisc.handler.ResponseDispatch;
import com.yahoo.jdisc.handler.ResponseHandler;

/**
 * @author gjoranv
 * @author ollivir
 */
public class TestHandler extends AbstractRequestHandler {
    public static final String RESPONSE = "Hello, World!";

    public ContentChannel handleRequest(com.yahoo.jdisc.Request request, ResponseHandler handler) {
        FastContentWriter writer = ResponseDispatch.newInstance(com.yahoo.jdisc.Response.Status.OK)
                .connectFastWriter(handler);
        writer.write(RESPONSE);
        writer.close();
        return null;
    }

}