@Loggable(value=1) public final class MkGrizzlyContainer extends Object implements MkContainer
MkContainer based on Grizzly Server.MkContainer| Constructor and Description |
|---|
MkGrizzlyContainer() |
| Modifier and Type | Method and Description |
|---|---|
URI |
home()
Get its home.
|
MkContainer |
next(MkAnswer answer)
Give this answer on the next request.
|
MkContainer |
next(MkAnswer answer,
Matcher<MkQuery> condition)
Give this answer on the next request if the matcher condition is
satisfied.
|
MkContainer |
next(MkAnswer answer,
Matcher<MkQuery> condition,
int count)
Give this answer on the next request(s) if the matcher condition is
satisfied up to a certain number of requests.
|
int |
queries()
How many queries we have left.
|
MkContainer |
start()
Start it on the first available TCP port.
|
MkContainer |
start(int prt)
Start it on a provided port.
|
void |
stop()
Stop container.
|
MkQuery |
take()
Get the oldest request received
(
NoSuchElementException
if no more elements in the list). |
MkQuery |
take(Matcher<MkAnswer> matcher)
Get the oldest request received subject to the matching condition.
|
Collection<MkQuery> |
takeAll(Matcher<MkAnswer> matcher)
Get the all requests received satisfying the given matcher.
|
public MkContainer next(MkAnswer answer)
MkContainernext in interface MkContaineranswer - Next answer to givepublic MkContainer next(MkAnswer answer, Matcher<MkQuery> condition)
MkContainernext in interface MkContaineranswer - Next answer to givecondition - The condition to matchpublic MkContainer next(MkAnswer answer, Matcher<MkQuery> condition, int count)
MkContainernext in interface MkContaineranswer - Next answer to givecondition - The condition to matchcount - Number of requests to matchpublic MkQuery take()
MkContainerNoSuchElementException
if no more elements in the list).take in interface MkContainerpublic MkQuery take(Matcher<MkAnswer> matcher)
MkContainerNoSuchElementException if no elements satisfy the
condition).take in interface MkContainermatcher - The matcher specifying the conditionpublic Collection<MkQuery> takeAll(Matcher<MkAnswer> matcher)
MkContainerNoSuchElementException if no elements satisfy the
condition).takeAll in interface MkContainermatcher - The matcher specifying the conditionpublic int queries()
MkContainerqueries in interface MkContainerMkContainer.take()public MkContainer start() throws IOException
MkContainerstart in interface MkContainerIOException - If failspublic MkContainer start(int prt) throws IOException
MkContainerstart in interface MkContainerprt - The port where it should start listeningIOException - If failspublic void stop()
MkContainerstop in interface MkContainerpublic URI home()
MkContainerhome in interface MkContainerCopyright © 2012–2015 jcabi.com. All rights reserved.