Class TRequestBroker (unit RBroker) |
TComponent
:The RequestBroker (ORB) main job is to instanciate objects to satisfy client requests, passing to the object the parameters from the request and giving the result back to the client when the object has finished. A request is made of a function code, a space and some parameters in a special format (TMWBuffer). The RequestBroker object is linked to the application server object and receive client requests from him, brokening those requests and dispatching them to server objects for execution.
Constructors |
Functions |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Properties |
Events |
Variables |
Constructors |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Functions |
:AddServerObject is called from the main application server code, at startup to build the request broker object table. This table associates objects and request. Each server object has a functions code (which default to the server object name without the leading TServerObject). Note hat the argument for AddServerObject is an object class, not an object instance.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
:BrokeRequest is the ORB main method. This is the method which does all the work: creack header, find and instanciate server object, execute server object code and send result back to the client.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
:This method is used to enumerate all server functions. The mains purpose is to built some way to display all the server functionnalities such as function code list.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
:A client request is constitued of two parts: a function code and some parameters. The CrackHeader method is responsible to split both parts. By default, it consider the function code to be the first word in the data received from the client and the parameter being the remaining data after this function code and any trailing spaces. You can overrie this method if you like to have a more complex headder for example to pass more info from the client to the server.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { Extract the function code and separate parameters from header
:Find a server object by using function code as a key. Returns the server object index in the table of object.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { Find a FunctionCode in the FObjectList and return the item index or -1 } { if function code not found.
:Remove an object from the obejct list.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { Remove a FunctionCode from FObjectList. Return 0 if Ok, -1 if not found
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Returned parameters length
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Properties |
:Used to store permanent data.
:UserData is not used by the request broker nor the application server component. It is there for the application server's writer to pass global data between the main application server code and each server object, such as TTable of any other data.
:Number of currently instanciated server objects.
Events |
:Triggered when the component need to display something on the user interface such as error or informatinal messages.
:Triggered when an object has been instanciated.
:Triggered when an object has been destroyed.
Variables |
:Just passed to ServerObject instances.
:Number of instanciated objects.
:List of all TDispatchObject.
:Triggered when an object has been instanciated.
:Triggered when an object has been destroyed.
:Just passed to ServerObject instances.