Example #1
0
    def __init__ (self, channelname, component=None, domain=None):
        '''
        Constructor.

        Params:
        - channelName is the channel name
        - component is the component this supplier has been instantiated from
        (if applicable). This parameter is likely to become mandatory in future
        version of ACS
        - domain is the name of the domain of notification channels the channel
        belongs to


        Returns: Nothing

        Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
        '''
        
        #Logger for this supplier
        self.logger = getLogger(str(channelname) + "-Supplier")

        #Call the super's constructor
        CommonNC.__init__(self, channelname, component, domain)
        
        #CORBA ref to the channels supplier admin
        self.supplierAdmin = None  
        #CORBA ref to this suppliers structured proxy push consumer
        self.sppc = None
        #number of events sent so far
        self.count = 0

        #Handle all of the CORBA stuff now
        CommonNC.initCORBA(self)
        self.initCORBA()
Example #2
0
    def __init__(self, channelname, component=None, domain=None):
        '''
        Constructor.

        Params:
        - channelName is the channel name
        - component is the component this supplier has been instantiated from
        (if applicable). This parameter is likely to become mandatory in future
        version of ACS
        - domain is the name of the domain of notification channels the channel
        belongs to


        Returns: Nothing

        Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
        '''

        #Logger for this supplier
        self.logger = getLogger(str(channelname) + "-Supplier")

        #Call the super's constructor
        CommonNC.__init__(self, channelname, component, domain)

        #CORBA ref to the channels supplier admin
        self.supplierAdmin = None
        #CORBA ref to this suppliers structured proxy push consumer
        self.sppc = None
        #number of events sent so far
        self.count = 0

        #Handle all of the CORBA stuff now
        CommonNC.initCORBA(self)
        self.initCORBA()
Example #3
0
    def __init__ (self, name, component=None, domain=None):
        '''
        Constructor.

        Params:
        - name is the channel name in string format
        - component is the component this supplier has been instantiated from
        (if applicable). This parameter is likely to become mandatory in future
        version of ACS
        - domain is the name of the domain of notification channels the channel
        belongs to

        Returns: Nothing

        Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
        '''
        self.logger = getLogger(str(name) + "-Consumer")

        #Call the super's constructor
        CommonNC.__init__(self, name, component, domain)
        
        #CORBA ref to the channels consumer admin
        self.consumerAdmin = None  
        #CORBA ref to this consumers structured proxy push supplier
        self.spps = None
        #Dictionary containing handler functions for different object types
        self.handlers = {}
        #dictionary mapping events to the total amount of time they have
        #to finish
        self.handlerTimeoutDict = getEventHandlerTimeoutDict(name)
        #profiler to time how long it takes events to be processed
        self.profiler = Profiler()
        #Is the consumer suspended?
        self.suspended = False
        #Lock used to read & write suspended attribute
        self.lockAction = threading.Lock()
       
        #Handle all of the CORBA stuff now
        CommonNC.initCORBA(self)
        self.initCORBA()
        self.__buffer_max_size = 100
        self.__buffer = Queue.Queue(self.__buffer_max_size);
        self.__stop_thread = False
        self.__thread = Thread(target=self.__process_event)
        self.__thread.setDaemon(True)
        self.__thread.start()