def setORBTimeout(timeout): """ Sets the timeout (in milliseconds) at the ORB level, affecting all method invocations within the ORB. """ setClientCallTimeout(timeout) return
def resetORBTimeout(): """ Resets (to zero) the ORB timeout, affecting all method invocations within the ORB (sets to no timeout). """ setClientCallTimeout(0) return
def resetORBTimeout(): ''' Resets (to zero) the ORB timeout, affecting all method invocations within the ORB (sets to no timeout). ''' setClientCallTimeout(0) return
def resetObjectTimeout(objref): """ Resets the timeout (to zero) for calls to the given CORBA object (sets to no timeout). """ setClientCallTimeout(objref, 0) return
def setORBTimeout(timeout): ''' Sets the timeout (in milliseconds) at the ORB level, affecting all method invocations within the ORB. ''' setClientCallTimeout(timeout) return
def resetObjectTimeout(objref): ''' Resets the timeout (to zero) for calls to the given CORBA object (sets to no timeout). ''' setClientCallTimeout(objref, 0) return
def setObjectTimeout(objref, timeout): """ Sets timeout (in milliseconds) on the given CORBA object. Future calls on the CORBA object will have this timeout, receiving an exception if the call takes longer than the timeout value. """ setClientCallTimeout(objref, timeout) return
def setObjectTimeout(objref, timeout): ''' Sets timeout (in milliseconds) on the given CORBA object. Future calls on the CORBA object will have this timeout, receiving an exception if the call takes longer than the timeout value. ''' setClientCallTimeout(objref, timeout) return
def _breakConnection(self, identifier, uses, provides): log.debug("Breaking connection '%s'", identifier) omniORB.setClientCallTimeout(1500) try: usesPort = uses.getReference() usesPort.disconnectPort(identifier) except: log.warn("Ignoring exception breaking connection '%s'", identifier) omniORB.setClientCallTimeout(0) uses.disconnected(identifier) provides.disconnected(identifier)
def set(self, timeout=0): """ Sets the timeout value. Parameters: - timeout the timeout to be set (a long), expressed in milliseconds. Returns: Nothing Raises: Nothing """ self.timeout = timeout setClientCallTimeout(self.timeout) return
def set(self, timeout=0): ''' Sets the timeout value. Parameters: - timeout the timeout to be set (a long), expressed in milliseconds. Returns: Nothing Raises: Nothing ''' self.timeout = timeout setClientCallTimeout(self.timeout) return
def reset(self): """ Resets the timeout (presently forces it to zero). It should work in such a way that it resets the timeout to the previous value, but the orb implementation does not support functionality to retrieve the previously set timeout. So it sets timeout to 0 which means no timeout. Parameters: Nothing Returns: Nothing Raises: Nothing """ setClientCallTimeout(0) return
def reset(self): ''' Resets the timeout (presently forces it to zero). It should work in such a way that it resets the timeout to the previous value, but the orb implementation does not support functionality to retrieve the previously set timeout. So it sets timeout to 0 which means no timeout. Parameters: Nothing Returns: Nothing Raises: Nothing ''' setClientCallTimeout(0) return
try: from omniORB import CORBA import CosNaming from . import CARESS from . import _GlobalIDL # pylint: disable=unused-import import omniORB sys.modules['CARESS'] = sys.modules['nicos.devices.vendor.caress.CARESS'] sys.modules['ABSDEV'] = sys.modules[ 'nicos.devices.vendor.caress._GlobalIDL'] omniORB.updateModule('CARESS') omniORB.updateModule('ABSDEV') # Clear client timeout to avoid some timeouts due to waitings in CARESS omniORB.setClientCallTimeout(0) # omniORB.setClientThreadCallTimeout(0) # omniORB.setClientConnectTimeout(0) except ImportError: omniORB = None CORBA_DEVICE = 500 LOADMASTER = 14 LOADSLAVE = 15 RESETMODULE = 16 SPECIALLOAD = 18 MODULE_ERROR = -1 NOT_ACTIVE = 1 ACTIVE = 2
def copy_ref_with_timeout(objref,timeout): """ Return a copy of the remote object reference with a client timeout set to it (in seconds).""" objref = objref._duplicate(objref) #make a copy of the obj's reference to assign a timeout to it omniORB.setClientCallTimeout(objref,timeout*miliseconds) return objref