class
ServerBuilder[Req, Rep, HasCodec, HasBindTo, HasName] extends AnyRef
Type Members
-
type
FullySpecifiedConfig = ServerConfig[Req, Rep, Yes, Yes, Yes]
-
type
This = ServerBuilder[Req, Rep, HasCodec, HasBindTo, HasName]
-
type
ThisConfig = ServerConfig[Req, Rep, HasCodec, HasBindTo, HasName]
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
backlog(value: Int): This
-
def
bindTo(address: SocketAddress): ServerBuilder[Req, Rep, HasCodec, Yes, HasName]
-
def
build(serviceFactory: ServiceFactory[Req, Rep])(implicit THE_BUILDER_IS_NOT_FULLY_SPECIFIED_SEE_ServerBuilder_DOCUMENTATION: ServerConfigEvidence[HasCodec, HasBindTo, HasName]): Server
-
def
build(service: Service[Req, Rep])(implicit THE_BUILDER_IS_NOT_FULLY_SPECIFIED_SEE_ServerBuilder_DOCUMENTATION: ServerConfigEvidence[HasCodec, HasBindTo, HasName]): Server
-
def
cancelOnHangup(yesOrNo: Boolean): This
-
def
channelFactory(cf: ServerChannelFactory): This
-
def
clone(): AnyRef
-
def
codec[Req1, Rep1](codecFactory: CodecFactory[Req1, Rep1]): ServerBuilder[Req1, Rep1, Yes, HasBindTo, HasName]
-
def
codec[Req1, Rep1](codecFactory: (ServerCodecConfig) ⇒ Codec[Req1, Rep1]): ServerBuilder[Req1, Rep1, Yes, HasBindTo, HasName]
-
def
codec[Req1, Rep1](codec: Codec[Req1, Rep1]): ServerBuilder[Req1, Rep1, Yes, HasBindTo, HasName]
-
val
config: ServerConfig[Req, Rep, HasCodec, HasBindTo, HasName]
-
def
copy[Req1, Rep1, HasCodec1, HasBindTo1, HasName1](config: ServerConfig[Req1, Rep1, HasCodec1, HasBindTo1, HasName1]): ServerBuilder[Req1, Rep1, HasCodec1, HasBindTo1, HasName1]
-
def
daemon(daemonize: Boolean): This
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
def
hostConnectionMaxIdleTime(howlong: Duration): This
-
def
hostConnectionMaxLifeTime(howlong: Duration): This
-
final
def
isInstanceOf[T0]: Boolean
-
def
keepAlive(value: Boolean): This
-
def
logChannelActivity(v: Boolean): This
-
def
logger(logger: Logger): This
-
def
maxConcurrentRequests(max: Int): This
-
def
monitor(mFactory: (String, SocketAddress) ⇒ Monitor): This
-
def
name(value: String): ServerBuilder[Req, Rep, HasCodec, HasBindTo, Yes]
-
final
def
ne(arg0: AnyRef): Boolean
-
def
newFinagleSslEngine(v: () ⇒ Engine): This
-
def
newSslEngine(newSsl: () ⇒ SSLEngine): This
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
-
def
readTimeout(howlong: Duration): This
-
def
recvBufferSize(value: Int): This
-
-
def
requestTimeout(howlong: Duration): This
-
def
sendBufferSize(value: Int): This
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
tls(certificatePath: String, keyPath: String, caCertificatePath: String = null, ciphers: String = null, nextProtos: String = null): This
-
def
toString(): String
-
-
def
unsafeBuild(service: Service[Req, Rep]): Server
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
def
withConfig[Req1, Rep1, HasCodec1, HasBindTo1, HasName1](f: (ServerConfig[Req, Rep, HasCodec, HasBindTo, HasName]) ⇒ ServerConfig[Req1, Rep1, HasCodec1, HasBindTo1, HasName1]): ServerBuilder[Req1, Rep1, HasCodec1, HasBindTo1, HasName1]
-
def
writeCompletionTimeout(howlong: Duration): This
Deprecated Value Members
-
def
build(serviceFactory: ServiceFactory[Req, Rep], THE_BUILDER_IS_NOT_FULLY_SPECIFIED_SEE_ServerBuilder_DOCUMENTATION: =:=[ThisConfig, FullySpecifiedConfig]): Server
-
def
build(serviceFactory: (ClientConnection) ⇒ Service[Req, Rep])(implicit THE_BUILDER_IS_NOT_FULLY_SPECIFIED_SEE_ServerBuilder_DOCUMENTATION: =:=[ThisConfig, FullySpecifiedConfig]): Server
-
def
build(serviceFactory: () ⇒ Service[Req, Rep])(implicit THE_BUILDER_IS_NOT_FULLY_SPECIFIED_SEE_ServerBuilder_DOCUMENTATION: =:=[ThisConfig, FullySpecifiedConfig]): Server
-
def
build(service: Service[Req, Rep], THE_BUILDER_IS_NOT_FULLY_SPECIFIED_SEE_ServerBuilder_DOCUMENTATION: =:=[ThisConfig, FullySpecifiedConfig]): Server
-
def
tracerFactory(t: Tracer): This
-
def
tracerFactory(factory: () ⇒ Tracer): This
Inherited from AnyRef
Inherited from Any
A handy Builder for constructing Servers (i.e., binding Services to a port). This class is subclassable. Override copy() and build() to do your own dirty work.
The main class to use is com.twitter.finagle.builder.ServerBuilder, as so
The
ServerBuilder
requires the definition ofcodec
,bindTo
andname
. In Scala, these are statically type checked, and in Java the lack of any of the above causes a runtime error.The
build
method uses an implicit argument to statically typecheck the builder (to ensure completeness, see above). The Java compiler cannot provide such implicit, so we provide a separate function in Java to accomplish this. Thus, the Java code for the above isAlternatively, using the
unsafeBuild
method onServerBuilder
verifies the builder dynamically, resulting in a runtime error instead of a compiler error.