Skip to content

Commit

Permalink
improved thread pool profile parametrization
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecastro05 committed Sep 6, 2021
1 parent e0ed676 commit eb34cfc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
Binary file removed dist/camel-xml2dsl-0.0.10.tar.gz
Binary file not shown.
Binary file removed dist/camel_xml2dsl-0.0.10-py3-none-any.whl
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = camel-xml2dsl
version = 0.0.10
version = 0.0.11
author = Jorge Castro
author_email = [email protected]
description = xml definition to dsl definition routes
Expand Down
2 changes: 1 addition & 1 deletion src/camel_xml2dsl.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: camel-xml2dsl
Version: 0.0.10
Version: 0.0.11
Summary: xml definition to dsl definition routes
Home-page: https://github.com/jorgecastro05/script-aro.git
Author: Jorge Castro
Expand Down
15 changes: 8 additions & 7 deletions src/xml2dsl/xml2dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,19 +284,20 @@ def delay_def(self, node):
def threadPoolProfile_def(self, node):
profileDef = '\nThreadPoolProfile profile = new ThreadPoolProfile();'
if 'defaultProfile' in node.attrib:
profileDef += '\nprofile.setDefaultProfile(true);'
profileDef += '\nprofile.setDefaultProfile('+ node.attrib['defaultProfile']+');'
if 'id' in node.attrib:
profileDef += '\nprofile.setId("threadPoolCrw15");'
profileDef += '\nprofile.setId("'+ node.attrib['id']+'");'
if 'keepAliveTime' in node.attrib:
profileDef += '\nprofile.setKeepAliveTime(25L);'
profileDef += '\nprofile.setKeepAliveTime('+ node.attrib['keepAliveTime']+'L);'
if 'maxPoolSize' in node.attrib:
profileDef += '\nprofile.setMaxPoolSize(15);'
profileDef += '\nprofile.setMaxPoolSize('+ node.attrib['maxPoolSize'] +');'
if 'maxQueueSize' in node.attrib:
profileDef += '\nprofile.setMaxQueueSize(250);'
profileDef += '\nprofile.setMaxQueueSize('+ node.attrib['maxQueueSize']+');'
if 'poolSize' in node.attrib:
profileDef += '\nprofile.setPoolSize(5);'
profileDef += '\nprofile.setPoolSize('+ node.attrib['poolSize']+');'
if 'rejectedPolicy' in node.attrib:
profileDef += '\nprofile.setRejectedPolicy(ThreadPoolRejectedPolicy.Abort);'
if node.attrib['rejectedPolicy'] == 'Abort':
profileDef += '\nprofile.setRejectedPolicy(ThreadPoolRejectedPolicy.Abort);'
return profileDef

if __name__ == "__main__":
Expand Down

0 comments on commit eb34cfc

Please sign in to comment.