Package org.gearman.tests.util
Class MockNIOConnection
- java.lang.Object
-
- org.gearman.common.GearmanNIOJobServerConnection
-
- org.gearman.tests.util.MockNIOConnection
-
- All Implemented Interfaces:
GearmanJobServerConnection
,GearmanJobServerIpConnection
public class MockNIOConnection extends GearmanNIOJobServerConnection
-
-
Constructor Summary
Constructors Constructor Description MockNIOConnection(String host)
MockNIOConnection(String host, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRead()
boolean
canWrite()
GearmanPacket
read()
void
write(GearmanPacket request)
-
Methods inherited from class org.gearman.common.GearmanNIOJobServerConnection
close, equals, getHost, getPort, getSelector, hasBufferedWriteData, hashCode, isOpen, open, registerSelector, toString
-
-
-
-
Method Detail
-
canWrite
public boolean canWrite()
- Specified by:
canWrite
in interfaceGearmanJobServerConnection
- Overrides:
canWrite
in classGearmanNIOJobServerConnection
-
canRead
public boolean canRead()
- Specified by:
canRead
in interfaceGearmanJobServerConnection
- Overrides:
canRead
in classGearmanNIOJobServerConnection
-
write
public void write(GearmanPacket request) throws IOException
- Specified by:
write
in interfaceGearmanJobServerConnection
- Overrides:
write
in classGearmanNIOJobServerConnection
- Throws:
IOException
-
read
public GearmanPacket read() throws IOException
- Specified by:
read
in interfaceGearmanJobServerConnection
- Overrides:
read
in classGearmanNIOJobServerConnection
- Throws:
IOException
-
-