Thread dedicated to a single request

Introduced properties

type A: RestfulAction

nitcorn :: RestfulTask :: A

Type of action
fun action: A

nitcorn :: RestfulTask :: action

Receiver action
protected fun action=(action: A)

nitcorn :: RestfulTask :: action=

Receiver action
init defaultinit(action: A, request: HttpRequest, http_server: HttpServer)

nitcorn :: RestfulTask :: defaultinit

fun http_server: HttpServer

nitcorn :: RestfulTask :: http_server

Server handling the request
protected fun http_server=(http_server: HttpServer)

nitcorn :: RestfulTask :: http_server=

Server handling the request
protected abstract fun indirect_restful_method: HttpResponse

nitcorn :: RestfulTask :: indirect_restful_method

Indirection to the real method in action
fun request: HttpRequest

nitcorn :: RestfulTask :: request

Request that created this thread
protected fun request=(request: HttpRequest)

nitcorn :: RestfulTask :: request=

Request that created this thread

Redefined properties

redef type SELF: RestfulTask

nitcorn $ RestfulTask :: SELF

Type of this instance, automatically specialized in every class
redef fun main

nitcorn $ RestfulTask :: main

Main method of this task

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type A: RestfulAction

nitcorn :: RestfulTask :: A

Type of action
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun action: A

nitcorn :: RestfulTask :: action

Receiver action
protected fun action=(action: A)

nitcorn :: RestfulTask :: action=

Receiver action
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
init defaultinit(action: A, request: HttpRequest, http_server: HttpServer)

nitcorn :: RestfulTask :: defaultinit

fun gdk_main: Bool

core :: Task :: gdk_main

Small unit of code executed by the GDK loop when idle
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun http_server: HttpServer

nitcorn :: RestfulTask :: http_server

Server handling the request
protected fun http_server=(http_server: HttpServer)

nitcorn :: RestfulTask :: http_server=

Server handling the request
protected abstract fun indirect_restful_method: HttpResponse

nitcorn :: RestfulTask :: indirect_restful_method

Indirection to the real method in action
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun main

core :: Task :: main

Main method of this task
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun request: HttpRequest

nitcorn :: RestfulTask :: request

Request that created this thread
protected fun request=(request: HttpRequest)

nitcorn :: RestfulTask :: request=

Request that created this thread
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram nitcorn::RestfulTask RestfulTask core::Task Task nitcorn::RestfulTask->core::Task core::Object Object core::Task->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

interface Task

core :: Task

Task with a main method to be implemented by subclasses

Class definitions

nitcorn $ RestfulTask
# Thread dedicated to a single `request`
abstract class RestfulTask
	super Task

	# Type of `action`
	type A: RestfulAction

	# Receiver action
	var action: A

	# Request that created this thread
	var request: HttpRequest

	# Server handling the `request`
	var http_server: HttpServer

	# Indirection to the real method in `action`
	protected fun indirect_restful_method: HttpResponse is abstract

	redef fun main
	do
		var response = indirect_restful_method
		http_server.respond response
		http_server.close
	end
end
lib/nitcorn/restful.nit:94,1--119,3