fscom.rmiserver: Functions Types Modinfo Source  

RMI / Server

This is the RMI server component.

The server component will manage the handling of multiple clients connecting to the process. The clients will be able to invoke methods from objects registered with RMIRegisterObjectService (see fscom.rmishared) on the server.

To give you further control of the clients, you can register types as service using RMIRegisterTypeService. A new object will then be created for every client that connects. You can also access the client's service registry and call methods on the client.

Functions Summary

RMIRegisterTypeService Register an type as a RMI service.
RMIStartServer Start RMI Server.
RMIUnregistertypeService Remove a service type from the service registry.

Types Summary

TRMIClient Represents an client connected to RMI.

Functions

Function RMIRegisterTypeService(typeName:String , serviceName:String = "")
DescriptionRegister an type as a RMI service.
InformationRegistering an type on a RMI server will make the server creating a new instance for each client.

If the type has a Method OnConnect(client: TRMIClient), this method will be called right after an instance was created by RMI.

If the type has a Method OnDisconnect(), it will be called after the client disconnected and the instance was removed from the RMI service registry.

Use the client object given in the OnConnect method to get client information, the other service instances associated with the same client and remote services of the client.


Function RMIStartServer(port:Short = 55555,executor:TExecutor=Null)
DescriptionStart RMI Server.
InformationThis will start an RMIServer on the given port and will create a timer to poll the network with the given hertz. You'll need to have a WaitSystem/WaitEvent/PollSystem call in your main loop or have polling activated.

Function RMIUnregistertypeService(typeName:String)
DescriptionRemove a service type from the service registry.

Types

Type TRMIClient Abstract
DescriptionRepresents an client connected to RMI.
Methods Summary
GetIp Get the ip of the client.
GetLocalServiceObject Will get the instance of the type service that is associated with the client.
GetPort Get the port of the client.
GetProtocol Get the protocol, the client is using. Will be "tcp" TODO: or "udp"
GetRemoteServiceObject Will get a proxy object of a client's service. Acts like RMIGetServiceObject (see fscom.rmiclient).
GetSharedObject Gets the shared object.
SetSharedObject Sets a shared object associated with the client (e.g. login information)
Method GetIp:Int() Abstract
DescriptionGet the ip of the client.
Method GetLocalServiceObject:Object(name:String) Abstract
DescriptionWill get the instance of the type service that is associated with the client.
Method GetPort:Short() Abstract
DescriptionGet the port of the client.
Method GetProtocol:String() Abstract
DescriptionGet the protocol, the client is using. Will be "tcp" TODO: or "udp"
Method GetRemoteServiceObject:Object(serviceName:String , localProxyClass:String = "") Abstract
DescriptionWill get a proxy object of a client's service. Acts like RMIGetServiceObject (see fscom.rmiclient).
Method GetSharedObject:Object() Abstract
DescriptionGets the shared object.
Method SetSharedObject:Object(obj:Object) Abstract
Returnsthe old shared object.
DescriptionSets a shared object associated with the client (e.g. login information)

Module Information

Version0.2
AuthorFrancesco Silvani
Licensezlib/libpng
History0.2
HistoryAdded TRMITypeService. These services create one object per client and allow callbacks.