- java.lang.Object
-
- swim.service.ServicePort
-
- All Implemented Interfaces:
ServiceContext
,IpInterface
,Log
public class ServicePort extends Object implements ServiceContext
-
-
Field Summary
Fields Modifier and Type Field Description protected KernelContext
kernel
protected Log
log
protected Policy
policy
protected Service
service
protected String
serviceName
protected Stage
stage
protected static int
STARTED
protected int
status
protected static AtomicIntegerFieldUpdater<ServicePort>
STATUS
-
Constructor Summary
Constructors Constructor Description ServicePort(String serviceName, KernelContext kernel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IpServiceRef
bindTcp(InetSocketAddress localAddress, IpService service, IpSettings ipSettings)
IpServiceRef
bindTls(InetSocketAddress localAddress, IpService service, IpSettings ipSettings)
void
close()
IpSocketRef
connectTcp(InetSocketAddress remoteAddress, IpSocket socket, IpSettings ipSettings)
IpSocketRef
connectTls(InetSocketAddress remoteAddress, IpSocket socket, IpSettings ipSettings)
void
debug(Object message)
Logs a debug-level message.protected void
didStart()
protected void
didStop()
void
error(Object message)
Logs an error-level message.void
fail(Object message)
Logs an fail-level message.void
info(Object message)
Logs an info-level message.IpSettings
ipSettings()
KernelContext
kernel()
Schedule
schedule()
Service
service()
String
serviceName()
void
setService(Service service)
Stage
stage()
void
start()
void
stop()
void
trace(Object message)
Logs a trace-level message.void
warn(Object message)
Logs a warn-level message.protected void
willStart()
protected void
willStop()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface swim.io.IpInterface
bindTcp, bindTcp, bindTcp, bindTls, bindTls, bindTls, connectTcp, connectTcp, connectTcp, connectTcp, connectTcp, connectTcp, connectTcp, connectTls, connectTls, connectTls, connectTls, connectTls, connectTls, connectTls
-
-
-
-
Field Detail
-
serviceName
protected final String serviceName
-
kernel
protected final KernelContext kernel
-
service
protected Service service
-
status
protected volatile int status
-
log
protected Log log
-
policy
protected Policy policy
-
stage
protected Stage stage
-
STARTED
protected static final int STARTED
- See Also:
- Constant Field Values
-
STATUS
protected static final AtomicIntegerFieldUpdater<ServicePort> STATUS
-
-
Constructor Detail
-
ServicePort
public ServicePort(String serviceName, KernelContext kernel)
-
-
Method Detail
-
serviceName
public final String serviceName()
-
schedule
public Schedule schedule()
- Specified by:
schedule
in interfaceServiceContext
-
stage
public final Stage stage()
- Specified by:
stage
in interfaceServiceContext
-
kernel
public final KernelContext kernel()
-
service
public final Service service()
-
setService
public void setService(Service service)
-
ipSettings
public IpSettings ipSettings()
- Specified by:
ipSettings
in interfaceIpInterface
-
bindTcp
public IpServiceRef bindTcp(InetSocketAddress localAddress, IpService service, IpSettings ipSettings)
- Specified by:
bindTcp
in interfaceIpInterface
-
bindTls
public IpServiceRef bindTls(InetSocketAddress localAddress, IpService service, IpSettings ipSettings)
- Specified by:
bindTls
in interfaceIpInterface
-
connectTcp
public IpSocketRef connectTcp(InetSocketAddress remoteAddress, IpSocket socket, IpSettings ipSettings)
- Specified by:
connectTcp
in interfaceIpInterface
-
connectTls
public IpSocketRef connectTls(InetSocketAddress remoteAddress, IpSocket socket, IpSettings ipSettings)
- Specified by:
connectTls
in interfaceIpInterface
-
start
public void start()
-
stop
public void stop()
-
close
public void close()
- Specified by:
close
in interfaceServiceContext
-
willStart
protected void willStart()
-
didStart
protected void didStart()
-
willStop
protected void willStop()
-
didStop
protected void didStop()
-
trace
public void trace(Object message)
Description copied from interface:Log
Logs a trace-level message.
-
debug
public void debug(Object message)
Description copied from interface:Log
Logs a debug-level message.
-
info
public void info(Object message)
Description copied from interface:Log
Logs an info-level message.
-
warn
public void warn(Object message)
Description copied from interface:Log
Logs a warn-level message.
-
error
public void error(Object message)
Description copied from interface:Log
Logs an error-level message.
-
-