Package omero :: Package gateway :: Class ProxyObjectWrapper
[hide private]
[frames] | no frames]

Class ProxyObjectWrapper

source code


Wrapper for services. E.g. Admin Service, Delete Service etc. Maintains reference to connection. Handles creation of service when requested.

Instance Methods [hide private]
 
__init__(self, conn, func_str)
Initialisation of proxy object wrapper.
source code
ProxyObjectWrapper
clone(self)
Creates and returns a new ProxyObjectWrapper with the same connection and service creation method name as this one.
source code
Boolean
_connect(self, forcejoin=False)
Returns True if connected.
source code
 
taint(self)
Sets the tainted flag to True
source code
 
untaint(self)
Sets the tainted flag to False
source code
 
close(self)
Closes the underlaying service, so next call to the proxy will create a new instance of it.
source code
 
_resyncConn(self, conn)
Reset refs to connection and session factory.
source code
omero.api.ServiceInterface subclass
_getObj(self)
Returns the wrapped service.
source code
Boolean
_ping(self)
For some reason, it seems that keepAlive doesn't, so every so often I need to recreate the objects.
source code
 
__getattr__(self, attr)
Returns named attribute of the wrapped service.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, conn, func_str)
(Constructor)

source code 

Initialisation of proxy object wrapper.

Parameters:
  • conn (BlitzGateway) - The BlitzGateway connection
  • func_str (String) - The name of the service creation method. E.g 'getAdminService'
Overrides: object.__init__

clone(self)

source code 

Creates and returns a new ProxyObjectWrapper with the same connection and service creation method name as this one.

Returns: ProxyObjectWrapper
Cloned service wrapper

_connect(self, forcejoin=False)

source code 

Returns True if connected. If connection OK, wrapped service is also created.

Parameters:
  • forcejoin (Boolean) - if True forces the connection to only succeed if we can rejoin the current sessionid
Returns: Boolean
True if connection OK

_resyncConn(self, conn)

source code 

Reset refs to connection and session factory. Resets session creation function. Attempts to reload the wrapped service - if already created (doesn't create service)

Parameters:

_getObj(self)

source code 

Returns the wrapped service. If it is None, service is created.

Returns: omero.api.ServiceInterface subclass
The wrapped service

_ping(self)

source code 

For some reason, it seems that keepAlive doesn't, so every so often I need to recreate the objects. Calls serviceFactory.keepAlive(service). If this returns false, attempt to create service.

Returns: Boolean
True if no exception thrown

__getattr__(self, attr)
(Qualification operator)

source code 

Returns named attribute of the wrapped service. If attribute is a method, the method is wrapped to handle exceptions, connection etc.

Parameters:
  • attr (String) - Attribute name
Returns:
Attribute or wrapped method