Beispiel #1
0
  def initialize(self):
    """ This replaces the standard initialize from Service
    """
    # Build the URLs
    self._url = self._cfg.getURL()
    if not self._url:
      return S_ERROR("Could not build service URL for %s" % GatewayService.GATEWAY_NAME)
    gLogger.verbose("Service URL is %s" % self._url)
    # Load handler
    result = self._loadHandlerInit()
    if not result['OK']:
      return result
    self._handler = result['Value']
    # Discover Handler
    # TODO: remove later
    if useThreadPoolExecutor:
      self._threadPool = ThreadPoolExecutor(max(0, self._cfg.getMaxThreads()))
    else:
      self._threadPool = ThreadPool(1,
                                    max(0, self._cfg.getMaxThreads()),
                                    self._cfg.getMaxWaitingPetitions())
      self._threadPool.daemonize()

    self._msgBroker = MessageBroker("%sMSB" % GatewayService.GATEWAY_NAME, threadPool=self._threadPool)
    self._msgBroker.useMessageObjects(False)
    getGlobalMessageBroker().useMessageObjects(False)
    self._msgForwarder = MessageForwarder(self._msgBroker)
    return S_OK()
Beispiel #2
0
 def initialize(self):
     # Build the URLs
     self._url = self._cfg.getURL()
     if not self._url:
         return S_ERROR("Could not build service URL for %s" % GatewayService.GATEWAY_NAME)
     gLogger.verbose("Service URL is %s" % self._url)
     # Discover Handler
     self._initMonitoring()
     self._threadPool = ThreadPool(1, max(0, self._cfg.getMaxThreads()), self._cfg.getMaxWaitingPetitions())
     self._threadPool.daemonize()
     self._msgBroker = MessageBroker("%sMSB" % GatewayService.GATEWAY_NAME, threadPool=self._threadPool)
     self._msgBroker.useMessageObjects(False)
     getGlobalMessageBroker().useMessageObjects(False)
     self._msgForwarder = MessageForwarder(self._msgBroker)
     return S_OK()
Beispiel #3
0
 def _initialize( self ):
   self.__trid = False
   self.__uniqueName = self.__generateUniqueClientName()
   self.__msgBroker = getGlobalMessageBroker()
   self.__callbacks = {}
   self.__connectExtraParams = {}
   self.__specialCallbacks = { 'drop' : [], 'msg' : [] }
Beispiel #4
0
 def initialize( self ):
   #Build the URLs
   self._url = self._cfg.getURL()
   if not self._url:
     return S_ERROR( "Could not build service URL for %s" % GatewayService.GATEWAY_NAME )
   gLogger.verbose( "Service URL is %s" % self._url )
   #Discover Handler
   self._initMonitoring()
   self._threadPool = ThreadPool( 1,
                                   max( 0, self._cfg.getMaxThreads() ),
                                   self._cfg.getMaxWaitingPetitions() )
   self._threadPool.daemonize()
   self._msgBroker = MessageBroker( "%sMSB" % GatewayService.GATEWAY_NAME, threadPool = self._threadPool )
   self._msgBroker.useMessageObjects( False )
   getGlobalMessageBroker().useMessageObjects( False )
   self._msgForwarder = MessageForwarder( self._msgBroker )
   return S_OK()
Beispiel #5
0
 def _initialize(self):
     self.__trid = False
     self.__transport = None
     self.__uniqueName = self.__generateUniqueClientName()
     self.__msgBroker = getGlobalMessageBroker()
     self.__callbacks = {}
     self.__connectExtraParams = {}
     self.__specialCallbacks = {"drop": [], "msg": []}
     self.__connectionLock = threading.Lock()
Beispiel #6
0
 def initialize( self ):
   """ This replaces the standard initialize from Service
   """
   #Build the URLs
   self._url = self._cfg.getURL()
   if not self._url:
     return S_ERROR( "Could not build service URL for %s" % GatewayService.GATEWAY_NAME )
   gLogger.verbose( "Service URL is %s" % self._url )
   #Load handler
   result = self._loadHandlerInit()
   if not result[ 'OK' ]:
     return result
   self._handler = result[ 'Value' ]
   #Discover Handler
   self._threadPool = ThreadPool( 1,
                                  max( 0, self._cfg.getMaxThreads() ),
                                  self._cfg.getMaxWaitingPetitions() )
   self._threadPool.daemonize()
   self._msgBroker = MessageBroker( "%sMSB" % GatewayService.GATEWAY_NAME, threadPool = self._threadPool )
   self._msgBroker.useMessageObjects( False )
   getGlobalMessageBroker().useMessageObjects( False )
   self._msgForwarder = MessageForwarder( self._msgBroker )
   return S_OK()