skinny.micro

TypedAsyncFeatures

trait TypedAsyncFeatures extends AsyncSupport with TypedAsyncRoutingDsl with AsyncBeforeAfterDsl

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

Self Type
TypedAsyncFeatures with SkinnyMicroBase
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TypedAsyncFeatures
  2. AsyncBeforeAfterDsl
  3. TypedAsyncRoutingDsl
  4. RoutingDslBase
  5. ServletContextAccessor
  6. RicherStringImplicits
  7. ServletApiImplicits
  8. Initializable
  9. UnstableAccessValidationConfig
  10. SkinnyContextInitializer
  11. RouteRegistryAccessor
  12. HaltPassControl
  13. AsyncSupport
  14. AsyncOperations
  15. AnyRef
  16. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait Config extends AnyRef

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

    Definition Classes
    ServletContextAccessorInitializable

Abstract Value Members

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

    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

    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

    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

    The base path for URL generation

    The base path for URL generation

    Attributes
    protected
    Definition Classes
    RoutingDslBase

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def FutureWithContext[A](op: (SkinnyContext) ⇒ A)(implicit ec: ExecutionContext, context: SkinnyContext): Future[A]

    Creates a future with implicit context.

    Creates a future with implicit context.

    A

    response type

    op

    operation inside this future

    ec

    execution context

    context

    context

    returns

    response value

    Definition Classes
    AsyncOperations
  7. def addRoute(method: HttpMethod, transformers: Seq[RouteTransformer], action: (Context) ⇒ AsyncResult): Route

    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
    TypedAsyncRoutingDsl
    See also

    skinny.micro.SkinnyMicroKernel#removeRoute

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

    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
    AsyncBeforeAfterDsl
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def awaitFutures[A](duration: Duration)(fs: Future[A]*)(implicit ec: ExecutionContext): Seq[A]

    Awaits multiple Future's results.

    Awaits multiple Future's results.

    duration

    duration to await futures

    fs

    futures

    ec

    execution context

    returns

    results

    Definition Classes
    AsyncOperations
  11. def before(transformers: RouteTransformer*)(fun: (Context) ⇒ Any): Unit

    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
    AsyncBeforeAfterDsl
  12. def clone(): AnyRef

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

    The configuration, typically a ServletConfig or FilterConfig.

    The configuration, typically a ServletConfig or FilterConfig.

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

    Attributes
    protected
    Definition Classes
    ServletContextAccessorInitializable
  15. def context: SkinnyContext

    Definition Classes
    SkinnyContextInitializer
  16. def contextPath: String

    Definition Classes
    ServletContextAccessor
  17. def delete(transformers: RouteTransformer*)(action: (Context) ⇒ Future[ActionResult]): Route

    Definition Classes
    TypedAsyncRoutingDsl
  18. implicit def enrichRequest(request: HttpServletRequest): RichRequest

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

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

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

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

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

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

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

    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
    TypedAsyncRoutingDsl
  26. final def getClass(): Class[_]

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

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

    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
  29. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  30. def head(transformers: RouteTransformer*)(action: (Context) ⇒ Future[ActionResult]): Route

    Definition Classes
    TypedAsyncRoutingDsl
  31. def initParameter(name: String): Option[String]

    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
  32. def initialize(config: (TypedAsyncFeatures.this)#ConfigT): Unit

    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
  33. def isAsyncExecutable(result: Any): Boolean

    true if async supported

    true if async supported

    Attributes
    protected
    Definition Classes
    AsyncSupport
  34. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  38. def options(transformers: RouteTransformer*)(action: (Context) ⇒ Future[ActionResult]): Route

    Definition Classes
    TypedAsyncRoutingDsl
  39. def pass(): Nothing

    Immediately exits from the current route.

    Immediately exits from the current route.

    Definition Classes
    HaltPassControl
  40. def patch(transformers: RouteTransformer*)(action: (Context) ⇒ Future[ActionResult]): Route

    Definition Classes
    TypedAsyncRoutingDsl
  41. def post(transformers: RouteTransformer*)(action: (Context) ⇒ Future[ActionResult]): Route

    Definition Classes
    TypedAsyncRoutingDsl
  42. def put(transformers: RouteTransformer*)(action: (Context) ⇒ Future[ActionResult]): Route

    Definition Classes
    TypedAsyncRoutingDsl
  43. def request(implicit ctx: SkinnyContext): HttpServletRequest

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

    Definition Classes
    SkinnyContextInitializer
  45. val routes: RouteRegistry

    The routes registered in this kernel.

    The routes registered in this kernel.

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

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

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

    Definition Classes
    ServletContextAccessor
  49. implicit def servletContext: ServletContext

    The servlet context in which this kernel runs.

    The servlet context in which this kernel runs.

    Definition Classes
    ServletContextAccessor
  50. def shutdown(): Unit

    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
  51. def skinnyContext(implicit ctx: ServletContext): SkinnyContext

    Skinny Micro Context

    Skinny Micro Context

    Definition Classes
    SkinnyContextInitializer
  52. implicit def stringToRicherString(s: String): RicherString

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

    Definition Classes
    AnyRef
  54. def toString(): String

    Definition Classes
    AnyRef → Any
  55. def trap(code: Int)(block: (Context) ⇒ Future[ActionResult]): Unit

    Definition Classes
    TypedAsyncRoutingDsl
    See also

    error

  56. def trap(codes: Range)(block: (Context) ⇒ Future[ActionResult]): Unit

    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
    TypedAsyncRoutingDsl
  57. def unstableAccessValidationEnabled: Boolean

    Enables unstable access validation.

    Enables unstable access validation.

    Attributes
    protected
    Definition Classes
    UnstableAccessValidationConfig
  58. def useMostlyStableHttpSession: Boolean

    Enables mostly stable Servlet HttpSession implementation instead.

    Enables mostly stable Servlet HttpSession implementation instead.

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

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

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

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

    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
  63. def withRequestResponse[A](request: HttpServletRequest, response: HttpServletResponse)(f: ⇒ A): A

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

    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

Deprecated Value Members

  1. def futureWithRequest[A](op: (HttpServletRequest) ⇒ A)(implicit ec: ExecutionContext, ctx: SkinnyContext): Future[A]

    Creates a future with implicit request.

    Creates a future with implicit request.

    A

    response type

    op

    operation inside this future

    ec

    execution context

    ctx

    skinny.micro context

    returns

    response value

    Definition Classes
    AsyncOperations
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) Use FutureWithContext { implicit ctx => ... } instead

Inherited from AsyncBeforeAfterDsl

Inherited from TypedAsyncRoutingDsl

Inherited from RoutingDslBase

Inherited from ServletContextAccessor

Inherited from RicherStringImplicits

Inherited from ServletApiImplicits

Inherited from Initializable

Inherited from SkinnyContextInitializer

Inherited from RouteRegistryAccessor

Inherited from HaltPassControl

Inherited from AsyncSupport

Inherited from AsyncOperations

Inherited from AnyRef

Inherited from Any

Ungrouped