Ejemplo n.º 1
0
    def __init__(self, channelName):
        '''
        Constructor.

        Handles absolutely everything. Once the constructor has been called,
        there is absolutely nothing for the developer to do other than let
        it run.
        
        Parameters:
        - channelName is the name of the channel to connect to

        Raises: ???
        '''
        
        #this member is the total number of events that have been received for
        #this particular channel
        self.count = 0

        #a dictionary where event_type's are the keys and the values are the
        #total number of that type of event received
        self.typeCount = {}

        #just call the superclass constructor
        Consumer.__init__(self, channelName)
        
        #subscribe to ALL events. in theory we could just invoke addSubscription("*")
        #but TAO Notification Service does NOT adhere to the OMG specs in this case.
        self.consumerAdmin.subscription_change([CosNotification.EventType("*", "*")],[])

        #ready to begin processing events
        self.consumerReady()
        return
 def __init__(self, numToExpect, outputFileName, waitBetweenEvents=0):
     '''
     Constructor.
     
     Params:
     - handler
     
     Returns: Nothing
     
     Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
     '''
     Consumer.__init__(self, perftest.NOTIFICATION_STRESS_CHANNEL_NAME)
     self.addSubscription(
         perftest.NotificationServiceStress.NotificationServiceStressEvent)
     self.outputFileName = outputFileName
     if (outputFileName is None):
         self.outputfile = sys.stdout
     else:
         self.outputfile = open(outputFileName, "w")
     self.consumerReady()
     if (numToExpect is None):
         self.numToExpect = 1
     else:
         self.numToExpect = numToExpect
     self.numReceived = 0
     self.waitBetweenEvents = waitBetweenEvents
 def __init__ (self, numToExpect, outputFileName, waitBetweenEvents=0):
     '''
     Constructor.
     
     Params:
     - handler
     
     Returns: Nothing
     
     Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
     '''
     Consumer.__init__(self, perftest.NOTIFICATION_STRESS_CHANNEL_NAME)
     self.addSubscription(perftest.NotificationServiceStress.NotificationServiceStressEvent)
     self.outputFileName = outputFileName
     if(outputFileName is None):
         self.outputfile = sys.stdout
     else:
         self.outputfile = open(outputFileName, "w")
     self.consumerReady()
     if(numToExpect is None):
         self.numToExpect = 1
     else:
         self.numToExpect = numToExpect
     self.numReceived = 0
     self.waitBetweenEvents=waitBetweenEvents
Ejemplo n.º 4
0
    def __init__ (self, handler):
        '''
        Constructor.
        
        Params:
        - handler
        
        Returns: Nothing
        
        Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
        '''
        self.handler = handler

        Consumer.__init__(self, acscommon.ARCHIVING_CHANNEL_NAME)
Ejemplo n.º 5
0
    def __init__(self, channel_name):
        '''
        Constructor.

        Parameters:

        channel_name Channel name.
        '''
        Consumer.__init__(self, channel_name, None)

        self.channel_name = channel_name
        self.rec_file_name = self.channel_name + '.xml' 
        self.rec_file = None
        self.start_time = -1
Ejemplo n.º 6
0
    def __init__(self, handler):
        '''
        Constructor.
        
        Params:
        - handler
        
        Returns: Nothing
        
        Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
        '''
        self.handler = handler

        Consumer.__init__(self, acscommon.ARCHIVING_CHANNEL_NAME, None,
                          acscommon.ACS_NC_DOMAIN_ARCHIVING)