Trait

skinny.micro

TypedThreadLocalFeatures

Related Doc: package micro

Permalink

trait TypedThreadLocalFeatures extends MainThreadLocalEverywhere with TypedRoutingDsl with BeforeAfterDsl

Built-in features in SkinnyMicroFilter/SkinnyMicroServlet. These traits should not be mixed in SkinnyMicroBase.

Self Type
TypedThreadLocalFeatures with SkinnyMicroBase
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TypedThreadLocalFeatures
  2. BeforeAfterDsl
  3. TypedRoutingDsl
  4. RoutingDslBase
  5. ServletContextAccessor
  6. RicherStringImplicits
  7. ServletApiImplicits
  8. Initializable
  9. UnstableAccessValidationConfig
  10. RouteRegistryAccessor
  11. HaltPassControl
  12. MainThreadLocalEverywhere
  13. SkinnyContextInitializer
  14. AnyRef
  15. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait Config extends AnyRef

    Permalink
    Definition Classes
    Initializable
  2. abstract type ConfigT <: AnyRef { ... /* 3 definitions in type refinement */ }

    Permalink
    Definition Classes
    ServletContextAccessorInitializable

Abstract Value Members

  1. abstract def error(handler: ErrorHandler): Unit

    Permalink

    Defines an error handler for exceptions thrown in either the before block or a route action.

    Defines an error handler for exceptions thrown in either the before block or a route action.

    If the error handler does not match, the result falls through to the previously defined error handler. The default error handler simply rethrows the exception.

    The error handler is run before the after filters, and the result is rendered like a standard response. It is the error handler's responsibility to set any appropriate status code.

    Definition Classes
    RoutingDslBase
  2. abstract def methodNotAllowed(block: (Set[HttpMethod]) ⇒ Any): Unit

    Permalink

    Defines a block to run if matching routes are found only for other methods.

    Defines a block to run if matching routes are found only for other methods. The set of matching methods is passed to the block.

    Definition Classes
    RoutingDslBase
  3. abstract def notFound(block: ⇒ Any): Unit

    Permalink

    Defines a block to run if no matching routes are found, or if all matching routes pass.

    Defines a block to run if no matching routes are found, or if all matching routes pass.

    Definition Classes
    RoutingDslBase
  4. abstract def routeBasePath(implicit ctx: SkinnyContext): String

    Permalink

    The base path for URL generation

    The base path for URL generation

    Attributes
    protected
    Definition Classes
    RoutingDslBase

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addRoute(method: HttpMethod, transformers: Seq[RouteTransformer], action: ⇒ Any): Route

    Permalink

    Prepends a new route for the given HTTP method.

    Prepends a new route for the given HTTP method.

    Can be overriden so that subtraits can use their own logic. Possible examples: $ - restricting protocols $ - namespace routes based on class name $ - raising errors on overlapping entries.

    This is the method invoked by get(), post() etc.

    Attributes
    protected
    Definition Classes
    TypedRoutingDsl
    See also

    skinny.micro.SkinnyMicroKernel#removeRoute

  5. def after(transformers: RouteTransformer*)(fun: ⇒ Any): Unit

    Permalink

    Adds a filter to run after the route.

    Adds a filter to run after the route. The filter only runs if each routeMatcher returns Some. If the routeMatchers list is empty, the filter runs for all routes.

    Definition Classes
    BeforeAfterDsl
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def asyncDelete(transformers: RouteTransformer*)(action: ⇒ Future[ActionResult]): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  8. def asyncGet(transformers: RouteTransformer*)(action: ⇒ Future[ActionResult]): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  9. def asyncHead(transformers: RouteTransformer*)(action: ⇒ Future[ActionResult]): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  10. def asyncOptions(transformers: RouteTransformer*)(action: ⇒ Future[ActionResult]): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  11. def asyncPatch(transformers: RouteTransformer*)(action: ⇒ Future[ActionResult]): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  12. def asyncPost(transformers: RouteTransformer*)(action: ⇒ Future[ActionResult]): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  13. def asyncPut(transformers: RouteTransformer*)(action: ⇒ Future[ActionResult]): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  14. def asyncTrap(code: Int)(block: ⇒ Future[ActionResult]): Unit

    Permalink
    Definition Classes
    TypedRoutingDsl
  15. def asyncTrap(codes: Range)(block: ⇒ Future[ActionResult]): Unit

    Permalink
    Definition Classes
    TypedRoutingDsl
  16. def before(transformers: RouteTransformer*)(fun: ⇒ Any): Unit

    Permalink

    Adds a filter to run before the route.

    Adds a filter to run before the route. The filter only runs if each routeMatcher returns Some. If the routeMatchers list is empty, the filter runs for all routes.

    Definition Classes
    BeforeAfterDsl
  17. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. var config: (TypedThreadLocalFeatures.this)#ConfigT

    Permalink

    The configuration, typically a ServletConfig or FilterConfig.

    The configuration, typically a ServletConfig or FilterConfig.

    Definition Classes
    ServletContextAccessor
  19. implicit def configWrapper(config: (TypedThreadLocalFeatures.this)#ConfigT): (TypedThreadLocalFeatures.this)#Config { object initParameters }

    Permalink
    Attributes
    protected
    Definition Classes
    ServletContextAccessorInitializable
  20. def context: SkinnyContext

    Permalink
    Definition Classes
    SkinnyContextInitializer
  21. def contextPath: String

    Permalink
    Definition Classes
    ServletContextAccessor
  22. def delete(transformers: RouteTransformer*)(action: ⇒ ActionResult): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  23. implicit def enrichRequest(request: HttpServletRequest): RichRequest

    Permalink
    Definition Classes
    ServletApiImplicits
  24. implicit def enrichResponse(response: HttpServletResponse): RichResponse

    Permalink
    Definition Classes
    ServletApiImplicits
  25. implicit def enrichServletContext(servletContext: ServletContext): RichServletContext

    Permalink
    Definition Classes
    ServletApiImplicits
  26. implicit def enrichSession(session: HttpSession): RichHttpServletSession

    Permalink
    Definition Classes
    ServletApiImplicits
  27. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  29. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. def get(transformers: RouteTransformer*)(action: ⇒ ActionResult): Route

    Permalink

    The SkinnyMicro DSL core methods take a list of skinny.micro.routing.RouteMatcher and a block as the action body.

    The SkinnyMicro DSL core methods take a list of skinny.micro.routing.RouteMatcher and a block as the action body. The return value of the block is rendered through the pipeline and sent to the client as the response body.

    See SkinnyMicroBase#renderResponseBody for the detailed behaviour and how to handle your response body more explicitly, and see how different return types are handled.

    The block is executed in the context of a CoreDsl instance, so all the methods defined in this trait are also available inside the block.

    get("/") {
      <form action="/echo">
        <label>Enter your name</label>
        <input type="text" name="name"/>
      </form>
    }
    
    post("/echo") {
      "hello {params('name)}!"
    }

    SkinnyMicroKernel provides implicit transformation from boolean blocks, strings and regular expressions to skinny.micro.routing.RouteMatcher, so you can write code naturally.

    get("/", request.getRemoteHost == "127.0.0.1") { "Hello localhost!" }
    Definition Classes
    TypedRoutingDsl
  31. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  32. def halt(result: response.ActionResult): Nothing

    Permalink
    Definition Classes
    HaltPassControl
  33. def halt[T](status: Integer = null, body: T = (), headers: Map[String, String] = Map.empty, reason: String = null)(implicit arg0: Manifest[T]): Nothing

    Permalink

    Immediately halts processing of a request.

    Immediately halts processing of a request. Can be called from either a before filter or a route.

    status

    the status to set on the response, or null to leave the status unchanged.

    body

    a result to render through the render pipeline as the body

    headers

    headers to add to the response

    reason

    the HTTP status reason to set, or null to leave unchanged.

    Definition Classes
    HaltPassControl
  34. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  35. def head(transformers: RouteTransformer*)(action: ⇒ ActionResult): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  36. def initParameter(name: String): Option[String]

    Permalink

    Gets an init parameter from the config.

    Gets an init parameter from the config.

    name

    the name of the key

    returns

    an option containing the value of the parameter if defined, or None if the parameter is not set.

    Definition Classes
    ServletContextAccessor
  37. def initialize(config: (TypedThreadLocalFeatures.this)#ConfigT): Unit

    Permalink

    Initializes the kernel.

    Initializes the kernel. Used to provide context that is unavailable when the instance is constructed, for example the servlet lifecycle. Should set the config variable to the parameter.

    config

    the configuration.

    Definition Classes
    ServletContextAccessorInitializable
  38. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  39. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. def options(transformers: RouteTransformer*)(action: ⇒ ActionResult): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  43. def pass(): Nothing

    Permalink

    Immediately exits from the current route.

    Immediately exits from the current route.

    Definition Classes
    HaltPassControl
  44. def patch(transformers: RouteTransformer*)(action: ⇒ ActionResult): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  45. def post(transformers: RouteTransformer*)(action: ⇒ ActionResult): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  46. def put(transformers: RouteTransformer*)(action: ⇒ ActionResult): Route

    Permalink
    Definition Classes
    TypedRoutingDsl
  47. def request(implicit ctx: SkinnyContext): HttpServletRequest

    Permalink
    Definition Classes
    SkinnyContextInitializer
  48. def response(implicit ctx: SkinnyContext): HttpServletResponse

    Permalink
    Definition Classes
    SkinnyContextInitializer
  49. val routes: RouteRegistry

    Permalink

    The routes registered in this kernel.

    The routes registered in this kernel.

    Attributes
    protected
    Definition Classes
    RouteRegistryAccessor
  50. def serverAuthority(implicit ctx: SkinnyContext): String

    Permalink
    Attributes
    protected
    Definition Classes
    ServletContextAccessor
  51. def serverHost(implicit ctx: SkinnyContext): String

    Permalink
    Definition Classes
    ServletContextAccessor
  52. def serverPort(implicit ctx: SkinnyContext): Int

    Permalink
    Definition Classes
    ServletContextAccessor
  53. implicit def servletContext: ServletContext

    Permalink

    The servlet context in which this kernel runs.

    The servlet context in which this kernel runs.

    Definition Classes
    ServletContextAccessor
  54. def shutdown(): Unit

    Permalink

    A hook to shutdown the class.

    A hook to shutdown the class. Bridges the gap between servlet's destroy and filter's destroy.

    Attributes
    protected
    Definition Classes
    Initializable
  55. implicit def skinnyContext(implicit ctx: ServletContext): SkinnyContext

    Permalink

    Skinny Micro Context

    Skinny Micro Context

    Definition Classes
    MainThreadLocalEverywhereSkinnyContextInitializer
  56. implicit def stringToRicherString(s: String): RicherString

    Permalink
    Definition Classes
    RicherStringImplicits
  57. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  58. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  59. def trap(code: Int)(block: ⇒ ActionResult): Unit

    Permalink

    Definition Classes
    TypedRoutingDsl
    See also

    trap

  60. def trap(codes: Range)(block: ⇒ ActionResult): Unit

    Permalink

    Error handler for HTTP response status code range.

    Error handler for HTTP response status code range. You can intercept every response code previously specified with #status or even generic 404 error.

      trap(403) {
       "You are not authorized"
      }
    }*

    }}

    Definition Classes
    TypedRoutingDsl
  61. def unstableAccessValidationEnabled: Boolean

    Permalink

    Enables unstable access validation.

    Enables unstable access validation.

    Attributes
    protected
    Definition Classes
    UnstableAccessValidationConfig
  62. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. def withRequest[A](request: HttpServletRequest)(f: ⇒ A): A

    Permalink

    Executes the block with the given request bound to the request method.

    Executes the block with the given request bound to the request method.

    Attributes
    protected
    Definition Classes
    SkinnyContextInitializer
  66. def withRequestResponse[A](request: HttpServletRequest, response: HttpServletResponse)(f: ⇒ A): A

    Permalink
    Attributes
    protected
    Definition Classes
    SkinnyContextInitializer
  67. def withResponse[A](response: HttpServletResponse)(f: ⇒ A): A

    Permalink

    Executes the block with the given response bound to the response method.

    Executes the block with the given response bound to the response method.

    Attributes
    protected
    Definition Classes
    SkinnyContextInitializer

Inherited from BeforeAfterDsl

Inherited from TypedRoutingDsl

Inherited from RoutingDslBase

Inherited from ServletContextAccessor

Inherited from RicherStringImplicits

Inherited from ServletApiImplicits

Inherited from Initializable

Inherited from RouteRegistryAccessor

Inherited from HaltPassControl

Inherited from MainThreadLocalEverywhere

Inherited from SkinnyContextInitializer

Inherited from AnyRef

Inherited from Any

Ungrouped