use of org.eclipse.jetty.io.AbstractEndPoint in project jetty.project by eclipse.
the class ResponseTest method init.
@Before
public void init() throws Exception {
_server = new Server();
Scheduler _scheduler = new TimerScheduler();
HttpConfiguration config = new HttpConfiguration();
LocalConnector connector = new LocalConnector(_server, null, _scheduler, null, 1, new HttpConnectionFactory(config));
_server.addConnector(connector);
_server.setHandler(new DumpHandler());
_server.start();
AbstractEndPoint endp = new ByteArrayEndPoint(_scheduler, 5000) {
@Override
public InetSocketAddress getLocalAddress() {
return LOCALADDRESS;
}
};
_channel = new HttpChannel(connector, new HttpConfiguration(), endp, new HttpTransport() {
private Throwable _channelError;
@Override
public void send(MetaData.Response info, boolean head, ByteBuffer content, boolean lastContent, Callback callback) {
if (_channelError == null)
callback.succeeded();
else
callback.failed(_channelError);
}
@Override
public boolean isPushSupported() {
return false;
}
@Override
public void push(org.eclipse.jetty.http.MetaData.Request request) {
}
@Override
public void onCompleted() {
}
@Override
public void abort(Throwable failure) {
_channelError = failure;
}
@Override
public boolean isOptimizedForDirectBuffers() {
return false;
}
});
}
Aggregations