Package org.apache.activeio.xnet
Class ServiceDaemon
- java.lang.Object
-
- org.apache.activeio.xnet.ServiceDaemon
-
- All Implemented Interfaces:
ServerService
,SocketService
public class ServiceDaemon extends java.lang.Object implements ServerService
-
-
Constructor Summary
Constructors Constructor Description ServiceDaemon(java.lang.String name, SocketService socketService, java.net.InetAddress address, int port)
ServiceDaemon(SocketService socketService, java.net.InetAddress address, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.InetAddress
getAddress()
Gets the inetAddress number that the daemon is listening on.java.lang.String
getIP()
Gets the ip number that the daemon is listening on.java.lang.String
getName()
Gets the name of the service.int
getPort()
Gets the port number that the daemon is listening on.java.lang.String
getServiceName()
int
getSoTimeout()
void
init(java.util.Properties props)
void
service(java.net.Socket socket)
void
setSoTimeout(int timeout)
void
start()
void
stop()
-
-
-
Constructor Detail
-
ServiceDaemon
public ServiceDaemon(SocketService socketService, java.net.InetAddress address, int port)
-
ServiceDaemon
public ServiceDaemon(java.lang.String name, SocketService socketService, java.net.InetAddress address, int port)
-
-
Method Detail
-
setSoTimeout
public void setSoTimeout(int timeout) throws java.net.SocketException
- Throws:
java.net.SocketException
-
getSoTimeout
public int getSoTimeout() throws java.io.IOException
- Throws:
java.io.IOException
-
getServiceName
public java.lang.String getServiceName()
-
getAddress
public java.net.InetAddress getAddress()
Gets the inetAddress number that the daemon is listening on.
-
init
public void init(java.util.Properties props) throws java.lang.Exception
- Specified by:
init
in interfaceServerService
- Throws:
java.lang.Exception
-
start
public void start() throws ServiceException
- Specified by:
start
in interfaceServerService
- Throws:
ServiceException
-
stop
public void stop() throws ServiceException
- Specified by:
stop
in interfaceServerService
- Throws:
ServiceException
-
getIP
public java.lang.String getIP()
Description copied from interface:ServerService
Gets the ip number that the daemon is listening on.- Specified by:
getIP
in interfaceServerService
-
getPort
public int getPort()
Gets the port number that the daemon is listening on.- Specified by:
getPort
in interfaceServerService
-
service
public void service(java.net.Socket socket) throws ServiceException, java.io.IOException
- Specified by:
service
in interfaceSocketService
- Throws:
ServiceException
java.io.IOException
-
getName
public java.lang.String getName()
Description copied from interface:SocketService
Gets the name of the service. Used for display purposes only- Specified by:
getName
in interfaceSocketService
-
-