Exemplo n.º 1
0
Arquivo: QoS.py Projeto: jjpopski/ACS
def setORBTimeout(timeout):
    """
    Sets the timeout (in milliseconds) at the ORB level, affecting all method 
    invocations within the ORB.
    """
    setClientCallTimeout(timeout)
    return
Exemplo n.º 2
0
Arquivo: QoS.py Projeto: jjpopski/ACS
def resetORBTimeout():
    """
    Resets (to zero) the ORB timeout, affecting all method invocations within 
    the ORB (sets to no timeout).
    """
    setClientCallTimeout(0)
    return
Exemplo n.º 3
0
def resetORBTimeout():
    '''
    Resets (to zero) the ORB timeout, affecting all method invocations within 
    the ORB (sets to no timeout).
    '''
    setClientCallTimeout(0)
    return
Exemplo n.º 4
0
Arquivo: QoS.py Projeto: 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
Exemplo n.º 5
0
def setORBTimeout(timeout):
    '''
    Sets the timeout (in milliseconds) at the ORB level, affecting all method 
    invocations within the ORB.
    '''
    setClientCallTimeout(timeout)
    return
Exemplo n.º 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
Exemplo n.º 7
0
Arquivo: QoS.py Projeto: 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
Exemplo n.º 8
0
Arquivo: QoS.py Projeto: 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
Exemplo n.º 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)
Exemplo n.º 10
0
Arquivo: QoS.py Projeto: 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
Exemplo n.º 11
0
Arquivo: QoS.py Projeto: 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
Exemplo n.º 12
0
Arquivo: QoS.py Projeto: 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
Exemplo n.º 13
0
Arquivo: QoS.py Projeto: 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
Exemplo n.º 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
Exemplo n.º 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