scistag.webstag.server.class_service_entry.WebClassServiceEntry¶
- class WebClassServiceEntry(class_type, multithread=False, parameters=None)[source]¶
Bases:
objectDefines the class entry for a single class which is published via http.
It converts the http request parameters to object method parameters, calls the method if it is available and afterwards bundles the method’s results to a http response again.
- Parameters
class_type (type) – The type of the class to be instantiated
multithread (bool) – Defines if the class is multithread secure and can be used in parallel
parameters (dict | None) –
The parameters to be passed to the object’s constructor
Note that these value will be kept and passed on upon first use of the object’s services.
Methods
Executes the object's method by unwrapping all input parameters to
Prepares the service and evaluate all available methods
Attributes
__dict____doc____module____weakref__list of weak references to the object (if defined)
The type of the class to construct for this service
The parameters to be passed to the object's initializer
Lock for the first initialization of an object
Lock for the execution of the object (if not multi-threading capable)
Flag if this service is setup
The object instance - will be created upon first use of the service
Defines if the service can be access from multiple threads
The methods the object implements
- execute(request)[source]¶
- Executes the object’s method by unwrapping all input parameters to
the function’s parameter list and vice versa all function results back to content returnable via http.
- Parameters
request (
WebRequest) – The http request details- Return type
- Returns
The http response
- _init_lock¶
Lock for the first initialization of an object
- access_lock¶
Lock for the execution of the object (if not multi-threading capable)
- class_type¶
The type of the class to construct for this service
- main_object¶
The object instance - will be created upon first use of the service
- multithread¶
Defines if the service can be access from multiple threads
- parameters¶
The parameters to be passed to the object’s initializer
- prepared¶
Flag if this service is setup