Skip to content
This repository
tree: d673f5cb79
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 25 lines (18 sloc) 0.496 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package co.freeside.betamax.handler

import co.freeside.betamax.message.*

abstract class ChainedHttpHandler implements HttpHandler {

private HttpHandler next

protected final Response chain(Request request) {
if (!next) {
throw new IllegalStateException('attempted to chain from the last handler in the chain')
}
next.handle(request)
}

final void setNext(HttpHandler next) {
this.next = next
}

final HttpHandler leftShift(HttpHandler next) {
setNext(next)
this.next
}
}
Something went wrong with that request. Please try again.