trait HttpClientModuleTrait extends TwitterModule with StackClientModuleTrait[Request, Response, Client]
Extending this trait allows for configuring an com.twitter.finagle.Http.Client and/or a com.twitter.finatra.httpclient.HttpClient.
class MyHttpClientModule extends HttpClientModuleTrait { override def dest: String = "/s/my/service" override def label: String = "myservice" override protected def sessionAcquisitionTimeout: Duration = 1.seconds override protected def requestTimeout: Duration = 5.seconds override protected def retryBudget: RetryBudget = RetryBudget(15.seconds, 5, .1) // if you want to customize the client configuration // you can: // // override def configureClient( // injector: Injector, // client: Http.Client // ): Http.Client = // client. // withTracer(NullTracer) // withStatsReceiver(NullStatsReceiver) // // You can configure TLS on the client directly // // override def configureClient( // injector: Injector, // client: Http.Client // ): Http.Client = client.withTls("yourSslHostName") // // depending on your client type, you may want to provide a global instance, // otherwise you might want to specify how your consumers can provide a binding // for an instance to the client // // ex: // @Provides // @Singleton // final def provideFinagleClient( // injector: Injector, // statsReceiver: StatsReceiver // ): Http.Client = newClient(injector, statsReceiver) // // Or create a service directly // // ex: // @Provides // @Singleton // final def provideMyService( // injector: Injector, // statsReceiver: StatsReceiver // ): Service[Request, Response] = // myCoolFilter.andThen(newService(injector, statsReceiver)) // // Or provide the `com.twitter.finatra.httpclient.HttpClient` // // ex: // @Provides // @Singleton // final def provideMyHttpClient( // injector: Injector, // statsReceiver: StatsReceiver, // mapper: ScalaObjectMapper // ): HttpClient = newHttpClient(injector, statsReceiver, mapper) }
- Note
This trait does not define any
@Provideannotations or bindings.
Example:
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- HttpClientModuleTrait
- StackClientModuleTrait
- TwitterModule
- ScalaModule
- InternalModule
- TwitterBaseModule
- TwitterModuleLifecycle
- Logging
- TwitterModuleFlags
- AbstractModule
- Module
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- class BindingBuilder[T] extends ScalaAnnotatedBindingBuilder[T]
- Definition Classes
- InternalModule
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addError(arg0: Message): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def addError(arg0: Throwable): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def addError(arg0: String, arg1: <repeated...>[AnyRef]): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- Annotations
- @transient()
- def addFlagConverter[T <: AnyRef](typeMatcher: Matcher[_ >: TypeLiteral[_]], F: Flaggable[T]): Unit
- Attributes
- protected
- Definition Classes
- TwitterModule
- def addFlagConverter[T <: AnyRef](implicit arg0: Manifest[T], F: Flaggable[T]): Unit
- Attributes
- protected
- Definition Classes
- TwitterModule
- def addTypeConverter[T](converter: TypeConverter)(implicit arg0: Manifest[T]): Unit
- Attributes
- protected
- Definition Classes
- TwitterModule
- def annotatedWith[A <: Annotation](implicit arg0: ClassTag[A]): Matcher[AnnotatedElement]
- Attributes
- protected[this]
- Definition Classes
- InternalModule
- def asClosable(client: Client): Closable
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def baseClient: Client
- Attributes
- protected
- Definition Classes
- HttpClientModuleTrait → StackClientModuleTrait
- def bind[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): BindingBuilder[T]
- Attributes
- protected[this]
- Definition Classes
- InternalModule
- def bind[T <: AnyRef](arg0: Class[T]): AnnotatedBindingBuilder[T]
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def bind[T <: AnyRef](arg0: TypeLiteral[T]): AnnotatedBindingBuilder[T]
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def bind[T <: AnyRef](arg0: Key[T]): LinkedBindingBuilder[T]
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def bindAssistedFactory[T]()(implicit arg0: Manifest[T]): Unit
- Attributes
- protected
- Definition Classes
- TwitterModule
- def bindConstant(): AnnotatedConstantBindingBuilder
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def bindInterceptor[I <: MethodInterceptor](classMatcher: Matcher[_ >: Class[_]], methodMatcher: Matcher[_ >: AnnotatedElement])(implicit arg0: ClassTag[I]): Unit
- Attributes
- protected[this]
- Definition Classes
- InternalModule
- def bindInterceptor(arg0: Matcher[_ >: Class[_ <: AnyRef] <: AnyRef], arg1: Matcher[_ >: Method <: AnyRef], arg2: <repeated...>[MethodInterceptor]): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- Annotations
- @transient()
- def bindListener(arg0: Matcher[_ >: Binding[_ <: AnyRef] <: AnyRef], arg1: <repeated...>[ProvisionListener]): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- Annotations
- @transient()
- def bindListener(arg0: Matcher[_ >: TypeLiteral[_ <: AnyRef] <: AnyRef], arg1: TypeListener): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def bindMultiple[T](annotation: Annotation)(implicit arg0: Manifest[T]): ScalaMultibinder[T]
- Attributes
- protected
- Definition Classes
- TwitterModule
- def bindMultiple[T, A <: Annotation](implicit arg0: Manifest[T], arg1: Manifest[A]): ScalaMultibinder[T]
- Attributes
- protected
- Definition Classes
- TwitterModule
- def bindMultiple[T](implicit arg0: Manifest[T]): ScalaMultibinder[T]
- Attributes
- protected
- Definition Classes
- TwitterModule
- def bindOption[T](annotation: Annotation)(implicit arg0: Manifest[T]): ScalaOptionBinder[T]
- Attributes
- protected
- Definition Classes
- TwitterModule
- def bindOption[T, A <: Annotation](implicit arg0: Manifest[T], arg1: Manifest[A]): ScalaOptionBinder[T]
- Attributes
- protected
- Definition Classes
- TwitterModule
- def bindOption[T](implicit arg0: Manifest[T]): ScalaOptionBinder[T]
- Attributes
- protected
- Definition Classes
- TwitterModule
- def bindScope[T <: Annotation](scope: Scope)(implicit arg0: ClassTag[T]): Unit
- Attributes
- protected[this]
- Definition Classes
- InternalModule
- def bindScope(arg0: Class[_ <: Annotation], arg1: Scope): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def binder(): Binder
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def binderAccess: Binder
- Attributes
- protected[this]
- Definition Classes
- ScalaModule → InternalModule
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def configure(): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- final def configure(arg0: Binder): Unit
- Definition Classes
- AbstractModule → Module
- def configureClient(injector: Injector, client: Client): Client
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- def convertToTypes(arg0: Matcher[_ >: TypeLiteral[_ <: AnyRef] <: AnyRef], arg1: TypeConverter): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- final def createFlag[T](name: String, default: T, help: String, flaggable: Flaggable[T]): Flag[T]
- Definition Classes
- TwitterModuleFlags
- final def createMandatoryFlag[T](name: String, help: String, usage: String, flaggable: Flaggable[T]): Flag[T]
- Definition Classes
- TwitterModuleFlags
- def currentStage(): Stage
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def debug(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def debug(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def debug(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def debug(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def debugResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging
- def defaultClosableAwaitPeriod: Duration
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- def defaultClosableGracePeriod: Duration
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- def defaultHeaders: Map[String, String]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def error(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def error(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def error(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def error(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def errorResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging
- def failfastOnFlagsNotParsed: Boolean
- Attributes
- protected[this]
- Definition Classes
- TwitterModuleFlags
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def flag[T](name: String, help: String)(implicit arg0: Flaggable[T], arg1: Manifest[T]): Flag[T]
- Definition Classes
- TwitterModuleFlags
- final def flag[T](name: String, default: T, help: String)(implicit arg0: Flaggable[T]): Flag[T]
- Definition Classes
- TwitterModuleFlags
- val flags: ArrayBuffer[Flag[_]]
- Attributes
- protected[inject]
- Definition Classes
- TwitterModuleFlags
- def frameworkConfigureClient(injector: Injector, client: Client): Client
- Attributes
- protected[twitter]
- Definition Classes
- StackClientModuleTrait
- def frameworkModules: Seq[Module]
- Attributes
- protected[inject]
- Definition Classes
- StackClientModuleTrait → TwitterBaseModule
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getMembersInjector[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MembersInjector[T]
- Attributes
- protected[this]
- Definition Classes
- InternalModule
- def getMembersInjector[T <: AnyRef](arg0: TypeLiteral[T]): MembersInjector[T]
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def getMembersInjector[T <: AnyRef](arg0: Class[T]): MembersInjector[T]
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def getProvider[T](implicit arg0: ClassTag[T]): Provider[T]
- Attributes
- protected[this]
- Definition Classes
- InternalModule
- def getProvider[T <: AnyRef](arg0: Class[T]): Provider[T]
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def getProvider[T <: AnyRef](arg0: Key[T]): Provider[T]
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hostname: String
- def info(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def info(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def info(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def info(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def infoResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging
- def initialClientConfiguration(injector: Injector, client: Client, statsReceiver: StatsReceiver): Client
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- def install(module: Module): Unit
- Attributes
- protected
- Definition Classes
- TwitterModule → AbstractModule
- Annotations
- @throws(scala.this.throws.<init>$default$1[UnsupportedOperationException])
- def isDebugEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isDebugEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isErrorEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isErrorEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isInfoEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isInfoEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isTraceEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isTraceEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isWarnEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isWarnEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def javaModules: Collection[Module]
- Attributes
- protected[inject]
- Definition Classes
- TwitterBaseModule
- final def logger: Logger
- Attributes
- protected[this]
- Definition Classes
- Logging
- final def loggerName: String
- Attributes
- protected[this]
- Definition Classes
- Logging
- def modules: Seq[Module]
- Attributes
- protected[inject]
- Definition Classes
- TwitterBaseModule
- def monitor: Monitor
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def newClient(injector: Injector, statsReceiver: StatsReceiver): Client
- Definition Classes
- HttpClientModuleTrait → StackClientModuleTrait
- final def newHttpClient(injector: Injector, statsReceiver: StatsReceiver, mapper: ScalaObjectMapper): HttpClient
- final def newService(injector: Injector, statsReceiver: StatsReceiver): Service[Request, Response]
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def onExit(f: => Unit): Unit
- Attributes
- protected
- Definition Classes
- TwitterModuleLifecycle
- def requestInjection(arg0: AnyRef): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def requestStaticInjection[T]()(implicit arg0: ClassTag[T]): Unit
- Attributes
- protected[this]
- Definition Classes
- InternalModule
- def requestStaticInjection(arg0: <repeated...>[Class[_ <: AnyRef]]): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- Annotations
- @transient()
- def requestTimeout: Duration
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- def requireBinding(arg0: Class[_ <: AnyRef]): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def requireBinding(arg0: Key[_ <: AnyRef]): Unit
- Attributes
- protected[google.inject]
- Definition Classes
- AbstractModule
- def retryBudget: RetryBudget
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- def retryPolicy: Option[RetryPolicy[Try[Response]]]
- def scopeStatsReceiver(injector: Injector, statsReceiver: StatsReceiver): StatsReceiver
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- def sessionAcquisitionTimeout: Duration
- Attributes
- protected
- Definition Classes
- StackClientModuleTrait
- def singletonPostWarmupComplete(injector: Injector): Unit
- Attributes
- protected[inject]
- Definition Classes
- TwitterModuleLifecycle
- def singletonShutdown(injector: Injector): Unit
- Attributes
- protected[inject]
- Definition Classes
- TwitterModuleLifecycle
- def singletonStartup(injector: Injector): Unit
- Attributes
- protected[inject]
- Definition Classes
- TwitterModuleLifecycle
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def trace(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def trace(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def trace(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def trace(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def traceResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def warn(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def warn(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def warn(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def warn(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def warnResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging