Package omero :: Package util :: Class Server
[hide private]
[frames] | no frames]

Class Server

source code


Basic server implementation which can be used for implementing a standalone python server which can be started from icegridnode.

The servant implementation MUST have a constructor which takes a single ServerContext argument AND have a cleanup() method

Logging is configured relative to the current directory to be in var/log by default.

Usage:

   if __name__ == "__main__":
       app=Server(ServicesI, "ServicesAdapter", Ice.Identity("Services",""))
       sys.exit(app.main(sys.argv))

app.impl now points to an instance of ServicesI

Instance Methods [hide private]
 
__init__(self, impl_class, adapter_name, identity, logdir=LOGDIR, dependencies=())
The constructor accepts an optional argument indicating whether to handle signals.
source code
 
waitOnStartup(self) source code
 
run(self, args)
This method must be overridden in a subclass.
source code
 
cleanup(self)
Cleans up all resources that were created by this server.
source code

Inherited from Ice.Application: doMain, interruptCallback, main

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from Ice.Application: appName, callbackOnInterrupt, communicator, destroyOnInterrupt, holdInterrupt, ignoreInterrupt, interrupted, releaseInterrupt, shutdownOnInterrupt

Inherited from Ice.Application (private): _callbackOnInterruptCallback, _destroyOnInterruptCallback, _holdInterruptCallback, _shutdownOnInterruptCallback

Class Variables [hide private]

Inherited from Ice.Application: HandleSignals, NoSignalHandling

Inherited from Ice.Application (private): _appName, _application, _callbackInProgress, _communicator, _condVar, _ctrlCHandler, _destroyed, _interrupted, _previousCallback, _released, _signalPolicy

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, impl_class, adapter_name, identity, logdir=LOGDIR, dependencies=())
(Constructor)

source code 

The constructor accepts an optional argument indicating whether to handle signals. The value should be either Application.HandleSignals (the default) or Application.NoSignalHandling.

Overrides: object.__init__
(inherited documentation)

run(self, args)

source code 

This method must be overridden in a subclass. The base class supplies an argument list from which all Ice arguments have already been removed. The method returns an integer exit status (0 is success, non-zero is failure).

Overrides: Ice.Application.run
(inherited documentation)

cleanup(self)

source code 

Cleans up all resources that were created by this server. Primarily the one servant instance.