示例#1
0
文件: QoS.py 项目: jjpopski/ACS
def setORBTimeout(timeout):
    """
    Sets the timeout (in milliseconds) at the ORB level, affecting all method 
    invocations within the ORB.
    """
    setClientCallTimeout(timeout)
    return
示例#2
0
文件: QoS.py 项目: jjpopski/ACS
def resetORBTimeout():
    """
    Resets (to zero) the ORB timeout, affecting all method invocations within 
    the ORB (sets to no timeout).
    """
    setClientCallTimeout(0)
    return
示例#3
0
def resetORBTimeout():
    '''
    Resets (to zero) the ORB timeout, affecting all method invocations within 
    the ORB (sets to no timeout).
    '''
    setClientCallTimeout(0)
    return
示例#4
0
文件: QoS.py 项目: jjpopski/ACS
def resetObjectTimeout(objref):
    """
    Resets the timeout (to zero) for calls to the given CORBA object (sets to
    no timeout).
    """
    setClientCallTimeout(objref, 0)
    return
示例#5
0
def setORBTimeout(timeout):
    '''
    Sets the timeout (in milliseconds) at the ORB level, affecting all method 
    invocations within the ORB.
    '''
    setClientCallTimeout(timeout)
    return
示例#6
0
def resetObjectTimeout(objref):
    '''
    Resets the timeout (to zero) for calls to the given CORBA object (sets to
    no timeout).
    '''
    setClientCallTimeout(objref, 0)
    return
示例#7
0
文件: QoS.py 项目: jjpopski/ACS
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
示例#8
0
文件: QoS.py 项目: tstaig/ACS
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
示例#9
0
 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)
示例#10
0
文件: QoS.py 项目: jjpopski/ACS
 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
示例#11
0
文件: QoS.py 项目: tstaig/ACS
 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
示例#12
0
文件: QoS.py 项目: jjpopski/ACS
 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
示例#13
0
文件: QoS.py 项目: tstaig/ACS
 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
示例#14
0
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
示例#15
0
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