Permalink
Browse files

Add the ability to pass a config node into the processor

  • Loading branch information...
Gavin M. Roy
Gavin M. Roy committed Dec 13, 2009
1 parent a185473 commit 825f117d43c6096d4f82f49ece59c6016ef5f903
Showing with 6 additions and 5 deletions.
  1. +6 −5 rejected.py
View
@@ -215,11 +215,12 @@ def run( self ):
processor_class = getattr(processor_module.__dict__[file_parts[len(file_parts)-1]], class_name)
logging.info( '%s: Creating message processor: %s.%s' %
( self.getName(), import_name, class_name ) )
- self.processor = processor_class()
-
- # If there is a config section for the binding, then try and pass it in
-# if self.config['Bindings'][self.binding_name].has_key(config):
-# if
+
+ # If we have a config, pass it in to the constructor
+ if self.config['Bindings'][self.binding_name].has_key('config'):
+ self.processor = processor_class(self.config['Bindings'][self.binding_name]['config'])
+ else:
+ self.processor = processor_class()
# Assign the port to monitor the queues on
self.monitor_port = self.config['Connections'][self.connect_name]['monitor_port']

0 comments on commit 825f117

Please sign in to comment.