From aa5e1701bf4dcbedaeebee3bc6133c95126a2572 Mon Sep 17 00:00:00 2001 From: logicoyparam Date: Wed, 31 Jul 2013 13:57:08 +0530 Subject: [PATCH] Archtype Projects extracted from zip for --- .../pom.xml | 43 ++ .../META-INF/maven/archetype-metadata.xml | 81 +++ .../resources/archetype-resources/build.xml | 72 +++ .../build/generated-sources/archetype/pom.xml | 38 ++ .../deploy-plugin/nbproject/build-impl.xml | 33 + .../deploy-plugin/nbproject/project.xml | 146 +++++ .../test/java/enginetest/test1Input.xml | 18 + .../test/java/enginetest/test2Input.xml | 18 + .../archetype-resources/test/testSA/build.xml | 143 +++++ .../test/testSA/src/META-INF/jbi.xml | 47 ++ .../test/testSA/testSUBC/build.xml | 77 +++ .../testSUBC/build/testSUBC/META-INF/jbi.xml | 20 + .../test/testSA/testSUBC/src/META-INF/jbi.xml | 20 + .../test/testSA/testSUSE/build.xml | 77 +++ .../testSUSE/build/testSUSE/META-INF/jbi.xml | 20 + .../test/testSA/testSUSE/src/META-INF/jbi.xml | 20 + .../deploy-plugin/build.xml | 11 + .../deploy-plugin/manifest.mf | 6 + .../deploy-plugin/nbproject/build-impl.xml | 30 + .../nbproject/genfiles.properties | 11 + .../nbproject/platform.properties | 4 + .../private/platform-private.properties | 4 + .../nbproject/project.properties | 7 + .../deploy-plugin/nbproject/project.xml | 151 +++++ ...pi.project.support.ant.AntBasedProjectType | 1 + ...spi.queries.CollocationQueryImplementation | 1 + .../openesb/component/cname/Bundle.properties | 15 + .../src/net/openesb/component/cname/layer.xml | 29 + .../component/cname/project/Bundle.properties | 4 + .../cname/project/SEPluginProject.java | 408 +++++++++++++ .../SEPluginProjectActionProvider.java | 136 +++++ .../project/SEPluginProjectGenerator.java | 182 ++++++ .../SEPluginProjectLogicalViewProvider.java | 81 +++ .../project/SEPluginProjectOperations.java | 114 ++++ .../project/SEPluginProjectProperties.java | 149 +++++ .../cname/project/SEPluginProjectType.java | 55 ++ .../project/customizer/Bundle.properties | 19 + .../project/customizer/CustomizerGeneral.form | 128 ++++ .../project/customizer/CustomizerGeneral.java | 178 ++++++ .../project/customizer/CustomizerPackage.form | 117 ++++ .../project/customizer/CustomizerPackage.java | 114 ++++ .../SEPluginProjectCustomizerModel.java | 125 ++++ .../SEPluginProjectCustomizerProvider.java | 230 +++++++ .../cname/project/node/Bundle.properties | 16 + .../project/node/SEPluginProjectNode.java | 350 +++++++++++ .../cname/project/resources/build-impl.xsl | 208 +++++++ .../cname/project/resources/build.xsl | 120 ++++ .../cname/project/resources/projectIcon.png | Bin 0 -> 450 bytes .../cname/project/resources/se-jbi-module.xml | 3 + .../cname/project/wizard/Bundle.properties | 9 + .../wizard/SEPluginProjectDescription.html | 8 + .../wizard/SEPluginProjectWizardIterator.java | 238 ++++++++ .../wizard/SEPluginProjectWizardPanel.java | 93 +++ .../SEPluginProjectWizardPanelVisual.form | 120 ++++ .../SEPluginProjectWizardPanelVisual.java | 259 ++++++++ .../project/wizard/resources/Greetings.wsdl | 89 +++ .../project/wizard/resources/goodbye.xsl | 31 + .../cname/project/wizard/resources/hello.xsl | 29 + .../cname/project/wizard/resources/jbi.xml | 14 + .../wizard/resources/xsltmap.properties | 28 + .../install-params.properties | 3 + .../archetype-resources/m2nbbuild-impl.xml | 132 ++++ .../archetype-resources/m2nbbuild.properties | 48 ++ .../archetype-resources/m2nbbuild.xml | 37 ++ .../nbproject/build-impl.xml | 574 ++++++++++++++++++ .../nbproject/genfiles.properties | 11 + .../nbproject/jbi_admin.xml | 504 +++++++++++++++ .../nbproject/jbiadmin-impl.xml | 339 +++++++++++ .../nbproject/private/private.properties | 6 + .../nbproject/private/retriever/catalog.xml | 3 + .../nbproject/project.properties | 91 +++ .../archetype-resources/nbproject/project.xml | 20 + .../resources/archetype-resources/pom.xml | 173 ++++++ .../projects/basic/archetype.properties | 5 + .../test/resources/projects/basic/goal.txt | 0 .../maven-archetype-service-engine-v2/pom.xml | 45 ++ .../META-INF/maven/archetype-metadata.xml | 82 +++ .../resources/archetype-resources/build.xml | 72 +++ .../build/generated-sources/archetype/pom.xml | 38 ++ .../deploy-plugin/nbproject/build-impl.xml | 33 + .../deploy-plugin/nbproject/project.xml | 146 +++++ .../test/java/enginetest/test1Input.xml | 18 + .../test/java/enginetest/test2Input.xml | 18 + .../archetype-resources/test/testSA/build.xml | 143 +++++ .../test/testSA/src/META-INF/jbi.xml | 47 ++ .../test/testSA/testSUBC/build.xml | 77 +++ .../testSUBC/build/testSUBC/META-INF/jbi.xml | 20 + .../test/testSA/testSUBC/src/META-INF/jbi.xml | 20 + .../test/testSA/testSUSE/build.xml | 77 +++ .../testSUSE/build/testSUSE/META-INF/jbi.xml | 20 + .../test/testSA/testSUSE/src/META-INF/jbi.xml | 20 + .../install-params.properties | 3 + .../archetype-resources/m2nbbuild-impl.xml | 133 ++++ .../archetype-resources/m2nbbuild.properties | 48 ++ .../archetype-resources/m2nbbuild.xml | 37 ++ .../nbproject/build-impl.xml | 554 +++++++++++++++++ .../nbproject/genfiles.properties | 11 + .../nbproject/jbi_admin.xml | 504 +++++++++++++++ .../nbproject/jbiadmin-impl.xml | 339 +++++++++++ .../nbproject/private/private.properties | 6 + .../nbproject/private/retriever/catalog.xml | 3 + .../nbproject/project.properties | 93 +++ .../archetype-resources/nbproject/project.xml | 20 + .../resources/archetype-resources/pom.xml | 282 +++++++++ .../src/conf/META-INF/jbi.xml | 45 ++ .../cname/ProviderSEComponentLifeCycle.java | 52 ++ .../component/cname/ProviderSEEndpoint.java | 101 +++ .../component/cname/ProviderSEInstaller.java | 34 ++ .../ProviderSEMessageExchangeHandler.java | 171 ++++++ .../component/cname/ProviderSERuntime.java | 56 ++ .../component/cname/ProviderSESUManager.java | 49 ++ .../cname/ProviderSEServiceUnit.java | 63 ++ .../component/cname/XSLTFileLocator.java | 210 +++++++ .../openesb/component/cname/XSLTService.java | 108 ++++ .../AbstractMessageExchangeHandler.java | 141 +++++ .../cname/common/BasicComponentLifeCycle.java | 398 ++++++++++++ .../cname/common/ComponentInstaller.java | 275 +++++++++ .../cname/common/ComponentRuntime.java | 174 ++++++ .../DefaultMessageExchangeReceiver.java | 180 ++++++ .../cname/common/MessageExchangeHandler.java | 31 + .../cname/common/MessageExchangeListener.java | 36 ++ .../cname/common/MessageExchangeReceiver.java | 47 ++ .../cname/common/MessageExchangeSupport.java | 170 ++++++ .../cname/common/RuntimeContext.java | 176 ++++++ .../component/cname/common/RuntimeHelper.java | 360 +++++++++++ .../AbstractServiceUnitManager.java | 312 ++++++++++ .../common/deployment/ConsumerEndpoint.java | 208 +++++++ .../cname/common/deployment/Endpoint.java | 289 +++++++++ .../common/deployment/ProviderEndpoint.java | 107 ++++ .../cname/common/deployment/SUDescriptor.java | 364 +++++++++++ .../cname/common/deployment/ServiceUnit.java | 464 ++++++++++++++ .../wsdl/AbstractExtensibilityElement.java | 44 ++ .../wsdl/AbstractExtensionRegistry.java | 45 ++ .../wsdl/AbstractExtensionSerializer.java | 123 ++++ .../cname/common/wsdl/AbstractNormalizer.java | 229 +++++++ .../cname/common/wsdl/SEBindingExt.java | 99 +++ .../cname/common/wsdl/WSDL11JBIWrapper.java | 471 ++++++++++++++ .../cname/common/wsdl/WSDLProcessor.java | 419 +++++++++++++ .../java/enginetest/ServiceEngineTest.java | 54 ++ .../test/java/enginetest/test1.properties | 11 + .../test/java/enginetest/test1Input.xml | 15 + .../test/java/enginetest/test2.properties | 11 + .../test/java/enginetest/test2Input.xml | 15 + .../cname/test/JBIComponentTestClient.java | 298 +++++++++ .../cname/test/JMXBindingTestClient.java | 136 +++++ .../cname/test/SOAPBindingTestClient.java | 159 +++++ .../test/testSA/build.properties | 22 + .../archetype-resources/test/testSA/build.xml | 140 +++++ .../test/testSA/src/META-INF/jbi.xml | 44 ++ .../test/testSA/testSUBC/build.properties | 10 + .../test/testSA/testSUBC/build.xml | 74 +++ .../test/testSA/testSUBC/build/testSUBC.zip | Bin 0 -> 1341 bytes .../testSUBC/build/testSUBC/Greetings.wsdl | 88 +++ .../testSUBC/build/testSUBC/META-INF/jbi.xml | 17 + .../test/testSA/testSUBC/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUBC/src/META-INF/jbi.xml | 17 + .../test/testSA/testSUSE/build.properties | 10 + .../test/testSA/testSUSE/build.xml | 74 +++ .../test/testSA/testSUSE/build/testSUSE.zip | Bin 0 -> 3003 bytes .../testSUSE/build/testSUSE/Greetings.wsdl | 88 +++ .../testSUSE/build/testSUSE/META-INF/jbi.xml | 17 + .../testSUSE/build/testSUSE/goodbye.xsl | 25 + .../testSA/testSUSE/build/testSUSE/hello.xsl | 23 + .../build/testSUSE/xsltmap.properties | 31 + .../test/testSA/testSUSE/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUSE/src/META-INF/jbi.xml | 17 + .../test/testSA/testSUSE/src/goodbye.xsl | 25 + .../test/testSA/testSUSE/src/hello.xsl | 23 + .../testSA/testSUSE/src/xsltmap.properties | 31 + .../projects/basic/archetype.properties | 6 + .../test/resources/projects/basic/goal.txt | 0 .../ServiceEngine-archetype-1.0-SNAPSHOT.jar | Bin 0 -> 130878 bytes .../META-INF/maven/archetype-metadata.xml | 82 +++ .../classes/archetype-resources/build.xml | 72 +++ .../build/generated-sources/archetype/pom.xml | 38 ++ .../deploy-plugin/nbproject/build-impl.xml | 33 + .../deploy-plugin/nbproject/project.xml | 146 +++++ .../test/java/enginetest/test1Input.xml | 18 + .../test/java/enginetest/test2Input.xml | 18 + .../archetype-resources/test/testSA/build.xml | 143 +++++ .../test/testSA/src/META-INF/jbi.xml | 47 ++ .../test/testSA/testSUBC/build.xml | 77 +++ .../testSUBC/build/testSUBC/META-INF/jbi.xml | 20 + .../test/testSA/testSUBC/src/META-INF/jbi.xml | 20 + .../test/testSA/testSUSE/build.xml | 77 +++ .../testSUSE/build/testSUSE/META-INF/jbi.xml | 20 + .../test/testSA/testSUSE/src/META-INF/jbi.xml | 20 + .../install-params.properties | 3 + .../archetype-resources/m2nbbuild-impl.xml | 133 ++++ .../archetype-resources/m2nbbuild.properties | 48 ++ .../classes/archetype-resources/m2nbbuild.xml | 37 ++ .../nbproject/build-impl.xml | 554 +++++++++++++++++ .../nbproject/genfiles.properties | 11 + .../nbproject/jbi_admin.xml | 504 +++++++++++++++ .../nbproject/jbiadmin-impl.xml | 339 +++++++++++ .../nbproject/private/private.properties | 6 + .../nbproject/private/retriever/catalog.xml | 3 + .../nbproject/project.properties | 93 +++ .../archetype-resources/nbproject/project.xml | 20 + .../classes/archetype-resources/pom.xml | 282 +++++++++ .../src/conf/META-INF/jbi.xml | 45 ++ .../cname/ProviderSEComponentLifeCycle.java | 52 ++ .../component/cname/ProviderSEEndpoint.java | 101 +++ .../component/cname/ProviderSEInstaller.java | 34 ++ .../ProviderSEMessageExchangeHandler.java | 171 ++++++ .../component/cname/ProviderSERuntime.java | 56 ++ .../component/cname/ProviderSESUManager.java | 49 ++ .../cname/ProviderSEServiceUnit.java | 63 ++ .../component/cname/XSLTFileLocator.java | 210 +++++++ .../openesb/component/cname/XSLTService.java | 108 ++++ .../AbstractMessageExchangeHandler.java | 141 +++++ .../cname/common/BasicComponentLifeCycle.java | 398 ++++++++++++ .../cname/common/ComponentInstaller.java | 275 +++++++++ .../cname/common/ComponentRuntime.java | 174 ++++++ .../DefaultMessageExchangeReceiver.java | 180 ++++++ .../cname/common/MessageExchangeHandler.java | 31 + .../cname/common/MessageExchangeListener.java | 36 ++ .../cname/common/MessageExchangeReceiver.java | 47 ++ .../cname/common/MessageExchangeSupport.java | 170 ++++++ .../cname/common/RuntimeContext.java | 176 ++++++ .../component/cname/common/RuntimeHelper.java | 360 +++++++++++ .../AbstractServiceUnitManager.java | 312 ++++++++++ .../common/deployment/ConsumerEndpoint.java | 208 +++++++ .../cname/common/deployment/Endpoint.java | 289 +++++++++ .../common/deployment/ProviderEndpoint.java | 107 ++++ .../cname/common/deployment/SUDescriptor.java | 364 +++++++++++ .../cname/common/deployment/ServiceUnit.java | 464 ++++++++++++++ .../wsdl/AbstractExtensibilityElement.java | 44 ++ .../wsdl/AbstractExtensionRegistry.java | 45 ++ .../wsdl/AbstractExtensionSerializer.java | 123 ++++ .../cname/common/wsdl/AbstractNormalizer.java | 229 +++++++ .../cname/common/wsdl/SEBindingExt.java | 99 +++ .../cname/common/wsdl/WSDL11JBIWrapper.java | 471 ++++++++++++++ .../cname/common/wsdl/WSDLProcessor.java | 419 +++++++++++++ .../java/enginetest/ServiceEngineTest.java | 54 ++ .../test/java/enginetest/test1.properties | 11 + .../test/java/enginetest/test1Input.xml | 15 + .../test/java/enginetest/test2.properties | 11 + .../test/java/enginetest/test2Input.xml | 15 + .../cname/test/JBIComponentTestClient.java | 298 +++++++++ .../cname/test/JMXBindingTestClient.java | 136 +++++ .../cname/test/SOAPBindingTestClient.java | 159 +++++ .../test/testSA/build.properties | 22 + .../archetype-resources/test/testSA/build.xml | 140 +++++ .../test/testSA/src/META-INF/jbi.xml | 44 ++ .../test/testSA/testSUBC/build.properties | 10 + .../test/testSA/testSUBC/build.xml | 74 +++ .../test/testSA/testSUBC/build/testSUBC.zip | Bin 0 -> 1341 bytes .../testSUBC/build/testSUBC/Greetings.wsdl | 88 +++ .../testSUBC/build/testSUBC/META-INF/jbi.xml | 17 + .../test/testSA/testSUBC/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUBC/src/META-INF/jbi.xml | 17 + .../test/testSA/testSUSE/build.properties | 10 + .../test/testSA/testSUSE/build.xml | 74 +++ .../test/testSA/testSUSE/build/testSUSE.zip | Bin 0 -> 3003 bytes .../testSUSE/build/testSUSE/Greetings.wsdl | 88 +++ .../testSUSE/build/testSUSE/META-INF/jbi.xml | 17 + .../testSUSE/build/testSUSE/goodbye.xsl | 25 + .../testSA/testSUSE/build/testSUSE/hello.xsl | 23 + .../build/testSUSE/xsltmap.properties | 31 + .../test/testSA/testSUSE/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUSE/src/META-INF/jbi.xml | 17 + .../test/testSA/testSUSE/src/goodbye.xsl | 25 + .../test/testSA/testSUSE/src/hello.xsl | 23 + .../testSA/testSUSE/src/xsltmap.properties | 31 + .../projects/basic/archetype.properties | 6 + .../test-classes/projects/basic/goal.txt | 0 .../project/ServiceEngine-archetype/build.log | 0 .../project/ServiceEngine-archetype/build.xml | 69 +++ .../install-params.properties | 0 .../m2nbbuild-impl.xml | 130 ++++ .../m2nbbuild.properties | 45 ++ .../ServiceEngine-archetype/m2nbbuild.xml | 34 ++ .../nbproject/build-impl.xml | 551 +++++++++++++++++ .../nbproject/genfiles.properties | 8 + .../nbproject/jbi_admin.xml | 501 +++++++++++++++ .../nbproject/jbiadmin-impl.xml | 336 ++++++++++ .../nbproject/private/private.properties | 3 + .../nbproject/private/retriever/catalog.xml | 0 .../nbproject/project.properties | 90 +++ .../nbproject/project.xml | 17 + .../project/ServiceEngine-archetype/pom.xml | 282 +++++++++ .../src/conf/META-INF/jbi.xml | 42 ++ .../cname/ProviderSEComponentLifeCycle.java | 49 ++ .../component/cname/ProviderSEEndpoint.java | 98 +++ .../component/cname/ProviderSEInstaller.java | 31 + .../ProviderSEMessageExchangeHandler.java | 168 +++++ .../component/cname/ProviderSERuntime.java | 53 ++ .../component/cname/ProviderSESUManager.java | 46 ++ .../cname/ProviderSEServiceUnit.java | 60 ++ .../component/cname/XSLTFileLocator.java | 207 +++++++ .../openesb/component/cname/XSLTService.java | 105 ++++ .../AbstractMessageExchangeHandler.java | 138 +++++ .../cname/common/BasicComponentLifeCycle.java | 395 ++++++++++++ .../cname/common/ComponentInstaller.java | 272 +++++++++ .../cname/common/ComponentRuntime.java | 171 ++++++ .../DefaultMessageExchangeReceiver.java | 177 ++++++ .../cname/common/MessageExchangeHandler.java | 28 + .../cname/common/MessageExchangeListener.java | 33 + .../cname/common/MessageExchangeReceiver.java | 44 ++ .../cname/common/MessageExchangeSupport.java | 167 +++++ .../cname/common/RuntimeContext.java | 173 ++++++ .../component/cname/common/RuntimeHelper.java | 357 +++++++++++ .../AbstractServiceUnitManager.java | 309 ++++++++++ .../common/deployment/ConsumerEndpoint.java | 205 +++++++ .../cname/common/deployment/Endpoint.java | 286 +++++++++ .../common/deployment/ProviderEndpoint.java | 104 ++++ .../cname/common/deployment/SUDescriptor.java | 361 +++++++++++ .../cname/common/deployment/ServiceUnit.java | 461 ++++++++++++++ .../wsdl/AbstractExtensibilityElement.java | 41 ++ .../wsdl/AbstractExtensionRegistry.java | 42 ++ .../wsdl/AbstractExtensionSerializer.java | 120 ++++ .../cname/common/wsdl/AbstractNormalizer.java | 226 +++++++ .../cname/common/wsdl/SEBindingExt.java | 96 +++ .../cname/common/wsdl/WSDL11JBIWrapper.java | 468 ++++++++++++++ .../cname/common/wsdl/WSDLProcessor.java | 416 +++++++++++++ .../java/enginetest/ServiceEngineTest.java | 51 ++ .../test/java/enginetest/test1.properties | 8 + .../test/java/enginetest/test1Input.xml | 12 + .../test/java/enginetest/test2.properties | 8 + .../test/java/enginetest/test2Input.xml | 12 + .../cname/test/JBIComponentTestClient.java | 295 +++++++++ .../cname/test/JMXBindingTestClient.java | 133 ++++ .../cname/test/SOAPBindingTestClient.java | 156 +++++ .../test/testSA/build.properties | 19 + .../test/testSA/build.xml | 137 +++++ .../test/testSA/src/META-INF/jbi.xml | 41 ++ .../test/testSA/testSUBC/build.properties | 7 + .../test/testSA/testSUBC/build.xml | 71 +++ .../test/testSA/testSUBC/build/testSUBC.zip | Bin 0 -> 1341 bytes .../testSUBC/build/testSUBC/Greetings.wsdl | 88 +++ .../testSUBC/build/testSUBC/META-INF/jbi.xml | 14 + .../test/testSA/testSUBC/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUBC/src/META-INF/jbi.xml | 14 + .../test/testSA/testSUSE/build.properties | 7 + .../test/testSA/testSUSE/build.xml | 71 +++ .../test/testSA/testSUSE/build/testSUSE.zip | Bin 0 -> 3003 bytes .../testSUSE/build/testSUSE/Greetings.wsdl | 88 +++ .../testSUSE/build/testSUSE/META-INF/jbi.xml | 14 + .../testSUSE/build/testSUSE/goodbye.xsl | 25 + .../testSA/testSUSE/build/testSUSE/hello.xsl | 23 + .../build/testSUSE/xsltmap.properties | 28 + .../test/testSA/testSUSE/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUSE/src/META-INF/jbi.xml | 14 + .../test/testSA/testSUSE/src/goodbye.xsl | 25 + .../test/testSA/testSUSE/src/hello.xsl | 23 + .../testSA/testSUSE/src/xsltmap.properties | 28 + .../pom.xml | 35 ++ .../META-INF/maven/archetype-metadata.xml | 69 +++ .../resources/archetype-resources/build.xml | 72 +++ .../deploy-plugin/build.xml | 11 + .../deploy-plugin/manifest.mf | 6 + .../deploy-plugin/nbproject/build-impl.xml | 30 + .../nbproject/genfiles.properties | 11 + .../nbproject/platform.properties | 4 + .../private/platform-private.properties | 4 + .../nbproject/project.properties | 7 + .../deploy-plugin/nbproject/project.xml | 59 ++ ...t.spi.ExtensibilityElementTemplateProvider | 1 + ....modules.xml.wsdl.model.spi.ElementFactory | 6 + ....wsdl.validator.spi.ValidatorSchemaFactory | 1 + ...org.netbeans.modules.xml.xam.spi.Validator | 2 + .../cname/BindingComponentWsdlExt.xsd | 115 ++++ .../openesb/component/cname/Bundle.properties | 21 + .../src/net/openesb/component/cname/layer.xml | 86 +++ .../component/cname/model/BindingExt.java | 47 ++ .../component/cname/model/ExtAttribute.java | 53 ++ .../component/cname/model/ExtComponent.java | 35 ++ .../component/cname/model/ExtConstants.java | 47 ++ .../model/ExtElementFactoryProvider.java | 85 +++ .../component/cname/model/ExtVisitor.java | 25 + .../component/cname/model/FaultExt.java | 47 ++ .../component/cname/model/InputExt.java | 47 ++ .../component/cname/model/OperationExt.java | 68 +++ .../component/cname/model/OutputExt.java | 47 ++ .../component/cname/model/PortExt.java | 134 ++++ .../component/cname/resources/binding-ext.png | Bin 0 -> 449 bytes .../component/cname/resources/fault-ext.png | Bin 0 -> 1035 bytes .../component/cname/resources/input-ext.png | Bin 0 -> 315 bytes .../cname/resources/operation-ext.png | Bin 0 -> 465 bytes .../component/cname/resources/output-ext.png | Bin 0 -> 315 bytes .../component/cname/resources/port-ext.png | Bin 0 -> 393 bytes .../cname/template/Bundle.properties | 12 + .../template/WSDLExtTemplateProvider.java | 24 + .../component/cname/template/template.xml | 71 +++ .../cname/validator/WSDLExtValidator.java | 229 +++++++ .../WSDLExtValidatorSchemaFactory.java | 43 ++ .../install-params.properties | 3 + .../archetype-resources/m2nbbuild-impl.xml | 130 ++++ .../archetype-resources/m2nbbuild.properties | 48 ++ .../archetype-resources/m2nbbuild.xml | 37 ++ .../nbproject/build-impl.xml | 558 +++++++++++++++++ .../nbproject/genfiles.properties | 11 + .../nbproject/jbi_admin.xml | 504 +++++++++++++++ .../nbproject/jbiadmin-impl.xml | 339 +++++++++++ .../nbproject/private/private.properties | 6 + .../nbproject/private/retriever/catalog.xml | 3 + .../nbproject/project.properties | 91 +++ .../archetype-resources/nbproject/project.xml | 20 + .../resources/archetype-resources/pom.xml | 171 ++++++ .../projects/basic/archetype.properties | 5 + .../test/resources/projects/basic/goal.txt | 0 .../pom.xml | 35 ++ .../META-INF/maven/archetype-metadata.xml | 76 +++ .../resources/archetype-resources/build.xml | 72 +++ .../build/generated-sources/archetype/pom.xml | 38 ++ .../deploy-plugin/nbproject/build-impl.xml | 33 + .../deploy-plugin/nbproject/project.xml | 62 ++ .../test/java/bindingtest/test1Input.xml | 15 + .../test/java/bindingtest/test2Input.xml | 15 + .../archetype-resources/test/testSA/build.xml | 143 +++++ .../test/testSA/src/META-INF/jbi.xml | 47 ++ .../test/testSA/testSUBC/build.xml | 77 +++ .../test/testSA/testSUBC/src/META-INF/jbi.xml | 20 + .../test/testSA/testSUSE/build.xml | 77 +++ .../test/testSA/testSUSE/src/META-INF/jbi.xml | 20 + .../archetype-resources/m2nbbuild-impl.xml | 130 ++++ .../archetype-resources/m2nbbuild.properties | 48 ++ .../archetype-resources/m2nbbuild.xml | 37 ++ .../nbproject/build-impl.xml | 557 +++++++++++++++++ .../nbproject/genfiles.properties | 11 + .../nbproject/jbi_admin.xml | 504 +++++++++++++++ .../nbproject/jbiadmin-impl.xml | 339 +++++++++++ .../nbproject/private/private.properties | 6 + .../nbproject/project.properties | 93 +++ .../archetype-resources/nbproject/project.xml | 20 + .../resources/archetype-resources/pom.xml | 268 ++++++++ .../src/conf/META-INF/jbi.xml | 45 ++ .../cname/JMXBindingComponentLifeCycle.java | 52 ++ .../cname/JMXBindingConsumerEndpoint.java | 153 +++++ .../cname/JMXBindingConsumerProxy.java | 237 ++++++++ .../component/cname/JMXBindingInstaller.java | 34 ++ .../component/cname/JMXBindingNormalizer.java | 242 ++++++++ .../cname/JMXBindingProviderEndpoint.java | 87 +++ .../cname/JMXBindingProviderProxy.java | 235 +++++++ .../component/cname/JMXBindingRuntime.java | 57 ++ .../component/cname/JMXBindingSUManager.java | 51 ++ .../cname/JMXBindingServiceUnit.java | 55 ++ .../cname/JMXBindingWSDLProcessor.java | 43 ++ .../component/cname/JMXEndpointMBean.java | 41 ++ .../AbstractMessageExchangeHandler.java | 141 +++++ .../cname/common/BasicComponentLifeCycle.java | 398 ++++++++++++ .../cname/common/ComponentInstaller.java | 275 +++++++++ .../cname/common/ComponentRuntime.java | 174 ++++++ .../DefaultMessageExchangeReceiver.java | 180 ++++++ .../cname/common/MessageExchangeHandler.java | 31 + .../cname/common/MessageExchangeListener.java | 36 ++ .../cname/common/MessageExchangeReceiver.java | 47 ++ .../cname/common/MessageExchangeSupport.java | 170 ++++++ .../cname/common/RuntimeContext.java | 176 ++++++ .../component/cname/common/RuntimeHelper.java | 360 +++++++++++ .../AbstractServiceUnitManager.java | 312 ++++++++++ .../common/deployment/ConsumerEndpoint.java | 208 +++++++ .../cname/common/deployment/Endpoint.java | 289 +++++++++ .../common/deployment/ProviderEndpoint.java | 107 ++++ .../cname/common/deployment/SUDescriptor.java | 364 +++++++++++ .../cname/common/deployment/ServiceUnit.java | 464 ++++++++++++++ .../wsdl/AbstractExtensibilityElement.java | 44 ++ .../wsdl/AbstractExtensionRegistry.java | 45 ++ .../wsdl/AbstractExtensionSerializer.java | 123 ++++ .../cname/common/wsdl/AbstractNormalizer.java | 229 +++++++ .../cname/common/wsdl/SEBindingExt.java | 99 +++ .../cname/common/wsdl/WSDL11JBIWrapper.java | 471 ++++++++++++++ .../cname/common/wsdl/WSDLProcessor.java | 419 +++++++++++++ .../component/cname/wsdlext/BindingExt.java | 101 +++ .../component/cname/wsdlext/ExtConstants.java | 52 ++ .../component/cname/wsdlext/FaultExt.java | 101 +++ .../component/cname/wsdlext/InputExt.java | 101 +++ .../component/cname/wsdlext/OperationExt.java | 121 ++++ .../component/cname/wsdlext/OutputExt.java | 101 +++ .../component/cname/wsdlext/PortExt.java | 217 +++++++ .../cname/wsdlext/WSDLExtHelper.java | 223 +++++++ .../component/cname/wsdlext/WSDLExtension.xsd | 98 +++ .../cname/wsdlext/WSDLExtensionRegistry.java | 46 ++ .../bindingtest/BindingComponentTest.java | 55 ++ .../test/java/bindingtest/test1.properties | 16 + .../test/java/bindingtest/test1Input.xml | 12 + .../test/java/bindingtest/test2.properties | 15 + .../test/java/bindingtest/test2Input.xml | 12 + .../cname/test/JBIComponentTestClient.java | 298 +++++++++ .../cname/test/JMXBindingTestClient.java | 136 +++++ .../cname/test/SOAPBindingTestClient.java | 159 +++++ .../test/testSA/build.properties | 22 + .../archetype-resources/test/testSA/build.xml | 140 +++++ .../test/testSA/src/META-INF/jbi.xml | 44 ++ .../test/testSA/testSUBC/build.properties | 10 + .../test/testSA/testSUBC/build.xml | 74 +++ .../test/testSA/testSUBC/src/Greetings.wsdl | 94 +++ .../test/testSA/testSUBC/src/META-INF/jbi.xml | 17 + .../test/testSA/testSUSE/build.properties | 10 + .../test/testSA/testSUSE/build.xml | 74 +++ .../test/testSA/testSUSE/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUSE/src/META-INF/jbi.xml | 17 + .../test/testSA/testSUSE/src/goodbye.xsl | 25 + .../test/testSA/testSUSE/src/hello.xsl | 23 + .../testSA/testSUSE/src/xsltmap.properties | 31 + .../projects/basic/archetype.properties | 6 + .../test/resources/projects/basic/goal.txt | 0 ...indingComponent-archetype-1.0-SNAPSHOT.jar | Bin 0 -> 137721 bytes .../META-INF/maven/archetype-metadata.xml | 76 +++ .../classes/archetype-resources/build.xml | 72 +++ .../build/generated-sources/archetype/pom.xml | 38 ++ .../deploy-plugin/nbproject/build-impl.xml | 33 + .../deploy-plugin/nbproject/project.xml | 62 ++ .../test/java/bindingtest/test1Input.xml | 15 + .../test/java/bindingtest/test2Input.xml | 15 + .../archetype-resources/test/testSA/build.xml | 143 +++++ .../test/testSA/src/META-INF/jbi.xml | 47 ++ .../test/testSA/testSUBC/build.xml | 77 +++ .../test/testSA/testSUBC/src/META-INF/jbi.xml | 20 + .../test/testSA/testSUSE/build.xml | 77 +++ .../test/testSA/testSUSE/src/META-INF/jbi.xml | 20 + .../archetype-resources/m2nbbuild-impl.xml | 130 ++++ .../archetype-resources/m2nbbuild.properties | 48 ++ .../classes/archetype-resources/m2nbbuild.xml | 37 ++ .../nbproject/build-impl.xml | 557 +++++++++++++++++ .../nbproject/genfiles.properties | 11 + .../nbproject/jbi_admin.xml | 504 +++++++++++++++ .../nbproject/jbiadmin-impl.xml | 339 +++++++++++ .../nbproject/private/private.properties | 6 + .../nbproject/project.properties | 93 +++ .../archetype-resources/nbproject/project.xml | 20 + .../classes/archetype-resources/pom.xml | 268 ++++++++ .../src/conf/META-INF/jbi.xml | 45 ++ .../cname/JMXBindingComponentLifeCycle.java | 52 ++ .../cname/JMXBindingConsumerEndpoint.java | 153 +++++ .../cname/JMXBindingConsumerProxy.java | 237 ++++++++ .../component/cname/JMXBindingInstaller.java | 34 ++ .../component/cname/JMXBindingNormalizer.java | 242 ++++++++ .../cname/JMXBindingProviderEndpoint.java | 87 +++ .../cname/JMXBindingProviderProxy.java | 235 +++++++ .../component/cname/JMXBindingRuntime.java | 57 ++ .../component/cname/JMXBindingSUManager.java | 51 ++ .../cname/JMXBindingServiceUnit.java | 55 ++ .../cname/JMXBindingWSDLProcessor.java | 43 ++ .../component/cname/JMXEndpointMBean.java | 41 ++ .../AbstractMessageExchangeHandler.java | 141 +++++ .../cname/common/BasicComponentLifeCycle.java | 398 ++++++++++++ .../cname/common/ComponentInstaller.java | 275 +++++++++ .../cname/common/ComponentRuntime.java | 174 ++++++ .../DefaultMessageExchangeReceiver.java | 180 ++++++ .../cname/common/MessageExchangeHandler.java | 31 + .../cname/common/MessageExchangeListener.java | 36 ++ .../cname/common/MessageExchangeReceiver.java | 47 ++ .../cname/common/MessageExchangeSupport.java | 170 ++++++ .../cname/common/RuntimeContext.java | 176 ++++++ .../component/cname/common/RuntimeHelper.java | 360 +++++++++++ .../AbstractServiceUnitManager.java | 312 ++++++++++ .../common/deployment/ConsumerEndpoint.java | 208 +++++++ .../cname/common/deployment/Endpoint.java | 289 +++++++++ .../common/deployment/ProviderEndpoint.java | 107 ++++ .../cname/common/deployment/SUDescriptor.java | 364 +++++++++++ .../cname/common/deployment/ServiceUnit.java | 464 ++++++++++++++ .../wsdl/AbstractExtensibilityElement.java | 44 ++ .../wsdl/AbstractExtensionRegistry.java | 45 ++ .../wsdl/AbstractExtensionSerializer.java | 123 ++++ .../cname/common/wsdl/AbstractNormalizer.java | 229 +++++++ .../cname/common/wsdl/SEBindingExt.java | 99 +++ .../cname/common/wsdl/WSDL11JBIWrapper.java | 471 ++++++++++++++ .../cname/common/wsdl/WSDLProcessor.java | 419 +++++++++++++ .../component/cname/wsdlext/BindingExt.java | 101 +++ .../component/cname/wsdlext/ExtConstants.java | 52 ++ .../component/cname/wsdlext/FaultExt.java | 101 +++ .../component/cname/wsdlext/InputExt.java | 101 +++ .../component/cname/wsdlext/OperationExt.java | 121 ++++ .../component/cname/wsdlext/OutputExt.java | 101 +++ .../component/cname/wsdlext/PortExt.java | 217 +++++++ .../cname/wsdlext/WSDLExtHelper.java | 223 +++++++ .../component/cname/wsdlext/WSDLExtension.xsd | 98 +++ .../cname/wsdlext/WSDLExtensionRegistry.java | 46 ++ .../bindingtest/BindingComponentTest.java | 55 ++ .../test/java/bindingtest/test1.properties | 16 + .../test/java/bindingtest/test1Input.xml | 12 + .../test/java/bindingtest/test2.properties | 15 + .../test/java/bindingtest/test2Input.xml | 12 + .../cname/test/JBIComponentTestClient.java | 298 +++++++++ .../cname/test/JMXBindingTestClient.java | 136 +++++ .../cname/test/SOAPBindingTestClient.java | 159 +++++ .../test/testSA/build.properties | 22 + .../archetype-resources/test/testSA/build.xml | 140 +++++ .../test/testSA/src/META-INF/jbi.xml | 44 ++ .../test/testSA/testSUBC/build.properties | 10 + .../test/testSA/testSUBC/build.xml | 74 +++ .../test/testSA/testSUBC/src/Greetings.wsdl | 94 +++ .../test/testSA/testSUBC/src/META-INF/jbi.xml | 17 + .../test/testSA/testSUSE/build.properties | 10 + .../test/testSA/testSUSE/build.xml | 74 +++ .../test/testSA/testSUSE/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUSE/src/META-INF/jbi.xml | 17 + .../test/testSA/testSUSE/src/goodbye.xsl | 25 + .../test/testSA/testSUSE/src/hello.xsl | 23 + .../testSA/testSUSE/src/xsltmap.properties | 31 + .../projects/basic/archetype.properties | 6 + .../test-classes/projects/basic/goal.txt | 0 .../BindingComponent-archetype/build.log | 0 .../BindingComponent-archetype/build.xml | 69 +++ .../m2nbbuild-impl.xml | 127 ++++ .../m2nbbuild.properties | 45 ++ .../BindingComponent-archetype/m2nbbuild.xml | 34 ++ .../nbproject/build-impl.xml | 554 +++++++++++++++++ .../nbproject/genfiles.properties | 8 + .../nbproject/jbi_admin.xml | 501 +++++++++++++++ .../nbproject/jbiadmin-impl.xml | 336 ++++++++++ .../nbproject/private/private.properties | 3 + .../nbproject/project.properties | 90 +++ .../nbproject/project.xml | 17 + .../BindingComponent-archetype/pom.xml | 268 ++++++++ .../src/conf/META-INF/jbi.xml | 42 ++ .../cname/JMXBindingComponentLifeCycle.java | 49 ++ .../cname/JMXBindingConsumerEndpoint.java | 150 +++++ .../cname/JMXBindingConsumerProxy.java | 234 +++++++ .../component/cname/JMXBindingInstaller.java | 31 + .../component/cname/JMXBindingNormalizer.java | 239 ++++++++ .../cname/JMXBindingProviderEndpoint.java | 84 +++ .../cname/JMXBindingProviderProxy.java | 232 +++++++ .../component/cname/JMXBindingRuntime.java | 54 ++ .../component/cname/JMXBindingSUManager.java | 48 ++ .../cname/JMXBindingServiceUnit.java | 52 ++ .../cname/JMXBindingWSDLProcessor.java | 40 ++ .../component/cname/JMXEndpointMBean.java | 38 ++ .../AbstractMessageExchangeHandler.java | 138 +++++ .../cname/common/BasicComponentLifeCycle.java | 395 ++++++++++++ .../cname/common/ComponentInstaller.java | 272 +++++++++ .../cname/common/ComponentRuntime.java | 171 ++++++ .../DefaultMessageExchangeReceiver.java | 177 ++++++ .../cname/common/MessageExchangeHandler.java | 28 + .../cname/common/MessageExchangeListener.java | 33 + .../cname/common/MessageExchangeReceiver.java | 44 ++ .../cname/common/MessageExchangeSupport.java | 167 +++++ .../cname/common/RuntimeContext.java | 173 ++++++ .../component/cname/common/RuntimeHelper.java | 357 +++++++++++ .../AbstractServiceUnitManager.java | 309 ++++++++++ .../common/deployment/ConsumerEndpoint.java | 205 +++++++ .../cname/common/deployment/Endpoint.java | 286 +++++++++ .../common/deployment/ProviderEndpoint.java | 104 ++++ .../cname/common/deployment/SUDescriptor.java | 361 +++++++++++ .../cname/common/deployment/ServiceUnit.java | 461 ++++++++++++++ .../wsdl/AbstractExtensibilityElement.java | 41 ++ .../wsdl/AbstractExtensionRegistry.java | 42 ++ .../wsdl/AbstractExtensionSerializer.java | 120 ++++ .../cname/common/wsdl/AbstractNormalizer.java | 226 +++++++ .../cname/common/wsdl/SEBindingExt.java | 96 +++ .../cname/common/wsdl/WSDL11JBIWrapper.java | 468 ++++++++++++++ .../cname/common/wsdl/WSDLProcessor.java | 416 +++++++++++++ .../component/cname/wsdlext/BindingExt.java | 98 +++ .../component/cname/wsdlext/ExtConstants.java | 49 ++ .../component/cname/wsdlext/FaultExt.java | 98 +++ .../component/cname/wsdlext/InputExt.java | 98 +++ .../component/cname/wsdlext/OperationExt.java | 118 ++++ .../component/cname/wsdlext/OutputExt.java | 98 +++ .../component/cname/wsdlext/PortExt.java | 214 +++++++ .../cname/wsdlext/WSDLExtHelper.java | 220 +++++++ .../component/cname/wsdlext/WSDLExtension.xsd | 98 +++ .../cname/wsdlext/WSDLExtensionRegistry.java | 43 ++ .../bindingtest/BindingComponentTest.java | 52 ++ .../test/java/bindingtest/test1.properties | 13 + .../test/java/bindingtest/test1Input.xml | 9 + .../test/java/bindingtest/test2.properties | 12 + .../test/java/bindingtest/test2Input.xml | 9 + .../cname/test/JBIComponentTestClient.java | 295 +++++++++ .../cname/test/JMXBindingTestClient.java | 133 ++++ .../cname/test/SOAPBindingTestClient.java | 156 +++++ .../test/testSA/build.properties | 19 + .../test/testSA/build.xml | 137 +++++ .../test/testSA/src/META-INF/jbi.xml | 41 ++ .../test/testSA/testSUBC/build.properties | 7 + .../test/testSA/testSUBC/build.xml | 71 +++ .../test/testSA/testSUBC/src/Greetings.wsdl | 94 +++ .../test/testSA/testSUBC/src/META-INF/jbi.xml | 14 + .../test/testSA/testSUSE/build.properties | 7 + .../test/testSA/testSUSE/build.xml | 71 +++ .../test/testSA/testSUSE/src/Greetings.wsdl | 89 +++ .../test/testSA/testSUSE/src/META-INF/jbi.xml | 14 + .../test/testSA/testSUSE/src/goodbye.xsl | 25 + .../test/testSA/testSUSE/src/hello.xsl | 23 + .../testSA/testSUSE/src/xsltmap.properties | 28 + 676 files changed, 75429 insertions(+) create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/META-INF/maven/archetype-metadata.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/manifest.mf create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/platform.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/private/platform-private.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.spi.project.support.ant.AntBasedProjectType create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.spi.queries.CollocationQueryImplementation create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/Bundle.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/layer.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/Bundle.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProject.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectActionProvider.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectGenerator.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectLogicalViewProvider.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectOperations.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectProperties.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectType.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/Bundle.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerGeneral.form create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerGeneral.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerPackage.form create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerPackage.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/SEPluginProjectCustomizerModel.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/SEPluginProjectCustomizerProvider.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/node/Bundle.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/node/SEPluginProjectNode.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/build-impl.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/build.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/projectIcon.png create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/se-jbi-module.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/Bundle.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectDescription.html create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardIterator.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanel.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanelVisual.form create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanelVisual.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/hello.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/install-params.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/private/private.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/test/resources/projects/basic/archetype.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/test/resources/projects/basic/goal.txt create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/META-INF/maven/archetype-metadata.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/install-params.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/private/private.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/conf/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEInstaller.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSERuntime.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSESUManager.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/XSLTFileLocator.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/XSLTService.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/ServiceEngineTest.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test1.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test2.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC.zip create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE.zip create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/hello.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/hello.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/test/resources/projects/basic/archetype.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/src/test/resources/projects/basic/goal.txt create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/ServiceEngine-archetype-1.0-SNAPSHOT.jar create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/META-INF/maven/archetype-metadata.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/install-params.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/jbi_admin.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/jbiadmin-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/private/private.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/private/retriever/catalog.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/conf/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEInstaller.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSERuntime.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSESUManager.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/XSLTFileLocator.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/XSLTService.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/ServiceEngineTest.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test1.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test2.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC.zip create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE.zip create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/hello.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/hello.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/archetype.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/goal.txt create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/build.log create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/install-params.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/jbi_admin.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/jbiadmin-impl.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/private/private.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/private/retriever/catalog.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/pom.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/conf/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEInstaller.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSERuntime.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSESUManager.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/XSLTFileLocator.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/XSLTService.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/ComponentInstaller.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/ComponentRuntime.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeListener.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/RuntimeContext.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/RuntimeHelper.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/Endpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/ServiceEngineTest.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test1.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test2.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC.zip create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE.zip create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/hello.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/hello.xsl create mode 100644 maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/pom.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/META-INF/maven/archetype-metadata.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/manifest.mf create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/platform.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/private/platform-private.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.model.spi.ElementFactory create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.validator.spi.ValidatorSchemaFactory create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.xam.spi.Validator create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/BindingComponentWsdlExt.xsd create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/Bundle.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/layer.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/BindingExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtAttribute.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtComponent.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtConstants.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtElementFactoryProvider.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtVisitor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/FaultExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/InputExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/OperationExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/OutputExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/PortExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/binding-ext.png create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/fault-ext.png create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/input-ext.png create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/operation-ext.png create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/output-ext.png create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/port-ext.png create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/template/Bundle.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/template/WSDLExtTemplateProvider.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/template/template.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/validator/WSDLExtValidator.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/validator/WSDLExtValidatorSchemaFactory.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/install-params.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/private/private.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/pom.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/test/resources/projects/basic/archetype.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/test/resources/projects/basic/goal.txt create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/pom.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/META-INF/maven/archetype-metadata.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/private/private.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/pom.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/conf/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingInstaller.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingNormalizer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingRuntime.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingSUManager.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXEndpointMBean.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/BindingExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/FaultExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/InputExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OperationExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OutputExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/PortExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/BindingComponentTest.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test1.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test2.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/hello.xsl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/test/resources/projects/basic/archetype.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/src/test/resources/projects/basic/goal.txt create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/BindingComponent-archetype-1.0-SNAPSHOT.jar create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/META-INF/maven/archetype-metadata.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/pom.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/jbi_admin.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/jbiadmin-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/private/private.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/pom.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/conf/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingInstaller.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingNormalizer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingRuntime.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingSUManager.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXEndpointMBean.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/BindingExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/FaultExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/InputExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OperationExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OutputExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/PortExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/BindingComponentTest.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test1.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test2.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/hello.xsl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/archetype.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/goal.txt create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/build.log create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/build-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/genfiles.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/jbi_admin.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/jbiadmin-impl.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/private/private.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/project.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/project.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/pom.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/conf/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingInstaller.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingNormalizer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingRuntime.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingSUManager.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXEndpointMBean.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/ComponentInstaller.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/ComponentRuntime.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeListener.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/RuntimeContext.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/RuntimeHelper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/Endpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/BindingExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/FaultExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/InputExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/OperationExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/OutputExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/PortExt.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/BindingComponentTest.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test1.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test1Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test2.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test2Input.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/build.properties create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/build.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/Greetings.wsdl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/META-INF/jbi.xml create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/goodbye.xsl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/hello.xsl create mode 100644 maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/xsltmap.properties diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/pom.xml new file mode 100644 index 000000000..04d8b8ea2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/pom.xml @@ -0,0 +1,43 @@ + + + + + + 4.0.0 + + open-jbi-components + ServiceEngine-Plugin-archetype + 1.0-SNAPSHOT + maven-archetype + + ServiceEngine-Plugin-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project Archtype for OpenESB Service Engine Netbeans Plugin + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 000000000..beba49420 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,81 @@ + + + + + + + + + deploy-plugin/nbproject + + **/*.xml + **/*.properties + + + + deploy-plugin/src + + **/*.html + **/*.java + **/*.xml + **/*.properties + + + + nbproject + + **/*.xml + **/*.properties + + + + nbproject/private + + **/*.xml + **/*.properties + + + + deploy-plugin + + **/*.xml + + + + deploy-plugin/src + + **/*.xsl + **/*.form + **/*.wsdl + **/*.png + **/*.AntBasedProjectType + **/*.CollocationQueryImplementation + + + + deploy-plugin + + **/*.mf + + + + + + build.xml + install-params.properties + m2nbbuild-impl.xml + m2nbbuild.properties + m2nbbuild.xml + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build.xml new file mode 100644 index 000000000..14afd1d29 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build.xml @@ -0,0 +1,72 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Builds, tests, and runs the project ${artifactId}. + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml new file mode 100644 index 000000000..fb390739c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml @@ -0,0 +1,38 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + 4.0.0 + + ${package} + ${artifactId}-archetype + ${version} + maven-archetype + + ${artifactId}-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml new file mode 100644 index 000000000..4bcb4d7ee --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml @@ -0,0 +1,33 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml new file mode 100644 index 000000000..8b878c82f --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml @@ -0,0 +1,146 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + org.netbeans.modules.apisupport.project + + + serviceengine + + + + org.apache.tools.ant.module + + + + 3 + 3.27.0.2 + + + + org.jdesktop.layout + + + + 1 + 1.4 + + + + org.netbeans.modules.java.project + + + + 1 + 1.12 + + + + org.netbeans.modules.project.ant + + + + 1 + 1.16 + + + + org.netbeans.modules.projectapi + + + + 1 + 1.13 + + + + org.netbeans.modules.projectuiapi + + + + 1 + 1.24.0.6 + + + + org.netbeans.modules.queries + + + + 1 + 1.10 + + + + org.openide.actions + + + + 6.6.0.1 + + + + org.openide.awt + + + + 6.11.0.1 + + + + org.openide.dialogs + + + + 7.5 + + + + org.openide.execution + + + + 1.10 + + + + org.openide.filesystems + + + + 7.3 + + + + org.openide.loaders + + + + 6.5 + + + + org.openide.nodes + + + + 7.2.0.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml new file mode 100644 index 000000000..b50d82c16 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml @@ -0,0 +1,18 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml new file mode 100644 index 000000000..947bb579c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml @@ -0,0 +1,18 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..5456aa8f2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml @@ -0,0 +1,143 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..fd6c5a710 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + ${symbol_dollar}{artifactId}_TestSA + This is a test Service Assembly to test Engine + + + + + ${symbol_dollar}{artifactId}_TestSUBC + This service unit enables soap inbound endpoint for a service in service engine + + + testSUBC.zip + sun-http-binding + + + + + ${symbol_dollar}{artifactId}_TestSUSE + This service unit enables greetings service provider in service engine + + + testSUSE.zip + ${symbol_dollar}{artifactId} + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..96e95745f --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml new file mode 100644 index 000000000..251f4073e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..251f4073e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..75340ea7d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml new file mode 100644 index 000000000..1ce2022bf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..1ce2022bf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/build.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/build.xml new file mode 100644 index 000000000..12e9743bf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/build.xml @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Builds, tests, and runs the project ${artifactId}. + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/manifest.mf b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/manifest.mf new file mode 100644 index 000000000..7b9bf6601 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: ${artifactId} +OpenIDE-Module-Layer: ${artifactId}/layer.xml +OpenIDE-Module-Localizing-Bundle: ${artifactId}/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml new file mode 100644 index 000000000..3b9e10fcc --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml @@ -0,0 +1,30 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/genfiles.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/genfiles.properties new file mode 100644 index 000000000..fe0e275eb --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/genfiles.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.xml.data.CRC32=10d1596b +build.xml.script.CRC32=11ff9e8e +build.xml.stylesheet.CRC32=a56c6a5b@2.50.1 +${symbol_pound} This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +${symbol_pound} Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=10d1596b +nbproject/build-impl.xml.script.CRC32=a0f936cd +nbproject/build-impl.xml.stylesheet.CRC32=68e521fc@2.50.1 diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/platform.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/platform.properties new file mode 100644 index 000000000..7ac9923fb --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/platform.properties @@ -0,0 +1,4 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +nbplatform.active=default diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/private/platform-private.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/private/platform-private.properties new file mode 100644 index 000000000..3ac32342a --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/private/platform-private.properties @@ -0,0 +1,4 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +user.properties.file=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working57${symbol_escape}${symbol_escape}.netbeans${symbol_escape}${symbol_escape}openesb${symbol_escape}${symbol_escape}build.properties diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.properties new file mode 100644 index 000000000..a5e2da3b1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.properties @@ -0,0 +1,7 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +javac.compilerargs=-Xlint -Xlint:-serial +javac.source=1.5 +nbm.homepage=http://www.netbeans.org +nbm.module.author=logicoyparam diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml new file mode 100644 index 000000000..b830d1f94 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml @@ -0,0 +1,151 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + org.netbeans.modules.apisupport.project + + + ${artifactId} + + + + org.apache.tools.ant.module + + + + 3 + 3.27.0.2 + + + + org.jdesktop.layout + + + + 1 + 1.4 + + + + org.netbeans.modules.java.project + + + + 1 + 1.12 + + + + org.netbeans.modules.project.ant + + + + 1 + 1.16 + + + + org.netbeans.modules.projectapi + + + + 1 + 1.13 + + + + org.netbeans.modules.projectuiapi + + + + 1 + 1.24.0.6 + + + + org.netbeans.modules.queries + + + + 1 + 1.10 + + + + org.openide.actions + + + + 6.6.0.1 + + + + org.openide.awt + + + + 6.11.0.1 + + + + org.openide.dialogs + + + + 7.5 + + + + org.openide.execution + + + + 1.10 + + + + org.openide.filesystems + + + + 7.3 + + + + org.openide.loaders + + + + 6.5 + + + + org.openide.nodes + + + + 7.2.0.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + org.openide.util.lookup + + + + 8.15.2 + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.spi.project.support.ant.AntBasedProjectType b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.spi.project.support.ant.AntBasedProjectType new file mode 100644 index 000000000..155f1a762 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.spi.project.support.ant.AntBasedProjectType @@ -0,0 +1 @@ +serviceengine.project.SEPluginProjectType diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.spi.queries.CollocationQueryImplementation b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.spi.queries.CollocationQueryImplementation new file mode 100644 index 000000000..9be0d09e9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.spi.queries.CollocationQueryImplementation @@ -0,0 +1 @@ +org.netbeans.modules.compapp.projects.base.queries.SameDriveCollocationQuery diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/Bundle.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/Bundle.properties new file mode 100644 index 000000000..3dfba410b --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/Bundle.properties @@ -0,0 +1,15 @@ +# binding component deployment plugin resource bundle +# binding deploy plugin +OpenIDE-Module-Name=JBI Deployment Plugin[${artifactId}] +# deployment plugin +OpenIDE-Module-Short-Description=Service engine deployment plugin for ${artifactId} +# deployment plugin for adding wsdl extensions related to the binding component to the wsdl editor +OpenIDE-Module-Long-Description=Deployment plugin for creating service units related to this service engine in composite application +# category +OpenIDE-Module-Display-Category=CAPS + +# plugin project template +Templates/Project/SOA/${artifactId}JBIModule.xml=${artifactId} JBI Module + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/layer.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/layer.xml new file mode 100644 index 000000000..b855204c4 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/layer.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/Bundle.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/Bundle.properties new file mode 100644 index 000000000..7b3c45fe3 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/Bundle.properties @@ -0,0 +1,4 @@ +LBL_Node_Sources=Sources + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProject.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProject.java new file mode 100644 index 000000000..9f6059eee --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProject.java @@ -0,0 +1,408 @@ +/* + * SEPluginProject.java + * + */ +package net.openesb.component.${artifactId}.project; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.io.File; +import java.io.IOException; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import org.netbeans.api.project.FileOwnerQuery; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectInformation; +import org.netbeans.api.project.ProjectManager; +import org.netbeans.api.project.Sources; +import org.netbeans.api.project.ant.AntArtifact; +import net.openesb.component.${artifactId}.project.customizer.SEPluginProjectCustomizerProvider; +import org.netbeans.spi.java.project.support.ui.BrokenReferencesSupport; +import org.netbeans.spi.project.AuxiliaryConfiguration; +import org.netbeans.spi.project.SubprojectProvider; +import org.netbeans.spi.project.ant.AntArtifactProvider; +import org.netbeans.spi.project.support.ant.AntProjectEvent; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.netbeans.spi.project.support.ant.AntProjectListener; +import org.netbeans.spi.project.support.ant.EditableProperties; +import org.netbeans.spi.project.support.ant.GeneratedFilesHelper; +import org.netbeans.spi.project.support.ant.ProjectXmlSavedHook; +import org.netbeans.spi.project.support.ant.PropertyEvaluator; +import org.netbeans.spi.project.support.ant.ReferenceHelper; +import org.netbeans.spi.project.support.ant.SourcesHelper; +import org.netbeans.spi.project.ui.PrivilegedTemplates; +import org.netbeans.spi.project.ui.ProjectOpenedHook; +import org.netbeans.spi.project.ui.RecommendedTemplates; +import org.netbeans.spi.queries.FileBuiltQueryImplementation; +import org.netbeans.spi.queries.SharabilityQueryImplementation; +import org.openide.ErrorManager; +import org.openide.filesystems.FileObject; +import org.openide.util.Lookup; +import org.openide.util.Mutex; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; +import org.openide.util.lookup.Lookups; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +/** + * + * @author chikkala + */ +public final class SEPluginProject implements Project, AntProjectListener { + + private static final Icon PROJECT_ICON = new ImageIcon(Utilities.loadImage(SEPluginProjectProperties.SE_PLUGIN_PROJECT_ICON_PATH)); // NOI18N + private AntProjectHelper helper; + private PropertyEvaluator evaluator; + private ReferenceHelper refHelper; + private GeneratedFilesHelper genFilesHelper; + private Lookup lookup; + + public SEPluginProject(AntProjectHelper helper) throws IOException { + this.helper = helper; + this.evaluator = createEvaluator(); + AuxiliaryConfiguration aux = helper.createAuxiliaryConfiguration(); + this.refHelper = new ReferenceHelper(helper, aux, helper.getStandardPropertyEvaluator()); + this.genFilesHelper = new GeneratedFilesHelper(helper); + this.lookup = createLookup(aux); + helper.addAntProjectListener(this); + } + + @Override + public String toString() { + return "SEPluginProject[" + getProjectDirectory() + "]"; // NOI18N + } + + public FileObject getProjectDirectory() { + return helper.getProjectDirectory(); + } + + public Lookup getLookup() { + return lookup; + } + + public void configurationXmlChanged(AntProjectEvent event) { + if (event.getPath().equals(AntProjectHelper.PROJECT_XML_PATH)) { + // Could be various kinds of changes, but name & displayName might have changed. + Info info = (Info) getLookup().lookup(ProjectInformation.class); + info.firePropertyChange(ProjectInformation.PROP_NAME); + info.firePropertyChange(ProjectInformation.PROP_DISPLAY_NAME); + } + //TODO: add other configuration xml change event handling code. + } + + public void propertiesChanged(AntProjectEvent event) { + //TODO: add property change event processing. + } + + public AntProjectHelper getAntProjectHelper() { + return helper; + } + + public ReferenceHelper getReferenceHelper() { + return this.refHelper; + } + + public PropertyEvaluator getEvaluator() { + return this.evaluator; + } + + /** + * Return configured project name. + */ + @SuppressWarnings(value = "unchecked") + public String getName() { + return (String) ProjectManager.mutex().readAccess(new Mutex.Action() { + public Object run() { + Element data = helper.getPrimaryConfigurationData(true); + + NodeList nl = data.getElementsByTagNameNS(SEPluginProjectType.PROJECT_CONFIGURATION_NAMESPACE, "name"); + if (nl.getLength() == 1) { + nl = nl.item(0).getChildNodes(); + if (nl.getLength() == 1 && nl.item(0).getNodeType() == Node.TEXT_NODE) { + return ((Text) nl.item(0)).getNodeValue(); + } + } + return "???"; // NOI18N + } + }); + } + + /** + * Store configured project name. + */ + @SuppressWarnings(value = "unchecked") + public void setName(final String name) { + ProjectManager.mutex().writeAccess(new Mutex.Action() { + public Object run() { + Element data = helper.getPrimaryConfigurationData(true); + + NodeList nl = data.getElementsByTagNameNS(SEPluginProjectType.PROJECT_CONFIGURATION_NAMESPACE, "name"); + Element nameEl; + if (nl.getLength() == 1) { + nameEl = (Element) nl.item(0); + NodeList deadKids = nameEl.getChildNodes(); + while (deadKids.getLength() > 0) { + nameEl.removeChild(deadKids.item(0)); + } + } else { + nameEl = data.getOwnerDocument().createElementNS(SEPluginProjectType.PROJECT_CONFIGURATION_NAMESPACE, "name"); + data.insertBefore(nameEl, data.getChildNodes().item(0)); + } + nameEl.appendChild(data.getOwnerDocument().createTextNode(name)); + helper.putPrimaryConfigurationData(data, true); + return null; + } + }); + } + + private PropertyEvaluator createEvaluator() { + //TODO: might need to use a custom evaluator to handle active platform substitutions... + return helper.getStandardPropertyEvaluator(); + } + + private FileBuiltQueryImplementation createFileBuiltQuery() { + return helper.createGlobFileBuiltQuery(getEvaluator(), + new String[]{"${src.dir}/*.java"}, // NOI18N + new String[]{"${build.classes.dir}/*.class"} // NOI18N + ); + } + + private SharabilityQueryImplementation createSharabilityQuery() { + return helper.createSharabilityQuery(getEvaluator(), + new String[]{"${src.dir}"}, // NOI18N + new String[]{"${build.dir}"} // NOI18N + ); + } + + private Sources getSources() { + final SourcesHelper sourcesHelper = new SourcesHelper(helper, getEvaluator()); + //TODO: add pricipal and typed source roots if required. + String srcLabel = NbBundle.getMessage(SEPluginProject.class, "LBL_Node_Sources"); //NOI18N + + String srcLoc = "${" + SEPluginProjectProperties.SRC_DIR + "}"; + sourcesHelper.addPrincipalSourceRoot(srcLoc, srcLabel, null, null); + sourcesHelper.addTypedSourceRoot(srcLoc, SEPluginProjectProperties.SOURCES_TYPE_XML, + srcLabel, null, null); + ProjectManager.mutex().postWriteRequest(new Runnable() { + public void run() { + sourcesHelper.registerExternalRoots(FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT); + } + }); + return sourcesHelper.createSources(); + } + + private Lookup createLookup(AuxiliaryConfiguration aux) { + + SubprojectProvider spp = refHelper.createSubprojectProvider(); + return Lookups.fixed(new Object[]{ + this, // to lookup this project from externally obtained Project + aux, + helper.createCacheDirectoryProvider(), + spp, + new Info(), + new SEPluginProjectActionProvider(this, helper, refHelper), + new SEPluginProjectLogicalViewProvider(this, helper, getEvaluator(), spp, refHelper), + new SEPluginProjectCustomizerProvider(this, helper, refHelper), + new AntArtifactProviderImpl(), + new ProjectXmlSavedHookImpl(), + new ProjectOpenedHookImpl(), + new RecommendedTemplatesImpl(), + new SEPluginProjectOperations(this), + getSources(), + createSharabilityQuery(), + createFileBuiltQuery() + }); + } +// Private inner classes ------------------------------------------------------- + + /** + * @see org.netbeans.api.project.ProjectInformation + */ + private final class Info implements ProjectInformation { + + private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); + + Info() { + } + + void firePropertyChange(String prop) { + pcs.firePropertyChange(prop, null, null); + } + + public String getName() { + return SEPluginProject.this.getName(); + } + + public String getDisplayName() { + return SEPluginProject.this.getName(); + } + + public Icon getIcon() { + return PROJECT_ICON; + } + + public Project getProject() { + return SEPluginProject.this; + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + pcs.addPropertyChangeListener(listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + pcs.removePropertyChangeListener(listener); + } + } + + /** + * @see org.netbeans.spi.project.support.ant.ProjectXmlSavedHook + */ + private final class ProjectXmlSavedHookImpl extends ProjectXmlSavedHook { + + ProjectXmlSavedHookImpl() { + } + + protected void projectXmlSaved() throws IOException { + genFilesHelper.refreshBuildScript( + GeneratedFilesHelper.BUILD_IMPL_XML_PATH, + SEPluginProject.class.getResource("resources/build-impl.xsl"), + false); + genFilesHelper.refreshBuildScript( + GeneratedFilesHelper.BUILD_XML_PATH, + SEPluginProject.class.getResource("resources/build.xsl"), + false); + } + } + + /** + * @see org.netbeans.spi.project.ui.ProjectOpenedHook + */ + private final class ProjectOpenedHookImpl extends ProjectOpenedHook { + + // TODO m + ProjectOpenedHookImpl() { + } + + @SuppressWarnings("unchecked") + protected void projectOpened() { + + try { + // Check up on build scripts. + genFilesHelper.refreshBuildScript( + GeneratedFilesHelper.BUILD_IMPL_XML_PATH, + SEPluginProject.class.getResource("resources/build-impl.xsl"), + true); + genFilesHelper.refreshBuildScript( + GeneratedFilesHelper.BUILD_XML_PATH, + SEPluginProject.class.getResource("resources/build.xsl"), + true); + } catch (IOException e) { + ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); + } + + // Make it easier to run headless builds on the same machine at least. + ProjectManager.mutex().writeAccess(new Mutex.Action() { + public Object run() { + EditableProperties ep = helper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH); + File buildProperties = new File(System.getProperty("netbeans.user"), "build.properties"); // NOI18N + ep.setProperty("user.properties.file", buildProperties.getAbsolutePath()); //NOI18N + helper.putProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH, ep); + //TODO: add any other resolved private properties. for example, the project paths and lib paths + try { + ProjectManager.getDefault().saveProject(SEPluginProject.this); + } catch (IOException e) { + ErrorManager.getDefault().notify(e); + } + return null; + } + }); + + SEPluginProjectLogicalViewProvider logicalViewProvider = + SEPluginProject.this.getLookup().lookup(SEPluginProjectLogicalViewProvider.class); + if (logicalViewProvider != null && logicalViewProvider.hasBrokenLinks()) { + BrokenReferencesSupport.showAlert(); + } + } + + protected void projectClosed() { + // Probably unnecessary, but just in case: + try { + ProjectManager.getDefault().saveProject(SEPluginProject.this); + } catch (IOException e) { + ErrorManager.getDefault().notify(e); + } + } + } + + /** + * @see org.netbeans.spi.project.ui.RecommendedTemplates + * @see org.netbeans.spi.project.ui.PrivilegedTemplates + */ + private static final class RecommendedTemplatesImpl implements RecommendedTemplates, PrivilegedTemplates { + + // List of primarily supported templates + private static final String[] TYPES = new String[]{ + /* TODO: add any other recommended templates + "java-classes", // NOI18N + "ejb-types", // NOI18N + "java-beans", // NOI18N + "oasis-XML-catalogs", // NOI18N + "XML", // NOI18N + "ant-script", // NOI18N + "ant-task", // NOI18N + "simple-files" // NOI18N + */ + "SOA", + "XML", // NOI18N + "simple-files" // NOI18N + }; + private static final String[] PRIVILEGED_NAMES = new String[]{ + /* TODO: add any other privileged names + "Templates/Classes/Class.java", // NOI18N + "Templates/Classes/Package", // NOI18N + "Templates/Classes/Interface.java" // NOI18N + */ + "Templates/XML/XmlDocument.xml", // NOI18N + "Templates/XML/XmlSchema.xsd", // NOI18N + "Templates/XML/WSDL.wsdl", // NOI18N + "Templates/Other/properties.properties" // NOI18N + }; + + public String[] getRecommendedTypes() { + return TYPES; + } + + public String[] getPrivilegedTemplates() { + return PRIVILEGED_NAMES; + } + } + + /** + * Exports the main JAR as an official build product for use from other + * scripts. The type of the artifact will be {@link AntArtifact#TYPE_JAR}. + * + * @see org.netbeans.spi.project.ant.AntArtifactProvider + */ + private final class AntArtifactProviderImpl implements AntArtifactProvider { + + public AntArtifact[] getBuildArtifacts() { + return new AntArtifact[]{ + helper.createSimpleAntArtifact( + SEPluginProjectProperties.ARTIFACT_TYPE_JBI_SU_PREFIX + + helper.getStandardPropertyEvaluator().getProperty(SEPluginProjectProperties.JBI_SU_TARGET_NAME), + SEPluginProjectProperties.JBI_SU_ZIP, + helper.getStandardPropertyEvaluator(), + SEPluginProjectProperties.BUILD_TARGET_DIST, + SEPluginProjectProperties.BUILD_TARGET_CLEAN), + helper.createSimpleAntArtifact(SEPluginProjectProperties.ARTIFACT_TYPE_JAR, + SEPluginProjectProperties.JBI_SU_ZIP, + helper.getStandardPropertyEvaluator(), + SEPluginProjectProperties.BUILD_TARGET_DIST, + SEPluginProjectProperties.BUILD_TARGET_CLEAN) + }; + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectActionProvider.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectActionProvider.java new file mode 100644 index 000000000..f24d31835 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectActionProvider.java @@ -0,0 +1,136 @@ +/* + * SEPluginProjectActionProvider.java + * + */ +package net.openesb.component.${artifactId}.project; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import org.apache.tools.ant.module.api.support.ActionUtils; +import org.netbeans.spi.project.ActionProvider; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.netbeans.spi.project.support.ant.GeneratedFilesHelper; +import org.netbeans.spi.project.support.ant.ReferenceHelper; +import org.netbeans.spi.project.ui.support.DefaultProjectOperations; +import org.openide.DialogDisplayer; +import org.openide.ErrorManager; +import org.openide.NotifyDescriptor; +import org.openide.filesystems.FileObject; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; + +/** + * Action provider of the SE Plugin projects. + * + * @author chikkala + */ +public class SEPluginProjectActionProvider implements ActionProvider { + + // Commands available from SE Plugin Project + private static final String[] supportedActions = {COMMAND_BUILD, COMMAND_CLEAN, COMMAND_REBUILD, COMMAND_DELETE, COMMAND_COPY, COMMAND_MOVE, COMMAND_RENAME}; + private SEPluginProject project; + // Ant project helper of the project + private AntProjectHelper antProjectHelper; + private ReferenceHelper refHelper; + /** + * Map from commands to ant targets + */ + private Map commands; + + public SEPluginProjectActionProvider(SEPluginProject project, AntProjectHelper antProjectHelper, ReferenceHelper refHelper) { + commands = new HashMap(); + commands.put(COMMAND_BUILD, new String[]{"dist"}); // NOI18N + commands.put(COMMAND_CLEAN, new String[]{"clean"}); // NOI18N + commands.put(COMMAND_REBUILD, new String[]{"clean", "dist"}); // NOI18N + //TODO: Add any other ant targets to commands map. + //commands.put(COMMAND_DEPLOY, new String[] {"run"}); // NOI18N + this.antProjectHelper = antProjectHelper; + this.project = project; + this.refHelper = refHelper; + } + + public String[] getSupportedActions() { + return supportedActions; + } + + public void invokeAction(final String command, final Lookup context) throws IllegalArgumentException { + + if (COMMAND_COPY.equals(command)) { + DefaultProjectOperations.performDefaultCopyOperation(project); + return; + } + + if (COMMAND_MOVE.equals(command)) { + DefaultProjectOperations.performDefaultMoveOperation(project); + return; + } + + if (COMMAND_RENAME.equals(command)) { + DefaultProjectOperations.performDefaultRenameOperation(project, null); + return; + } + if (COMMAND_DELETE.equals(command)) { + DefaultProjectOperations.performDefaultDeleteOperation(project); + return; + } + + Runnable action = new Runnable() { + public void run() { + Properties p = new Properties(); + String[] targetNames; + + targetNames = getTargetNames(command, context, p); + if (targetNames == null) { + return; + } + if (targetNames.length == 0) { + targetNames = null; + } + if (p.keySet().size() == 0) { + p = null; + } + try { + FileObject buildFo = findBuildXml(); + if (buildFo == null || !buildFo.isValid()) { + //The build.xml was deleted after the isActionEnabled was called + NotifyDescriptor nd = new NotifyDescriptor.Message(NbBundle.getMessage(SEPluginProjectActionProvider.class, + "LBL_No_Build_XML_Found"), NotifyDescriptor.WARNING_MESSAGE); + DialogDisplayer.getDefault().notify(nd); + } else { + ActionUtils.runTarget(buildFo, targetNames, p); + } + } catch (IOException e) { + ErrorManager.getDefault().notify(e); + } + } + }; + //TODO: add code if needed that requires the execution to wait for some other task to complete. + action.run(); // execute the task to invoke the ant target for the command + + } + + public boolean isActionEnabled(String command, Lookup context) throws IllegalArgumentException { + if (findBuildXml() == null) { + return false; + } + //TODO: Add any commands enabling check logic if required. + return true; + } + + public FileObject findBuildXml() { + return project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH); + } + + /** + * @return array of targets or null to stop execution; can return empty + * array + */ + public String[] getTargetNames(String command, Lookup context, Properties p) throws IllegalArgumentException { + String[] targetNames = commands.get(command); + //TODO: add any special code that requires adding new target names or setting the + // external properties p passed during the ant exection if required. + return targetNames; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectGenerator.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectGenerator.java new file mode 100644 index 000000000..0cc2e39e1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectGenerator.java @@ -0,0 +1,182 @@ +/* + * SEPluginProjectGenerator.java + * + */ +package net.openesb.component.${artifactId}.project; + +import java.io.File; +import java.io.File; +import java.io.IOException; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectManager; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.netbeans.spi.project.support.ant.EditableProperties; +import org.netbeans.spi.project.support.ant.ProjectGenerator; +import org.netbeans.spi.project.support.ant.PropertyUtils; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileStateInvalidException; +import org.openide.filesystems.FileUtil; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Creates a Deployment Plugin Project for Service Engine. + * + * @author chikkala + */ +public class SEPluginProjectGenerator { + + private File mPrjDir; + private String mPrjName; + private String mSUName; + private String mSUDesc; + private String mSUTarget; + + public SEPluginProjectGenerator() { + this.mSUName = SEPluginProjectProperties.JBI_SU_NAME_VALUE; + this.mSUDesc = SEPluginProjectProperties.JBI_SU_DESCRIPTION_VALUE; + this.mSUTarget = SEPluginProjectProperties.JBI_SU_TARGET_NAME_VALUE; + } + + public File getProjectDirectory() { + return this.mPrjDir; + } + + public String getProjectName() { + return this.mPrjName; + } + + public String getSUName() { + return this.mSUName; + } + + public void setSUName(String suName) { + this.mSUName = suName; + } + + public String getSUDescription() { + return this.mSUDesc; + } + + public void setSUDescription(String suDesc) { + this.mSUDesc = suDesc; + } + + public String getSUTarget() { + return this.mSUTarget; + } + + public void setSUTarget(String suTarget) { + this.mSUTarget = suTarget; + } + + private void createPrimaryConfigurationData(AntProjectHelper prjHelper) { + + Element data = prjHelper.getPrimaryConfigurationData(true); + Document doc = data.getOwnerDocument(); + + Element nameEl = doc.createElementNS(SEPluginProjectType.PROJECT_CONFIGURATION_NAMESPACE, "name"); // NOI18N + nameEl.appendChild(doc.createTextNode(this.getProjectName())); + data.appendChild(nameEl); + + prjHelper.putPrimaryConfigurationData(data, true); + } + + private void createProjectPrivateProperties(AntProjectHelper prjHelper) { + + EditableProperties ep = prjHelper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH); + + //TODO: add any project private properties here. + // ep.setProperty("application.args", ""); // NOI18N + prjHelper.putProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH, ep); + } + + private void createProjectProperties(AntProjectHelper prjHelper) { + + EditableProperties ep = prjHelper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); + + ep.setProperty(SEPluginProjectProperties.SRC_DIR, SEPluginProjectProperties.SRC_DIR_VALUE); + ep.setComment(SEPluginProjectProperties.SRC_DIR, new String[]{"# service unit source directory "}, false); // NOI18N + ep.setProperty(SEPluginProjectProperties.BUILD_DIR, SEPluginProjectProperties.BUILD_DIR_VALUE); + + ep.setProperty(SEPluginProjectProperties.BUILD_DIR, SEPluginProjectProperties.BUILD_DIR_VALUE); + + ep.setProperty(SEPluginProjectProperties.JBI_SU_ZIP, SEPluginProjectProperties.JBI_SU_ZIP_VALUE); + + ep.setProperty(SEPluginProjectProperties.JBI_SU_NAME, getSUName()); + ep.setProperty(SEPluginProjectProperties.JBI_SU_DESCRIPTION, getSUDescription()); + ep.setProperty(SEPluginProjectProperties.JBI_SU_TARGET_NAME, getSUTarget()); + + // save properties to file. + prjHelper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, ep); + } + + public AntProjectHelper createProject(File prjDir, String prjName) throws IOException { + AntProjectHelper prjHelper = null; + + this.mPrjDir = prjDir; + this.mPrjName = prjName; + if (SEPluginProjectProperties.JBI_SU_NAME_VALUE.equals(this.getSUName())) { + // default value. so set the su name to project name. + String suName = PropertyUtils.getUsablePropertyName(this.getProjectName()); + this.setSUName(suName); + } + + FileObject prjDirFO = createProjectDir(this.getProjectDirectory()); + + prjHelper = ProjectGenerator.createProject(prjDirFO, SEPluginProjectType.TYPE); + + createPrimaryConfigurationData(prjHelper); + createProjectProperties(prjHelper); + createProjectPrivateProperties(prjHelper); + + FileObject srcFolder = FileUtil.createFolder(prjDirFO, SEPluginProjectProperties.SRC_DIR_VALUE); // NOI18N + + // create su jbi.xml + SEPluginProjectProperties.createDefaultSUDescriptor(srcFolder); + + //TODO: create any service unit specifc default artifacts here. + + Project p = ProjectManager.getDefault().findProject(prjDirFO); + ProjectManager.getDefault().saveProject(p); + + return prjHelper; + } + + private static FileObject createProjectDir(File dir) throws IOException { + FileObject dirFO; + if (!dir.exists()) { + //Refresh before mkdir not to depend on window focus, refreshFileSystem does not work correctly + refreshFolder(dir); + if (!dir.mkdirs()) { + throw new IOException("Can not create project folder."); //NOI18N + } + refreshFileSystem(dir); + } + dirFO = FileUtil.toFileObject(dir); + assert dirFO != null : "No such dir on disk: " + dir; // NOI18N + assert dirFO.isFolder() : "Not really a dir: " + dir; // NOI18N + return dirFO; + } + + private static void refreshFileSystem(final File dir) throws FileStateInvalidException { + File rootF = dir; + while (rootF.getParentFile() != null) { + rootF = rootF.getParentFile(); + } + FileObject dirFO = FileUtil.toFileObject(rootF); + assert dirFO != null : "At least disk roots must be mounted! " + rootF; // NOI18N + dirFO.getFileSystem().refresh(false); + } + + private static void refreshFolder(File dir) { + while (!dir.exists()) { + dir = dir.getParentFile(); + } + FileObject fo = FileUtil.toFileObject(dir); + if (fo != null) { + fo.getChildren(); + fo.refresh(); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectLogicalViewProvider.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectLogicalViewProvider.java new file mode 100644 index 000000000..79f1cae06 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectLogicalViewProvider.java @@ -0,0 +1,81 @@ +/* + * SEPluginProjectLogicalViewProvider.java + * + */ +package net.openesb.component.${artifactId}.project; + +import org.netbeans.api.project.FileOwnerQuery; +import org.netbeans.api.project.Project; +import net.openesb.component.${artifactId}.project.node.SEPluginProjectNode; +import org.netbeans.spi.java.project.support.ui.BrokenReferencesSupport; +import org.netbeans.spi.java.project.support.ui.PackageView; +import org.netbeans.spi.project.SubprojectProvider; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.netbeans.spi.project.support.ant.PropertyEvaluator; +import org.netbeans.spi.project.support.ant.ReferenceHelper; +import org.netbeans.spi.project.ui.LogicalViewProvider; +import org.openide.filesystems.FileObject; +import org.openide.nodes.Node; + +/** + * + * @author chikkala + */ +public class SEPluginProjectLogicalViewProvider implements LogicalViewProvider { + + private final Project mProject; + private final AntProjectHelper mHelper; + private final PropertyEvaluator mEvaluator; + private final SubprojectProvider mSpp; + private final ReferenceHelper mResolver; + + public SEPluginProjectLogicalViewProvider(Project project, AntProjectHelper helper, PropertyEvaluator evaluator, SubprojectProvider spp, ReferenceHelper resolver) { + this.mProject = project; + assert project != null; + this.mHelper = helper; + assert helper != null; + this.mEvaluator = evaluator; + assert evaluator != null; + this.mSpp = spp; + assert spp != null; + this.mResolver = resolver; + } + + public Node createLogicalView() { + return new SEPluginProjectNode(this.mProject, this.mHelper, this.mEvaluator, this.mSpp, this.mResolver); + } + + public Node findPath(Node root, Object target) { + Project project = root.getLookup().lookup(Project.class); + if (project == null) { + return null; + } + + if (target instanceof FileObject) { + FileObject fo = (FileObject) target; + Project owner = FileOwnerQuery.getOwner(fo); + if (!project.equals(owner)) { + return null; // Don't waste time if project does not own the fo + } + + Node[] nodes = root.getChildren().getNodes(true); + for (int i = 0; i < nodes.length; i++) { + Node result = PackageView.findPath(nodes[i], target); + if (result != null) { + return result; + } + } + } + + return null; + } + + private String[] getBreakableProperties() { + String[] breakableProps = new String[0]; + return breakableProps; + } + + public boolean hasBrokenLinks() { + return BrokenReferencesSupport.isBroken(mHelper, mResolver, getBreakableProperties(), new String[]{SEPluginProjectProperties.DEFAULT_PLATFORM}); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectOperations.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectOperations.java new file mode 100644 index 000000000..5c7dd9486 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectOperations.java @@ -0,0 +1,114 @@ +/* + * SEPluginProjectOperations.java + * + */ +package net.openesb.component.${artifactId}.project; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import org.apache.tools.ant.module.api.support.ActionUtils; +import org.netbeans.api.project.Project; +import org.netbeans.spi.project.ActionProvider; +import org.netbeans.spi.project.CopyOperationImplementation; +import org.netbeans.spi.project.DeleteOperationImplementation; +import org.netbeans.spi.project.MoveOperationImplementation; +import org.netbeans.spi.project.support.ant.GeneratedFilesHelper; +import org.openide.filesystems.FileObject; +import org.openide.util.Lookup; +import org.openide.util.lookup.Lookups; + +/** + * + * @author chikkala + */ +public class SEPluginProjectOperations implements DeleteOperationImplementation, CopyOperationImplementation, MoveOperationImplementation { + + private SEPluginProject project; + + public SEPluginProjectOperations(SEPluginProject project) { + this.project = project; + } + + public void notifyDeleting() throws IOException { + SEPluginProjectActionProvider ap = project.getLookup().lookup(SEPluginProjectActionProvider.class); + + assert ap != null; + + Lookup context = Lookups.fixed(new Object[0]); + Properties p = new Properties(); + String[] targetNames = ap.getTargetNames(ActionProvider.COMMAND_CLEAN, context, p); + FileObject buildXML = project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH); + + assert targetNames != null; + assert targetNames.length > 0; + + ActionUtils.runTarget(buildXML, targetNames, p).waitFinished(); + } + + public void notifyDeleted() throws IOException { + project.getAntProjectHelper().notifyDeleted(); + } + + public List getMetadataFiles() { + FileObject projectDirectory = project.getProjectDirectory(); + List files = new ArrayList(); + + addFile(projectDirectory, "nbproject", files); // NOI18N + addFile(projectDirectory, "build.xml", files); // NOI18N + addFile(projectDirectory, "manifest.mf", files); // NOI18N + addFile(projectDirectory, projectDirectory.getName(), files); //NOI18N + + return files; + } + + public List getDataFiles() { + List files = new ArrayList(); + FileObject projectDirectory = project.getProjectDirectory(); + FileObject srcDirFO = SEPluginProjectProperties.getSourceDirectory(project); + files.add(srcDirFO); + return files; + } + + public void notifyCopying() throws IOException { + // do nothing. + // This does copy the old distribution file over though, which is + // probably OK because "ant clean" will clean it up. + } + + public void notifyCopied(Project original, File originalPath, String newName) throws IOException { + if (original == null) { + // do nothing for the original project. + return; + } + + project.getReferenceHelper().fixReferences(originalPath); + + String oldName = project.getName(); + project.setName(newName); + } + + public void notifyMoving() throws IOException { + notifyDeleting(); + } + + public void notifyMoved(Project original, File originalPath, String newName) throws IOException { + if (original == null) { + project.getAntProjectHelper().notifyDeleted(); + return; + } + String oldName = project.getName(); + project.setName(newName); + project.getReferenceHelper().fixReferences(originalPath); + } + + private static void addFile(FileObject projectDirectory, String fileName, List result) { + FileObject file = projectDirectory.getFileObject(fileName); + + if (file != null) { + result.add(file); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectProperties.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectProperties.java new file mode 100644 index 000000000..22166d15e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectProperties.java @@ -0,0 +1,149 @@ +/* + * SEPluginProjectProperties.java + * + */ +package net.openesb.component.${artifactId}.project; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.openide.filesystems.FileLock; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; + +/** + * + * @author chikkala + */ +public class SEPluginProjectProperties { + + public static final String DEFAULT_PLATFORM = "default_platform"; // NOI18N + public static final String SOURCES_TYPE_XML = "xml"; + public static final String SOURCES_TYPE_JAVA = "java"; + public static final String SE_PLUGIN_PROJECT_ICON_PATH = "serviceengine/project/resources/projectIcon.png"; // NOI18N" + /** + * comp app callable ant build targets see + * SEPluginProject.AntArtifactProviderImpl for more info. When a composite + * application project builds the service assembly it calls these targets to + * build a service unit added by this project. + */ + public static final String BUILD_TARGET_DIST = "dist_se"; // NOI18N + public static final String BUILD_TARGET_CLEAN = "clean"; // NOI18N + /** + * Ant artifact type value required for plugin to compapp project see + * SEPluginProject.AntArtifactProviderImpl for more info. The value used is + * "CAPS.asa: where is the name + * of the service engine to which the service unit created by this project + * will be deployed. + */ + public static final String ARTIFACT_TYPE_JBI_SU_PREFIX = "CAPS.asa:"; // NOI18N + /** + * service unit target property. The value is the component name of the + * service engine to which the service unit created by this project will be + * deployed. + */ + public static final String JBI_SU_TARGET_NAME = "jbi.su.target.name"; // NOI18N + /** + * Name of the service engine + */ + public static final String JBI_SU_TARGET_NAME_VALUE = "paramv4seplugin"; // NOI18N + public static final String ARTIFACT_TYPE_JAR = "jar"; // NOI18N + public static final String JBI_SU_NAME = "jbi.su.name"; // NOI18N + public static final String JBI_SU_NAME_VALUE = "ServiceUnit"; // NOI18N + public static final String JBI_SU_DESCRIPTION = "jbi.su.description"; // NOI18N + public static final String JBI_SU_DESCRIPTION_VALUE = "Service unit description"; // NOI18N + public static final String JBI_SU_ZIP = "jbi.su.zip"; + /** + * bug in the comp app project build system prevents us to define the + * service unit archive file name and location to be any thing. You must + * define a hardcoded name for the su archive. TODO: will use the + * ${build.dir}/${jbi.su.name}.zip when compapp bug is fixed. + */ + public static final String JBI_SU_ZIP_VALUE = "${build.dir}/SEDeployment.jar"; + // public static final String JBI_SU_ZIP_VALUE = "${build.dir}/${jbi.su.name}.zip"; + /** + * these properties can be used in the build script that produces the + * service unit archive file. + */ + public static final String JAR_COMPRESS = "jar.compress"; // NOI18N + public static final String BUILD_FILES_EXCLUDES = "build.files.excludes"; // NOI18N + public static final String BUILD_DIR = "build.dir"; // NOI18N + public static final String BUILD_DIR_VALUE = "build"; // NOI18N + public static final String JBI_SU_BUILD_DIR_VALUE = "${build.dir}/${jbi.su.name}"; // NOI18N + public static final String SRC_DIR = "src.dir"; // NOI18N + public static final String SRC_DIR_VALUE = "src"; // NOI18N + public static final String SU_JBI_XML_PATH = "META-INF/jbi.xml"; // NOI18N + + public static FileObject getSourceDirectory(SEPluginProject project) { + AntProjectHelper helper = project.getAntProjectHelper(); + String srcDir = helper.getStandardPropertyEvaluator().getProperty(SRC_DIR); // NOI18N + return helper.resolveFileObject(srcDir); + } + + public static FileObject createDefaultSUDescriptor(FileObject srcFolder) throws IOException { + FileObject jbiXmlFO = null; + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + out.println(""); + out.println(""); + out.println(" "); + out.println(" "); + out.println(" "); + out.println(" "); + out.println(""); + out.close(); + writer.close(); + + jbiXmlFO = FileUtil.createData(srcFolder, SU_JBI_XML_PATH); + saveToFileObject(jbiXmlFO, writer.getBuffer()); + + return jbiXmlFO; + } + + public static void saveToFileObject(FileObject outFO, StringBuffer srcBuff) { + FileLock outLock = null; + OutputStream outS = null; + InputStream inS = null; + + try { + inS = new ByteArrayInputStream(srcBuff.toString().getBytes()); + outLock = outFO.lock(); + outS = outFO.getOutputStream(outLock); + FileUtil.copy(inS, outS); + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (inS != null) { + try { + inS.close(); + } catch (Exception ex) { + //ingore + } + } + if (outS != null) { + try { + outS.close(); + } catch (Exception ex) { + //ingore + } + } + if (outLock != null) { + outLock.releaseLock(); + } + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectType.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectType.java new file mode 100644 index 000000000..1378bd99c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/SEPluginProjectType.java @@ -0,0 +1,55 @@ +/* + * SEPluginProjectProperties.java + */ +package net.openesb.component.${artifactId}.project; + +import java.io.IOException; +import org.netbeans.api.project.Project; +import org.netbeans.spi.project.support.ant.AntBasedProjectType; +import org.netbeans.spi.project.support.ant.AntProjectHelper; + +/** + * Factory for simple service engine deployment plugin project projects. + * + * @author chikkala + */ +public final class SEPluginProjectType implements AntBasedProjectType { + + /** + */ + public static final String TYPE = "serviceengine.project.type"; // NOI18N + /** + */ + public static final String PROJECT_CONFIGURATION_NAMESPACE = "http://www.netbeans.org/ns/jbimodules/paramv4seplugin/1"; // NOI18N + /** + */ + public static final String PROJECT_CONFIGURATION_NAME = "data"; // NOI18N + /** + */ + public static final String PRIVATE_CONFIGURATION_NAME = "data"; // NOI18N + /** + */ + public static final String PRIVATE_CONFIGURATION_NAMESPACE = "http://www.netbeans.org/ns/jbimodules/paramv4seplugin/private/1"; // NOI18N + + /** + * Do nothing, just a service. + */ + public SEPluginProjectType() { + } + + public String getType() { + return TYPE; + } + + public Project createProject(AntProjectHelper helper) throws IOException { + return new SEPluginProject(helper); + } + + public String getPrimaryConfigurationDataElementName(boolean shared) { + return shared ? PROJECT_CONFIGURATION_NAME : PRIVATE_CONFIGURATION_NAME; + } + + public String getPrimaryConfigurationDataElementNamespace(boolean shared) { + return shared ? PROJECT_CONFIGURATION_NAMESPACE : PRIVATE_CONFIGURATION_NAMESPACE; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/Bundle.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/Bundle.properties new file mode 100644 index 000000000..05c5ab3d5 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/Bundle.properties @@ -0,0 +1,19 @@ +# CustomizerDialog +LBL_Customizer_Title=Project Properties - {0} +# cutomizer node labels +LBL_Config_General=General +LBL_Config_BuildCategories=Build +LBL_Config_Compile=Compile +LBL_Config_Package=Package + +# Cutomizer node panel strings +# sample cutomizer panel +# General cutomizer panel +LBL_config.general.su.name=Name: +LBL_config.general.su.desc=Description: +LBL_config.general.su.target=Target JBI Component\: +LBL_config.general.su.target.value.unknown=Unknown +LBL_config.package.su.zip=&Service Unit Archive File\: +LBL_config.package.build.files.exludes=&Exclude from archive file\: +LBL_config.package.build.files.exludes.message=(can not exclude jbi.xml) +CHKB_config.package.jar.compress=&Compress Archive File diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerGeneral.form b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerGeneral.form new file mode 100644 index 000000000..b54857007 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerGeneral.form @@ -0,0 +1,128 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerGeneral.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerGeneral.java new file mode 100644 index 000000000..7943fd97c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerGeneral.java @@ -0,0 +1,178 @@ +/* + * CustomizerGeneral.java + */ +package net.openesb.component.${artifactId}.project.customizer; + +import javax.swing.JPanel; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import org.openide.util.HelpCtx; + +/** + * + * @author chikkala + */ +public class CustomizerGeneral extends JPanel implements HelpCtx.Provider { + + private SEPluginProjectCustomizerModel uiModel; + + public CustomizerGeneral(SEPluginProjectCustomizerModel uiModel) { + + this.uiModel = uiModel; + + initComponents(); + + initTargetComponent(uiModel.getSUTargetModel()); + + this.mSUNameTF.setDocument(uiModel.getSUNameModel()); + this.mSUDescriptionTA.setDocument(uiModel.getSUDescriptionModel()); + + } + + public HelpCtx getHelpCtx() { + return new HelpCtx(CustomizerGeneral.class); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + java.awt.GridBagConstraints gridBagConstraints; + + mSUTargetLBL = new javax.swing.JLabel(); + mSUTargetValueLBL = new javax.swing.JLabel(); + mSUNameLBL = new javax.swing.JLabel(); + mSUNameTF = new javax.swing.JTextField(); + mSUDescriptionLBL = new javax.swing.JLabel(); + mSUDescriptionScrollPane = new javax.swing.JScrollPane(); + mSUDescriptionTA = new javax.swing.JTextArea(); + mFillLBL = new javax.swing.JLabel(); + + setLayout(new java.awt.GridBagLayout()); + + mSUTargetLBL.setLabelFor(mSUTargetValueLBL); + mSUTargetLBL.setText(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "LBL_config.general.su.target")); // NOI18N + mSUTargetLBL.setToolTipText(""); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.ipadx = 5; + gridBagConstraints.ipady = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(12, 2, 2, 4); + add(mSUTargetLBL, gridBagConstraints); + mSUTargetLBL.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "LBL_config.general.su.target")); // NOI18N + + mSUTargetValueLBL.setText(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "LBL_config.general.su.target.value.unknown")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.ipadx = 5; + gridBagConstraints.ipady = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(12, 2, 2, 4); + add(mSUTargetValueLBL, gridBagConstraints); + mSUTargetValueLBL.getAccessibleContext().setAccessibleName(""); + + mSUNameLBL.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + mSUNameLBL.setLabelFor(mSUNameTF); + mSUNameLBL.setText(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "LBL_config.general.su.name")); // NOI18N + mSUNameLBL.setToolTipText(""); + mSUNameLBL.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.ipadx = 5; + gridBagConstraints.ipady = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 4); + add(mSUNameLBL, gridBagConstraints); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.ipadx = 5; + gridBagConstraints.ipady = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 4); + add(mSUNameTF, gridBagConstraints); + + mSUDescriptionLBL.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + mSUDescriptionLBL.setText(org.openide.util.NbBundle.getMessage(CustomizerGeneral.class, "LBL_config.general.su.desc")); // NOI18N + mSUDescriptionLBL.setToolTipText(""); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.ipadx = 5; + gridBagConstraints.ipady = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 4); + add(mSUDescriptionLBL, gridBagConstraints); + + mSUDescriptionScrollPane.setPreferredSize(new java.awt.Dimension(4, 40)); + + mSUDescriptionTA.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N + mSUDescriptionTA.setMargin(new java.awt.Insets(1, 1, 1, 1)); + mSUDescriptionScrollPane.setViewportView(mSUDescriptionTA); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.ipadx = 5; + gridBagConstraints.ipady = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 4); + add(mSUDescriptionScrollPane, gridBagConstraints); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 5; + gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; + gridBagConstraints.weighty = 1.0; + add(mFillLBL, gridBagConstraints); + }// //GEN-END:initComponents + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel mFillLBL; + private javax.swing.JLabel mSUDescriptionLBL; + private javax.swing.JScrollPane mSUDescriptionScrollPane; + private javax.swing.JTextArea mSUDescriptionTA; + private javax.swing.JLabel mSUNameLBL; + private javax.swing.JTextField mSUNameTF; + private javax.swing.JLabel mSUTargetLBL; + private javax.swing.JLabel mSUTargetValueLBL; + // End of variables declaration//GEN-END:variables + + private void setDocumentText(Document doc, String text) { + try { + doc.remove(0, doc.getLength()); + doc.insertString(0, text, null); + } catch (BadLocationException ex) { + ex.printStackTrace(); + // ingore + } + } + + private String getDocumentText(Document doc) { + try { + return doc.getText(0, doc.getLength()); + } catch (BadLocationException ex) { + ex.printStackTrace(); + return ""; + } + } + + private void initTargetComponent(Document doc) { + String targetComp = getDocumentText(doc); + this.mSUTargetValueLBL.setText(targetComp); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerPackage.form b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerPackage.form new file mode 100644 index 000000000..7d688a980 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerPackage.form @@ -0,0 +1,117 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerPackage.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerPackage.java new file mode 100644 index 000000000..a99cca3f3 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/CustomizerPackage.java @@ -0,0 +1,114 @@ +/* + * CustomizerPackage + */ +package net.openesb.component.${artifactId}.project.customizer; + +import javax.swing.JPanel; +import org.openide.util.HelpCtx; + +/** + * Customizer for general project attributes. + * + * @author chikkala + */ +public class CustomizerPackage extends JPanel implements HelpCtx.Provider { + + private SEPluginProjectCustomizerModel uiModel; + + public CustomizerPackage(SEPluginProjectCustomizerModel uiModel) { + this.uiModel = uiModel; + initComponents(); + + mZipFileTF.setDocument(uiModel.getSUZipModel()); + mExcludesTF.setDocument(uiModel.getBuildFilesExcludesModel()); + + uiModel.getJarCompressModel().setMnemonic(mCompressChkBox.getMnemonic()); + mCompressChkBox.setModel(uiModel.getJarCompressModel()); + } + + public HelpCtx getHelpCtx() { + return new HelpCtx(CustomizerPackage.class); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + java.awt.GridBagConstraints gridBagConstraints; + + mZipFileLBL = new javax.swing.JLabel(); + mZipFileTF = new javax.swing.JTextField(); + mExcludesLBL = new javax.swing.JLabel(); + mExcludesTF = new javax.swing.JTextField(); + mCompressChkBox = new javax.swing.JCheckBox(); + mExcludeMessageLBL = new javax.swing.JLabel(); + + setLayout(new java.awt.GridBagLayout()); + + mZipFileLBL.setLabelFor(mZipFileTF); + org.openide.awt.Mnemonics.setLocalizedText(mZipFileLBL, org.openide.util.NbBundle.getMessage(CustomizerPackage.class, "LBL_config.package.su.zip")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 12); + add(mZipFileLBL, gridBagConstraints); + + mZipFileTF.setEditable(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 12, 0); + add(mZipFileTF, gridBagConstraints); + mZipFileTF.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(CustomizerPackage.class).getString("AD_jTextFieldDistDir")); // NOI18N + + mExcludesLBL.setLabelFor(mExcludesTF); + org.openide.awt.Mnemonics.setLocalizedText(mExcludesLBL, org.openide.util.NbBundle.getMessage(CustomizerPackage.class, "LBL_config.package.build.files.exludes")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12); + add(mExcludesLBL, gridBagConstraints); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.weightx = 1.0; + add(mExcludesTF, gridBagConstraints); + mExcludesTF.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(CustomizerPackage.class).getString("AD_jTextFieldExcludes")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(mCompressChkBox, org.openide.util.NbBundle.getMessage(CustomizerPackage.class, "CHKB_config.package.jar.compress")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weighty = 1.0; + add(mCompressChkBox, gridBagConstraints); + mCompressChkBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(CustomizerPackage.class).getString("AD_jCheckBoxCompress")); // NOI18N + + mExcludeMessageLBL.setLabelFor(mExcludesTF); + org.openide.awt.Mnemonics.setLocalizedText(mExcludeMessageLBL, org.openide.util.NbBundle.getBundle(CustomizerPackage.class).getString("LBL_config.package.build.files.exludes.message")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 2; + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0); + add(mExcludeMessageLBL, gridBagConstraints); + }// //GEN-END:initComponents + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox mCompressChkBox; + private javax.swing.JLabel mExcludeMessageLBL; + private javax.swing.JLabel mExcludesLBL; + private javax.swing.JTextField mExcludesTF; + private javax.swing.JLabel mZipFileLBL; + private javax.swing.JTextField mZipFileTF; + // End of variables declaration//GEN-END:variables +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/SEPluginProjectCustomizerModel.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/SEPluginProjectCustomizerModel.java new file mode 100644 index 000000000..0da2f2a5a --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/SEPluginProjectCustomizerModel.java @@ -0,0 +1,125 @@ +/* + * SEPluginProjectCustomizerModel.java + * + */ +package net.openesb.component.${artifactId}.project.customizer; + +import java.io.IOException; +import javax.swing.ButtonModel; +import javax.swing.text.Document; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectManager; +import net.openesb.component.${artifactId}.project.SEPluginProjectProperties; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.netbeans.spi.project.support.ant.EditableProperties; +import org.netbeans.spi.project.support.ant.PropertyEvaluator; +import org.netbeans.spi.project.support.ant.ReferenceHelper; +import org.netbeans.spi.project.support.ant.ui.StoreGroup; +import org.openide.ErrorManager; +import org.openide.filesystems.FileObject; +import org.openide.util.Mutex; +import org.openide.util.MutexException; + +/** + * + * @author chikkala + */ +public class SEPluginProjectCustomizerModel { + + private Project mProject; + private AntProjectHelper mAntPrjHelper; + private ReferenceHelper mRefHelper; + private StoreGroup mPrjPropsStore; + private Document mSUTargetModel; + private Document mSUNameModel; + private Document mSUDescModel; + private Document mSUZipModel; + private ButtonModel mSUZipCompressModel; + private Document mBuildFilesExcludesModel; + + /** + * Creates a new instance of Customizer UI Model and initializes it + */ + public SEPluginProjectCustomizerModel(Project project, AntProjectHelper antProjectHelper, ReferenceHelper refHelper) { + this.mProject = project; + this.mAntPrjHelper = antProjectHelper; + this.mRefHelper = refHelper; + this.mPrjPropsStore = new StoreGroup(); + init(); + } + + public Document getSUTargetModel() { + return this.mSUTargetModel; + } + + public Document getSUNameModel() { + return this.mSUNameModel; + } + + public Document getSUDescriptionModel() { + return this.mSUDescModel; + } + + public Document getSUZipModel() { + return this.mSUZipModel; + } + + public ButtonModel getJarCompressModel() { + return this.mSUZipCompressModel; + } + + public Document getBuildFilesExcludesModel() { + return this.mBuildFilesExcludesModel; + } + + /** + * Initializes the visual models + */ + private void init() { + // initialize visual models from project properties + PropertyEvaluator evaluator = this.mAntPrjHelper.getStandardPropertyEvaluator(); + // cutomizer-general + this.mSUTargetModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.JBI_SU_TARGET_NAME); + this.mSUNameModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.JBI_SU_NAME); + this.mSUDescModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.JBI_SU_DESCRIPTION); + // customizer-package + this.mSUZipModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.JBI_SU_ZIP); + this.mSUZipCompressModel = this.mPrjPropsStore.createToggleButtonModel(evaluator, SEPluginProjectProperties.JAR_COMPRESS); + this.mBuildFilesExcludesModel = this.mPrjPropsStore.createStringDocument(evaluator, SEPluginProjectProperties.BUILD_FILES_EXCLUDES); + } + + /** + * Save visual models to project properties and other metadata + */ + public void save() { + + try { + // Store properties + @SuppressWarnings("unchecked") + Boolean result = (Boolean) ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction() { + final FileObject projectDir = mAntPrjHelper.getProjectDirectory(); + + public Object run() throws IOException { + //TODO: regenreate any project build script and project metadata if required. + // store project properties. + storeProperties(); + return Boolean.TRUE; + } + }); + // and save project if required. + if (result == Boolean.TRUE) { + ProjectManager.getDefault().saveProject(mProject); + } + } catch (MutexException e) { + ErrorManager.getDefault().notify((IOException) e.getException()); + } catch (IOException ex) { + ErrorManager.getDefault().notify(ex); + } + + } + + private void storeProperties() throws IOException { + EditableProperties projectProperties = mAntPrjHelper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); + this.mPrjPropsStore.store(projectProperties); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/SEPluginProjectCustomizerProvider.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/SEPluginProjectCustomizerProvider.java new file mode 100644 index 000000000..124e39f28 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/customizer/SEPluginProjectCustomizerProvider.java @@ -0,0 +1,230 @@ +/* + * SEPluginProjectCustomizerProvider.java + * + */ +package net.openesb.component.${artifactId}.project.customizer; + +import java.awt.Dialog; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.ResourceBundle; +import javax.swing.JComponent; +import javax.swing.JPanel; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectUtils; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.netbeans.spi.project.support.ant.ReferenceHelper; +import org.netbeans.spi.project.ui.CustomizerProvider; +import org.netbeans.spi.project.ui.support.ProjectCustomizer; +import org.openide.util.NbBundle; + +/** + * + * @author chikkala + */ +public class SEPluginProjectCustomizerProvider implements CustomizerProvider { + + // Option indexes + private static final int OPTION_OK = 0; + private static final int OPTION_CANCEL = OPTION_OK + 1; + // Option command names + private static final String COMMAND_OK = "OK"; // NOI18N + private static final String COMMAND_CANCEL = "CANCEL"; // NOI18N + // Categories + private static final String GENERAL = "General"; // NOI18N + private static final String BUILD_CATEGORIES = "Build"; // NOI18N + private static final String COMPILE = "Compile"; // NOI18N + private static final String PACKAGE = "Package"; // NOI18N + private Project project; + private AntProjectHelper antProjectHelper; + private ReferenceHelper refHelper; + private SEPluginProjectCustomizerModel uiModel; + private List categories; + private ProjectCustomizer.CategoryComponentProvider panelProvider; + private static Map project2Dialog = new HashMap(); + + public SEPluginProjectCustomizerProvider(Project project, AntProjectHelper antProjectHelper, ReferenceHelper refHelper) { + this.project = project; + this.refHelper = refHelper; + this.antProjectHelper = antProjectHelper; + } + + public void showCustomizer() { + showCustomizer(null); + } + + public void showCustomizer(String preselectedCategory) { + showCustomizer(preselectedCategory, null); + } + + public void showCustomizer(String preselectedCategory, String preselectedSubCategory) { + + Dialog dialog = project2Dialog.get(project); + if (dialog != null) { + dialog.setVisible(true); + return; + } else { + SEPluginProjectCustomizerModel model = new SEPluginProjectCustomizerModel(project, antProjectHelper, refHelper); + init(model); + + OptionListener listener = new OptionListener(project, uiModel); + + if (preselectedCategory != null && preselectedSubCategory != null) { + for (ProjectCustomizer.Category category : categories) { + if (preselectedCategory.equals(category.getName())) { + JComponent component = panelProvider.create(category); + if (component instanceof SubCategoryProvider) { + ((SubCategoryProvider) component).showSubCategory(preselectedSubCategory); + } + break; + } + } + } + dialog = ProjectCustomizer.createCustomizerDialog( + categories.toArray(new ProjectCustomizer.Category[categories.size()]), + panelProvider, preselectedCategory, listener, null); + dialog.addWindowListener(listener); + dialog.setTitle(MessageFormat.format(NbBundle.getMessage(SEPluginProjectCustomizerProvider.class, "LBL_Customizer_Title"), new Object[]{ProjectUtils.getInformation(project).getDisplayName()})); + + project2Dialog.put(project, dialog); + dialog.setVisible(true); + } + } + + private void init(SEPluginProjectCustomizerModel uiModel) { + + this.uiModel = uiModel; + categories = new ArrayList(); + panelProvider = new PanelProvider(createCategoriesMap()); + } + + /** + * Getter for categories + */ + protected List getCategories() { + return categories; + } + + /** + * This api is called when showCustomizer is invoked and if customizer + * provider is not fully initialized. The default implementation creates + * Project Reference and XML Catalog Categories. Subclasses can override + * this and may or may not call super depending upon, the categories are + * desired in project customizer. + */ + protected Map createCategoriesMap() { + + ResourceBundle bundle = NbBundle.getBundle(SEPluginProjectCustomizerProvider.class); + + ProjectCustomizer.Category generalNode = ProjectCustomizer.Category.create( + GENERAL, + bundle.getString("LBL_Config_General"), // NOI18N + null, + (ProjectCustomizer.Category[]) null); + ProjectCustomizer.Category packageNode = ProjectCustomizer.Category.create( + PACKAGE, + bundle.getString("LBL_Config_Package"), // NOI18N + null, + (ProjectCustomizer.Category[]) null); + /* //TODO: add new category if required + ProjectCustomizer.Category compileNode = ProjectCustomizer.Category.create( + COMPILE, + bundle.getString( "LBL_Config_Compile" ), // NOI18N + null, + (ProjectCustomizer.Category[])null); + */ + ProjectCustomizer.Category[] buildCategories = new ProjectCustomizer.Category[]{packageNode}; + // TODO: add other categories to build if required. + // buildCategories = new ProjectCustomizer.Category[] {compileNode, packageNode }; + ProjectCustomizer.Category buildCategoriesNode = ProjectCustomizer.Category.create( + BUILD_CATEGORIES, + bundle.getString("LBL_Config_BuildCategories"), // NOI18N + null, + buildCategories); + + getCategories().add(generalNode); + getCategories().add(buildCategoriesNode); + + Map panels = + new HashMap(); + + panels.put(generalNode, new CustomizerGeneral(uiModel)); + panels.put(packageNode, new CustomizerPackage(uiModel)); + // panels.put(compileNode, new CustomizerCompile(uiModel)); + + return panels; + } + + /** + * CategoryComponentProvider provider class. It stores categories and there + * corresponding UI in a map. An instance of PanelProvider is stored in + * CustomizerProviderImpl instance + */ + private static class PanelProvider implements ProjectCustomizer.CategoryComponentProvider { + + private JPanel EMPTY_PANEL = new JPanel(); + private Map panels; + + PanelProvider(Map panels) { + this.panels = panels; + } + + public JComponent create(ProjectCustomizer.Category category) { + JComponent panel = panels.get(category); + return panel == null ? EMPTY_PANEL : panel; + } + } + + /** + * Listens to the actions on the Customizer's option buttons + */ + private class OptionListener extends WindowAdapter implements ActionListener { + + private Project project; + private SEPluginProjectCustomizerModel uiModel; + + OptionListener(Project project, SEPluginProjectCustomizerModel uiModel) { + this.project = project; + this.uiModel = uiModel; + } + + // Listening to OK button ---------------------------------------------- + public void actionPerformed(ActionEvent e) { + // Store the properties into project + this.uiModel.save(); + // Close & dispose the the dialog + Dialog dialog = project2Dialog.get(project); + if (dialog != null) { + dialog.setVisible(false); + dialog.dispose(); + } + } + + // Listening to window events ------------------------------------------ + public void windowClosed(WindowEvent e) { + project2Dialog.remove(project); + } + + public void windowClosing(WindowEvent e) { + //Dispose the dialog otherwsie the {@link WindowAdapter#windowClosed} + //may not be called + Dialog dialog = project2Dialog.get(project); + if (dialog != null) { + dialog.setVisible(false); + dialog.dispose(); + } + } + } + + public static interface SubCategoryProvider { + + public void showSubCategory(String name); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/node/Bundle.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/node/Bundle.properties new file mode 100644 index 000000000..aacefb0e0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/node/Bundle.properties @@ -0,0 +1,16 @@ +LBL_Fix_Broken_Links_Action=Resolve Reference Problems... + +#Actions +LBL_CleanAction_Name=Clean Project +LBL_BuildAction_Name=Build Project +LBL_RebuildAction_Name=Clean and Build Project +LBL_RunAction_Name=Run Project +LBL_DebugAction_Name=Debug Project +LBL_JavadocAction_Name=Generate Javadoc for Project +LBL_TestAction_Name=Test Component +LBL_Properties_Action=Properties +LBL_AddProject_Action=Add Project... +LBL_AddLibrary_Action=Add Library... +LBL_AddFolder_Action=Add JAR/Folder... + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/node/SEPluginProjectNode.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/node/SEPluginProjectNode.java new file mode 100644 index 000000000..f756d9081 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/node/SEPluginProjectNode.java @@ -0,0 +1,350 @@ +/* + * SEPluginProjectNode.java + * + */ +package net.openesb.component.${artifactId}.project.node; + +import java.awt.event.ActionEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.ResourceBundle; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JSeparator; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectUtils; +import net.openesb.component.${artifactId}.project.SEPluginProjectProperties; +import org.netbeans.spi.java.project.support.ui.BrokenReferencesSupport; +import org.netbeans.spi.project.ActionProvider; +import org.netbeans.spi.project.SubprojectProvider; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.netbeans.spi.project.support.ant.PropertyEvaluator; +import org.netbeans.spi.project.support.ant.ReferenceHelper; +import org.netbeans.spi.project.ui.support.CommonProjectActions; +import org.netbeans.spi.project.ui.support.DefaultProjectOperations; +import org.netbeans.spi.project.ui.support.ProjectSensitiveActions; +import org.openide.actions.FindAction; +import org.openide.filesystems.FileAttributeEvent; +import org.openide.filesystems.FileChangeListener; +import org.openide.filesystems.FileEvent; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileRenameEvent; +import org.openide.loaders.DataObject; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.nodes.FilterNode; +import org.openide.nodes.Node; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; +import org.openide.util.actions.SystemAction; +import org.openide.util.lookup.Lookups; + +/** + * + * @author chikkala + */ +public class SEPluginProjectNode extends AbstractNode { + + private Project project; + private AntProjectHelper helper; + private PropertyEvaluator evaluator; + private SubprojectProvider spp; + private ReferenceHelper resolver; + private Action brokenLinksAction; + private boolean broken; + + public SEPluginProjectNode(Project project, AntProjectHelper helper, PropertyEvaluator evaluator, SubprojectProvider spp, ReferenceHelper resolver) { + super(new SEPluginProjectNodeChildren(project, helper, evaluator), Lookups.singleton(project)); + setIconBaseWithExtension(SEPluginProjectProperties.SE_PLUGIN_PROJECT_ICON_PATH); + super.setName(ProjectUtils.getInformation(project).getDisplayName()); + + this.project = project; + assert project != null; + this.helper = helper; + assert helper != null; + this.evaluator = evaluator; + assert evaluator != null; + this.spp = spp; + assert spp != null; + this.resolver = resolver; + + if (hasBrokenLinks(helper, resolver)) { + broken = true; + brokenLinksAction = new BrokenLinksAction(); + } + } + + @Override + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + // TODO: new HelpCtx("se_deploy_plugin_project_about"); // NOI18N + } + + @Override + public Action[] getActions(boolean context) { + if (context) { + return super.getActions(true); + } else { + return getAdditionalActions(); + } + } + + @Override + public boolean canRename() { + return true; + } + + @Override + public void setName(String s) { + DefaultProjectOperations.performDefaultRenameOperation(project, s); + } + + private String[] getBreakableProperties() { + String[] breakableProps = new String[0]; + return breakableProps; + } + + public boolean hasBrokenLinks(AntProjectHelper helper, ReferenceHelper resolver) { + return BrokenReferencesSupport.isBroken(helper, resolver, getBreakableProperties(), new String[]{SEPluginProjectProperties.DEFAULT_PLATFORM}); + } + + private Action[] getAdditionalActions() { + + ResourceBundle bundle = NbBundle.getBundle(SEPluginProjectNode.class); + + List actions = new ArrayList(); + + actions.add(CommonProjectActions.newFileAction()); + actions.add(null); + actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_BUILD, bundle.getString("LBL_BuildAction_Name"), null)); // NOI18N + actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_REBUILD, bundle.getString("LBL_RebuildAction_Name"), null)); // NOI18N + actions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, bundle.getString("LBL_CleanAction_Name"), null)); // NOI18N + //TODO: add additional plugin specific actions + actions.add(null); + actions.add(CommonProjectActions.setAsMainProjectAction()); + actions.add(CommonProjectActions.openSubprojectsAction()); + actions.add(CommonProjectActions.closeProjectAction()); + actions.add(null); + actions.add(CommonProjectActions.renameProjectAction()); + actions.add(CommonProjectActions.moveProjectAction()); + actions.add(CommonProjectActions.copyProjectAction()); + actions.add(CommonProjectActions.deleteProjectAction()); + actions.add(null); + actions.add(SystemAction.get(FindAction.class)); + // add actions from layer filesystem configuration + addFromLayers(actions, "Projects/Actions"); //NOI18N + actions.add(null); + actions.add(brokenLinksAction); + actions.add(CommonProjectActions.customizeProjectAction()); + + return actions.toArray(new Action[actions.size()]); + } + + private void addFromLayers(List actions, String path) { + Lookup look = Lookups.forPath(path); + for (Object next : look.lookupAll(Object.class)) { + if (next instanceof Action) { + actions.add((Action) next); + } else if (next instanceof JSeparator) { + actions.add(null); + } + } + } + + /** + * This action is created only when project has broken references. Once + * these are resolved the action is disabled. + */ + private class BrokenLinksAction extends AbstractAction implements PropertyChangeListener { + + public BrokenLinksAction() { + evaluator.addPropertyChangeListener(this); + putValue(Action.NAME, NbBundle.getMessage(SEPluginProjectNode.class, "LBL_Fix_Broken_Links_Action")); + } + + public void actionPerformed(ActionEvent e) { + /* + BrokenReferencesSupport.showCustomizer(helper, resolver, BREAKABLE_PROPERTIES, new String[]{SEPluginProjectProperties.DEFAULT_PLATFORM}); + if (!hasBrokenLinks(helper, resolver)) { + disable(); + } + */ + // do nothing... + } + + public void propertyChange(PropertyChangeEvent evt) { + if (!broken) { + disable(); + return; + } + broken = hasBrokenLinks(helper, resolver); + if (!broken) { + disable(); + } + } + + private void disable() { + broken = false; + setEnabled(false); + evaluator.removePropertyChangeListener(this); + fireIconChange(); + fireOpenedIconChange(); + } + } + + private static final class SEPluginProjectNodeChildren extends Children.Keys implements FileChangeListener { + + private static final String KEY_SU_JBI_XML = "SU_JBI_XML_Key"; // NOI18N + private static final String KEY_SOURCE_DIR = "SourceDirKey"; // NOI18N + private Project project; + private AntProjectHelper helper; + private PropertyEvaluator evaluator; + + public SEPluginProjectNodeChildren(Project project, AntProjectHelper helper, PropertyEvaluator evaluator) { + this.project = project; + assert project != null; + this.helper = helper; + assert helper != null; + this.evaluator = evaluator; + assert evaluator != null; + } + + private FileObject getSourceFolder() { + String srcDir = helper.getStandardPropertyEvaluator().getProperty(SEPluginProjectProperties.SRC_DIR); // NOI18N + return helper.resolveFileObject(srcDir); + } + + private FileObject getJbiXml(FileObject srcDirFO) { + FileObject jbiXmlFO = null; + if (srcDirFO == null) { + return null; + } + jbiXmlFO = srcDirFO.getFileObject(SEPluginProjectProperties.SU_JBI_XML_PATH); + if (jbiXmlFO == null) { + // create default jbi.xml + try { + jbiXmlFO = SEPluginProjectProperties.createDefaultSUDescriptor(srcDirFO); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + return jbiXmlFO; + } + + @Override + @SuppressWarnings("unchecked") + protected void addNotify() { + super.addNotify(); + FileObject projectDirFO = project.getProjectDirectory(); + if (projectDirFO != null) { + projectDirFO.addFileChangeListener(this); + } + FileObject srcDirFO = getSourceFolder(); + if (srcDirFO != null) { + srcDirFO.addFileChangeListener(this); + } + setKeys(getKeys()); + } + + @Override + @SuppressWarnings("unchecked") + protected void removeNotify() { + + setKeys(Collections.emptySet()); + + FileObject projectDirFO = project.getProjectDirectory(); + if (projectDirFO != null) { + projectDirFO.removeFileChangeListener(this); + } + FileObject srcDirFO = getSourceFolder(); + if (srcDirFO != null) { + srcDirFO.removeFileChangeListener(this); + } + + super.removeNotify(); + } + + private Collection getKeys() { + //when the project is deleted externally do not try to create children, the source groups + //are not valid + if (project.getProjectDirectory() == null || !project.getProjectDirectory().isValid()) { + return Collections.emptyList(); + } + + List result = new ArrayList(); + + FileObject srcDirFO = null; + FileObject jbiXmlFO = null; + + srcDirFO = getSourceFolder(); + if (srcDirFO != null) { + jbiXmlFO = getJbiXml(srcDirFO); + } + if (jbiXmlFO != null) { + result.add(KEY_SU_JBI_XML); + } + + if (srcDirFO != null) { + result.add(KEY_SOURCE_DIR); + } + + //TODO: add any other top level node keys here. + return result; + } + + protected Node createNode(FileObject fo) { + try { + DataObject dataObj = DataObject.find(fo); + return new FilterNode(dataObj.getNodeDelegate()); + } catch (Exception ex) { + return null; + } + } + + protected Node[] createNodes(Object key) { + List newNodes = new ArrayList(); + if (KEY_SU_JBI_XML.equals(key)) { + FileObject srcDirFO = getSourceFolder(); + FileObject jbiXmlFO = getJbiXml(srcDirFO); + newNodes.add(createNode(jbiXmlFO)); + } else if (KEY_SOURCE_DIR.equals(key)) { + FileObject srcDirFO = getSourceFolder(); + newNodes.add(createNode(srcDirFO)); + } + return newNodes.toArray(new Node[newNodes.size()]); + } + + @SuppressWarnings("unchecked") + public void fileFolderCreated(FileEvent evt) { + setKeys(getKeys()); + } + + @SuppressWarnings("unchecked") + public void fileDataCreated(FileEvent evt) { + setKeys(getKeys()); + } + + public void fileChanged(FileEvent evt) { + + } + + @SuppressWarnings("unchecked") + public void fileDeleted(FileEvent evt) { + setKeys(getKeys()); + } + + @SuppressWarnings("unchecked") + public void fileRenamed(FileRenameEvent evt) { + setKeys(getKeys()); + } + + public void fileAttributeChanged(FileAttributeEvent evt) { + + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/build-impl.xsl b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/build-impl.xsl new file mode 100644 index 000000000..9adad65fd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/build-impl.xsl @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + default + .. + + + jar + Build whole project. + + + + ====================== + INITIALIZATION SECTION + ====================== + + + + Empty placeholder for easier customization. + You can override this target in the ../build.xml file. + + + + -pre-init + + + + + -pre-init,-init-private + + + + + -pre-init,-init-private,-init-user + + + + + -pre-init,-init-private,-init-user,-init-project + + + + + Empty placeholder for easier customization. + You can override this target in the ../build.xml file. + + + + -pre-init,-init-private,-init-user,-init-project,-do-init + Must set src.dir + Must set build.dir + Must set jbi.su.name + Must set jbi.su.zip + + + + -pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check + + + + =================== + COMPILATION SECTION + =================== + + + + init + + + + + Empty placeholder for easier customization. + You can override this target in the ../build.xml file. + + + + init,-pre-pre-compile,-pre-compile + + + + + + + + + + Empty placeholder for easier customization. + You can override this target in the ../build.xml file. + + + + init,-pre-pre-compile,-pre-compile,-do-compile,-post-compile + Compile project. + + + + ==================== + JAR BUILDING SECTION + ==================== + + + + init + + + + + Empty placeholder for easier customization. + You can override this target in the ../build.xml file. + + + + init,compile,-pre-pre-jar,-pre-jar + + + + + Empty placeholder for easier customization. + You can override this target in the ../build.xml file. + + + + init,compile,-pre-jar,-do-jar,-post-jar + Build JAR. + + + + init,jar + + + + init,jar + + + + =============== + CLEANUP SECTION + =============== + + + + init + + + + + + Empty placeholder for easier customization. + You can override this target in the ../build.xml file. + + + + init,-do-clean,-post-clean + Clean build products. + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/build.xsl b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/build.xsl new file mode 100644 index 000000000..288568af6 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/build.xsl @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + You may freely edit this file. See commented blocks below for + some examples of how to customize the build. + (If you delete it and reopen the project it will be recreated.) + + + + + + + default + . + Builds, tests, and runs the project + . + + + + + + + + + + For list of available properties check the imported + nbproject/build-impl.xml file. + + + Another way to customize the build is by overriding existing main targets. + The targets of interest are: + + -init-macrodef-javac: defines macro for javac compilation + -init-macrodef-junit: defines macro for junit execution + -init-macrodef-debug: defines macro for class debugging + -init-macrodef-java: defines macro for class execution + -do-jar-with-manifest: JAR building (if you are using a manifest) + -do-jar-without-manifest: JAR building (if you are not using a manifest) + run: execution of project + -javadoc-build: Javadoc generation + test-report: JUnit report generation + + An example of overriding the target for project execution could look like this: + + + + + + + + Notice that the overridden target depends on the jar target and not only on + the compile target as the regular run target does. Again, for a list of available + properties which you can use, check the target you are overriding in the + nbproject/build-impl.xml file. + + ]]> + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/projectIcon.png b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/projectIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..efb923b40690516038fa763ef9cca96a5aa6dde7 GIT binary patch literal 450 zcmV;z0X_bSP)3ct?C0nwvjtF2 zxf3AxiS1oC5uM3w0q&UdG#j>VcNVO(6x;#NH}t>IzOtWSgXJ*_)V*fj2d4AExy{kv zh#hG2IZw0Y*d+mbU0OqQ9F^BcbRR91007*qoM6N<$f_vG>p#T5? literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/se-jbi-module.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/se-jbi-module.xml new file mode 100644 index 000000000..01e9ab043 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/resources/se-jbi-module.xml @@ -0,0 +1,3 @@ + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/Bundle.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/Bundle.properties new file mode 100644 index 000000000..56d0f658f --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/Bundle.properties @@ -0,0 +1,9 @@ +LBL_CreateProjectStep=Name and Location + +LBL_ProjectName=Project &Name: + +LBL_ProjectLocation=Project &Location: + +LBL_ProjectFolder=Project &Folder: + +LBL_Browse=Br&owse... diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectDescription.html b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectDescription.html new file mode 100644 index 000000000..21e9e6bdc --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectDescription.html @@ -0,0 +1,8 @@ + + + + + + Service Engine deploment plugin project + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardIterator.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardIterator.java new file mode 100644 index 000000000..5da0b6429 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardIterator.java @@ -0,0 +1,238 @@ +/* + * SEPluginProjectWizardIterator.java + */ +package net.openesb.component.${artifactId}.project.wizard; + +import java.awt.Component; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import javax.swing.JComponent; +import javax.swing.event.ChangeListener; +import net.openesb.component.${artifactId}.project.SEPluginProjectGenerator; +import net.openesb.component.${artifactId}.project.SEPluginProjectProperties; +import org.netbeans.spi.project.support.ant.AntProjectHelper; +import org.netbeans.spi.project.ui.support.ProjectChooser; +import org.netbeans.spi.project.ui.templates.support.Templates; +import org.openide.WizardDescriptor; +import org.openide.filesystems.FileLock; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.filesystems.Repository; +import org.openide.loaders.DataFolder; +import org.openide.loaders.DataObject; +import org.openide.util.NbBundle; + +public class SEPluginProjectWizardIterator implements WizardDescriptor.InstantiatingIterator { + + public final static String PROJECT_DIR = "projdir"; + public final static String PROJECT_NAME = "name"; + public final static String DEF_PROJECT_NAME_VALUE = "JBIModule"; + private int index; + private WizardDescriptor.Panel[] panels; + private WizardDescriptor wiz; + + public SEPluginProjectWizardIterator() { + } + + public static SEPluginProjectWizardIterator createIterator() { + return new SEPluginProjectWizardIterator(); + } + + private WizardDescriptor.Panel[] createPanels() { + return new WizardDescriptor.Panel[]{ + new SEPluginProjectWizardPanel() + }; + } + + private String[] createSteps() { + return new String[]{ + NbBundle.getMessage(SEPluginProjectWizardIterator.class, "LBL_CreateProjectStep") + }; + } + + public Set instantiate(/*ProgressHandle handle*/) throws IOException { + + Set resultSet = createSEDeployPluginProject(); + // save the current projects folder + File dirF = FileUtil.normalizeFile((File) wiz.getProperty(PROJECT_DIR)); + File parent = dirF.getParentFile(); + if (parent != null && parent.exists()) { + ProjectChooser.setProjectsFolder(parent); + } + return resultSet; + } + + public void initialize(WizardDescriptor wiz) { + this.wiz = wiz; + + try { + FileObject templateFO = Templates.getTemplate(wiz); + DataObject templateDO = DataObject.find(templateFO); + this.wiz.putProperty(PROJECT_NAME, templateDO.getName()); + } catch (Exception ex) { + this.wiz.putProperty(PROJECT_NAME, DEF_PROJECT_NAME_VALUE); + } + + index = 0; + panels = createPanels(); + // Make sure list of steps is accurate. + String[] steps = createSteps(); + for (int i = 0; i < panels.length; i++) { + Component c = panels[i].getComponent(); + if (steps[i] == null) { + // Default step name to component name of panel. + // Mainly useful for getting the name of the target + // chooser to appear in the list of steps. + steps[i] = c.getName(); + } + if (c instanceof JComponent) { // assume Swing components + JComponent jc = (JComponent) c; + // Step #. + jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i)); + // Step name (actually the whole list for reference). + jc.putClientProperty("WizardPanel_contentData", steps); + } + } + } + + public void uninitialize(WizardDescriptor wiz) { + this.wiz.putProperty(PROJECT_DIR, null); + this.wiz.putProperty(PROJECT_NAME, null); + this.wiz = null; + panels = null; + } + + public String name() { + return MessageFormat.format("{0} of {1}", + new Object[]{new Integer(index + 1), new Integer(panels.length)}); + } + + public boolean hasNext() { + return index < panels.length - 1; + } + + public boolean hasPrevious() { + return index > 0; + } + + public void nextPanel() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + index++; + } + + public void previousPanel() { + if (!hasPrevious()) { + throw new NoSuchElementException(); + } + index--; + } + + public WizardDescriptor.Panel current() { + return panels[index]; + } + + // If nothing unusual changes in the middle of the wizard, simply: + public final void addChangeListener(ChangeListener l) { + } + + public final void removeChangeListener(ChangeListener l) { + } + + protected Set createSEDeployPluginProject() throws IOException { + + Set resultSet = new LinkedHashSet(); + + File prjDirFile = FileUtil.normalizeFile((File) wiz.getProperty(PROJECT_DIR)); + String prjName = (String) wiz.getProperty(PROJECT_NAME); + + SEPluginProjectGenerator prjGenerator = new SEPluginProjectGenerator(); + AntProjectHelper h = prjGenerator.createProject(prjDirFile, prjName); + + FileObject projectDirFO = h.getProjectDirectory(); + resultSet.add(projectDirFO); + + Set defArtifacts = createProjectSpecificArtifacts(projectDirFO); + resultSet.addAll(defArtifacts); + + return resultSet; + } + + private FileObject copyResource(FileObject dirFO, String name, String resourcePath) throws IOException { + FileObject dataFO = null; + FileLock outLock = null; + OutputStream outS = null; + InputStream inS = null; + + try { + inS = this.getClass().getResourceAsStream(resourcePath); + dataFO = FileUtil.createData(dirFO, name); + outLock = dataFO.lock(); + outS = dataFO.getOutputStream(outLock); + FileUtil.copy(inS, outS); + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (inS != null) { + try { + inS.close(); + } catch (Exception ex) { + //ingore + } + } + if (outS != null) { + try { + outS.close(); + } catch (Exception ex) { + //ingore + } + } + if (outLock != null) { + outLock.releaseLock(); + } + } + return dataFO; + } + + protected Set createProjectSpecificArtifacts(FileObject projectDirFO) throws IOException { + Set resultSet = new LinkedHashSet(); + //TODO: create any default service unit artifacts needed. + try { + + FileObject srcDirFO = projectDirFO.getFileObject(SEPluginProjectProperties.SRC_DIR_VALUE); + resultSet.add(srcDirFO); + + // create service unit jbi descriptor + FileObject metaInfDirFO = FileUtil.createFolder(srcDirFO, "META-INF"); + FileObject jbiXmlFO = copyResource(metaInfDirFO, "jbi.xml", "resources/jbi.xml"); + resultSet.add(jbiXmlFO); + + // create any service unit artifacts such as wsdl files and configuration files + + // list of su artifacts to be created from the resources directory + String[] suArtifacts = {"xsltmap.properties","goodbye.xsl","hello.xsl","Greetings.wsdl"}; + + for (String suArtifact : suArtifacts) { + FileObject suArtifactFO = copyResource(srcDirFO, suArtifact, "resources/" + suArtifact); + resultSet.add(suArtifactFO); + } + + //TODO: add any addtional default service unit artifacts here. + // FileObject suArtifactFO = copyResource(srcDirFO, "su-artifact.xml", "resources/su-artifact.xml"); + // resultSet.add(suArtifactFO); + + } catch (Exception ex) { + ex.printStackTrace(); + } + return resultSet; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanel.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanel.java new file mode 100644 index 000000000..b742f7e67 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanel.java @@ -0,0 +1,93 @@ +/* + * SEPluginProjectWizardPanel.java + */ +package net.openesb.component.${artifactId}.project.wizard; + +import java.awt.Component; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import org.openide.WizardDescriptor; +import org.openide.WizardValidationException; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; + +/** + * Panel just asking for basic info. + */ +public class SEPluginProjectWizardPanel implements WizardDescriptor.Panel, + WizardDescriptor.ValidatingPanel, WizardDescriptor.FinishablePanel { + + private WizardDescriptor wizardDescriptor; + private SEPluginProjectWizardPanelVisual component; + + /** + * Creates a new instance of templateWizardPanel + */ + public SEPluginProjectWizardPanel() { + } + + public Component getComponent() { + if (component == null) { + component = new SEPluginProjectWizardPanelVisual(this); + component.setName(NbBundle.getMessage(SEPluginProjectWizardPanel.class, "LBL_CreateProjectStep")); + } + return component; + } + + public HelpCtx getHelp() { + return new HelpCtx(SEPluginProjectWizardPanel.class); + } + + public boolean isValid() { + getComponent(); + return component.valid(wizardDescriptor); + } + private final Set/**/ listeners = new HashSet(1); // or can use ChangeSupport in NB 6.0 + + @SuppressWarnings("unchecked") + public final void addChangeListener(ChangeListener l) { + synchronized (listeners) { + listeners.add(l); + } + } + + public final void removeChangeListener(ChangeListener l) { + synchronized (listeners) { + listeners.remove(l); + } + } + + @SuppressWarnings("unchecked") + protected final void fireChangeEvent() { + Iterator it; + synchronized (listeners) { + it = new HashSet(listeners).iterator(); + } + ChangeEvent ev = new ChangeEvent(this); + while (it.hasNext()) { + ((ChangeListener) it.next()).stateChanged(ev); + } + } + + public void readSettings(Object settings) { + wizardDescriptor = (WizardDescriptor) settings; + component.read(wizardDescriptor); + } + + public void storeSettings(Object settings) { + WizardDescriptor d = (WizardDescriptor) settings; + component.store(d); + } + + public boolean isFinishPanel() { + return true; + } + + public void validate() throws WizardValidationException { + getComponent(); + component.validate(wizardDescriptor); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanelVisual.form b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanelVisual.form new file mode 100644 index 000000000..b3238405d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanelVisual.form @@ -0,0 +1,120 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanelVisual.java b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanelVisual.java new file mode 100644 index 000000000..d16d84ddb --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/SEPluginProjectWizardPanelVisual.java @@ -0,0 +1,259 @@ +/* + * SEPluginProjectWizardPanelVisual.java + */ +package net.openesb.component.${artifactId}.project.wizard; + +import java.io.File; +import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.Document; +import org.netbeans.spi.project.ui.support.ProjectChooser; +import org.openide.WizardDescriptor; +import org.openide.WizardValidationException; +import org.openide.filesystems.FileUtil; + +public class SEPluginProjectWizardPanelVisual extends JPanel implements DocumentListener { + + public static final String PROP_PROJECT_NAME = "projectName"; + private SEPluginProjectWizardPanel panel; + + public SEPluginProjectWizardPanelVisual(SEPluginProjectWizardPanel panel) { + initComponents(); + this.panel = panel; + // Register listener on the textFields to make the automatic updates + projectNameTextField.getDocument().addDocumentListener(this); + projectLocationTextField.getDocument().addDocumentListener(this); + } + + public String getProjectName() { + return this.projectNameTextField.getText(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + projectNameLabel = new javax.swing.JLabel(); + projectNameTextField = new javax.swing.JTextField(); + projectLocationLabel = new javax.swing.JLabel(); + projectLocationTextField = new javax.swing.JTextField(); + browseButton = new javax.swing.JButton(); + createdFolderLabel = new javax.swing.JLabel(); + createdFolderTextField = new javax.swing.JTextField(); + + projectNameLabel.setLabelFor(projectNameTextField); + org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(SEPluginProjectWizardPanelVisual.class, "LBL_ProjectName")); // NOI18N + + projectLocationLabel.setLabelFor(projectLocationTextField); + org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(SEPluginProjectWizardPanelVisual.class, "LBL_ProjectLocation")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(SEPluginProjectWizardPanelVisual.class, "LBL_Browse")); // NOI18N + browseButton.setActionCommand("BROWSE"); + browseButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + browseButtonActionPerformed(evt); + } + }); + + createdFolderLabel.setLabelFor(createdFolderTextField); + org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(SEPluginProjectWizardPanelVisual.class, "LBL_ProjectFolder")); // NOI18N + + createdFolderTextField.setEditable(false); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(projectNameLabel) + .add(projectLocationLabel) + .add(createdFolderLabel)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, projectNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, projectLocationTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, createdFolderTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(browseButton) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(projectNameLabel) + .add(projectNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(projectLocationLabel) + .add(projectLocationTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(browseButton)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(createdFolderLabel) + .add(createdFolderTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(213, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed + String command = evt.getActionCommand(); + if ("BROWSE".equals(command)) { + JFileChooser chooser = new JFileChooser(); + FileUtil.preventFileChooserSymlinkTraversal(chooser, null); + chooser.setDialogTitle("Select Project Location"); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + String path = this.projectLocationTextField.getText(); + if (path.length() > 0) { + File f = new File(path); + if (f.exists()) { + chooser.setSelectedFile(f); + } + } + if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { + File projectDir = chooser.getSelectedFile(); + projectLocationTextField.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath()); + } + panel.fireChangeEvent(); + } + + }//GEN-LAST:event_browseButtonActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton browseButton; + private javax.swing.JLabel createdFolderLabel; + private javax.swing.JTextField createdFolderTextField; + private javax.swing.JLabel projectLocationLabel; + private javax.swing.JTextField projectLocationTextField; + private javax.swing.JLabel projectNameLabel; + private javax.swing.JTextField projectNameTextField; + // End of variables declaration//GEN-END:variables + + public void addNotify() { + super.addNotify(); + //same problem as in 31086, initial focus on Cancel button + projectNameTextField.requestFocus(); + } + + boolean valid(WizardDescriptor wizardDescriptor) { + + if (projectNameTextField.getText().length() == 0) { + wizardDescriptor.putProperty("WizardPanel_errorMessage", + "Project Name is not a valid folder name."); + return false; // Display name not specified + } + File f = FileUtil.normalizeFile(new File(projectLocationTextField.getText()).getAbsoluteFile()); + if (!f.isDirectory()) { + String message = "Project Folder is not a valid path."; + wizardDescriptor.putProperty("WizardPanel_errorMessage", message); + return false; + } + final File destFolder = FileUtil.normalizeFile(new File(createdFolderTextField.getText()).getAbsoluteFile()); + + File projLoc = destFolder; + while (projLoc != null && !projLoc.exists()) { + projLoc = projLoc.getParentFile(); + } + if (projLoc == null || !projLoc.canWrite()) { + wizardDescriptor.putProperty("WizardPanel_errorMessage", + "Project Folder cannot be created."); + return false; + } + + if (FileUtil.toFileObject(projLoc) == null) { + String message = "Project Folder is not a valid path."; + wizardDescriptor.putProperty("WizardPanel_errorMessage", message); + return false; + } + + File[] kids = destFolder.listFiles(); + if (destFolder.exists() && kids != null && kids.length > 0) { + // Folder exists and is not empty + wizardDescriptor.putProperty("WizardPanel_errorMessage", + "Project Folder already exists and is not empty."); + return false; + } + wizardDescriptor.putProperty("WizardPanel_errorMessage", ""); + return true; + } + + void store(WizardDescriptor d) { + String name = projectNameTextField.getText().trim(); + String folder = createdFolderTextField.getText().trim(); + + d.putProperty("projdir", new File(folder)); + d.putProperty("name", name); + } + + void read(WizardDescriptor settings) { + File projectLocation = (File) settings.getProperty(SEPluginProjectWizardIterator.PROJECT_DIR); + if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory()) { + projectLocation = ProjectChooser.getProjectsFolder(); + } else { + projectLocation = projectLocation.getParentFile(); + } + this.projectLocationTextField.setText(projectLocation.getAbsolutePath()); + + String projectName = (String) settings.getProperty(SEPluginProjectWizardIterator.PROJECT_NAME); + if (projectName == null) { + projectName = SEPluginProjectWizardIterator.DEF_PROJECT_NAME_VALUE; + } + this.projectNameTextField.setText(projectName); + this.projectNameTextField.selectAll(); + } + + void validate(WizardDescriptor d) throws WizardValidationException { + // nothing to validate + } + + // Implementation of DocumentListener -------------------------------------- + public void changedUpdate(DocumentEvent e) { + updateTexts(e); + if (this.projectNameTextField.getDocument() == e.getDocument()) { + firePropertyChange(PROP_PROJECT_NAME, null, this.projectNameTextField.getText()); + } + } + + public void insertUpdate(DocumentEvent e) { + updateTexts(e); + if (this.projectNameTextField.getDocument() == e.getDocument()) { + firePropertyChange(PROP_PROJECT_NAME, null, this.projectNameTextField.getText()); + } + } + + public void removeUpdate(DocumentEvent e) { + updateTexts(e); + if (this.projectNameTextField.getDocument() == e.getDocument()) { + firePropertyChange(PROP_PROJECT_NAME, null, this.projectNameTextField.getText()); + } + } + + /** + * Handles changes in the Project name and project directory, + */ + private void updateTexts(DocumentEvent e) { + + Document doc = e.getDocument(); + + if (doc == projectNameTextField.getDocument() || doc == projectLocationTextField.getDocument()) { + // Change in the project name + + String projectName = projectNameTextField.getText(); + String projectFolder = projectLocationTextField.getText(); + + //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) { + createdFolderTextField.setText(projectFolder + File.separatorChar + projectName); + //} + + } + panel.fireChangeEvent(); // Notify that the panel changed + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/Greetings.wsdl new file mode 100644 index 000000000..756417abf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/goodbye.xsl b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/goodbye.xsl new file mode 100644 index 000000000..3259f2f3a --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/goodbye.xsl @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + Goodbye + ! Have a great time. + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/hello.xsl b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/hello.xsl new file mode 100644 index 000000000..d6794cbf8 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/hello.xsl @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + Hello + ! + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/jbi.xml new file mode 100644 index 000000000..6c6757d3d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/jbi.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/xsltmap.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/xsltmap.properties new file mode 100644 index 000000000..06e4b6631 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/project/wizard/resources/xsltmap.properties @@ -0,0 +1,28 @@ +# properties will be used to find the xslt file that will be used for invoking a +# service operation. +# The "xsltmap.properties" file should contain two types of properties +# 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +# "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +# 2. a service description to xslt file properties with syntax like +# "{tns-prefix}service-name=xslt_file_name" and +# "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +# "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +# the service description property is a "." delimited tokens that represents +# a serive or interface qname and a operation name. To locate xslt file either with +# service qname or service qname and operaton or serivice qname and interface qname +# and operation, all the three properties specified above should be there for each xslt file. +# + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +# just service level default settings +{greet2}greetService=hello.xsl +# service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +# service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +# service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +# service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/install-params.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/install-params.properties new file mode 100644 index 000000000..712a6a3ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/install-params.properties @@ -0,0 +1,3 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml new file mode 100644 index 000000000..b1abf7e2e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml @@ -0,0 +1,132 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.properties new file mode 100644 index 000000000..663de1bb9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.properties @@ -0,0 +1,48 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} build properties file to set/override the properties of the netbeans project +${symbol_pound} build properties when the netbeans build is called from the maven build lifecycle. +${symbol_pound} Netbeans project when build from the IDE, uses a build.properties from the user.dir +${symbol_pound} of the Netbeans IDE to resolve some of the properties used in the project such as +${symbol_pound} the libraries classpath. +${symbol_pound} When invoking the Netbeans project build from maven, this build.properties file +${symbol_pound} is not available. So, you can add the properties defined in ide build properties +${symbol_pound} that this project uses here. +${symbol_pound} + +${symbol_pound} default local repository settings. If the repository location is different +${symbol_pound} -D command line option should override this (e.g. mvn -Dmaven.repo.local=/my/m2/repository +maven.repo.local=${symbol_dollar}{user.home}/.m2/repository +${symbol_pound} begin jbi admin settings +${symbol_pound} set the below properties if you want to override the properties from nbproject/project.properties +${symbol_pound} that sets the application server admin settings. +${symbol_pound} +${symbol_pound} jbi.as.home=C:/Sun/glassfish-v2-b58g +${symbol_pound} jbi.host=localhost +${symbol_pound} jbi.port=4848 +${symbol_pound} jbi.username=admin +${symbol_pound} jbi.password=adminadmin +${symbol_pound} end jbi admin settings +${symbol_pound} + +${symbol_pound} classpath settings +junit.ant.task.classpath=${symbol_dollar}{maven.repo.local}/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar +junit.runtime.classpath=${symbol_dollar}{maven.repo.local}/junit/junit/3.8.2/junit-3.8.2.jar +libs.junit.classpath=${symbol_dollar}{junit.runtime.classpath}:${symbol_dollar}{junit.ant.task.classpath} +libs.jbi-cdk-ant-tasks.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi-cdk/jbi-cdk-ant-tasks/${version}/jbi-cdk-ant-tasks-${version}.jar + +libs.jbi.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi/1.0/jbi-1.0.jar +libs.wsdl4j.162.classpath=${symbol_dollar}{maven.repo.local}/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar +${symbol_pound} libs.jaxws21.classpath=${symbol_dollar}{jbi.as.home}/lib/javaee.jar:${symbol_dollar}{jbi.as.home}/lib/webservices-rt.jar +libs.jaxws21.classpath=${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/activation/activation/1.1/activation-1.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/ws/jaxws-rt/2.1.2/jaxws-rt-2.1.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.xml new file mode 100644 index 000000000..31217d15d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.xml @@ -0,0 +1,37 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml new file mode 100644 index 000000000..89775b186 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml @@ -0,0 +1,574 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task is getting executed! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task executed successfully! + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties new file mode 100644 index 000000000..4972e19f9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.xml.data.CRC32=d291c685 +build.xml.script.CRC32=5eca2350 +build.xml.stylesheet.CRC32=8add101f@1.0 +${symbol_pound} This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +${symbol_pound} Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=d291c685 +nbproject/build-impl.xml.script.CRC32=e3f75085 +nbproject/build-impl.xml.stylesheet.CRC32=4ed53ee0@1.0 diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml new file mode 100644 index 000000000..1d5833c62 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml @@ -0,0 +1,504 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + +This ant script contains the jbi ant tasks and the targets and properties using +which the jbi admin commands can be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Usage : ant -f <fullpath>/jbi_admin.xml [options] [target] + options: -D<property>=<value> + Specify a property/value pairs as options that are valid for the target. + target : ant target name in jbi_admin.xml + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml new file mode 100644 index 000000000..7e7dca2ae --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml @@ -0,0 +1,339 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + Install, uninstall, reinstall, start, stop, shutdown jbi components. + + + + + + + + + + + + + + Must set jbi.host + Must set jbi.port + Must set jbi.username + Must set jbi.password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/private/private.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/private/private.properties new file mode 100644 index 000000000..e540325d5 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/private/private.properties @@ -0,0 +1,6 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +javac.debug=true +javadoc.preview=true +user.properties.file=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working57${symbol_escape}${symbol_escape}.netbeans${symbol_escape}${symbol_escape}openesb${symbol_escape}${symbol_escape}build.properties diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml new file mode 100644 index 000000000..712a6a3ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml @@ -0,0 +1,3 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/project.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/project.properties new file mode 100644 index 000000000..0822a9f0e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/project.properties @@ -0,0 +1,91 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.classes.dir=${symbol_dollar}{build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${symbol_dollar}{build.dir}/generated +build.predist.dir=${symbol_dollar}{build.dir}/predist +build.predist.jar=${symbol_dollar}{build.predist.dir}/component.jar +build.predist.lib.dir=${symbol_dollar}{build.predist.dir}/lib +${symbol_pound} Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${symbol_dollar}{build.dir}/test/classes +build.test.dir=${symbol_dollar}{build.dir}/test +build.test.results.dir=${symbol_dollar}{build.dir}/test/results +conf.dir=src/conf +debug.classpath=${symbol_escape} + ${symbol_dollar}{run.classpath} +debug.test.classpath=${symbol_escape} + ${symbol_dollar}{run.test.classpath} +${symbol_pound} This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${symbol_dollar}{dist.dir}/${artifactId}.zip +dist.javadoc.dir=${symbol_dollar}{dist.dir}/javadoc +jar.compress=false +javac.classpath=${symbol_escape} + ${symbol_dollar}{libs.jbi.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.sharedlibs.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.lib.classpath} +${symbol_pound} Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir}:${symbol_escape} + ${symbol_dollar}{libs.junit.classpath}:${symbol_escape} + ${symbol_dollar}{libs.jaxws21.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jbi.ant.tasks.classpath=${symbol_escape} + ${symbol_dollar}{jbi.as.home}/lib/sun-appserv-ant.jar:${symbol_escape} + ${symbol_dollar}{jbi.as.home}/jbi/lib/jbi-ant-tasks.jar +jbi.as.home=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish +jbi.as.instance.id=[D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.component.bootstrap.class=serviceengine.ProviderSEInstaller +jbi.component.class=serviceengine.ProviderSERuntime +jbi.component.description=Description of service engine : ${artifactId} +jbi.component.lib.classpath=${symbol_escape} + ${symbol_dollar}{libs.wsdl4j.162.classpath} +jbi.component.name=${artifactId} +jbi.component.sharedlibs.classpath= +jbi.component.type=service-engine +jbi.host=localhost +jbi.install.params.file=install-params.properties +jbi.install.with.params=false +jbi.password=this really long string is used to identify a password that has been stored in the Keyring +jbi.port=4848 +jbi.soap.binding.name=sun-http-binding +jbi.username=admin +meta.inf.dir=${symbol_dollar}{conf.dir}/META-INF +platform.active=default_platform +project.jbi.deploy.plugin=./deploy-plugin +project.testSA=test/testSA +run.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir} +${symbol_pound} Space-separated list of JVM arguments used when running the project +${symbol_pound} (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +${symbol_pound} or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.test.classpath}:${symbol_escape} + ${symbol_dollar}{build.test.classes.dir} +src.dir=src/java +test-sys-prop.test.results.dir=${symbol_dollar}{build.test.results.dir} +test-sys-prop.test.src.dir=test-sys-prop.test.src.dir +test.src.dir=test/java +testSA.enabled=true +testSA.name=${artifactId}_TestSA diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/project.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/project.xml new file mode 100644 index 000000000..942beffad --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/nbproject/project.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + org.netbeans.modules.jbi.apisupport.project.jbicomponent + + + ${artifactId} + service-engine + 1.6.5 + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 000000000..b0d360fba --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,173 @@ + + + + 4.0.0 + ${groupId} + ${artifactId} + jar + ${version} + JBI Component[ServiceEngine] + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + http://open-esb.org + + build + src/java + test/java + build/classes + build/test/classes + package + + + + maven-antrun-plugin + 1.2 + + + + default-cli + + run + + + + !!!!!!!!!!!!!!!!!!!!!! Moving Files and organizing package !!!!!!!!!!!!!!!!!!!!!!!! + + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + + + + + + + maven2-repo1 + Maven2 Central Repository + http://repo1.maven.org/maven2 + + + download-java-net-maven2-repository + download.java.net Maven 2.x repository + http://download.java.net/maven/2/ + + + maven-repository.dev.java.net-repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + + + ws-zones + ws.zones maven repository + http://ws.zones.apache.org/repository2/ + + + apache.org + Maven Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + + apache.org + Maven Plugin Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + org.apache.maven + maven-ant-tasks + 2.0.7 + + + open-esb.jbi-cdk + jbi-cdk-ant-tasks + 1.0-SNAPSHOT + + + open-esb + jbi + 1.0 + + + wsdl4j + wsdl4j + 1.6.2 + + + com.sun.xml.ws + jaxws-rt + 2.1.2 + test + + + + + ${maven.repo.local} + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/test/resources/projects/basic/archetype.properties b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/test/resources/projects/basic/archetype.properties new file mode 100644 index 000000000..84ab644c4 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/test/resources/projects/basic/archetype.properties @@ -0,0 +1,5 @@ +#Tue Jul 23 17:03:00 IST 2013 +package=it.pkg +version=0.1-SNAPSHOT +groupId=archetype.it +artifactId=basic diff --git a/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/test/resources/projects/basic/goal.txt b/maven-archtype-v2/maven-archetype-service-engine-plugin-v2/src/test/resources/projects/basic/goal.txt new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/pom.xml new file mode 100644 index 000000000..34d356fba --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/pom.xml @@ -0,0 +1,45 @@ + + + + + + 4.0.0 + + open-jbi-components + ServiceEngine-archetype + 1.0-SNAPSHOT + maven-archetype + + ServiceEngine-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project Archtype for OpenESB Service Engine, that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 000000000..ea7fd9335 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,82 @@ + + + + + + + + + C:\\GlassFishESBv22\\glassfish + + + + + test/java + + **/*.xml + **/*.java + **/*.properties + + + + src/java + + **/*.java + + + + test/testSA + + **/*.xml + **/*.properties + + + + nbproject + + **/*.xml + **/*.properties + + + + src/conf + + **/*.xml + + + + nbproject/private + + **/*.xml + **/*.properties + + + + test/testSA + + **/*.xsl + **/*.zip + **/*.wsdl + + + + + + build.xml + install-params.properties + m2nbbuild-impl.xml + m2nbbuild.properties + m2nbbuild.xml + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build.xml new file mode 100644 index 000000000..14afd1d29 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build.xml @@ -0,0 +1,72 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Builds, tests, and runs the project ${artifactId}. + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml new file mode 100644 index 000000000..1e58b6067 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml @@ -0,0 +1,38 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + 4.0.0 + + ${package} + ${artifactId}-archetype + ${version} + maven-archetype + + ${artifactId}-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml new file mode 100644 index 000000000..c493031be --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml @@ -0,0 +1,33 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml new file mode 100644 index 000000000..2bdebaa2b --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml @@ -0,0 +1,146 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + org.netbeans.modules.apisupport.project + + + ${symbol_dollar}{artifactId} + + + + org.apache.tools.ant.module + + + + 3 + 3.27.0.2 + + + + org.jdesktop.layout + + + + 1 + 1.4 + + + + org.netbeans.modules.java.project + + + + 1 + 1.12 + + + + org.netbeans.modules.project.ant + + + + 1 + 1.16 + + + + org.netbeans.modules.projectapi + + + + 1 + 1.13 + + + + org.netbeans.modules.projectuiapi + + + + 1 + 1.24.0.6 + + + + org.netbeans.modules.queries + + + + 1 + 1.10 + + + + org.openide.actions + + + + 6.6.0.1 + + + + org.openide.awt + + + + 6.11.0.1 + + + + org.openide.dialogs + + + + 7.5 + + + + org.openide.execution + + + + 1.10 + + + + org.openide.filesystems + + + + 7.3 + + + + org.openide.loaders + + + + 6.5 + + + + org.openide.nodes + + + + 7.2.0.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml new file mode 100644 index 000000000..b50d82c16 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml @@ -0,0 +1,18 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml new file mode 100644 index 000000000..947bb579c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml @@ -0,0 +1,18 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..5456aa8f2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml @@ -0,0 +1,143 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..fd6c5a710 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + ${symbol_dollar}{artifactId}_TestSA + This is a test Service Assembly to test Engine + + + + + ${symbol_dollar}{artifactId}_TestSUBC + This service unit enables soap inbound endpoint for a service in service engine + + + testSUBC.zip + sun-http-binding + + + + + ${symbol_dollar}{artifactId}_TestSUSE + This service unit enables greetings service provider in service engine + + + testSUSE.zip + ${symbol_dollar}{artifactId} + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..96e95745f --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml new file mode 100644 index 000000000..251f4073e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..251f4073e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..75340ea7d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml new file mode 100644 index 000000000..1ce2022bf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..1ce2022bf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/install-params.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/install-params.properties new file mode 100644 index 000000000..712a6a3ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/install-params.properties @@ -0,0 +1,3 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml new file mode 100644 index 000000000..2093d6b39 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml @@ -0,0 +1,133 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild.properties new file mode 100644 index 000000000..663de1bb9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild.properties @@ -0,0 +1,48 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} build properties file to set/override the properties of the netbeans project +${symbol_pound} build properties when the netbeans build is called from the maven build lifecycle. +${symbol_pound} Netbeans project when build from the IDE, uses a build.properties from the user.dir +${symbol_pound} of the Netbeans IDE to resolve some of the properties used in the project such as +${symbol_pound} the libraries classpath. +${symbol_pound} When invoking the Netbeans project build from maven, this build.properties file +${symbol_pound} is not available. So, you can add the properties defined in ide build properties +${symbol_pound} that this project uses here. +${symbol_pound} + +${symbol_pound} default local repository settings. If the repository location is different +${symbol_pound} -D command line option should override this (e.g. mvn -Dmaven.repo.local=/my/m2/repository +maven.repo.local=${symbol_dollar}{user.home}/.m2/repository +${symbol_pound} begin jbi admin settings +${symbol_pound} set the below properties if you want to override the properties from nbproject/project.properties +${symbol_pound} that sets the application server admin settings. +${symbol_pound} +${symbol_pound} jbi.as.home=C:/Sun/glassfish-v2-b58g +${symbol_pound} jbi.host=localhost +${symbol_pound} jbi.port=4848 +${symbol_pound} jbi.username=admin +${symbol_pound} jbi.password=adminadmin +${symbol_pound} end jbi admin settings +${symbol_pound} + +${symbol_pound} classpath settings +junit.ant.task.classpath=${symbol_dollar}{maven.repo.local}/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar +junit.runtime.classpath=${symbol_dollar}{maven.repo.local}/junit/junit/3.8.2/junit-3.8.2.jar +libs.junit.classpath=${symbol_dollar}{junit.runtime.classpath}:${symbol_dollar}{junit.ant.task.classpath} +libs.jbi-cdk-ant-tasks.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi-cdk/jbi-cdk-ant-tasks/${version}/jbi-cdk-ant-tasks-${version}.jar + +libs.jbi.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi/1.0/jbi-1.0.jar +libs.wsdl4j.162.classpath=${symbol_dollar}{maven.repo.local}/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar +${symbol_pound} libs.jaxws21.classpath=${symbol_dollar}{jbi.as.home}/lib/javaee.jar:${symbol_dollar}{jbi.as.home}/lib/webservices-rt.jar +libs.jaxws21.classpath=${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/activation/activation/1.1/activation-1.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/ws/jaxws-rt/2.1.2/jaxws-rt-2.1.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild.xml new file mode 100644 index 000000000..31217d15d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/m2nbbuild.xml @@ -0,0 +1,37 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml new file mode 100644 index 000000000..2e8e00c93 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml @@ -0,0 +1,554 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task is getting executed! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task executed successfully! + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties new file mode 100644 index 000000000..cfde66418 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.xml.data.CRC32=ac78c060 +build.xml.script.CRC32=9068f2c7 +build.xml.stylesheet.CRC32=8add101f@1.0 +${symbol_pound} This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +${symbol_pound} Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=ac78c060 +nbproject/build-impl.xml.script.CRC32=d15987fd +nbproject/build-impl.xml.stylesheet.CRC32=4ed53ee0@1.0 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml new file mode 100644 index 000000000..8a7d2a523 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml @@ -0,0 +1,504 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + +This ant script contains the jbi ant tasks and the targets and properties using +which the jbi admin commands can be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Usage : ant -f <fullpath>/jbi_admin.xml [options] [target] + options: -D<property>=<value> + Specify a property/value pairs as options that are valid for the target. + target : ant target name in jbi_admin.xml + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml new file mode 100644 index 000000000..7e7dca2ae --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml @@ -0,0 +1,339 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + Install, uninstall, reinstall, start, stop, shutdown jbi components. + + + + + + + + + + + + + + Must set jbi.host + Must set jbi.port + Must set jbi.username + Must set jbi.password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/private/private.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/private/private.properties new file mode 100644 index 000000000..e540325d5 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/private/private.properties @@ -0,0 +1,6 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +javac.debug=true +javadoc.preview=true +user.properties.file=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working57${symbol_escape}${symbol_escape}.netbeans${symbol_escape}${symbol_escape}openesb${symbol_escape}${symbol_escape}build.properties diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml new file mode 100644 index 000000000..712a6a3ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml @@ -0,0 +1,3 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/project.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/project.properties new file mode 100644 index 000000000..2a9ec25b5 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/project.properties @@ -0,0 +1,93 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.classes.dir=${symbol_dollar}{build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${symbol_dollar}{build.dir}/generated +build.predist.dir=${symbol_dollar}{build.dir}/predist +build.predist.jar=${symbol_dollar}{build.predist.dir}/component.jar +build.predist.lib.dir=${symbol_dollar}{build.predist.dir}/lib +${symbol_pound} Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${symbol_dollar}{build.dir}/test/classes +build.test.dir=${symbol_dollar}{build.dir}/test +build.test.results.dir=${symbol_dollar}{build.dir}/test/results +conf.dir=src/conf +debug.classpath=${symbol_escape} + ${symbol_dollar}{run.classpath} +debug.test.classpath=${symbol_escape} + ${symbol_dollar}{run.test.classpath} +${symbol_pound} This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${symbol_dollar}{dist.dir}/${artifactId}.zip +dist.javadoc.dir=${symbol_dollar}{dist.dir}/javadoc +jar.compress=false +javac.classpath=${symbol_escape} + ${symbol_dollar}{libs.jbi.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.sharedlibs.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.lib.classpath} +${symbol_pound} Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir}:${symbol_escape} + ${symbol_dollar}{libs.junit.classpath}:${symbol_escape} + ${symbol_dollar}{libs.jaxws21.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jbi.ant.tasks.classpath=${symbol_escape} + ${symbol_dollar}{jbi.as.home}/lib/sun-appserv-ant.jar:${symbol_escape} + ${symbol_dollar}{jbi.as.home}/jbi/lib/jbi-ant-tasks.jar +#jbi.as.home=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish +jbi.as.home=${glassfishLocation} +#jbi.as.instance.id=[D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.as.instance.id=[${glassfishLocation}]deployer:Sun:AppServer::localhost:4848 +jbi.component.bootstrap.class=${artifactId}.ProviderSEInstaller +jbi.component.class=${artifactId}.ProviderSERuntime +jbi.component.description=Description of service engine : ${artifactId} +jbi.component.lib.classpath=${symbol_escape} + ${symbol_dollar}{libs.wsdl4j.162.classpath} +jbi.component.name=${artifactId} +jbi.component.sharedlibs.classpath= +jbi.component.type=service-engine +jbi.host=localhost +jbi.install.params.file=install-params.properties +jbi.install.with.params=false +jbi.password=this really long string is used to identify a password that has been stored in the Keyring +jbi.port=4848 +jbi.soap.binding.name=sun-http-binding +jbi.username=admin +meta.inf.dir=${symbol_dollar}{conf.dir}/META-INF +platform.active=default_platform +project.jbi.deploy.plugin=./deploy-plugin +project.testSA=test/testSA +run.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir} +${symbol_pound} Space-separated list of JVM arguments used when running the project +${symbol_pound} (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +${symbol_pound} or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.test.classpath}:${symbol_escape} + ${symbol_dollar}{build.test.classes.dir} +src.dir=src/java +test-sys-prop.test.results.dir=${symbol_dollar}{build.test.results.dir} +test-sys-prop.test.src.dir=test-sys-prop.test.src.dir +test.src.dir=test/java +testSA.enabled=true +testSA.name=${artifactId}_TestSA diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/project.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/project.xml new file mode 100644 index 000000000..942beffad --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/nbproject/project.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + org.netbeans.modules.jbi.apisupport.project.jbicomponent + + + ${artifactId} + service-engine + 1.6.5 + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 000000000..a65255db9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,282 @@ + + + + 4.0.0 + ${groupId} + ${artifactId} + jar + ${version} + JBI Component[${artifactId}] + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + http://open-esb.org + + build + src/java + test/java + build/classes + build/test/classes + package + + + org.apache.maven.plugins + maven-compiler-plugin + + true + 1.5 + 1.5 + + + **/*.java + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + **/*.* + + + + + maven-surefire-plugin + 2.1.3 + true + + + true + + **/bindingtest/*.java + **/enginetest/*.java + + + + + + maven-antrun-plugin + 1.2 + + + m2nbbuild-compile + compile + + run + + + + + + + + + m2nbbuild-compile-test + test-compile + + run + + + + + + + + + m2nbbuild-package + package + + run + + + + + + + + + m2nbbuild-utest + test + + run + + + + + + + + + m2nbbuild-itest + integration-test + + run + + + + + + + + + m2nbbuild-clean + clean + + run + + + + + + + + + + default-cli + + run + + + + !!!!!!!!!!!!!!!!!!!!!! Moving Files and organizing package !!!!!!!!!!!!!!!!!!!!!!!! + + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + + + + + + + maven2-repo1 + Maven2 Central Repository + http://repo1.maven.org/maven2 + + + download-java-net-maven2-repository + download.java.net Maven 2.x repository + http://download.java.net/maven/2/ + + + maven-repository.dev.java.net-repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + + + ws-zones + ws.zones maven repository + http://ws.zones.apache.org/repository2/ + + + apache.org + Maven Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + + apache.org + Maven Plugin Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + org.apache.maven + maven-ant-tasks + 2.0.7 + + + open-esb.jbi-cdk + jbi-cdk-ant-tasks + 1.0-SNAPSHOT + + + open-esb + jbi + 1.0 + + + wsdl4j + wsdl4j + 1.6.2 + + + com.sun.xml.ws + jaxws-rt + 2.1.2 + test + + + + + ${maven.repo.local} + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/conf/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/conf/META-INF/jbi.xml new file mode 100644 index 000000000..7c40ad15c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/conf/META-INF/jbi.xml @@ -0,0 +1,45 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + ${artifactId} + Description of service engine : ${artifactId} + + + net.openesb.component.${artifactId}.ProviderSERuntime + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + net.openesb.component.${artifactId}.ProviderSEInstaller + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java new file mode 100644 index 000000000..af3bbc2c6 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java @@ -0,0 +1,52 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSEComponentLifeCycle.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.BasicComponentLifeCycle; +import net.openesb.component.${artifactId}.common.DefaultMessageExchangeReceiver; +import net.openesb.component.${artifactId}.common.MessageExchangeReceiver; +import net.openesb.component.${artifactId}.common.RuntimeContext; +import javax.jbi.JBIException; +import javax.jbi.component.Component; + +/** + * This class extends the basic ComponentLifeCycle implementation to provide + * component specific implementation of the ComponentLifeCycle. + * + * @see javax.jbi.ComponentLifeCycle + * @see com.sun.jbi.sample.component.common.BasicComponentLifeCycle + * @author chikkala + */ +public class ProviderSEComponentLifeCycle extends BasicComponentLifeCycle { + + /** + * constructor + */ + public ProviderSEComponentLifeCycle(Component compRuntime) { + super(compRuntime); + } + + /** + * creates DefaultMessageExchangeReceiver to handles receiving and + * processing the message exchanges from the delivery channel. + */ + @Override + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return new DefaultMessageExchangeReceiver(); + } + + /** + * chance to extended classes to do the component specific init + * + * @throws javax.jbi.JBIException + */ + @Override + protected void doInit() throws JBIException { + // NOOP + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEEndpoint.java new file mode 100644 index 000000000..cddaa21da --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEEndpoint.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSEEndpoint.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.MessageExchangeHandler; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.MessageExchangeListener; +import net.openesb.component.${artifactId}.common.deployment.ProviderEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor; +import javax.jbi.JBIException; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.wsdl.Definition; + +/** + * This class extends the ProviderEndpoint to implement component specific + * endpoint configuration. It implements the MessageExchangeListener to receive + * message exchange notifications from the MessageExchangeSupport fired by + * MessageExchangeReceiver and process it using a message exchange handler. + * + * This endpoint is configured for a service provided by this component which + * can receive a xml document and apply xslt transformation and send the results + * back in a InOut message exchange to complete a service invocation on this + * endpoint. + * + * @author chikkala + */ +public class ProviderSEEndpoint extends ProviderEndpoint implements MessageExchangeListener { + + private XSLTFileLocator mXsltFileLocator; + private XSLTService mXsltService; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public ProviderSEEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ProviderSEServiceUnit su) { + super(provides, wsdlDef, su); + } + + /** + * XSLT transformation service used in transformation of the xml documents + * received on this endpoint. + */ + public XSLTService getXSLTService() { + return this.mXsltService; + } + + /** + * returns the XSLTFileLocator object that is created to find the xslt file + * to be used for a particular service operation invocation by looking at + * the mapping file specified in the service unit that deploys this + * endpoint. + */ + public XSLTFileLocator getXSLTFileLocator() { + return this.mXsltFileLocator; + } + + @Override + public void doInit() throws JBIException { + RuntimeHelper.getLogger().info("ProviderSEEndpoint:doInit called"); + ProviderSEServiceUnit su = (ProviderSEServiceUnit) this.getServiceUnit(); + this.mXsltFileLocator = su.getXsltFileLocator(); + this.mXsltService = XSLTService.XSLTServiceImpl.getInstance(); + } + + /** + * creates the message exchange handler that will be used to process the + * message exchange received for this endpoint. + */ + @Override + public MessageExchangeHandler createMessageExchangeHandler() { + return new ProviderSEMessageExchangeHandler(this); + } + + /** + * returns the implementation of the message exchange listener which the + * MessageExchangeSupport invokes when a message exchange is received from + * delivery channel by MessageExchangeReceiver. + */ + @Override + protected MessageExchangeListener createMessageExchangeListener() { + return this; + } + + /** + * implementation of the message exchange received method of the listener. + */ + public void messageExchangeReceived(ExchangeStatus status, MessageExchange me) { + try { + RuntimeHelper.getLogger().fine("MXListener.MessageExchangeReceived: with Status: " + status); + processMessageExchangeWithHandler(status, me); + // processMessageExchange(me); + } catch (Exception ex) { + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEInstaller.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEInstaller.java new file mode 100644 index 000000000..88da303d2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEInstaller.java @@ -0,0 +1,34 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + /* + * ProviderSEInstaller.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.ComponentInstaller; + +/** + * This class extends the ComponentInstaller that implements the + * javax.jbi.component.Bootstrap for a component installation contract. + * + * If the default implemenation of the javax.jbi.component.Bootstrap in + * com.sun.jbi.sample.component.common.ComponentInstaller is not sufficient for + * this components install, uninstall and upgrade requirements, override the + * default implementation here to add component specific installation and + * upgrade tasks such as initializing configuration mbean and creating resources + * specific to component or upgrade workspace and service units during upgrading + * the component. + * + * @see javax.jbi.Bootstrap + * @see com.sun.jbi.sample.component.common.ComponentInstaller + * @author chikkala + */ +public class ProviderSEInstaller extends ComponentInstaller { + + /** + * Constructor to create the MyEngineInstaller. + */ + public ProviderSEInstaller() { + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java new file mode 100644 index 000000000..b3002d6ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java @@ -0,0 +1,171 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSEMessageExchangeHandler.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.AbstractMessageExchangeHandler; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.wsdl.WSDL11JBIWrapper; +import java.io.StringReader; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Source; + +/** + * This class extends the AbstractMessageExchangeHandler to implement the + * component specific message exchange processing on the provider side in a + * service engine. + * + * @author chikkala + */ +public class ProviderSEMessageExchangeHandler extends AbstractMessageExchangeHandler { + + private ProviderSEEndpoint mEndpoint; + + /** + * Creates a new instance of ProviderSEMXHandler + */ + public ProviderSEMessageExchangeHandler(ProviderSEEndpoint endpoint) { + this.mEndpoint = endpoint; + } + + protected Logger getLogger() { + return this.mEndpoint.getLogger(); + } + + protected DeliveryChannel getDeliveryChannel() { + return this.mEndpoint.getDeliveryChannel(); + } + + protected void validateMessageExchange() throws MessagingException { + MessageExchange msgExchange = this.getMessageExchange(); + + if (this.getMessageExchange() == null) { + throw new MessagingException("MessageExchange Object is null in MessageExchageHandler"); + } + + if (MessageExchange.Role.CONSUMER.equals(msgExchange.getRole())) { + throw new MessagingException("Provider Message Exchange Handler can not have MessageExchange with CONSUMER Role"); + } + + if (!(msgExchange instanceof InOut)) { + throw new MessagingException("InOut Message Exchange Handler MessageExchange object should be instanceof javax.jbi.messaging.InOut "); + } + } + + protected void processError(Exception ex) { + MessageExchange msgExchange = this.getMessageExchange(); + Exception errEx = msgExchange.getError(); // get the error and print + RuntimeHelper.getLogger().info( + "InOut Message Exchange Provider received Error: " + errEx.getMessage()); + msgExchange.getError().printStackTrace(); + } + + protected void processDone() { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.getLogger().info("InOut Message Exchange Provider received DONE :" + + " END of service invocation"); + } + + protected void processFault(Fault fault) { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.logError("InOut Message Exchange Provider Handler can not receive Fault on Provider side"); + } + + protected void processMessage() { + try { + processInMessageOnProvider((InOut) this.getMessageExchange()); + } catch (JBIException ex) { + ex.printStackTrace(); + } + } + + protected void processInMessageOnProvider(InOut inOutExchange) throws JBIException { + RuntimeHelper.getLogger().fine("Processing In Message on Provider side " + inOutExchange); + // receive IN message. + NormalizedMessage inMsg = inOutExchange.getInMessage(); + NormalizedMessage outMsg = null; + Fault fault = null; + Source inContent = null; + Source outContent = null; + Source faultContent = null; + String faultAsText = null; + // process in message + inContent = inMsg.getContent(); + // invoke the service operation + try { + QName opName = inOutExchange.getOperation(); + QName svcName = inOutExchange.getEndpoint().getServiceName(); + RuntimeHelper.getLogger().fine("xslt service info " + svcName + opName); + + XSLTFileLocator xsltFileLocator = this.mEndpoint.getXSLTFileLocator(); + XSLTService xsltService = this.mEndpoint.getXSLTService(); + + String xsltPath = xsltFileLocator.findXsltFile(svcName, opName); + RuntimeHelper.getLogger().fine("XsltPath " + xsltPath); + if (xsltPath == null) { + RuntimeHelper.getLogger().fine(" No XSLT File found in MAP " + + xsltFileLocator.printMap()); + } + outContent = xsltService.transform(inContent, xsltPath); + + } catch (Exception ex) { + // exception invoking the operation. so, set exception text as fault content. + ex.printStackTrace(); + faultAsText = RuntimeHelper.getExceptionAsText(ex); + String faultText = RuntimeHelper.getExceptionAsXmlText(ex); + faultContent = RuntimeHelper.createDOMSource(new StringReader(faultText)); + } + // set out or fault message + if (outContent != null) { + // set the out message content. + outMsg = inOutExchange.createMessage(); + inOutExchange.setOutMessage(outMsg); + normalizeOutMessage(inOutExchange, outMsg, outContent); + // outMsg.setContent(outContent); + } else if (faultContent != null) { + fault = inOutExchange.createFault(); + inOutExchange.setFault(fault); + fault.setContent(faultContent); // may need to normalize the content. + } + // send out or fault message. + // this.getDeliveryChannel().sendSync(inOutExchange, SEND_SYNC_TIMEOUT); + this.send(); + } + + private void normalizeOutMessage(MessageExchange me, NormalizedMessage normMsg, Source msgSrc) throws MessagingException { + try { + // DOMSource wrappedSource = wrapOutputMessage(me, msgSrc); + WSDL11JBIWrapper outWrapper = WSDL11JBIWrapper.createOutputWrapper( + this.mEndpoint.getWSDLOperation(me.getOperation())); + + // check if the output from the transformer is in a wrapped form + WSDL11JBIWrapper wrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(msgSrc)); + if (wrapper != null) { + outWrapper.appendParts(wrapper.getParts()); + } else { + outWrapper.appendPart(RuntimeHelper.sourceToDOMSource(msgSrc)); + } + + normMsg.setContent(outWrapper.toDOMSource()); + + } catch (MessagingException ex) { + throw ex; + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSERuntime.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSERuntime.java new file mode 100644 index 000000000..5a395d9ee --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSERuntime.java @@ -0,0 +1,56 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSERuntime.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.ComponentRuntime; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; + +/** + * This class extends the ComponentRuntime that implements + * javax.jbi.component.Component interface required for the component contract + * at runtime. + * + * This class provides the component specific ComponentLifeCycle implementation + * as well as the component specific ServiceUnitManager implementation. + * + * Add any additional component runtime specific functionality here. + * + * @see javax.jbi.component.Component + * @see com.sun.jbi.sample.component.common.ComponentRuntime + * @see com.sun.jbi.sample.component.common.BasicComponentLifecycle + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @author chikkala + */ +public class ProviderSERuntime extends ComponentRuntime { + + /** + * Creates a new instance of MyEngineRuntime + */ + public ProviderSERuntime() { + super(); + } + + /** + * overriding the parent's createComponentLifeCycle to create component + * specific component lifecycle implementation. + */ + @Override + protected ComponentLifeCycle createComponentLifeCycle() { + return new ProviderSEComponentLifeCycle(this); + } + + /** + * overrides the parent's createServiceUnitManager to create component + * specific service unit manager + */ + @Override + protected ServiceUnitManager createServiceUnitManager() { + return new ProviderSESUManager(this); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSESUManager.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSESUManager.java new file mode 100644 index 000000000..ed2cbed58 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSESUManager.java @@ -0,0 +1,49 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSESUManager.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.AbstractServiceUnitManager; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; + +/** + * This class extends the AbstractServiceUnitManager to implement component + * specific service unit manager by creating the component specific ServiceUnit + * implementation. + * + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit + * @author chikkala + */ +public class ProviderSESUManager extends AbstractServiceUnitManager { + + private ProviderSERuntime mRuntime; + + /** + * Creates a new instance of ProviderSESUManager + */ + public ProviderSESUManager(ProviderSERuntime compRuntime) { + super(); + this.mRuntime = compRuntime; + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + protected String getComponentName() { + return RuntimeHelper.getComponentName(); + } + //TODO implement ProviderSEServiceUnit + + protected ServiceUnit createServiceUnit(String suName, String suRootPath) throws DeploymentException { + return new ProviderSEServiceUnit(suName, suRootPath); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java new file mode 100644 index 000000000..e11af0975 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java @@ -0,0 +1,63 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSEServiceUnit.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import net.openesb.component.${artifactId}.common.deployment.ProviderEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Provides; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; + +/** + * This class extends the ServiceUnit to implement the component specific + * service unit processing. It creates the component specific ProviderEndpoint + * implementation to configure the service provider endpoint on this component + * deployed in the service unit. It also processes the deployment artifacts that + * are specific to the service provided by the component. + * + * @author chikkala + */ +public class ProviderSEServiceUnit extends ServiceUnit { + + private XSLTFileLocator mXsltFileLocator; + + /** + * Creates a new instance of ProviderSEServiceUnit + */ + public ProviderSEServiceUnit(String suName, String suRootPath) { + super(suName, suRootPath); + } + + protected XSLTFileLocator getXsltFileLocator() { + return this.mXsltFileLocator; + } + + @Override + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return new ProviderSEEndpoint(provides, wsdlDef, this); + } + + /** + * load and validates the component specific deployment artifacts. It loads + * the xsltmap properties into XSLTFileLocator which will be used to find + * the xslt file corresponding to a service operation. + */ + @Override + protected void loadOtherArtifacts() throws DeploymentException { + super.loadOtherArtifacts(); + // load any component specific service unit artifacts + if (this.mXsltFileLocator == null) { + try { + this.mXsltFileLocator = + new XSLTFileLocator(this.getSURootPath(), "xsltmap.properties"); + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/XSLTFileLocator.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/XSLTFileLocator.java new file mode 100644 index 000000000..d5189d393 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/XSLTFileLocator.java @@ -0,0 +1,210 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * XSLTFileLocator.java + */ +package net.openesb.component.${artifactId}; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.xml.namespace.QName; + +/** + * This class represents the component specific deployment artifact which reads + * the deployed "xsltmap.properties" file in the service unit and processes it + * to find the xslt file to be used for a particular operation on a service + * provided by the deployment. + *
+ * The "xsltmap.properties" file should contain two types of properties
+ * 1.for namespace prefix to namespaceURI map that starts with "xmlns." prefix like
+ *   "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo"
+ * 2. a service description to xslt file properties with syntax like
+ *   "{tns-prefix}service-name=xslt_file_name"  and
+ *   "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and
+ *   "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" .
+ * the service description property is a "." delimited tokens that represents a serive
+ * or interface qname and a operation name. To locate xslt file either with service qname
+ * or service qname and operaton or serivice qname and interface qname and operation,
+ * all the three properties specified above should be there for each xslt file. for example,
+ *  xmlns.echo1=http://www.sun.com/jbi/examples/sample-service/echo
+ *  xmlns.echo2=http://www.sun.com/jbi/examples/sample-service/echo
+ *  {echo2}echoService=echo.xsl
+ *  {echo2}echoService.{echo1}echo=echo.xsl
+ *  {echo2}echoService.{echo1}echo.echo=echo.xsl
+ * 
+ * + * @author chikkala + */ +public class XSLTFileLocator { + + private Map mXsltFileMap; + + /** + * Creates a new instance of XsltLocator + */ + public XSLTFileLocator(String rootPath, String mapFile) throws Exception { + this.mXsltFileMap = new HashMap(); + initXsltLocator(rootPath, mapFile); + } + + private void initXsltLocator(String rootPath, String mapFilePath) throws Exception { + @SuppressWarnings("unchecked") + Map mapProps = loadMappingProperties(rootPath, mapFilePath); + + Map nsMap = new HashMap(); + Map xsltMap = new HashMap(); + + for (String name : mapProps.keySet()) { + String value = mapProps.get(name); + if (name.startsWith("{")) { + xsltMap.put(name, value); + } else if (name.startsWith("xmlns.")) { + String xmlns = name.substring(6); + nsMap.put(xmlns, value); + } + } + + for (String name : xsltMap.keySet()) { + String value = xsltMap.get(name); + String[] tokens = name.split("${symbol_escape}${symbol_escape}."); + String svcName = null; + String intrName = null; + String opName = null; + + if (tokens.length == 1) { + svcName = expandQName(tokens[0], nsMap); + } else if (tokens.length == 2) { + svcName = expandQName(tokens[0], nsMap); + opName = expandQName(tokens[1], nsMap); + } else if (tokens.length == 3) { + svcName = expandQName(tokens[0], nsMap); + intrName = expandQName(tokens[1], nsMap); + opName = tokens[2]; + } else { + System.out.println("invalid property name in xslt map property" + name); + } + + StringBuffer buff = new StringBuffer(); + buff.append(svcName); + if (intrName != null) { + buff.append("."); + buff.append(intrName); + } + if (opName != null) { + buff.append("."); + buff.append(opName); + } + File file = new File(rootPath, value); + String xsltFile = file.getAbsolutePath(); + this.mXsltFileMap.put(buff.toString(), xsltFile); + } + } + + private String expandQName(String qname, Map xmlnsMap) { + + // qname passed is "{prefix}localname" + QName temp = QName.valueOf(qname); + String prefix = temp.getNamespaceURI(); + String nsURI = xmlnsMap.get(prefix); + if (nsURI == null) { + nsURI = prefix; // just use the prefix as it is. + } + QName realQName = new QName(nsURI, temp.getLocalPart()); + return realQName.toString(); + } + + private Map loadMappingProperties(String rootPath, String mapFilePath) throws Exception { + File mapFile = new File(rootPath, mapFilePath); + Properties mapProps = new Properties(); + if (!mapFile.exists()) { + throw new Exception("Mapping file not found " + mapFilePath); + } + FileInputStream inStream = null; + try { + inStream = new FileInputStream(mapFile); + mapProps.load(inStream); + } catch (FileNotFoundException ex) { + ex.printStackTrace(); + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + if (inStream != null) { + try { + inStream.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + return mapProps; + } + + /** + * return the xslt file mapped to either service name or service qname + + * operation qname + * + * @param serviceQName must be non null qname + * @param opQName can be null the xslt file can be located at service level. + */ + public String findXsltFile(QName serviceQName, QName opQName) { + StringBuffer buff = new StringBuffer(); + buff.append(serviceQName.toString()); + if (opQName != null) { + buff.append("."); + // workaround for the http soap bc bug which does not set the namespace + // uri on the op name. for time being use the serviceQName's namespace + String namespaceURI = opQName.getNamespaceURI(); + if (namespaceURI == null || namespaceURI.length() == 0) { + QName tempOp = + new QName(serviceQName.getNamespaceURI(), opQName.getLocalPart()); + buff.append(tempOp.toString()); + } else { + buff.append(opQName.toString()); + } + } + String xsltFile = this.mXsltFileMap.get(buff.toString()); + return xsltFile; + } + + /** + * return the xslt file mapped to either service name or service qname + + * interface qname + operation + * + * @param serviceQName must be non null service qname + * @param intrQName interface qname + * @param opName operation name ( not a qname) + */ + public String findXsltFile(QName serviceQName, QName intrQName, String opName) { + StringBuffer buff = new StringBuffer(); + buff.append(serviceQName.toString()); + if (intrQName != null) { + buff.append("."); + buff.append(intrQName.toString()); + } + if (opName != null) { + buff.append("."); + buff.append(opName); + } + String xsltFile = this.mXsltFileMap.get(buff.toString()); + return xsltFile; + } + + public String printMap() { + StringWriter buff = new StringWriter(); + PrintWriter out = new PrintWriter(buff); + for (String key : this.mXsltFileMap.keySet()) { + out.println("Key= " + key); + out.println("XsltFile= " + this.mXsltFileMap.get(key)); + } + out.close(); + return buff.getBuffer().toString(); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/XSLTService.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/XSLTService.java new file mode 100644 index 000000000..a303e10a0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/XSLTService.java @@ -0,0 +1,108 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * XSLTService.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.File; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; +import java.util.logging.Logger; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import org.w3c.dom.Document; + +/** + * This is a sample service implementation that takes the input as xml document + * and the xslt file to apply the xslt transformation on the input xml and + * return the transformed output xml. This implementation of the service is + * invoked when a InOut message exchange is processed to invoke a service + * provided by the engine. + * + * @author chikkala + */ +public interface XSLTService { + + /** + * this operation takes the input xml document and constructs the output xml + * document by applying the xslt in the file specified in xsltPath + * + * @param inputDoc input xml document + * @param xsltPath absolute file path of xslt file. + * @return transformed output xml document + */ + Source transform(Source inputDoc, String xsltPath) throws Exception; + + /** + * This class implements the echo service operations which the service + * engine will invoke when a InOut message exchange is processed to invoke a + * service provided by the engine. + */ + public static class XSLTServiceImpl implements XSLTService { + + private XSLTServiceImpl() { + } + + /** + * accessor to create/locate the service implementation + * + * @return echo service implementation + */ + public static XSLTService getInstance() { + return new XSLTServiceImpl(); + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + /** + * this operation takes the input xml document and constructs the output + * xml document with the same data to implement the echo. + * + * @param inputDoc input document + * @return output document + */ + public Source transform(Source inputDoc, String xsltPath) throws Exception { + Document outDoc = null; + StringBuffer inBuff = RuntimeHelper.readFromSource(inputDoc); + + getLogger().fine("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} TRANSFORMER INPUT MESSAGE BEGIN ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}"); + getLogger().fine(inBuff.toString()); + getLogger().fine("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} TRANSFORMER INPUT MESSAGE END ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}"); + + TransformerFactory tf = null; + tf = TransformerFactory.newInstance(); + StreamSource xsltSource = new StreamSource(new File(xsltPath)); + Transformer xformer = tf.newTransformer(xsltSource); + + Properties params = new Properties(); //TODO get the pramas from the user file + for (Object name : params.keySet()) { + xformer.setParameter((String) name, params.get(name)); + } + StringWriter writer = new StringWriter(); + StreamResult result = new StreamResult(writer); + + DOMSource xmlSource = new DOMSource(RuntimeHelper.buildDOMDocument(new StringReader(inBuff.toString()))); + + xformer.transform(xmlSource, result); + + getLogger().fine("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} TRANSFORMER OUTPUT MESSAGE BEGIN ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}"); + getLogger().fine(writer.getBuffer().toString()); + getLogger().fine("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} TRANSFORMER OUTPUT MESSAGE END ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}"); + + outDoc = RuntimeHelper.buildDOMDocument(new StringReader(writer.getBuffer().toString())); + DOMSource outSource = new DOMSource(outDoc); + + return outSource; + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java new file mode 100644 index 000000000..4987029b3 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java @@ -0,0 +1,141 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractMessageExchangeHandler.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.io.StringReader; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.xml.namespace.QName; + +/** + * This class is an abstract implementation of the MessageExchangeHandler which + * provides the base implementation of the ME processing and provides hooks to + * extended classes to implement component specific processing. + * + * @author chikkala + */ +public abstract class AbstractMessageExchangeHandler implements MessageExchangeHandler { + + public static String IN_MESSAGE = "in"; + public static String OUT_MESSAGE = "out"; + + private MessageExchange mMessageExchange; + private ExchangeStatus mStatus; + /** Creates a new instance of AbstractMessageExchangeHandler */ + protected AbstractMessageExchangeHandler() { + this.mMessageExchange = null; + } + + protected abstract Logger getLogger(); + protected abstract DeliveryChannel getDeliveryChannel(); + protected abstract void validateMessageExchange() throws MessagingException; + protected abstract void processError(Exception ex); + protected abstract void processDone(); + protected abstract void processMessage(); + protected abstract void processFault(Fault fault); + + public final MessageExchange getMessageExchange() { + return this.mMessageExchange; + } + + public final void setMessageExchange(MessageExchange msgExchange) { + this.mMessageExchange = msgExchange; + } + + public final ExchangeStatus getMessageExchangeStatus() { + if ( this.mStatus != null ) { + return this.mStatus; + } else if ( this.mMessageExchange != null ) { + return this.mMessageExchange.getStatus(); + } else { + return null; + } + } + + public final void setMessageExchangeStatus(ExchangeStatus status) { + this.mStatus = status; + } + + protected void send() throws MessagingException { + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected boolean sendSync(long timeout) throws MessagingException { + return this.getDeliveryChannel().sendSync(this.mMessageExchange, timeout); + } + + protected void sendDone() throws MessagingException { + this.mMessageExchange.setStatus(ExchangeStatus.DONE); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendError(Exception ex) throws MessagingException { + this.mMessageExchange.setError(ex); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendFault(Exception ex, QName type, String name) throws MessagingException { + Fault fault = this.mMessageExchange.createFault(); + if ( ex != null ) { + String xmlText = RuntimeHelper.getExceptionAsXmlText(ex); + fault.setContent(RuntimeHelper.createDOMSource(new StringReader(xmlText))); + } + this.mMessageExchange.setFault(fault); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void processActive() { + Fault fault = this.getMessageExchange().getFault(); + if ( fault != null ) { + processFault(fault); + } else { + processMessage(); + } + } + /** + * implementation of the MessageExchangeHandler${symbol_pound}processMessageExchange method. + */ + public void processMessageExchange(ExchangeStatus status, MessageExchange msgEx) { + + getLogger().fine("MessageExchangeHandler.processMessageExchange:status: " + status ); + + this.setMessageExchangeStatus(status); + this.setMessageExchange(msgEx); + + try { + validateMessageExchange(); + } catch (MessagingException ex) { + getLogger().log(Level.FINE, "Invalid message exchange for processing ", ex); + if ( this.getMessageExchange() != null ) { + try { + sendError(ex); + } catch (MessagingException errEx) { + getLogger().log(Level.FINE, "Can not send invalid message exchange error", errEx); + } + } + return; + } + + MessageExchange msgExchange = this.getMessageExchange(); + + if (ExchangeStatus.ACTIVE.equals(status) ) { + processActive(); + } else if (ExchangeStatus.DONE.equals(status) ) { + processDone(); + } else if (ExchangeStatus.ERROR.equals(status) ) { + processError(msgExchange.getError()); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java new file mode 100644 index 000000000..d76fbe0f9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java @@ -0,0 +1,398 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractComponentLifeCycle.java + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.MessagingException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.ComponentLifeCycle. This is an + * abstract class that keeps the reference to the component context and the lifecycle + * extension mbeans. It implements the lifecycle method and provide the extended methods + * for each lifecycle methods to implement component specific functionality. + *

+ * It makes sure that the mininum initialization required for the component + * lifecycle is implemented by this class or the classes extending this class. + *

+ * Another important functionality implemented in this class is that it initializes the global + * RuntimeContext for the component with the ComponentContext passed by the JBI runtime and the + * opened delivery channel to make them available globally to any class in the component implementation + * that may need it during component lifecycle + *

+ * Service engine or a binding component lifecycle implementation can directly extend + * this class for their required functionality and override some of the methods to provide + * their own implementation. + * + * @see javax.jbi.ComponentLifeCycle + * @author chikkala + */ +public class BasicComponentLifeCycle implements ComponentLifeCycle { + /** reference to the component runtime */ + private Component mCompRuntime; + /** component context */ + private ComponentContext mComponentContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + /** a message receiver that accepts messages from delivery channel */ + private MessageExchangeReceiver mMsgExchReceiver; + + /** + * constructor for the ComponentLifecycle implementation. + * @param compRuntime + */ + protected BasicComponentLifeCycle(Component compRuntime) { + this.mCompRuntime = compRuntime; + } + /** + * @return Component + */ + public final Component getComponentRuntime() { + return this.mCompRuntime; + } + /** + * @return ComponentContext component context. + */ + public final ComponentContext getComponentContext() { + return mComponentContext; + } + /** + * @return component name + */ + protected String getComponentName() { + return (this.mComponentContext != null) ? + this.mComponentContext.getComponentName() : null; + } + /////////////////////////////////////////////////////////////////////////// + // ComponentLifeCycle interface implemenation + /////////////////////////////////////////////////////////////////////////// + + /** + * Initializes the component lifecycle. This method makes sure that the + * component context passed by the jbi runtime is saved in the lifecycle + * object before calling the other component initialization methods to + * completely initialize the component. + * @param context Component context + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}init(javax.jbi.component.ComponentContext) + * @throws javax.jbi.JBIException on error + */ + public final void init(ComponentContext context) throws JBIException { + + if ( context == null ) { + throw new JBIException("Null Component Context received in " + + "Component Lifecycle init "); + } + this.mComponentContext = context; // 0. save the component context passed by jbi framework. + // initialize the content + initGlobalContext(); // 1. Initialize component runtime context. + registerExtensionMBean(); // 2. Create and register extension mbean. + openDeliveryChannel(); // 3. Open delivery channel. + initMessageExchangeReceiver(); // 4. Create message exchange receiver. + doInit(); // 5. Do any component specific initialization such + // as static service providers and consumers initialization. + + this.getLogger().fine("Component " + this.getComponentName() + " initialized"); + } + + /** + * Starts the component. Extended classes can override/implement the methods called + * in this method to provide component specify start functionality. + * + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}start() + * @throws javax.jbi.JBIException on error + */ + public final void start() throws JBIException { + + doStart(); // 1. do any other component specific start tasks such as + // activating any static service providers and consumers. + startMessageExchangeProcessing(); // 2. begin accepting and processing message exchanges. + + this.getLogger().fine("Component " + this.getComponentName() + " started"); + } + + /** + * Stop the component.Extended classes can override/implement the methods called + * in this method to provide component specify stop functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}stop() + */ + public final void stop() throws JBIException { + + stopMessageExchangeProcessing(); // 1. stop accepting and processing message exchanges. + doStop(); // 2. do any other component specific stop tasks such as + // deactivating any static service providers and consumers. + this.getLogger().fine("Component " + this.getComponentName() + " stopped."); + } + + /** + * Shut down the component. Extended classes can override/implement the methods called + * in this method to provide component specify shut down functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}shutDown() + */ + public final void shutDown() throws JBIException { + // clean up all resources. + shutdownMessageExchangeReceiver(); // 1. remove the message receiver. + closeDeliveryChannel(); // 2. close delivery channel + unregisterExtensionMBean(); // 3. unregister and remove extension mbean if exists. + doShutDown(); // 4. do any other component specific clean up tasks such + // as clean any static service providers and consumer resource. + this.getLogger().fine("Component " + this.getComponentName() + " shut down"); + } + /** + * create jmx object name for the extension mbean. default implementation does + * not required to have the extension mbean. + * @return ObjectName of the extension mbean + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * gets the reference to the extension mbean name. + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}getExtensionMBeanName() + * @return ObjectName of the extension mbean objectname or null if component + * does not support extension mbean + */ + public final ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = this.createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. default + * implementation does not require the extension mbean + * @return the ExtensionMBean implementation as StandardMBean + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * gets the reference to the extension mbean. + * @return extension mbean implementation or null if component does not support. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + * @throws JBIException on error registering mbean + */ + protected final void registerExtensionMBean() throws JBIException { + // creatre the extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server if any. + */ + protected final void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Extension MBean from MBeanServer for " + this.getComponentName(), e); + } + } + /** + * creates MessageExchangeReceiver implementation that handles receiving and processing + * the message exchanges from the delivery channel. Component should implement + * this method to provide the MessageReceiver. + * + * Component may return null indicating that they don't need the message receiver + * that can receive and process message exchanges from delivery channel. For example, + * components that have only service consumers which send a synchronous messages to + * providers don't need this. + * + * @throws java.lang.Exception + * @return MessageExchangeReceiver implementation. null if the component does not support it. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}createMessageExchangeReceiver + */ + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return null; + } + /** + * returns the message exchange receiver implementation reference + * @return MessageExchangeReceiver interface + */ + protected final MessageExchangeReceiver getMessageExchangeReceiver() { + if ( this.mMsgExchReceiver == null ) { + this.mMsgExchReceiver = createMessageExchangeReceiver(); + } + return this.mMsgExchReceiver; + } + /** + * creates a message receiver object as part of the component initialization. + * @throws javax.jbi.JBIException + */ + protected void initMessageExchangeReceiver() throws JBIException { + // create and initialize the MessageExchangeReceiver + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.initReceiver(); + } + } + /** + * allows the component to accept the message exchange objects from the + * delivery channel and process it as part of the component startup process. + * @throws javax.jbi.JBIException + */ + protected void startMessageExchangeProcessing() throws JBIException { + // start message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.startProcessing(); + } + } + /** + * stops the component from accepting the message exchange objects from the + * delivery channel as part of the component stop process + * @throws javax.jbi.JBIException + */ + protected void stopMessageExchangeProcessing() throws JBIException { + // stop message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.stopProcessing(); + } + } + /** + * removes the message receiver as part of the component shutdown process + * @throws javax.jbi.JBIException + */ + protected void shutdownMessageExchangeReceiver() throws JBIException { + // clean up message processing. + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.shutdownReceiver(); + } + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * initializes the RuntimeContext during component init lifecycle phase. This + * includes setting the ComponentContext and loggers etc. extended classes must + * save the component context in the RuntimeContext in this methods implementation. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}initGlobalContext + */ + protected void initGlobalContext() { + RuntimeContext.getInstance().setComponentContext(this.getComponentContext()); + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } + /** opens the delivery channel to accept or send message exchange objects + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}openDeliveryChannel + */ + protected void openDeliveryChannel() { + try { + DeliveryChannel channel = this.getComponentContext().getDeliveryChannel(); + RuntimeContext.getInstance().setDeliveryChannel(channel); + } catch (MessagingException ex) { + ex.printStackTrace(); + } + } + /** closes the delivery channel as part of the component shutdown process. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}closeDeliveryChannel + */ + protected void closeDeliveryChannel() { + // closes delivery channel and remove the reference. + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel != null ) { + channel.close(); + } + } catch (MessagingException ex) { + ex.printStackTrace(); + } finally { + RuntimeContext.getInstance().setDeliveryChannel(null); + } + } + /** + * chance to extended classes to do any extra component specific init tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * initialized here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}init method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}init + */ + protected void doInit() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific start tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * activated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}start method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}start + */ + protected void doStart() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific stop tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * deactivated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}stop method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}stop + */ + protected void doStop() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific shutdown tasks.If the component + * supports static service providers or consumers without deployment support, they can be + * cleaned up here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}shutdown method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}shutdown + */ + protected void doShutDown() throws JBIException { + //NOOP + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java new file mode 100644 index 000000000..7e44dc053 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java @@ -0,0 +1,275 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + /* + * ComponentInstaller.java + */ +package net.openesb.component.${artifactId}.common; + +import java.util.List; +import java.util.logging.Level; +import javax.jbi.component.Bootstrap; +import javax.jbi.component.InstallationContext; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.Bootstrap. This class implements + * the minimum required functionality for component installation contract + * of the jbi component in the jbi environment. It also takes care of maintaining + * the installation context reference and installation specific logger creation and + * installation extension mbean registration and unregistration during initialization + * and cleanup. Extended classes only need to supply the mbean name and its implementation + * object for the installation extensions. + * + * It makes sure that the installation context and the loggers are available to + * the classes extended from this class to add more installation specific functionality. + * + * Service engine or a binding component installation implementation can directly use + * this class or extend this class to add more functionality to their installation + * process. + * + * @see javax.jbi.Bootstrap + * @author chikkala + */ +public class ComponentInstaller implements Bootstrap { + /** default logger*/ + private Logger mDefLogger; + /** bootstrap logger */ + private Logger mBTLogger ; + /** Installation Context . */ + private InstallationContext mInstallationContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + + /** Constructor to create the ComponentInstaller. */ + public ComponentInstaller() { + } + /** + * @return InstallationContext of the component. + */ + public final InstallationContext getInstallationContext() { + return this.mInstallationContext; + } + protected String getComponentName() { + return (this.mInstallationContext != null) ? + this.mInstallationContext.getComponentName() : null; + } + /** + * @return logger initialized from the installation context or a default + * logger. + */ + protected Logger getLogger() { + // try init bootstrap logger + if (this.mBTLogger == null && this.mInstallationContext != null ) { + try { + this.mBTLogger = + this.mInstallationContext.getContext().getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mBTLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mBTLogger != null) ? this.mBTLogger : this.mDefLogger; + } + /** + * Initializes the installation environment for a component. + * @see javax.jbi.component.Bootstrap${symbol_pound}init(javax.jbi.component.InstallationContext) + */ + public final void init(InstallationContext installContext) throws javax.jbi.JBIException { + + if ( installContext == null ) { + throw new JBIException("Null Installation Context received in " + + "Component Bootstrap initialization"); + } + // save the installation context reference passed by the jbi framework. + this.mInstallationContext = installContext; + registerExtensionMBean(); // create and register extension mbean + doInit(); // do any other extra initialization required specific to the component installation. + // initialize logger + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component Installer initialized"); + } + /** + * default implementation just logs the method call. extended classes should override this. + * @see javax.jbi.component.Bootstrap${symbol_pound}onInstall() + */ + public void onInstall() throws javax.jbi.JBIException { + //TODO: do required initializaton and resource creation + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component installed."); + } + /** + * default implementation just logs the method call. + * @see javax.jbi.component.Bootstrap${symbol_pound}onUninstall() + */ + public void onUninstall() throws javax.jbi.JBIException { + //TODO: do clean up the resource and other stuff. + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component uninstalled"); + } + /** + * default noop implementation of the cleanup. + * @see javax.jbi.component.Bootstrap${symbol_pound}cleanUp() + */ + public final void cleanUp() throws javax.jbi.JBIException { + + unregisterExtensionMBean(); // unregister extension mbean and remove it + doCleanUp(); // do any other extra cleanup specific to the component installation. + this.getLogger().fine( this.mInstallationContext.getComponentName() + + " Component Installer Cleaned up"); + } + + /** + * create jmx object name for the extension mbean. Extended classes should + * return the component specific installer extension mbean name here. + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * default implementation that does not have extension mbean return null. + * @see javax.jbi.component.Bootstrap${symbol_pound}getExtensionMBeanName() + */ + public final javax.management.ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. Extended + * classes should return the installer extension mbean implementation as the + * standard mbean. + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * returns the installation extension mbean implementation. + * @return StandardMBean for the extension mbean implementation. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * Chance to extended classes to do the component installation specific init. + * Installation context will be initialized before calling this method. So, + * initialize other things if required in this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller${symbol_pound}init( + * javax.jbi.component.InstallationContext) + */ + protected void doInit() throws JBIException { + this.getLogger().info(this.getInstallationContext().getComponentName() + + " : Component Installer initialized"); + } + /** + * Chance to extended classes to do the component installation specific cleanup. + * ExtensionMbean will be unregistered before calling this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller${symbol_pound}cleanUp( + * javax.jbi.component.InstallationContext) + */ + protected void doCleanUp() throws JBIException { + this.getLogger().fine(this.getInstallationContext().getComponentName() + + " : Component Installer doCleanUp"); + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + */ + protected void registerExtensionMBean() throws JBIException { + // creatre the installation extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation if the object name is created. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Installation Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Installation Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server. + */ + protected void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Installation extension MBean for " + this.getComponentName(), e); + } + } + /** + * This method is called by the JBI runtime to allow a component to upgrade + * it's workspace and any existing Service Units to match the new version of + * the component. The JBI runtime copies the existing workspace root to the + * new workspace root prior to calling this method, so that the component + * can examine the contents of the workspace root to determine the version + * of the component from which the upgrade is being made. All updates to the + * workspace root are done in-place; in the event of a failure, the JBI + * runtime reverts back to the original workspace root, the original install + * root, and the original Service Unit roots for the component. + * + * Note1: The component must ensure that it never holds open references + * to any files in the workspace root or any of the Service Unit roots upon + * returning from this method. Failure to do so will cause problems when + * the runtime attempts to complete the upgrade processing. + * + * Note2: The installation context that is normally initialized + * by the runtime by calling ${symbol_pound}init method of the javax.jbi.Bootstrap interface + * before install and uninstall will not be called before calling this + * upgrade method. So, installation context can not be used in this method's + * implementation. + * + * Note3: Since there won't be any installation context available, the logger + * that returned from the ${symbol_pound}getLogger method is a default logger created using + * the package name of this class or extended class if the method is overridden + * in the extended class. + * + * @param workspaceRoot the workspace root for the new version of the + * component that will replace the currently installed version. This is + * populated with the contents of the original workspace root and the + * component must update it to match the new version of the component. + * @param serviceUnitRoots a list of directory paths to all of the Service + * Units currently deployed to the component. The component must update all + * of these to match the new version of the component. + * @exception JBIException when there is an error requiring that the upgrade + * be terminated. + */ + public void upgrade(String workspaceRoot, List serviceUnitRoots) + throws javax.jbi.JBIException + { + //TODO: override this method in the extended class to handle the + // workspace root and service unit roots upgrade according to the + // component's requirement. + this.getLogger().fine("Default upgrade implementation. " + + "TODO: Implement workspace root and service unit roots upgrade."); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java new file mode 100644 index 000000000..5c32ce274 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java @@ -0,0 +1,174 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ComponentRuntime.java + */ +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Logger; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.servicedesc.ServiceEndpoint; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; + +/** + * This class implements javax.jbi.component.Component interface which is + * responsible for creating the Component Lifecycle implementation and the + * ServiceUnitManager implementation for the jbi component. + * + * This class makes sure that non null component lifecycle implementation is + * returns by this class or any classes extended from this class which is + * required as a component contract. It also provides default implementation of + * all methods of the Component interface which the extended classes can + * override to add more functionality. + * + * @see javax.jbi.component.Component + * @author chikkala + */ +public class ComponentRuntime implements Component { + /** Component LifeCycle implementation */ + private ComponentLifeCycle mLifeCycle; + /** ServiceUnitManager implementation */ + private ServiceUnitManager mSUManager; + /** default logger*/ + private Logger mDefLogger; + + /** Creates a new instance of ComponentImpl */ + public ComponentRuntime() { + this.mLifeCycle = null; + this.mSUManager = null; + } + /** + * returns the ComponentContext. Any component runtime class extended from + * this class can override this method to return their own reference to the + * ComponentContext. + * @return ComponentContext component context. + */ + public ComponentContext getComponentContext() { + ComponentContext ctx = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + ctx = ((BasicComponentLifeCycle) this.mLifeCycle).getComponentContext(); + } + return ctx; + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + public Logger getLogger() { + Logger logger = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + logger = ((BasicComponentLifeCycle) this.mLifeCycle).getLogger(); + } + // init default logger if required + if ( logger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (logger != null) ? logger : this.mDefLogger; + } + /** + * return the ComponentLifeCycle implementation. if returned null, the + * ComponentLifeCycleImpl will be used as the component lifecycle + * Extended classes can override this method and do their own ComponentLifecyle + * specific creation. + */ + protected ComponentLifeCycle createComponentLifeCycle() { + return new BasicComponentLifeCycle(this); + } + /** + * Get the life cycle control interface for this component. + * + * @return the life cycle control interface for this component + * @see javax.jbi.Component${symbol_pound}getLifeCycle() + */ + public final ComponentLifeCycle getLifeCycle() { + if ( this.mLifeCycle == null ) { + this.mLifeCycle = createComponentLifeCycle(); + if ( this.mLifeCycle == null ) { + this.getLogger().fine("Creating basic component lifecycle implemenation"); + // use the default ComponentLifeCycle Impl if a component + // specific implementation return null in createComponentLifeCycle. + this.mLifeCycle = new BasicComponentLifeCycle(this); + } + } + return this.mLifeCycle; + } + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. + * Extended classes can override this method and do their own ServiceUnitManager + * specific creation. + */ + protected ServiceUnitManager createServiceUnitManager() { + return null; + } + /** + * Get the Service Unit manager for this component. + * + * @return the ServiceUnitManager for this component, or + * null if there is none. + * @see javax.jbi.Component${symbol_pound}getServiceUnitManager() + */ + public final ServiceUnitManager getServiceUnitManager() { + if ( this.mSUManager == null ) { + this.mSUManager = createServiceUnitManager(); + } + return this.mSUManager; + } + /** + * Retrieves a DOM representation containing metadata which describes the + * service provided by this component, through the given endpoint. + * + * Default implementation does not support service description. + * + * @see javax.jbi.Component${symbol_pound}getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint) + */ + public Document getServiceDescription(ServiceEndpoint serviceEndpoint) { + return null; + } + /** + * This method is called by JBI to check if this component, in the role of + * provider of the service indicated by the given exchange, can actually + * perform the operation desired. + * + * Default implementation has no policy and allows all exchanges with consumer. + * + * @see javax.jbi.Component${symbol_pound}isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithConsumerOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * This method is called by JBI to check if this component, in the role of + * consumer of the service indicated by the given exchange, can actually + * interact with the provider properly. The provider is described by the + * given endpoint and the service description supplied by that endpoint. + * + * Default implementation has no policy and allows all exchanges with provider. + * + * @see javax.jbi.Component${symbol_pound}isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithProviderOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * Resolve the given endpoint reference. + * + * Default implementation does not have any XML dialect. So can not resolve the + * endpoint from the document fragment. + * + * @see javax.jbi.Component${symbol_pound}resolveEndpointReference(org.w3c.dom.DocumentFragment) + */ + public ServiceEndpoint resolveEndpointReference(DocumentFragment documentFragment) { + return null; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java new file mode 100644 index 000000000..51c85bc6e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java @@ -0,0 +1,180 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * DefaultMessageExchangeReceiver.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; + +/** + * This class implements MessageExchangeReceiver interface. This is a default implementation that + * demonstrates the multi-threaded environment to receive and process message exchanges from the + * delivery channel. It uses a main thread to receive message exchanges from the delivery channel + * and then processes the received message exchanges in a individual threads from the thread pool. + * The controller methods of MessageExchangeReceiver controls the main thread and the thread pool + * execution. + * + * @author chikkala + */ +public class DefaultMessageExchangeReceiver implements MessageExchangeReceiver { + + /** delivery channel accept time out */ + private final static long DC_ACCEPT_TIME_OUT = 3000; // milliseconds + /** receiver thread wait time before polling for messages after woke up **/ + private final static long RECEIVER_WAIT_TIME = 2000; // milliseconds + /** receiver thread wait time before force shutdown */ + private final static long RECEIVER_SHUTDOWN_WAIT_TIME = 10; // seconds + /** handler threads wait time before forced shutdown */ + private final static long HANDLERS_SHUTDOWN_WAIT_TIME = 30; // seconds + /** handler thread pool size */ + private final static int HANDLER_THREAD_POOL_SIZE = 5; + /** receiver thread accept message exchange condition */ + private Boolean mCanAccept = false; + /** receiver thread termination condition */ + private Boolean mContinue = true; + /** receiver thread executor service */ + private ExecutorService mReceiverThreadMgr; + /** handler thread executor service */ + private ExecutorService mHandlerThreadPool; + + /** no default constructor for extended classes */ + public DefaultMessageExchangeReceiver() { + } + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + public final void initReceiver() throws JBIException { + + this.mHandlerThreadPool = Executors.newFixedThreadPool(HANDLER_THREAD_POOL_SIZE); + this.mReceiverThreadMgr = Executors.newSingleThreadExecutor(); + + this.mReceiverThreadMgr.execute(new Runnable() { + public void run() { + Thread t = Thread.currentThread(); + while ( mContinue ) { + if (mCanAccept) { + receiveAndProcessMessageExchange(); + } else { + try { + t.sleep(RECEIVER_WAIT_TIME); + } catch (InterruptedException interruptException) { + // someone must have interrupted this thread + // do nothing + RuntimeHelper.logDebug("Interrupted the MessageReceiverThread in Sleep"); + } + } + } + } + }); + } + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + public final void shutdownReceiver() throws JBIException { + + synchronized ( mContinue ) { + mContinue = false; + } + boolean terminated = false; + try { + this.mReceiverThreadMgr.shutdown(); + terminated = this.mReceiverThreadMgr.awaitTermination( + RECEIVER_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Message Receiver not shutdown. Forcing shutdown"); + this.mReceiverThreadMgr.shutdownNow(); + } + } + shutdownHandlers(); + } + /** + * shutdown all the working threads from the thread pool. + */ + private final void shutdownHandlers() throws JBIException { + + boolean terminated = false; + try { + this.mHandlerThreadPool.shutdown(); + terminated = this.mHandlerThreadPool.awaitTermination( + HANDLERS_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Handler threads not shutdown. Forcing shutdown"); + this.mHandlerThreadPool.shutdownNow(); + } + } + } + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + public final void startProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = true; + } + } + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + public final void stopProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = false; + } + } + + protected MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + private void receiveAndProcessMessageExchange() { + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel == null ) { + RuntimeHelper.logDebug("DeliveryChannel Not Opened for receiving messages"); + return; + } + final MessageExchange msgExchange = channel.accept(DC_ACCEPT_TIME_OUT); + if ( msgExchange == null ) { + // delivery channel timeout occurred. do nothing. + // RuntimeHelper.logDebug("DeliveryChannel returned null message exchange from accept"); + return; + } + final ExchangeStatus status = msgExchange.getStatus(); + // process message exchange in a separate thread + this.mHandlerThreadPool.execute(new Runnable() { + public void run() { + getMessageExchangeSupport().fireMessageExchangeReceived(status, msgExchange); + } + }); + + } catch (MessagingException ex) { + RuntimeHelper.logWarning(ex); + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java new file mode 100644 index 000000000..fed6c987d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeHandler.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface is a Handler to perform message exchanges when the component + * receives the MessageExchange object from the delivery channel. + * Implementation of this interface should implement the processing of + * the active, error, done status of the MessageExchange object according to + * the MEP for which the MessageExchange object is created. + * + * @author chikkala + */ +public interface MessageExchangeHandler { + /** + * this method will be invoked to process the MessageExchange + * object. + * @param msgExchange MessageExchange object to process. + */ + void processMessageExchange(ExchangeStatus status, MessageExchange msgExchange); + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java new file mode 100644 index 000000000..c27c1f221 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java @@ -0,0 +1,36 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeListener.java + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface defines the notification mechanism with which the message exchange object received + * from the delivery channel is processed by the interesting parties. A particular service endpoint + * implementation would first register the implementation of this interface with MessageExchangeSupport + * to get the notification of a received message exchange on a particular service endpoint and the + * implementation of the interface would process the message exchange when notified. + * + * When the com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver receives the message exchange + * object, it asks the MessageExchangeSupport to notify the MessageExchangeLister that is registered for the + * received message exchange object to process the message exchange object. + * @see com.sun.jbi.sample.component.common.MessageExchangeSupport + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public interface MessageExchangeListener { + /** + * MessageExchangeSupport will call this method to notify the lister implementation that a + * message exchange is received from the delivery channel. + * @param me MessageExchange Object + */ + void messageExchangeReceived(ExchangeStatus status, MessageExchange me); +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java new file mode 100644 index 000000000..607146abd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeReceiver.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.JBIException; + +/** + * This interface provides the methods can controls the receiving and processing of the message + * exchange objects from the delivery channel during the component lifecycle operations. + * The implementation of this interface can use multi-threaded environment to receive and process + * message exchanges from the delivery channel during the component lifecycle. + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @author chikkala + */ +public interface MessageExchangeReceiver { + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + void initReceiver() throws JBIException; + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + void startProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + void stopProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + void shutdownReceiver() throws JBIException; + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java new file mode 100644 index 000000000..bddf9a8b1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java @@ -0,0 +1,170 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeSupport.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.xml.namespace.QName; + +/** + * This class supports the registering and unregistering MessageExchangeListeners and the + * MessageExchangeHandlers that can be used to process the received message exchange from a + * delivery channel. A global reference to this class will be created in RuntimeContext object to + * provide access to this class from any where in the component runtime. + * + * A ProviderEndpoint or ConsumerEndpoint interested in a MessageExchange received from a delivery + * channel for a particular service endpoint will register the MessageExchangeListener with this + * class. The DefaultMessageExchangeReceiver when received a message exchange object from the delivery + * channel uses MessageExchangeSupport.processMessageExchange method to notify the registered listener. + * + * The MessageExchangeListener implementation ( ProviderEndpoint or ConsumerEndpoint ) while processing + * received message ( messageExchangeReceived()) will create and register the message exchange handlers + * to process the message exchange. + * + * @see RuntimeContext${symbol_pound}getMessageExchangeSupport + * @see RuntimeHelper${symbol_pound}getMessageExchangeSupport + * @see DefaultMessageExchangeReceiver${symbol_pound}receiveAndProcessMessageExchange + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public class MessageExchangeSupport { + /** listener map to notify a message exchange received event */ + private Map mListeners; + /** handlers that can process the message exchange */ + private Map mHandlers; + /** Creates a new instance of MessageExchangeSupport */ + public MessageExchangeSupport() { + this.mListeners = Collections.synchronizedMap(new HashMap()); + this.mHandlers = Collections.synchronizedMap(new HashMap()); + } + /** + * generates key that will be used to store the MessageExchangeListener objects. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public String createListenerKey(Role role, QName interfaceName, QName serviceName, String endpointName) { + + StringBuffer strBuff = new StringBuffer(); + strBuff.append(interfaceName).append("+"); + strBuff.append(serviceName).append("+"); + strBuff.append(endpointName).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(role) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(role) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + /** + * adds message exchange listener who are interested in receiving the notification when the + * message exchange is received from delivery channel. The listener can be registered with the + * following combination of the parameters: (role,interfaceName,serviceName, endpointName), + * (role,interfaceName,null, null), (role, null,serviceName, endpointName), (role, null,serviceName, null) + * + * @param role role of the message exchange listener PROVIDER or CONSUMER - can not be null. + * @param interfaceName QName of the interface ( protType ) - can be null if the serviceName is not null + * @param serviceName QName of the service - can be null if interfaceName is not null. + * @param endpointName endpoint name of the service. - can be null if the serviceName is not null. + * @param listener MessageExchangeListener object + */ + public synchronized void addMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName, MessageExchangeListener listener) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + this.mListeners.put(key, listener); + } + /** + * removes any message exchange listener registered for the service endpoint specified by the serviceName and + * endpoint name. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public synchronized void removeMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + MessageExchangeListener listener = this.mListeners.remove(key); + if ( listener == null ) { + RuntimeHelper.getLogger().fine("No message exchange listener removed with key " + key); + } + } + /** + * finds the MessageExchangeListner registers for the endpoint for which the message exchange is + * received and call the method on the listener + */ + public boolean fireMessageExchangeReceived(ExchangeStatus status, MessageExchange me) { + boolean notified = false; + Role role = me.getRole(); + QName interfaceName = me.getInterfaceName(); + QName serviceName = me.getEndpoint().getServiceName(); + String endpointName = me.getEndpoint().getEndpointName(); + // lookup with complete service description ( role + interface + service + endpoint ) + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + MessageExchangeListener listener = this.mListeners.get(key); + + if ( listener == null ) { // lookup with role+interface name + key = createListenerKey(role, interfaceName, null, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with role + serviceName + endpointName + key = createListenerKey(role, null, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with with role + serviceName + key = createListenerKey(role, null, serviceName, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { + RuntimeHelper.getLogger().fine("Could not find listener for message exchange" + me); + notified = false; + } else { + listener.messageExchangeReceived(status,me); + notified = true; + } + return notified; + } + /** + * registers the MessageExchangeHandler implementation against the message exchange id. + * @param me MessageExchange for which the handler need to be assigned + * @param handler MessageExchangeHandler implementation that will be registers. + */ + public synchronized void addMessageExchangeHandler(MessageExchange me, MessageExchangeHandler handler) { + this.mHandlers.put(me.getExchangeId(), handler); + } + /** + * removes the MessageExchangeHandler for the particular message exchange object + */ + public synchronized void removeMessageExchangeHandler(MessageExchange me) { + MessageExchangeHandler handler = this.mHandlers.remove(me.getExchangeId()); + if ( handler == null ) { + RuntimeHelper.getLogger().fine("No MessageExchangeHandler found for removing " + me.getExchangeId()); + } + } + /** + * looks up the registered message exchange handler for the message exchange object + * @param me MessageExchangeHandler. + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(MessageExchange me) { + return this.mHandlers.get(me.getExchangeId()); + } + /** + * looks up the registered message exchange handler for the message exchange object with Id + * @param exchangeId message exchange object's id + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(String exchangeId) { + return this.mHandlers.get(exchangeId); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java new file mode 100644 index 000000000..be75c7b7d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java @@ -0,0 +1,176 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * RuntimeContext.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; + +/** + * This class is global context for all the component runtime to store and + * retrieve the information that should be available anywhere in the component runtime. + * + * Each instance variable of this class will be initialized at various points of the + * component runtime using setter methods on this class. + * + * The two important objects that will be initialized and available from this context are + * ComponentContext and the opened DeliveryChannel objects both of which will be set from the + * implementation {@link BasicComponentLifeCycle}. + * + * Note that the ComponentContext from this global context will not be available until + * the jbi framework calls the init method of the ComponentLifeCycle of the component and + * then intern the implementation of the init method sets the context. + * + * @see BasicComponentLifeCycle${symbol_pound}initGlobalContext + * @see BasicComponentLifeCycle${symbol_pound}openDeliveryChannel + * @see BasicComponentLifeCycle${symbol_pound}closeDeliveryChannel + * @author chikkala + */ +public final class RuntimeContext { + /** RuntimeContext singleton instance */ + private static RuntimeContext sRuntimeContext; + /** default logger*/ + private Logger mDefLogger; + /** Logger object. */ + private Logger mLogger; + /** Holds value of property ComponentContext. */ + private ComponentContext mComponentContext; + /** Holds value of property DeliveryChannel. */ + private DeliveryChannel mDeliveryChannel; + /** MessageExchange processing support **/ + private MessageExchangeSupport mMESupport; + + /** outside code can not instantiate RuntimeContext */ + private RuntimeContext() { + } + /** + * @return RuntimeContext instance. + */ + public static RuntimeContext getInstance() { + if ( sRuntimeContext == null ) { + synchronized (RuntimeContext.class) { + if ( sRuntimeContext == null ) { + sRuntimeContext = new RuntimeContext(); + } + } + } + return sRuntimeContext; + } + /** + * Getter for to obtaining ComponentContext from any where in the component runtime. + * @return ComponentContext. + */ + public ComponentContext getComponentContext() { + return this.mComponentContext; + } + /** + * Sets the Component context reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle${symbol_pound}initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle${symbol_pound}initContext + * for details. + * @param componentContext New value of property ComponentContext. + * @see BasicComponentLifeCycle${symbol_pound}initGlobalContext + */ + public void setComponentContext(ComponentContext componentContext) { + if ( this.mComponentContext != null ) { + (new IllegalStateException("Component Context already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mComponentContext = componentContext; + } + /** + * Getter for obtaining opened delivery channel from any where in the component runtime. + * @return DeliveryChannel. + */ + public DeliveryChannel getDeliveryChannel() { + return this.mDeliveryChannel; + } + /** + * Sets the opened delivery channel reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle${symbol_pound}initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle${symbol_pound}initContext + * for details. + * + * @param componentContext New value of property ComponentContext. + */ + public void setDeliveryChannel(DeliveryChannel deliveryChannel) { + if ( deliveryChannel != null && this.mDeliveryChannel != null ) { + (new IllegalStateException("Delivery Channel already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mDeliveryChannel = deliveryChannel; + } + /** + * Sets the logger. + * + * @param name name for the Logger. + * @param resourceBundle resource bundle for the logger. can be null. + */ + public void setLogger(String name, String resourceBundle) { + + if (this.mComponentContext != null) { + // get the logger from component context if the component context is not null + try { + this.mLogger = this.mComponentContext.getLogger(name, resourceBundle); + } catch (Exception ex) { + ex.printStackTrace(); + } + } else { + this.mDefLogger = Logger.getLogger(name, resourceBundle); + } + } + /** + * Returns the logger. + * + * @return Logger + */ + public Logger getLogger() { + + // try init logger + if (this.mLogger == null && this.mComponentContext != null ) { + try { + this.mLogger = + this.mComponentContext.getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mLogger != null) ? this.mLogger : this.mDefLogger; + } + /** + * Returns the Component Name if the ComponentContext is set. else null + * @return component name + */ + public String getComponentName() { + String componentName = null; + if (this.mComponentContext != null) { + componentName = this.mComponentContext.getComponentName(); + } + return componentName; + } + /** + * Global MessageExchangeSupport reference. Various classes in the common + * component runtime would use this method to obtain the MessageExchangeSupport + * for processing message exchange objects received from delivery channel. + */ + public MessageExchangeSupport getMessageExchangeSupport() { + if ( this.mMESupport == null ) { + this.mMESupport = new MessageExchangeSupport(); + } + return this.mMESupport; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java new file mode 100644 index 000000000..f12c2b2f4 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java @@ -0,0 +1,360 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * RuntimeHelper.java + */ + +package net.openesb.component.${artifactId}.common; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * This is a helper class that have bunch of methods for xml processing. + * @author chikkala + */ +public class RuntimeHelper { + + public static Logger getLogger() { + return RuntimeContext.getInstance().getLogger(); + } + + public static void logWarning(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.WARNING, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().warning(logObj.toString()); + } + } + + public static void logError(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.SEVERE, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().severe(logObj.toString()); + } + } + + public static void logDebug(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.FINER, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().finer(logObj.toString()); + } + } + + public static String getComponentName() { + return RuntimeContext.getInstance().getComponentName(); + } + public static ComponentContext getComponentContext() { + return RuntimeContext.getInstance().getComponentContext(); + } + public static DeliveryChannel getDeliveryChannel() { + return RuntimeContext.getInstance().getDeliveryChannel(); + } + + public static MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeContext.getInstance().getMessageExchangeSupport(); + } + + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(Reader xmlReader) throws Exception { + InputSource xmlSource = new InputSource(xmlReader); + return buildDOMDocument(xmlSource); + } + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(InputSource xmlSource) throws Exception { + Document xmlDoc = null; + DocumentBuilderFactory docBuilderFactory = + DocumentBuilderFactory.newInstance(); + docBuilderFactory.setValidating(false); + docBuilderFactory.setNamespaceAware(true); + DocumentBuilder docBuilder = + docBuilderFactory.newDocumentBuilder(); + docBuilder.setErrorHandler( new DefaultHandler() { + public void fatalError(SAXParseException e) + throws SAXException { + throw new SAXException(e.getMessage()); + } + }); + + docBuilder.setEntityResolver(new EntityResolver() { + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + StringReader reader = + new StringReader(""); // NOI18N + InputSource source = new InputSource(reader); + source.setPublicId(publicId); + source.setSystemId(systemId); + return source; + } + }); + + xmlDoc = docBuilder.parse(xmlSource); + + return xmlDoc; + } + /** + * reads xml text from DOMSource to StringBuffer + */ + public static StringBuffer readFromDOMSource(DOMSource domSource) { + + StringWriter writer = new StringWriter(); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer trans = null; + try { + trans = tFactory.newTransformer(); + trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, + "yes"); + trans.setOutputProperty(OutputKeys.INDENT, "yes"); + StreamResult result = new StreamResult(writer); + trans.transform(domSource, result); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads the xml text from InputSource into a StringBuffer + */ + public static StringBuffer readFromInputSource(InputSource inSource) { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + InputStream inStream = inSource.getByteStream(); + Reader reader = inSource.getCharacterStream(); + if ( reader == null ) { + reader = new InputStreamReader(inStream); + } + BufferedReader buff = new BufferedReader(reader); + try { + + for ( String line = null; (line = buff.readLine()) != null ; ) { + out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads xml from from DOM, SAX or Stream Source into a string buffer + */ + public static StringBuffer readFromSource(Source source) { + if ( source instanceof DOMSource ) { + return readFromDOMSource((DOMSource)source); + } else { + InputSource inSource = SAXSource.sourceToInputSource(source); + if ( inSource != null ) { + return readFromInputSource(inSource); + } else { + return null; + } + } + } + /** + * creates a DOMSource from the xml text read from the reader. + */ + public static DOMSource createDOMSource(Reader xmlReader) { + Document doc = null; + try { + doc = buildDOMDocument(xmlReader); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * creates a DOMSource from any source. If the source itself is DOMSource, + * the source is returned as it is as DOMSource. + */ + public static DOMSource sourceToDOMSource(Source source) { + if ( source instanceof DOMSource) { + return (DOMSource) source; + } + InputSource xmlSource = SAXSource.sourceToInputSource(source); + Document doc = null; + try { + doc = buildDOMDocument(xmlSource); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * converts the ex stracktrace to string. + */ + public static StringBuffer getExceptionStackTrace(Exception ex) { + StringWriter strWriter = new StringWriter(); + if ( ex != null ) { + PrintWriter out = new PrintWriter(strWriter); + ex.printStackTrace(out); + } + return strWriter.getBuffer(); + } + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsXmlText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + String exXmlText = + "" + + "" + message + "" + + "" + stackTrace + "" + + "" ; + return exXmlText; + } + + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + StringBuffer buff = new StringBuffer(); + buff.append(message); + buff.append(System.getProperty("line.separator", "${symbol_escape}n")); + buff.append(stackTrace); + return buff.toString(); + } + + + /** + * For attribute values which denote a QName, i.e. include a namespace prefix, + * resolve the value into a QName. + * If a namespace can not be resolved, it is set to empty - it does not + * result in an exception + * @param attrValue the string value of the attribute + * @param element the element the attribute belongs to + */ + public static QName resolveAttrQName(String attrValue, Element element) { + int aColonLoc = attrValue.indexOf(":"); + String aLocalName = attrValue; + String aPrefix = null; + String aNS = null; + if (aColonLoc > -1) { + aPrefix = attrValue.substring(0, aColonLoc); + aLocalName = attrValue.substring(aColonLoc + 1); + + // Traverse up the hierarchy until a namespace definition is found + // or the top of the document is reached. + Node currNode = element; + while ((aNS == null || aNS.equals("")) && currNode != null) { + if (currNode.getNodeType() == Node.ELEMENT_NODE) { + aNS = ((Element) currNode).getAttribute("xmlns:" + aPrefix); + } + currNode = currNode.getParentNode(); + } + } + + QName qName = new QName(aNS, aLocalName, aPrefix); + + return qName; + } + + /** + * replaces the xml entity references with the xml escape chars + * @param xmlString Text with the xml escape chars + * @param Text with the xml entity references + */ + public static String replaceXmlEscapeCharsToEntityRefereces(String xmlString) { + if ( xmlString == null ) { + return xmlString; + } + + // just convert < , > and & only + StringBuffer sbuff = new StringBuffer(2 * xmlString.length()); + for ( int i = 0; i < xmlString.length(); ++i ) { + switch ( xmlString.charAt(i) ) { + case '&': sbuff.append("&"); + break; + case '<': sbuff.append("<"); + break; + case '>': sbuff.append(">"); + break; + default: sbuff.append( xmlString.charAt(i) ); + } + } + return sbuff.toString(); + } + + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + + public static Element getElement(DOMSource domSource) { + return getElement(domSource.getNode()); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java new file mode 100644 index 000000000..fd0fc4f79 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java @@ -0,0 +1,312 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractServiceUnitManager.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.management.DeploymentException; + +/** + * This is an abstract class that implements {@link javax.jbi.component.ServiceUnitManager} to provide a + * service unit deployment support for the component. The implementation supported by this service + * unit manager and related classes in this package provides WSDL1.1 based service unit deployment + * in the component. + * + * @see javax.jbi.component.ServiceUnitManager + * @see ServiceUnit + * + * @author chikkala + */ +public abstract class AbstractServiceUnitManager implements ServiceUnitManager { + + /** Map of ServiceUnit Name to the ServiceUnit Object for all the service units + * deployed in the component */ + private Map mSUMap; + + /** Creates a new instance of AbstractSUManager */ + protected AbstractServiceUnitManager() { + this.mSUMap = Collections.synchronizedMap(new HashMap()); + } + /** returns the component name + * @return component name. + */ + protected abstract String getComponentName(); + /** + * @return Logger + */ + protected abstract Logger getLogger(); + /** + * returns the creation of the ServiceUnit implementation specific to the service unit deployment + * for the component. + * @param suName service unit name + * @param suRootPath service unit root path + * @param concrete implementation of the ServiceUnit class. + */ + protected abstract ServiceUnit createServiceUnit(String suName, String suRootPath) + throws DeploymentException; + /** + * returns the service unit object deployed by the specified name. or null if not deployed. + * @param suName service unit name to look for + * @param ServiceUnit object for the suName. or null if not present. + */ + private ServiceUnit getServiceUnit(String suName) { + return this.mSUMap.get(suName); + } + /** + * lookup for the deployed service unit. If not there, throws a deployment exception. + * @param suName service unit name + * @return ServiceUnit object + * @throws DeploymentException if the service unit is not present. + */ + private ServiceUnit findServiceUnit(String suName) throws DeploymentException { + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return serviceUnit; + } + /** + * add the service unit object to the list of deployed service units. if there is already a + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is added. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit addServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + this.mSUMap.put(suName, su); + return su; + } + /** + * removes service unit object from the list of deployed service units. if there is no + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is being removed. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit removeServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return this.mSUMap.remove(suName); + } + /** + * creates the concrete service unit implementation and calls the load method on it to initialize + * the created service unit. + * @param suName service unit name to create + * @param suRootPath service unit root path. + * @return ServiceUnit that is created and loaded. + */ + private ServiceUnit loadServiceUnit(String suName, String suRootPath) throws DeploymentException { + ServiceUnit serviceUnit = createServiceUnit(suName, suRootPath); + serviceUnit.doLoad(); + return serviceUnit; + } + /** + * deploys a service unit. it creates and loads the service unit object for the suName and then call + * doDeploy on the service unit and adds it to the deployed service unit list + * @return result as jbi management xml + * @throws DeploymentException if there is an error deploying. + */ + private synchronized String deployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + ServiceUnit serviceUnit = loadServiceUnit(suName, suRootPath); + serviceUnit.doDeploy(); + addServiceUnit(serviceUnit); + return result; + } + /** + * Deploy a Service Unit to the component. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}deploy(String, String); + */ + public final String deploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Deploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully deployed service unit " + suName; + Exception errEx = null; + try { + deployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to deploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, ex); + } + return createComponentTaskResultXML(compName, "deployTask", isSuccess, mainMsg, errEx); + } + + /** + * undeploys the service unit. it looks up the existing deployed service unit and call doUndeploy + * on it and then removes from the deployed service unit list. + */ + private synchronized String undeployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit serviceUnit = findServiceUnit(suName); + serviceUnit.doUndeploy(); + removeServiceUnit(serviceUnit); + return result; + } + /** + * Undeploy a service unit from the component. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}undeploy(String, String); + */ + public final String undeploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Undeploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully undeployed service unit " + suName; + Exception errEx = null; + try { + undeployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to undeploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, errEx); + } + return createComponentTaskResultXML(compName, "undeployTask", isSuccess, mainMsg, errEx); + } + /** + * Initialize the given deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}init(String, String); */ + public final void init(String suName, String suRootPath) + throws DeploymentException { + this.getLogger().fine("Initializing service unit " + suName + " with suRootPath " + suRootPath); + String result = suName; + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { // if the service unit not exists, create and add + serviceUnit = loadServiceUnit(suName, suRootPath); // create and load service unit + addServiceUnit(serviceUnit); // add service unit to existing service units + } + serviceUnit.doInit(); // Do Service unit initialization tasks + this.getLogger().fine("Service unit initialized:" + suName); + } + /** + * Shut down the deployment. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}shutdown(String); + */ + public final void shutDown(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doShutdown(); // Do Service unit shutdown tasks + this.getLogger().fine("Service unit shut down:" + suName); + } + /** + * Start the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}start(String); + */ + public final void start(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStart(); // Do service unit start tasks. + this.getLogger().fine("Service unit started:" + suName ); + } + /** + * Stop the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}stop(String); + */ + public final void stop(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStop(); // do service unit stop tasks + this.getLogger().fine("Service unit stopped: " + suName + " stopped."); + } + + /** + * helper method to create result message as jbi management message xml. + * @param componentName name of the component for this xml. + * @param taskId task id + * @param isSuccess true to format a success result, false to format a failed result. + * @param mainMsg main result message + * @param errEx Exception, null if there is no exception in failure message. + * @return XML string. + */ + protected static String createComponentTaskResultXML( + String componentName, String taskId, boolean isSuccess, String mainMsg, Exception errEx ) { + + String exMsgXml = getComponentTaskResultExceptionXML(errEx); + String mainMsgXmlEsc = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces(mainMsg); + String taskResult = isSuccess ? "SUCCESS" : "FAILED"; + String msgType = isSuccess ? "INFO" : "ERROR"; + + String xmlResult = + "" + + " " + componentName + "" + + " " + + " " + + " " + taskId + "" + + " " + taskResult + "" + + " " + msgType + "" + + " " + + " " + + " SU_MGR_MSG_ID" + + " " + mainMsgXmlEsc + "" + + " " + + " " + + exMsgXml + + " " + + " " + + ""; + + return xmlResult; + } + /** + * converts the exception to the jbi management message xml chunk. + */ + private static String getComponentTaskResultExceptionXML(Exception errEx) { + StringBuffer exMsgBuff = new StringBuffer(); + if ( errEx == null ) { + return exMsgBuff.toString(); // empty string. + } + + List exList = new ArrayList(); + int exLevel = 0; + for ( Throwable cause = errEx ; cause != null ; cause = cause.getCause() ) { + String causeMsg = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + cause.getMessage()); + StringWriter stBuff = new StringWriter(); + PrintWriter stOut = new PrintWriter(stBuff); + StackTraceElement[] stList = cause.getStackTrace(); + for (StackTraceElement stEl : stList) { + stOut.println(stEl.toString()); + } + stOut.close(); + String causeStackTrace = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + stBuff.getBuffer().toString()); + + exMsgBuff.append(""); + exMsgBuff.append(" " + exLevel + ""); + exMsgBuff.append(" " + "SU_MGR_EXP_ID"); + exMsgBuff.append(" " + causeMsg + ""); + exMsgBuff.append(" "); + exMsgBuff.append(" " + causeStackTrace + ""); + exMsgBuff.append(""); + ++exLevel; + } + + return exMsgBuff.toString(); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java new file mode 100644 index 000000000..e9537ca9e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java @@ -0,0 +1,208 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ConsumerEndpoint.java + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.messaging.MessageExchangeFactory; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service consumer. {@link ServiceUnit${symbol_pound}createConsumerEndpoint} creates the object of this + * type to implement the service consumer functionality. + * + * @see ServiceUnit${symbol_pound}createConsumerEndpoint + * @author chikkala + */ + +public class ConsumerEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with CONSUMER role and makes sure that the service + * description passed to it is of consumer description. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(Role.CONSUMER, consumes, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef) { + this(consumes, wsdlDef, null); + } + public final void init() throws JBIException { + getLogger().fine("ConsumerEndpoint: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + public final void activate() throws JBIException { + getLogger().fine("ConsumerEndpoint: activate called"); + //1. do common ativation tasks. + doActivate(); //2. do any other activation related tasks. + } + + public final void deactivate() throws JBIException { + getLogger().fine("ConsumerEndpoint: deactivate called"); + //1. do common deactivation tasks. + doDeactivate(); //2. do any other deactivation related tasks. + } + + public final void clean() throws JBIException { + getLogger().fine("ConsumerEndpoint: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + + /** + * helper method to find the active ServiceEndpiont for the service described with the + * serviceDescriptor. This method looks for the Active ServiceEndpoint using interface or + * service name or service name and the endpoint name. + */ + public ServiceEndpoint findServiceEndpoint() { + + QName serviceType = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + + ServiceEndpoint [] refs = null; + ServiceEndpoint serviceEndpoint = null; + ComponentContext compContext = this.getComponentContext(); + + if ( compContext == null ) { + this.getLogger().info("Null Component context. Can not find ServiceEndpoint"); + return null; + } + // lookup ServiceEndpiont with concrete service(serice qname + endpoint name). + if ( serviceName != null && endpointName != null ) { + this.getLogger().info("Looking for ServiceEndpoint with:" + + " ServiceName: " + serviceName + " EndpointName: " + endpointName); + serviceEndpoint = compContext.getEndpoint(serviceName, endpointName); + } + // else lookup ServiceEndpiont with Service Name + if ( serviceEndpoint == null && serviceName != null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service name: " + serviceName); + refs = compContext.getEndpointsForService(serviceName); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + // else lookup ServiceEndpont with serviceType + if ( serviceEndpoint == null && serviceType != null && + serviceName == null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service type: " + serviceType); + refs = compContext.getEndpoints(serviceType); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + + return serviceEndpoint; + } + + /** + * this method creates a InOutMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOut createInOutMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for ${symbol_escape}n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOut inOutME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOutME = factory.createInOutExchange(); + // set operation + inOutME.setOperation(operation); + // set interface if that is not set + if ( inOutME.getInterfaceName() == null ) { + inOutME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOutME.createMessage(); + // set IN Normalized message on message exchange + inOutME.setInMessage(inMsg); + + return inOutME; + } + + /** + * this method creates a InOnlyMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOnly createInOnlyMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for ${symbol_escape}n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOnly inOnlyME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOnlyME = factory.createInOnlyExchange(); + // set operation + inOnlyME.setOperation(operation); + // set interface if that is not set + if ( inOnlyME.getInterfaceName() == null ) { + inOnlyME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOnlyME.createMessage(); + // set IN Normalized message on message exchange + inOnlyME.setInMessage(inMsg); + + return inOnlyME; + } + + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java new file mode 100644 index 000000000..359114ed2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java @@ -0,0 +1,289 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * Endpoint.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.MessageExchangeHandler; +import net.openesb.component.${artifactId}.common.MessageExchangeListener; +import net.openesb.component.${artifactId}.common.MessageExchangeSupport; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; + +/** + * This is an abstract class that represents the Endpoint defined for service provisioning or + * consumption in a jbi component. It stores the required service description ( wsdl definition, + * role, service unit to which it belongs etc) and defines the lifecycle operations {@link ${symbol_pound}init}, + * {@link ${symbol_pound}activate}, {@link ${symbol_pound}deactivate}, {@link ${symbol_pound}clean} to control a service endpoint that + * provides or consumes the service. + *

+ * Extended classes implement the abstract methods defined in this class to implement the endpoint + * functionality by providing the functionality to process the deployment artifacts specific to this + * endpoint, configure the endpoint to send/receive messages to/from delivery channel and process them + * according to the specific service implementation. + * + * @author chikkala + */ +public abstract class Endpoint { + /** Role of this endpoint. CONSUMER or PROVIDER */ + private Role mRole; + /** Service description from the SU descriptor for which this endpoint is configured */ + private SUDescriptor.Service mService; + /** WSDL definition corresponding to this endpoint */ + private Definition mWsdlDef; + /** service endpoint corresponding to this endpoint */ + private ServiceEndpoint mServiceEndpoint; + /** service unit from which this endpoint is created */ + private ServiceUnit mSU; // can be null + /** private constructor to force extended classes to use the parameterized constructor */ + private Endpoint() { + } + /** Creates a new instance of Endpoint + * @param role CONSUMER or PRVODER role. + * @param service service description from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + * @param su service unit object which created this endpoint. + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl, ServiceUnit su) { + this.mService = service; + this.mRole = role; + this.mWsdlDef = wsdl; + this.mSU = su; + } + /** Creates a new instance of Endpoint without service unit. may be useful for static endpoints that + * are not part of the deployment + * @param role CONSUMER or PRVODER role. + * @param service service info from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl) { + this(role, service, wsdl, null); + } + /** + * should be called to initialize any resources related to this endpoint object + * throws JBIException + */ + public abstract void init() throws JBIException; + /** + * activates the endpoint to send/receive messages + * throws JBIException + */ + public abstract void activate() throws JBIException; + /** + * deactivates the endpoint + * throws JBIException + */ + public abstract void deactivate() throws JBIException; + /** + * clean endpoint + * throws JBIException + */ + public abstract void clean() throws JBIException; + + public final Role getRole() { + return this.mRole; + } + public final boolean isProvider() { + return (Role.PROVIDER.equals(this.getRole())); + } + public final boolean isConsumer() { + return (Role.CONSUMER.equals(this.getRole())); + } + public final Definition getWSDL() { + return this.mWsdlDef; + } + public final SUDescriptor.Service getService() { + return this.mService; + } + public final ServiceEndpoint getServiceEndpoint() { + return this.mServiceEndpoint; + } + protected final void setServiceEndpoint(ServiceEndpoint svcEP) { + this.mServiceEndpoint = svcEP; + } + public final ServiceUnit getServiceUnit() { + return this.mSU; + } + /** + * generates an ID that would uniquely identify this endpoint implementation. Use as a key to map + * any information to store that is related to this endpoint. + */ + public final String getID() { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(this.mService.getInterface()).append("+"); + strBuff.append(this.mService.getServiceName()).append("+"); + strBuff.append(this.mService.getEndpointName()).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(this.mRole) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(this.mRole) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + + @Override + public String toString() { + return "Endpoint : " + "${symbol_escape}n" + this.mService; + } + /** + * checks if this endpoint is configured for the binding component or service engine. + */ + public boolean isForBindingComponent() { + boolean isForBindingComponent = false; + if ( this.mSU != null ) { + try { + isForBindingComponent = this.mSU.getSUDescriptor().isForBindingComponent(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + return isForBindingComponent; + } + + public QName getOperationQName(String opName) { + return new QName(this.getService().getInterface().getNamespaceURI(), opName); + } + + public Operation getWSDLOperation(QName opQName) { + String opName = null; + if ( opQName != null ) { + opName = opQName.getLocalPart(); + } + Operation operation = WSDLProcessor.findOperation(this.getWSDL(), + this.getService().getInterface(), opName); + return operation; + } + + public Binding getWSDLBinding() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + if ( serviceName != null ) { + return WSDLProcessor.findServiceBinding(this.getWSDL(), serviceName, endpointName); + } else { + return WSDLProcessor.findInterfaceBinding(this.getWSDL(), interfaceName, null); + } + } + /** @return logger */ + public Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** @return ComponentContext */ + public ComponentContext getComponentContext() { + return RuntimeHelper.getComponentContext(); + } + /** @return DeliveryChannel */ + public DeliveryChannel getDeliveryChannel() { + return RuntimeHelper.getDeliveryChannel(); + } + /** + * helper function to get the MessageExchangeSupport object + */ + public MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + public MessageExchangeHandler createMessageExchangeHandler() { + return null; + } + /** + * creates the message exchange listener. Extended classes should return + * MessageExchangeListener implementation. + * @return MessageExchangeListener or null. + * + */ + protected MessageExchangeListener createMessageExchangeListener() { + return null; + } + /** + * Creates and adds message exchange listener to receive message exchange received notification. + */ + protected void addMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeListener meListener = createMessageExchangeListener(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null && meListener != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName, meListener); + if ( serviceName != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), null, serviceName, endpointName, meListener); + } + } + } + /** + * Removes message exchange listener from the MessageExchangeSupport. + */ + protected void removeMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName); + if ( serviceName != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), null, serviceName, endpointName); + } + } + } + + public final boolean processMessageExchangeWithHandler(ExchangeStatus status, MessageExchange me) { + + //1. lookup handler + //2. if not there create one and register + //3. call process message exchange on it + //4. check status. if that is the end, remove the handler + + MessageExchangeSupport support = this.getMessageExchangeSupport(); + if ( support == null ) { + getLogger().fine("No MessageExchangeSupport present"); + return false; + } + MessageExchangeHandler handler = support.findMessageExchangeHandler(me); + if ( handler == null ) { + handler = this.createMessageExchangeHandler(); + if ( handler == null ) { + getLogger().fine("MessageExchangeHandler not supported"); + return false; + } + support.addMessageExchangeHandler(me, handler); + } + + handler.processMessageExchange(status, me); + + getLogger().fine("XXX MX Handler processed ME with STATUS: " + status); + + if (!ExchangeStatus.ACTIVE.equals(status) ) { + // DONE or ERROR means done with the me. + getLogger().fine("End of ME processing. STATUS: " + status + + ". Removing the MX Handler ..."); + support.removeMessageExchangeHandler(me); + } + + return true; + } + +} + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java new file mode 100644 index 000000000..4bd932fc1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java @@ -0,0 +1,107 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderEndpoint.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Service; +import javax.jbi.JBIException; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service provider. {@link ServiceUnit${symbol_pound}createProviderEndpoint} creates the object of this + * type to implement the service provider functionality. It makes sure that this class or the extended + * classes will activate or deactivate the ServiceEndpoint corresponding to the service + * provided by the endpoint is performed during the activate and deactivate method calls as part of the + * endpoint lifecycle. + * + * @see ServiceUnit${symbol_pound}createProviderEndpoint + * @author chikkala + */ + +public class ProviderEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with PROVIDER role and makes sure that the service + * description passed to it is of provider description. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(Role.PROVIDER, provides, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef) { + this(provides, wsdlDef, null); + } + /** + * initializes the endpoint and creates and registers the MessageExchangeListener with + * MessageExchangeSupport. + */ + public final void init() throws JBIException { + getLogger().fine("ProviderEndpiont: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + /** + * calls activatesServiceEndpoint for the Provider. + */ + public final void activate() throws JBIException { + getLogger().fine("ProviderEndpiont: activate called"); + activateServiceEndpoint(); //1. activate service endpoint in NMR + doActivate(); //2. do any other activation related tasks. + } + /** + * calls deactivateServiceEndpoint for the Provider. + */ + public final void deactivate() throws JBIException { + getLogger().fine("ProviderEndpiont: deactivate called"); + deactivateServiceEndpoint(); //1. deactivates the service endpoint in NMR + doDeactivate(); //2. do any other deactivation related tasks. + } + /** + * removes the message exchange listener. cleans up other resources + */ + public final void clean() throws JBIException { + getLogger().fine("ProviderEndpiont: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + /** + * Activates the ServiceEndpoint with NMR + */ + private void activateServiceEndpoint() throws JBIException { + Service service = this.getService(); + ServiceEndpoint svcEP = this.getComponentContext().activateEndpoint( + service.getServiceName(), service.getEndpointName()); + this.setServiceEndpoint(svcEP); + } + /** + * Deactivates ServiceEndpoint in NMR + */ + private void deactivateServiceEndpoint() throws JBIException { + this.getComponentContext().deactivateEndpoint(this.getServiceEndpoint()); + this.setServiceEndpoint(null); + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java new file mode 100644 index 000000000..1919647be --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java @@ -0,0 +1,364 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SUDescriptor.java + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import javax.jbi.management.DeploymentException; +import javax.xml.namespace.QName; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * This interface represent the service unit descriptor (jbi.xml) model. This will be used in + * ServiceUnit implementation to find the services provided and consumed by this service unit. + * {@link SUDescriptorFactory${symbol_pound}getSUDescriptor} method reads the jbi.xml in the service unit to + * to the implementation of this interface. + * + * @see SUDescriptorFactory + * @see Consumes + * @see Provides + * @see ServiceUnit + * + * @author chikkala + */ +public interface SUDescriptor { + + Collection getProvidedServices(); + + Collection getConsumedServices(); + + boolean isForBindingComponent(); + + /** + * base interface that models the service information described in the service unit descriptor for + * consumed services and provided services. + */ + public interface Service { + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + QName getInterface(); + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + QName getServiceName(); + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + String getEndpointName(); + } + /** + * marker interface that represents the provided services in the service unit + */ + public interface Provides extends Service { + } + /** + * this interface represents the consumed service information in the su descriptor. + */ + public interface Consumes extends Service { + + public final static String STANDARD_LINK = "standard"; + public final static String SOFT_LINK = "soft"; + public final static String HARD_LINK = "hard"; + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + String getLinkType(); + } + /** + * This is a factory class that can build the Service Unit Descriptor model from the jbi.xml + */ + public static class SUDescriptorFactory { + + protected final static String JBI_TAG_NAME = "services"; + protected final static String SERVICES_TAG_NAME = "services"; + protected final static String BC_TAG_NAME = "binding-component"; + protected final static String PROVIDES_TAG_NAME = "provides"; + protected final static String CONSUMES_TAG_NAME = "consumes"; + protected final static String INTERFACE_TAG_NAME = "interface-name"; + protected final static String SERVICE_TAG_NAME = "service-name"; + protected final static String ENDPOINT_TAG_NAME = "endpoint-name"; + protected final static String LINK_TYPE_TAG_NAME = "link-type"; + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(String jbiXmlPath) throws Exception { + FileReader reader = null; + try { + reader = new FileReader(jbiXmlPath); + SUDescriptor suDesc = getSUDescriptor(reader); + return suDesc; + } finally { + if ( reader != null ) { + try { + reader.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(Reader reader) throws Exception { + SUDescriptor suDescriptor = null; + Document suDescDoc = RuntimeHelper.buildDOMDocument(reader); + Element jbiEl = suDescDoc.getDocumentElement(); + if (JBI_TAG_NAME.equals(jbiEl.getTagName())) { + throw new DeploymentException("Invalid service unit descriptor : no jbi root element"); + } + + NodeList servicesNL = jbiEl.getElementsByTagName(SERVICES_TAG_NAME); + if (servicesNL != null && servicesNL.getLength() == 1) { + Element servicesEl = (Element) servicesNL.item(0); + suDescriptor = SUDescriptorImpl.createSUDescriptor(servicesEl); + } else { + throw new DeploymentException("Invalid service unit descriptor : invalid services element"); + } + + return suDescriptor; + } + + } + /** + * This class implements SUDescriptor + */ + public static class SUDescriptorImpl implements SUDescriptor { + + private List mConsumedList; + private List mProvidedList; + private boolean mIsForBindingComponent; + + protected SUDescriptorImpl(boolean isForBindingComponent) { + this.mIsForBindingComponent = isForBindingComponent; + this.mConsumedList = new ArrayList(); + this.mProvidedList = new ArrayList(); + } + + protected void addProvidedService(Provides provides) { + this.mProvidedList.add(provides); + } + + protected void addConsumedService(Consumes consumes) { + this.mConsumedList.add(consumes); + } + + public Collection getProvidedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mProvidedList); + } + + public Collection getConsumedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mConsumedList); + } + + public boolean isForBindingComponent() { + return this.mIsForBindingComponent; + } + + protected static SUDescriptor createSUDescriptor(Element servicesEl) throws Exception { + boolean isForBC = false; + String bcTagString = servicesEl.getAttribute(SUDescriptorFactory.BC_TAG_NAME); + isForBC = Boolean.valueOf(bcTagString).booleanValue(); + SUDescriptorImpl suDesc = new SUDescriptorImpl(isForBC); + // add consumes + NodeList consumesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.CONSUMES_TAG_NAME); + for ( int i=0; i < consumesNL.getLength(); ++i) { + Element consumesEl = (Element) consumesNL.item(i); + Consumes consumes = ConsumedService.createConsumedService(consumesEl); + suDesc.addConsumedService(consumes); + } + // add provides + NodeList providesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.PROVIDES_TAG_NAME); + for ( int i=0; i < providesNL.getLength(); ++i) { + Element providesEl = (Element) providesNL.item(i); + Provides provides = ProvidedService.createProvidedService(providesEl); + suDesc.addProvidedService(provides); + } + + return suDesc; + } + } + /** + * Base class that implements the Service interface + */ + public static abstract class AbstractService implements Service { + + private QName mInterface; + private QName mServiceName; + private String mEndpointName; + + private AbstractService() { + } + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + public QName getInterface() { + return this.mInterface; + } + + /** + * Setter for property interfaceQName. + * @param interfaceQName New value of property interfaceQName. + */ + protected void setInterface(QName interfaceQName) { + this.mInterface = interfaceQName; + } + + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + public QName getServiceName() { + return this.mServiceName; + } + + /** + * Setter for property serviceName. + * @param serviceName New value of property serviceName. + */ + protected void setServiceName(QName serviceName) { + this.mServiceName = serviceName; + } + + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + public String getEndpointName() { + return this.mEndpointName; + } + + /** + * Setter for property endpointName. + * @param endpointName New value of property endpointName. + */ + protected void setEndpointName(String endpointName) { + this.mEndpointName = endpointName; + } + + } + /** + * This class implements the Provides interface + */ + public static class ProvidedService + extends AbstractService + implements Provides { + protected ProvidedService(QName interfaceQName, QName serviceName, String endpointName) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + } + + @Override + public String toString() { + return "Provides :" + + "${symbol_escape}n${symbol_escape}t interface-name= " + getInterface() + + "${symbol_escape}n${symbol_escape}t service-name= " + getServiceName() + + "${symbol_escape}n${symbol_escape}t endpont-name= " + getEndpointName(); + } + + protected static Provides createProvidedService(Element providesEl) throws Exception { + + String ifName = providesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = providesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = providesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + if ( ifName == null || serviceName == null || endpointName == null ) { + throw new Exception("Invalid provides element: missing " + SUDescriptorFactory.INTERFACE_TAG_NAME + + " or " + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, providesEl); + QName serviceQName = RuntimeHelper.resolveAttrQName(serviceName, providesEl); + + return new ProvidedService(ifQName, serviceQName, endpointName); + } + } + /** + * This class implements the Consumes interface. + */ + public static class ConsumedService + extends AbstractService + implements Consumes { + private String mLinkType; + protected ConsumedService(QName interfaceQName, + QName serviceName, String endpointName, String linkType) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + this.mLinkType = linkType; + } + + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + public String getLinkType() { + return this.mLinkType; + } + + @Override + public String toString() { + return "Cosumes :" + + "${symbol_escape}n${symbol_escape}t interface-name= " + getInterface() + + "${symbol_escape}n${symbol_escape}t service-name= " + getServiceName() + + "${symbol_escape}n${symbol_escape}t endpont-name= " + getEndpointName() + + "${symbol_escape}n${symbol_escape}t link-type= " + getLinkType(); + } + + protected static Consumes createConsumedService(Element consumesEl) throws Exception { + + String ifName = consumesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = consumesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = consumesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + String linkType = consumesEl.getAttribute(SUDescriptorFactory.LINK_TYPE_TAG_NAME); + if ( linkType == null || linkType.trim().length() == 0 ) { + linkType = STANDARD_LINK; + } + + if ( ifName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.INTERFACE_TAG_NAME ); + } + if ( serviceName == null || endpointName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, consumesEl); + QName serviceQName = null; + if ( serviceName != null ) { + serviceQName = RuntimeHelper.resolveAttrQName(serviceName, consumesEl); + } + if ( serviceQName != null && endpointName != null && linkType != null ) { + if (!(STANDARD_LINK.equals(linkType) || + SOFT_LINK.equals(linkType) || HARD_LINK.equals(linkType)) ) { + throw new Exception("Invalid consumes attribute value" + + SUDescriptorFactory.LINK_TYPE_TAG_NAME + "=" + linkType); + } + } + return new ConsumedService(ifQName, serviceQName, endpointName, linkType); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java new file mode 100644 index 000000000..365633ddc --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java @@ -0,0 +1,464 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ServiceUnit.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Provides; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Service; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; + +/** + * This is an abstract class that implements the service unit functionality in the component which + * processes the service unit artifacts and implement the actual service unit lifecycle functionality. + * The AbstractServiceUnitManager and its extended classes that implement the ServiceUnitManager + * functionality creates and maintains the reference to the concrete implementation of this class to + * invoke the functionality implemented by this class and its concrete implementation during the + * execution of the ServiceUnitMangers lifecycle methods by the jbi runtime. + *

+ * The main lifecycle methods of this class that will be called by the ServiceUnitManger implementation + * during the service unit deployment lifecycle are {@link ${symbol_pound}doload}, {@link ${symbol_pound}doDeploy}, {@link ${symbol_pound}doUndeploy}, + * {@link ${symbol_pound}doInit}, {@link ${symbol_pound}doStart}, {@link ${symbol_pound}doStop} and {@link ${symbol_pound}doShutdown} + *

+ * Service unit processing supported by this implementation is based on wsdl 1.1 deployments where the + * services provided and consumed in this service unit are described using wsdl 1.1 definitions. + *

+ * The main service unit artifacts that will be processed during deployment lifecycle of the service + * unit are 1.Service unit descriptor(jbi.xml) that describes the services provided and consumed by + * this service unit. 2.WSDL 1.1 document that describes the service definition 3.Component specific + * configurations related to services provided and consumed by this service unit. + *

+ * When the service unit is for Binding Component, the component specific configurations are read + * from the WSDL1.1 extensions defined in the WSDL document corresponding to the service provider + * or consumer deployed with this service unit. + *

+ * When the service unit is for Service Engine, the component specific configurations are read + * from the deployment artifacts such as xslt files and mapping files in the service unit zip file + * along with the WSDL document corresponding to the service provider or consumer deployed with this + * service unit. + * + * @see SUDescriptor + * @see Endpoint + * @see ProviderEndpoint + * @see ConsumerEndpoint + * @see WSDLProcessor + * @author chikkala + */ +public abstract class ServiceUnit { + /** Service Unit Name */ + private String mSUName; + /** Service Unit Root path passed by jbi runtime */ + private String mSURootPath; + /** service unit descriptor model unmarshalled from service unit jbi.xml */ + private SUDescriptor mSUDescriptor; + /** Map of Endpoint Key to ProviderEndpoint configurations in this service unit */ + private Map mProviderEndpointMap; + /** Map of Endpoint Key to ConsumerEndpoint configurations in this service unit */ + private Map mConsumerEndpointMap; + /** Map of Service Key to the WSDL Definition in this service unit */ + private Map mWSDLMap; + /** WSDLProcessor configured for this service unit to process wsdls in the service unit */ + private WSDLProcessor mWSDLProcessor; + /** + * + * @param suName + * @param suRootPath + */ + protected ServiceUnit(String suName, String suRootPath) { + this.mSUName = suName; + this.mSURootPath = suRootPath; + this.mSUDescriptor = null; + this.mWSDLMap = new HashMap(); + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + } + /** returns service unit name + * @return service unit name + */ + public String getName() { + return this.mSUName; + } + /** returns service unit root path where the su artifacts are unzipped by the jbi runtime + * @return path to the service unit root directory. + */ + public String getSURootPath() { + return this.mSURootPath; + } + protected SUDescriptor createSUDescriptor() throws Exception { + File jbiXmlFile = new File(this.getSURootPath(), "META-INF/jbi.xml"); + String jbiXmlPath = jbiXmlFile.getAbsolutePath(); + return SUDescriptor.SUDescriptorFactory.getSUDescriptor(jbiXmlPath); + } + /** return the Service unit descriptor model that was read from the jbi.xml + * @return SUDescriptor + */ + public SUDescriptor getSUDescriptor() throws Exception { + if ( this.mSUDescriptor == null ) { + this.mSUDescriptor = createSUDescriptor(); + } + return this.mSUDescriptor; + } + public ProviderEndpoint getProviderEndpoint(String providerID) { + return this.mProviderEndpointMap.get(providerID); + } + public Collection getProviderEndpoints() { + return Collections.unmodifiableCollection(this.mProviderEndpointMap.values()); + } + public ConsumerEndpoint getConsumerEndpoint(String cosumerID) { + return this.mConsumerEndpointMap.get(cosumerID); + } + + public Collection getConsumerEndpoints() { + return Collections.unmodifiableCollection(this.mConsumerEndpointMap.values()); + } + /** + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * extended classes implement this method to create the su specific WSDLProcessor. for examples, + * a su supporting binding component may have wsdl extensions that it want to registry for reading + * the configurations from the wsdl file. + * @return WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + */ + protected WSDLProcessor createWSDLProcessor() { + return new WSDLProcessor(this.getSURootPath()); + } + /** + * return the WSDLProcessor reference by creates if it is not yet created. + * @return WSDLProcessor. + */ + public final WSDLProcessor getWSDLProcessor() { + if ( this.mWSDLProcessor == null ) { + this.mWSDLProcessor = createWSDLProcessor(); + } + return this.mWSDLProcessor; + } + /** + * loads the service unit artifacts into the SU model. AbstractServiceUnitManager implementation + * calls this method during the during deploy and init lifecycle methods when the service unit + * object is newly created. + */ + public void doLoad() throws DeploymentException { + try { + SUDescriptor suDesc = getSUDescriptor(); // load jbi.xml + loadServiceDefinitions(); // check if the wsdls are valid for corresponding services. + loadOtherArtifacts(); // additional validations specific to component deployment features. + loadEndpoints(); // create endpoints + } catch ( DeploymentException jbiEx) { + throw jbiEx; + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + /** extended classes implement this method to perform the su specific deployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doDeploy() throws DeploymentException { + // NOOP. doLoad has done it all. + this.getLogger().fine("ServiceUnit.doDeploy"); + } + /** extended classes implement this method to perform the su specific undeployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doUndeploy() throws DeploymentException { + //NOOP + this.getLogger().fine("ServiceUnit.doUndeploy"); + } + /** extended classes implement this method to perform the su specific initialization tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doInit() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doInit"); + this.doInitEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on start in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStart() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStart"); + this.doActivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on stop in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStop() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStop"); + this.doDeactivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on shutdown in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doShutdown() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doShutdown"); + this.doCleanEndpoints(); + } + /** + * create the ProviderEndpoint that implement the service provider implementation specific to this su. + * @return ProviderEndpoint or null if the SU does not support the service provider access + */ + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return null; + } + /** + * create the ProviderEndpoint that implement the service consumer implementation specific to this su. + * @return ConsumerEndpoint or null if the SU does not support the service consumer access + */ + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return null; + } + /** + * generates the key based on the service to store the wsdl definitions . + */ + protected String getServiceKey(Service service) { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(service.getInterface()).append("+"); + strBuff.append(service.getServiceName()).append("+"); + strBuff.append(service.getEndpointName()); + return strBuff.toString(); + } + /** + * looks up the wsdl definition loaded for this service. + */ + protected Definition findWSDLFor(Service service) throws WSDLException { + Definition wsdlDef = null; + String key = this.getServiceKey(service); + wsdlDef = this.mWSDLMap.get(key); + return wsdlDef; + } + + protected Definition findWSDL(List wsdlList, Service service, boolean ignoreEndpointLookup) { + Definition foundDef = null; + for ( Definition def : wsdlList ) { + if ( WSDLProcessor.isWSDLFor(def, service.getInterface(), service.getServiceName(), + ((ignoreEndpointLookup) ? null : service.getEndpointName()) ) ) { + foundDef = def; + break; + } + } + return foundDef; + } + /** + * loads the WSDL definitions corresponds to the service providers and consumers defined in the + * service unit descriptor. + */ + protected void loadServiceDefinitions() throws Exception { + + this.mWSDLMap = new HashMap(); + + WSDLProcessor wsdlProcessor = getWSDLProcessor(); + List wsdlList = wsdlProcessor.readWSDLs(this.getSURootPath()); + this.getLogger().fine("Number of wsdl definitions in service unit " + wsdlList.size()); + + List services = new ArrayList(); + services.addAll(this.getSUDescriptor().getProvidedServices()); + services.addAll(this.getSUDescriptor().getConsumedServices()); + + boolean isForBinding = this.getSUDescriptor().isForBindingComponent(); + this.getLogger().fine("Is this service unit for Binding? " + isForBinding); + + for ( Service service : services ) { + this.getLogger().fine("Looking up WSDL for service " + service); + boolean ignoreEndpointLookup = false; + boolean providerAtEngine = false; + if ( !isForBinding && service instanceof Provides ) { + ignoreEndpointLookup = true; + providerAtEngine = true; + } + Definition def = findWSDL(wsdlList, service, ignoreEndpointLookup); + if ( def == null ) { + throw new Exception("WSDL Definition not found for " + service); + } + this.mWSDLMap.put(getServiceKey(service), def); + if ( providerAtEngine ) { + // provider at engine. so add engine binding and endpoint to the wsdl + wsdlProcessor.create${artifactId}Binding(def, + service.getInterface(), service.getServiceName(), service.getEndpointName()); + } + } + } + /** extended classes implement this method to perform the su specific artifacts validation in + * this method implementation. + * @throws DeploymentException on error. + */ + protected void loadOtherArtifacts() throws DeploymentException { + // nothing to validate further. + this.getLogger().fine("ServiceUnit.loadOtherArtifacts"); + } + /** + * creates ProviderEndpoint and ConsumerEndpoint objects corresponding to the service providers + * and consumers described in the su descriptor ( jbi.xml ) + */ + protected void loadEndpoints() throws Exception { + + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + + Collection providesList = this.getSUDescriptor().getProvidedServices(); + for ( Provides provides : providesList ) { + Definition wsdlDef = findWSDLFor(provides); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + provides); + } + ProviderEndpoint provider = createProviderEndpoint(provides, wsdlDef); + this.mProviderEndpointMap.put(provider.getID(), provider); + } + + Collection consumesList = this.getSUDescriptor().getConsumedServices(); + for ( Consumes consumes : consumesList ) { + Definition wsdlDef = findWSDLFor(consumes); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + consumes); + } + ConsumerEndpoint consumer = createConsumerEndpoint(consumes, wsdlDef); + this.mConsumerEndpointMap.put(consumer.getID(), consumer); + } + } + /** + * initializes the Endpoint objects created corresponding to the consumer and providers defined + * in the su descriptor + */ + protected void doInitEndpoints() throws DeploymentException { + // init endpoints. if any initialization fails, rollback the already inited endpoints + List initedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.init(); + initedEndpoints.add(endpoint); + } catch ( Exception initEx) { + doCleanEndpoints(initedEndpoints); + throw new DeploymentException(initEx); + } + } + + } + /** + * invokes activates method of all provider and consumer endpoint object in this su. if there is + * and error activating any one the endpoints, it deactivates the already activated ones and throws + * the error + */ + protected void doActivateEndpoints() throws DeploymentException { + // activate providers first and then consumers + List activatedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.activate(); + activatedEndpoints.add(endpoint); + } catch ( Exception actEx) { + doDeactivateEndpoints(activatedEndpoints); + throw new DeploymentException(actEx); + } + } + } + /** + * invokes deactivate method on the list of Endpoint objects passed to this method + */ + protected void doDeactivateEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.deactivate(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes deactivate method on the all consumer and provider endpoint objects + */ + protected void doDeactivateEndpoints() { + // deactivate consumers first and then the providers + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doDeactivateEndpoints(allEndpoints); + } + /** + * invokes clean method on the list of endpoint objects + */ + protected void doCleanEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.clean(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes clean method on the all consumer and provider endpoint objects in this su. + */ + protected void doCleanEndpoints() { + + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doCleanEndpoints(allEndpoints); + } + /** + * prints the service unit description + */ + protected final String printDetails() { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + + out.println("ServiceUnit Name : " + this.getName()); + out.println("ServiceUnit Root : " + this.getSURootPath()); + + SUDescriptor suDesc = null; + try { + suDesc = this.getSUDescriptor(); + for ( SUDescriptor.Consumes consumer : suDesc.getConsumedServices()) { + out.println(consumer); + } + for ( SUDescriptor.Provides provides : suDesc.getProvidedServices()) { + out.println(provides); + } + } catch (Exception ex) { + ex.printStackTrace(out); + } + return writer.getBuffer().toString(); + } + + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java new file mode 100644 index 000000000..67bbf5a45 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java @@ -0,0 +1,44 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensibilityElement.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This is an abstract class which can be extended to create jwsdl (wsdl4j's) extension elements model to + * read/write the wsdl extension elements in wsdl 1.1 xml. + * + * @author chikkala + */ +public abstract class AbstractExtensibilityElement implements ExtensibilityElement, java.io.Serializable { + public static final long serialVersionUID = 1; + private QName mElementType; + private Boolean mRequired; + + /** Creates a new instance of AbstractExtensibilityElement */ + protected AbstractExtensibilityElement() { + } + + public void setElementType(QName elementType) { + this.mElementType = elementType; + } + + public QName getElementType() { + return this.mElementType; + } + + public void setRequired(Boolean required) { + this.mRequired = required; + } + + public Boolean getRequired() { + return this.mRequired; + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java new file mode 100644 index 000000000..5233aeee2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java @@ -0,0 +1,45 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensionRegistry.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.List; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This is the abstract class used to add the wsdl extension serializers and deserializers to the + * wsdl extension registry configured to read/write wsdl extensions into a know java model. + * @see AbstractExtensionSerializer + * @see WSDLProcessor + * @author chikkala + */ +public abstract class AbstractExtensionRegistry extends ExtensionRegistry { + + /** Creates a new instance of AbstractSerializer + * it calls the createSerializers method to get the list of + * serializers and then call registerSerializer on each AbstractExtensionSerializer + * to register them with this registry. + * @see AbstractExtensionSerializer${symbol_pound}registerSerializer + */ + protected AbstractExtensionRegistry() { + super(); + List list = createSerializers(); + for (AbstractExtensionSerializer ser : list ) { + ser.registerSerializer(this); + } + // register ${artifactId} Binding serializers + AbstractExtensionSerializer seBindingSer = new SEBindingExt.SEBindingExtSerializer(); + seBindingSer.registerSerializer(this); + } + /** + * create wsdl extension serializers for each extension element to register with the extension + * registry. + * @return List of AbstractExtensionSerializer objects for serializing/deserializing the wsdl extensions. + * @see AbstractExtensionSerializer + */ + protected abstract List createSerializers(); +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java new file mode 100644 index 000000000..4ac1b37d6 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java @@ -0,0 +1,123 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensionSerializer.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.PrintWriter; +import java.io.Serializable; +import java.util.Set; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionDeserializer; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.extensions.ExtensionSerializer; +import javax.xml.namespace.QName; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +/** + * This class is an abstract class that should be extended to implements extension serializer and + * deserializer. This class implements the code required for registering the serializer and deserializer + * implemented by this class. THe AbstractExtensionRegistry class calls the ${symbol_pound}registerSerializer method + * to register the concrete implementation of this class with extension registry. + * @see AbstractExtensionRegistry + * @author chikkala + */ +public abstract class AbstractExtensionSerializer + implements ExtensionSerializer, ExtensionDeserializer, Serializable { + + public static final long serialVersionUID = 1; + + private Class mParentType; + private Class mExtensionType; + private QName mElementType; + + /** Creates a new instance of AbstractSerializer */ + public AbstractExtensionSerializer(Class parentType, QName elementType, Class extensionType) { + this.mParentType = parentType; + this.mElementType = elementType; + this.mExtensionType = extensionType; + } + + public Class getParentType() { + return this.mParentType; + } + public QName getElementType() { + return this.mElementType; + } + public Class getExtensionType() { + return this.mExtensionType; + } + + public void registerSerializer(ExtensionRegistry extReg) { + extReg.registerSerializer(this.mParentType, this.mElementType, this); + extReg.registerDeserializer(this.mParentType, this.mElementType, this); + extReg.mapExtensionTypes(this.mParentType, this.mElementType, this.mExtensionType); + } + + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + // DO NOTHING. Binding component runtime does not need to serialize the wsdl extensions. + } + + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + return null; + } + + public static String getAttribute(Element el, String attrName) { + String attrValue = null; + Attr attr = el.getAttributeNode(attrName); + if ( attr != null ) { + attrValue = attr.getValue(); + } + return attrValue; + } + + protected String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + /** + * @return the name with the prefix defined for the namespaceURI in the wsdl definition. + * @throws WSDLException if the prefix not found in the wsdl definition. note that the + * default prefix is an empty string. + */ + protected String getQualifiedName(Definition def, + String namespaceURI, String localName) throws WSDLException { + String prefix = null; + if (namespaceURI != null && !namespaceURI.equals("")) { + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + throw new WSDLException(WSDLException.OTHER_ERROR, + "Can not find prefix in WSDL Definition for " + namespaceURI); + } + } + if ( prefix != null && !prefix.equals("")) { + return prefix + ":" + localName; + } else { + return localName; + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java new file mode 100644 index 000000000..b10800550 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java @@ -0,0 +1,229 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractNormalizer.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.ArrayList; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Part; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * This is an abstract class that implements most of the functionality to normalize the binding protocol + * specific concrete message to jbi wrapper and and denormalize jbi wrapper to the concrete binding + * protocol specific message. + *

+ * The extended classes specific to particular binding protocol will be used when a jbi binding + * component is sending and receiving messages from the external service providers and consumers using + * a particular binding protocol known to this class. Extended implementation of this class should make + * use of the helper methods in this class in normalizing and denormalizing the messages. + * @see JMXBindingNormalizer + * @author chikkala + */ +public abstract class AbstractNormalizer { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + /** wsdl definition to use when normalizing and denormalizing */ + private Definition mWSDL; + /** Binding definition to use when normalizing and denormalizing */ + private Binding mBinding; + + private AbstractNormalizer() {} + /** Creates a new instance of JMXBCNormalizer */ + public AbstractNormalizer(Definition wsdl, Binding binding) { + this.mWSDL = wsdl; + this.mBinding = binding; + } + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete mssage of a particular binding protocol. + */ + public abstract void normalizeInput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeOutput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be de-normalized. + * @param normMsg NormalizedMessage which should be used to create de-normalized message. + */ + public abstract DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + + /** + * denormalized the normalized fault message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException; + /** + * @return the wsdl definition to use in normalizing and denormalizing the message + */ + protected Definition getWSDL() { + return this.mWSDL; + } + /** + * @return the wsdl binding definition to use in normalizing and denormalizing the message + */ + protected Binding getBinding() { + return this.mBinding; + } + /** + * create and add message parts to the jbiWrapper according to the abstract message model. This + * method assumes that the each element in the msgParts list passed to it is mapped to the part + * of the abstract wsdl message and uses the type or element attribute of the abstract message to + * determine whether the element is actual part element or a wrapped part type. + * Use this method in normalizing the concrete protocol specific message to jbi wrapper message. + * @param jbiWrapper object that holds the jbi wrapper information. + * @param wsdlMsg abstract message from the wsdl definition + * @param msgParts actual message parts from the concrete message + */ + protected void addMessagePartsToJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg, List msgParts) throws MessagingException { + List wsdlParts = wsdlMsg.getOrderedParts(null); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= msgParts.size() ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + Element msgPart = msgParts.get(i); + if ( wsdlPart.getElementName() != null ) { + jbiWrapper.appendPart(msgPart); + } else { + // it is type. + // check the element name is same as part + if ( !wsdlPart.getName().equals(msgPart.getLocalName()) ) { + throw new MessagingException("mismatched message content for part " + wsdlPart.getName()); + } + if ( !wsdlMsg.getQName().getNamespaceURI().equals(msgPart.getNamespaceURI()) ) { + throw new MessagingException("mismatched message content namespace for part " + wsdlPart.getName()); + } + // check the content is text or element. + List partContent = getChildElements(msgPart); + if ( partContent.size() > 0 ) { + // add content as part elements + jbiWrapper.appendPart(partContent); + } else { + // add the content as text + jbiWrapper.appendPart(msgPart.getTextContent()); + } + } + } + } + /** + * extracts the message parts from the jbiWrapper according to the abstract wsdl message + * definition passed to it. Use this method in denormalizing the jbi wrapper message into the + * binding protocol specific concrete message. + * @param jbiWrapper jbi wrapper object that contains message parts and the message type information. + * @param wsdlMsg abstract wsdl message definition to use in constructing the part elements. + */ + protected List getMessagePartsFromJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg) + throws MessagingException, ParserConfigurationException { + + List msgParts = new ArrayList(); + int jbiPartCount = jbiWrapper.getPartCount(); + List wsdlParts = wsdlMsg.getOrderedParts(null); + QName msgType = jbiWrapper.getType(); + if (!wsdlMsg.getQName().getNamespaceURI().equals(msgType.getNamespaceURI())) { + throw new MessagingException("Namespace mismatch between jbi wrapper message type and wsdl message"); + } + Document newDoc = jbiWrapper.getDocumentBuilder().newDocument(); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= jbiPartCount ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + if ( wsdlPart.getElementName() != null ) { + msgParts.add(jbiWrapper.getPartAsElement(i)); + } else { + // it is type. create a new element for a typed part + // check the element name is same as part + String prefix = msgType.getPrefix(); + String nsURI = msgType.getNamespaceURI(); + String localName = wsdlPart.getName(); + Element partEl = newDoc.createElementNS(nsURI, prefix + ":" + localName); + partEl.setAttributeNS(XMLNS_NS, "xmlns:"+prefix, nsURI); + NodeList partContent = jbiWrapper.getPart(i); + appendChildren(partEl, partContent, newDoc, true); + msgParts.add(partEl); + } + } + return msgParts; + } + /** + * utility method that can append the nodeList passed to it to the element children. + * @param el element node to which the nodeList should be appended + * @param doc the document object that should be used to import the nodeList + * @param importNode true if the nodeList should be imported while appending the nodeList to the + * element children. false if no import is necessary. + */ + protected void appendChildren(Element el, NodeList nodeList, Document doc, boolean importNode) { + + for ( int pIdx = 0; pIdx < nodeList.getLength(); ++pIdx) { + Node node = nodeList.item(pIdx); + if ( importNode ) { + node = doc.importNode(node, true); + } + el.appendChild(node); + } + } + /** + * @param el element from which to extract the child elements + * @return List list of child Element nodes. + */ + protected List getChildElements(Element el) { + List list = new ArrayList(); + NodeList nodeList = el.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if (!(node instanceof Element) ){ + continue; + } + list.add((Element)node); + } + return list; + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java new file mode 100644 index 000000000..30663d867 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java @@ -0,0 +1,99 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SEBindingExt.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation classes implement wsdl 1.1 extension model for the + * jbi service engine binding that is defined in jsr 208(sec. 5.5.6.1). to read/write concrete binding + * element in the wsdl definition for the service endpoint binding provided by the service engine. + * The wsdl definition with this binding information can be used in providing the service provider + * metadata returned by the service engine in Component.getServiceDescription. + *

+ * AbstractExtensionRegistry by default include this extension serializers in the + * registry to read/write this service engine binding type in the wsdl definition. + *

+ * During a service unit deployment/initialization in the service engine, the deployed wsdl definition + * is loaded and modified to provide this binding for the service provided by the engine. + * + * @see WSDLProcessor${symbol_pound}create${artifactId}Binding + * @see AbstractExtensionRegistry + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit${symbol_pound}loadServiceDefinitions + * @author chikkala + */ +public interface SEBindingExt extends ExtensibilityElement, java.io.Serializable { + + public static final String NS_URI = "http://java.sun.com/xml/ns/jbi/binding/service+engine"; + public static final String NS_DEF_PREFIX = "jbise"; + /** Element names. */ + public static final String EL_BINDING_EXT = "binding"; + /**Qualified element names.*/ + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + + public static class SEBindingExtImpl extends AbstractExtensibilityElement implements SEBindingExt { + + public SEBindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + @Override + public String toString() { + StringBuffer buff = new StringBuffer(); + buff.append("<"+NS_DEF_PREFIX+":"+EL_BINDING_EXT); + buff.append("/>"); + return buff.toString(); + } + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static SEBindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + SEBindingExtImpl bindingExt = new SEBindingExt.SEBindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, SEBindingExt.NS_DEF_PREFIX); + return bindingExt; + } + } + /** + * serializer and descrializer implementation for the binding extension element. + */ + public static class SEBindingExtSerializer extends AbstractExtensionSerializer { + + public SEBindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, SEBindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + SEBindingExt extObj = (SEBindingExt)extReg.createExtension(parentType, elementType); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + + SEBindingExt extObj = (SEBindingExt)extension; + + StringBuffer buff = new StringBuffer(); + buff.append("<" + elName ); + buff.append("/>"); + pw.println(buff.toString()); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java new file mode 100644 index 000000000..92606104d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java @@ -0,0 +1,471 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDL11JBIWrapper.java + * + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +/** + * This class wraps the wsdl11 messages to the jbi wrapper message suitable for + * processing in the wsdl2.0 model of the normalized message in jbi as defined in jsr208 like + * + * + * + * + * + * + * + * + * + * + * @author chikkala + */ +public class WSDL11JBIWrapper { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + public static final String WRAPPER_NAMESPACE = "http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; + public static final String DEF_NS_PREFIX = "jbiwrp"; + public static final String DEF_MESSAGE_NS_PREFIX = "msgns"; + public static final String JBI_MESSAGE_EL = "message"; + public static final String JBI_PART_EL = "part"; + public static final String VERSION_ATTR = "version"; + public static final String VERSION_ATTR_VALUE = "1.0"; + public static final String TYPE_ATTR = "type"; + public static final String NAME_ATTR = "name"; + + private static DocumentBuilder sDocBuilder = null; + /** qname of message attribute from wsdl:input, wsdl:output or wsdl:fault */ + private QName mType; + /** optional name attribute from wsdl:input, wsdl:output or wsdl:fault */ + private String mName; + /** each parts contents as node list */ + List mPartConentList = new ArrayList(); + + /** Creates a new instance of WSDL11JBIWrapper */ + public WSDL11JBIWrapper() { + } + /** creates the namespace aware document builder. extended classes can override this method + * to return the doc builder created else where. + */ + protected DocumentBuilder createDocumentBuilder() throws ParserConfigurationException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + return factory.newDocumentBuilder(); + } + /** return the document builder + * @return DocumentBuilder + */ + public final DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { + if ( WSDL11JBIWrapper.sDocBuilder == null ) { + WSDL11JBIWrapper.sDocBuilder = createDocumentBuilder(); + } + return WSDL11JBIWrapper.sDocBuilder; + } + /** + * @return type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public QName getType() { + return this.mType; + } + /** + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public void setType(QName type) { + this.mType = type; + } + /** @return name attribute from wsdl:input, wsdl:output or wsdl:fault. or null if not set. */ + public String getName() { + return this.mName; + } + /** + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault. can be null. + */ + public void setName(String name) { + this.mName = name; + } + /** + * appends part content as node list + */ + public void appendPart(NodeList partContent) { + this.mPartConentList.add(partContent); + } + /** + * append part content from the List of nodes + */ + public void appendPart(List partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content as element + */ + public void appendPart(Element partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content from DOMSource + */ + public void appendPart(DOMSource partContent) { + Element partConentEl = getElement(partContent.getNode()); + this.mPartConentList.add(new NodeListImpl(partConentEl)); + } + /** + * append part content as text node. + */ + public void appendPart(String partContent) { + Text textContent = null; + try { + textContent = this.getDocumentBuilder().newDocument().createTextNode(partContent); + } catch (ParserConfigurationException ex) { + ex.printStackTrace(); + } + if ( textContent != null ) { + this.mPartConentList.add(new NodeListImpl(textContent)); + } + } + /** + * append list of part contents each is a NodeList to the parts + */ + public void appendParts(List partContentList) { + this.mPartConentList.addAll(partContentList); + } + /** + * returned the ordered list of part contents. + */ + public List getParts() { + return Collections.unmodifiableList(this.mPartConentList); + } + /** + * return the number of parts + */ + public int getPartCount() { + return this.mPartConentList.size(); + } + /** + * return the part content at a particular index as NodeList. + */ + public NodeList getPart(int idx) { + return this.mPartConentList.get(idx); + } + /** + * return part context at a particular index as text + */ + public String getPartAsText(int idx) { + NodeList partNodes = getPart(idx); + Document doc; + try { + doc = this.getDocumentBuilder().newDocument(); + Element el = doc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + for ( int i=0; i < partNodes.getLength(); ++i) { + el.appendChild(partNodes.item(i)); + } + return el.getTextContent(); + } catch (ParserConfigurationException ex) { + return null; + } + } + /** + * return part context at a particular index as Element + */ + public Element getPartAsElement(int idx) { + Element contentEl = null; + NodeList partNodes = getPart(idx); + for ( int i=0; i < partNodes.getLength(); ++i) { + Node node = partNodes.item(i); + if ( node instanceof Element) { + contentEl = (Element)node; + break; + } + } + return contentEl; + } + /** + * creates Document from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return Document containing the wsdl 11 wrapper xml + */ + public Document toDocument() throws ParserConfigurationException { + + Document wrapperDoc = getDocumentBuilder().newDocument(); + Element jbiMessage = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_MESSAGE_EL); + jbiMessage.setAttribute(VERSION_ATTR, VERSION_ATTR_VALUE); + wrapperDoc.appendChild(jbiMessage); + + QName type = this.getType(); + if ( type == null ) { + type = new QName("", "", DEF_MESSAGE_NS_PREFIX); + } + // set the jbiMessage attributes + String prefix = type.getPrefix(); + if (prefix == null || prefix.length() == 0) { + prefix = DEF_MESSAGE_NS_PREFIX; + } + jbiMessage.setAttribute(TYPE_ATTR, prefix + ":" + type.getLocalPart()); + jbiMessage.setAttributeNS( XMLNS_NS, "xmlns:" + prefix, type.getNamespaceURI()); + + String name = this.getName(); + if (name != null && name.trim().length() > 0 ) { + jbiMessage.setAttribute(NAME_ATTR, name); + } + + List partContentList = this.getParts(); + for ( NodeList nodeList : partContentList ) { + // set jbi part message + Element jbiPart = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + jbiMessage.appendChild(jbiPart); + for ( int i =0; i < nodeList.getLength(); ++i ) { + Node importedMsgNode = wrapperDoc.importNode(nodeList.item(i), true); + jbiPart.appendChild(importedMsgNode); + } + } + + return wrapperDoc; + + } + /** + * creates DOMSource from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return DOMSource containing the wsdl 11 wrapper xml + */ + public DOMSource toDOMSource() throws ParserConfigurationException { + DOMSource wrappedSource = new DOMSource(); + wrappedSource.setNode(toDocument()); + return wrappedSource; + } + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + /** + * creates wrapper object from the DOMSource that has wsdl 11 wrapper xml. + * @param wrappedMsg wsdl 11 wrapper xml as DOMSource + * @return WSDL11JBIWrapper representing the wrapper xml. + */ + public static WSDL11JBIWrapper sourceToWrapper(DOMSource wrappedMsg) { + Element jbiMessage = getElement(wrappedMsg.getNode()); + if ( jbiMessage == null ) { + return null; + } + String nsURI = jbiMessage.getNamespaceURI(); + String tagName = jbiMessage.getLocalName(); + if (!WRAPPER_NAMESPACE.equals(nsURI) || !JBI_MESSAGE_EL.equals(tagName)) { + return null; + } + String name = jbiMessage.getAttribute(NAME_ATTR); + String typeQN = jbiMessage.getAttribute(TYPE_ATTR); + String typePrefix = ""; + String typeName = ""; + if ( typeQN != null && typeQN.trim().length() > 0 ) { + int idx = typeQN.indexOf(':'); + if ( idx >= 0 ) { + typePrefix = typeQN.substring(0, idx); + if ( typeQN.length() > idx ) { + typeName = typeQN.substring(idx+1); + } + } else { + typePrefix = ""; + typeName = typeQN; + } + } + String typeURI = jbiMessage.getAttribute("xmlns:" + typePrefix); + QName typeQName = new QName(typeURI, typeName, typePrefix); + + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(typeQName); + NodeList jbiPartList = jbiMessage.getElementsByTagNameNS(WRAPPER_NAMESPACE, JBI_PART_EL); + for ( int i=0; i < jbiPartList.getLength(); ++i) { + Node jbiPart = jbiPartList.item(i); + wrapper.appendPart(jbiPart.getChildNodes()); + } + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object and sets the type and name of the object + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name ) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(type); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content has multiple child element. + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, NodeList partContent) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + wrapper.appendPart(partContent); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content is a single element + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, Element msgEl) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name, new WSDL11JBIWrapper.NodeListImpl(msgEl)); + return wrapper; + } + + public static WSDL11JBIWrapper createWrapper(QName type, String name, DOMSource inputSource) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + Node msgNode = getElement(inputSource.getNode()); + NodeList nodeList = new WSDL11JBIWrapper.NodeListImpl(msgNode); + wrapper.appendPart(nodeList); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations input element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createInputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Input input = operation.getInput(); + if ( input == null ) { + return null; + } + name = input.getName(); + Message wsdlMsg = input.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createOutputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Output output = operation.getOutput(); + if ( output == null) { + return null; + } + name = output.getName(); + Message wsdlMsg = output.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @param faultName fault name, can be null to look for the fault with no name. + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createFaultWrapper(Operation operation, String faultName) throws ParserConfigurationException { + QName type = null; + String name = null; + @SuppressWarnings("unchecked") + Map faultMap = operation.getFaults(); + Fault fault = faultMap.get(faultName); + + if ( fault == null ) { + return null; + } + name = fault.getName(); + Message wsdlMsg = fault.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * NodeList implementation. + */ + public static class NodeListImpl extends ArrayList implements NodeList { + + public NodeListImpl() { + super(); + } + + public NodeListImpl(Node aNode) { + super(); + if (aNode != null) { + this.add(aNode); + } + } + + public NodeListImpl(List nodes) { + if (nodes != null) { + this.addAll(nodes); + } + } + + public int getLength() { + return this.size(); + } + + public Node item(int idx) { + return this.get(idx); + } + + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java new file mode 100644 index 000000000..6e0c0993f --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java @@ -0,0 +1,419 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDLProcessor.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.wsdl.Port; +import javax.wsdl.PortType; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ElementExtensible; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.wsdl.xml.WSDLWriter; +import javax.xml.namespace.QName; + +/** + * This class is used to configure jwsdl(wsdl4j) to read and process wsdl documents with wsdl extensions. + * It provides set of helper methods to read and process the wsdl definitions from files with .wsdl + * extension from a specified directory. + *

+ * A Binding Component that is processing the wsdl extensions for its deployment configuration would + * extend this class and provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + *

+ * A Service Engine that is processing the wsdl during deployment can directly use this class + * to process the wsdl as the default implementation returned by this class configures the wsdl extension + * registry to read/write the service engine binding extensions. + * + * @see AbstractExtensionRegistry + * @see SEBindingExt + * @author chikkala + */ +public class WSDLProcessor { + + private String mXmlCatalogPath = "xml-catalog.xml"; + private String mWsdlDirPath = ""; + private WSDLReader mReader; + + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir) { + this(wsdlDir, null); + } + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir, String xmlCatPath) { + if ( wsdlDir != null ) { + this.mWsdlDirPath = wsdlDir; + } + if ( xmlCatPath != null ) { + this.mXmlCatalogPath = xmlCatPath; + } + } + /** @return directory path from which this class reads the wsdl files with .wsdl as file extension. */ + public String getWSDLDirectory() { + return this.mWsdlDirPath; + } + /** path to the xml catalog file in the service unit which can be used for Catalog-based entity + * and URI resolution. + */ + public String getXmlCatelogPath() { + return this.mXmlCatalogPath; + } + /** wsdl extension registry required for processing the wsdl extensions in the wsdl definition to + * java model. Binding component that is processing the wsdl extensions for its deployment + * configuration would provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + * @return ExtensionSerializer + * @see AbstractExtensionSerializer + */ + protected ExtensionRegistry getExtensionRegistry() { + return new AbstractExtensionRegistry() { + protected List createSerializers() { + return new ArrayList(); + } + }; + } + /** + * @return the WSDLReader configured with extension registry to process the wsdl extensions. + */ + public final WSDLReader getWSDLReader() throws WSDLException { + if ( this.mReader == null ) { + WSDLFactory factory = WSDLFactory.newInstance(); + this.mReader = factory.newWSDLReader(); + // reader.setFeature("javax.wsdl.verbose", true); + // reader.setFeature("javax.wsdl.importDocuments", true); + this.mReader.setExtensionRegistry(getExtensionRegistry()); + } + return this.mReader; + } + /** + * reads the wsdl file and returns the wsdl definition jwsdl model. + * @param wsldFilePath relative path to wsdl file from the the root wsdl directory returns from + * ${symbol_pound}getWSDLDirectory in the service unit or or absolute path . + * @return Definition + */ + public Definition readWSDL(String wsdlFilePath) throws WSDLException { + File wsdlFile = new File(wsdlFilePath); + if ( !wsdlFile.isAbsolute() ) { + wsdlFile = new File(this.mWsdlDirPath, wsdlFilePath); + } + return getWSDLReader().readWSDL(wsdlFile.getAbsolutePath()); + } + /** + * reads the files with .wsdl file extension in a directory. If the directory should + * be searched recursively, it searches this directory, all child directories of this + * directory and then to their child directories recursively. + * @param dir directory file to search for .wsdl files + * @param rec if set to true, it recursively searches the directory. if set to false, only + * this directory is searched. + * @return List of Files with .wsdl extension. + */ + public List listWSDLFiles(File dir, final boolean rec) throws IOException { + if ( dir == null || !dir.isDirectory()) { + throw new IOException(dir + " is not a directory for looking up wsdl files"); + } + List wsdlList = new ArrayList(); + File[] files = dir.listFiles(new FileFilter() { + public boolean accept(File pathname) { + if ( rec && pathname.isDirectory()) { + return true; + } else { + String name = pathname.getName(); + int idx = name.lastIndexOf('.'); + if ( idx < 0 ) { + return false; + } + String ext = name.substring(idx); + return ".wsdl".equalsIgnoreCase(ext); + } + } + }); + for ( File file : files ) { + if ( rec && file.isDirectory()) { + List wsdlFiles = listWSDLFiles(file, rec); + wsdlList.addAll(wsdlFiles); + } else { + wsdlList.add(file); + } + } + return wsdlList; + } + /** + * reads the files with .wsdl file extension in a directory fromDir and return the list of + * wsdl definitions corresponding to them. + * @param fromDir path to the directory relative to the root wsdl directory returns from + * ${symbol_pound}getWSDLDirectory or the absolute path to the directory. + */ + public List readWSDLs(String fromDir) throws WSDLException { + if ( fromDir == null ) { fromDir = ""; } + File wsdlDir = new File(fromDir); + if (!wsdlDir.isAbsolute()) { + wsdlDir = new File(this.mWsdlDirPath, fromDir); + } + + List wsdlFiles = new ArrayList(); + try { + wsdlFiles = listWSDLFiles(wsdlDir, true); + } catch (IOException ioEx) { + throw new WSDLException("WSDLFileReadError", ioEx.getMessage(),ioEx); + } + + List wsdlPaths = new ArrayList(); + for ( File wsdlFile : wsdlFiles) { + wsdlPaths.add(wsdlFile.getAbsolutePath()); + } + Collections.sort(wsdlPaths); + + List wsdlList = new ArrayList(); + for ( String wsdlPath : wsdlPaths ) { + Definition wsdlDef = readWSDL(wsdlPath); + wsdlList.add(wsdlDef); + } + return wsdlList; + } + /** + * finds PortType using port type ( interface ) qname. + */ + public static PortType findInterface(Definition wsdlDef, QName interfaceName) { + return wsdlDef.getPortType(interfaceName); + } + /** finds the Service using service qname */ + public static Service findService(Definition wsdlDef, QName serviceName) { + return wsdlDef.getService(serviceName); + } + /** finds the wsdl port using service qname and endpoint name */ + public static Port findServiceEndpoint(Definition wsdlDef, QName serviceName, String endpointName) { + Service service = null; + Port port = null; + service = findService(wsdlDef, serviceName); + if ( service != null ) { + port = service.getPort(endpointName); + } + return port; + } + /** + * finds the binding definition to which the service with serviceName and endpointName was bound. + */ + public static Binding findServiceBinding(Definition wsdlDef, QName serviceName, String endpointName) { + Binding binding = null; + Port port = findServiceEndpoint(wsdlDef, serviceName, endpointName); + if ( port != null ) { + binding = port.getBinding(); + } + return binding; + } + /** + * finds the binding definition using the interface(portType) qname with a + */ + public static Binding findInterfaceBinding(Definition wsdlDef, + QName interfaceQName, QName extQName) { + Map bindingMap = wsdlDef.getBindings(); + @SuppressWarnings("unchecked") + Collection bindings = bindingMap.values(); + for ( Binding binding : bindings ) { + if ( binding.getPortType().getQName().equals(interfaceQName)) { + return binding; + } + } + return null; + } + + /** + * find the wsdl4j operation corresponds to the interface+operation. + * @param wsdlDef wsdl definition + * @param portTypeQName portType QName + * @param opName operation name. if null, first operation in the portType + * is returned. + * @return Operation corresponding to the portType+opName + */ + public static Operation findOperation(Definition wsdlDef, + QName portTypeQName, String opName) { + Operation operation = null; + PortType portType = wsdlDef.getPortType(portTypeQName); + if ( portType != null ) { + if ( opName != null ) { + operation = portType.getOperation(opName, null, null); + } else { + @SuppressWarnings("unchecked") + List list = portType.getOperations(); + if ( list != null && list.size() > 0 ) { + operation = list.get(0); + } + } + } + return operation; + } + /** + * verifies whether the wsdl definition contains the specified service descriptions or not. Used + * to locate the wsdl definition for the services describes in service unit deployment + * descriptor(jbi.xm). + * @param interfaceName portType qname to find in the definition. can be null if you are trying to + * find only service endpoint description. + * @param serviceName qname for the service to find in this wsdl. can be null if + * you are trying to find only portType (abstract service) description. + * @param endpointName port name to find in the service definition. null if only + * service with any port should be looked up. + * + * @return true if the wsdl definition contains the specified service description. + */ + public static boolean isWSDLFor(Definition wsdlDef, + QName interfaceName, QName serviceName, String endpointName) { + PortType portType = null; + Service service = null; + Port port = null; + if ( interfaceName != null ) { + portType = findInterface(wsdlDef, interfaceName); + } + + if ( serviceName != null ) { + service = findService(wsdlDef, serviceName); + } + + if ( endpointName != null && service != null ) { + port = service.getPort(endpointName); + } + + boolean isWSDL = true; + + if ( (interfaceName != null && portType == null) || + ( serviceName != null && service == null ) || + ( endpointName != null && (service == null || port == null)) ) { + isWSDL = false; + } + + return isWSDL; + } + /** + * creates a binding definition that contains a service engine binding elements in the specified + * wsdl definition for a portType. It will try to find/create the binding element with interface + * local name with a "_JBISEBinding" suffix and add service engine binding element to it if it + * is not present. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding create${artifactId}Binding(Definition wsdl, QName interfaceName) { + QName bindingQName = new QName(wsdl.getQName().getNamespaceURI(), + interfaceName.getLocalPart() + "_JBISEBinding"); + Binding binding = wsdl.getBinding(bindingQName); + if ( binding == null ) { + binding = wsdl.createBinding(); + binding.setQName(bindingQName); + binding.setPortType(wsdl.getPortType(interfaceName)); + binding.setUndefined(false); + + ExtensibilityElement bindingExt = + SEBindingExt.SEBindingExtImpl.addExtensibilityElement(wsdl, binding); + + wsdl.addBinding(binding); + } + return binding; + } + /** + * creates port and binding elements that provide the the service engine binding for a service. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @param serviceName service under which the port definition bound to the service engine binding + * should be created. + * @param endpointName port name. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding create${artifactId}Binding(Definition wsdl, QName interfaceName, QName serviceName, String endpointName ) { + Binding binding = null; + Service service = findService(wsdl, serviceName); + if ( service == null ) { + return null; + } + Port port = service.getPort(endpointName); + if ( port != null ) { + binding = port.getBinding(); + } else { + // create port + port = wsdl.createPort(); + port.setName(endpointName); + binding = create${artifactId}Binding(wsdl, interfaceName); + port.setBinding(binding); + service.addPort(port); + } + return binding; + } + /** prints the wsdl to text from the wsdl definition */ + public static void printWSDL(PrintWriter out, Definition def) { + try { + WSDLFactory factory = WSDLFactory.newInstance(); + WSDLWriter wsdlWriter = factory.newWSDLWriter(); + wsdlWriter.writeWSDL(def, out); + } catch (WSDLException ex) { + ex.printStackTrace(out); + } + } + /** prints the wsdl to text from the wsdl definition */ + public static String printWSDLToString(Definition def) { + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + printWSDL(out, def); + out.close(); + return writer.getBuffer().toString(); + } + /** returns an existing namespace prefix or create one if not exists for the corresponding namespaceURI */ + public static String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static void addExtensibilityElement(Definition wsdlDef, + ElementExtensible extensibleEl, ExtensibilityElement extEl, String defPrefix) { + QName elementType = extEl.getElementType(); + String namespaceURI = elementType.getNamespaceURI(); + String prefix = wsdlDef.getPrefix(namespaceURI); + if ( prefix == null ) { + // no namespace prefix defined. create one. + prefix = WSDLProcessor.getNamespacePrefix(wsdlDef, namespaceURI, defPrefix); + wsdlDef.addNamespace(prefix, namespaceURI); + } + extensibleEl.addExtensibilityElement(extEl); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/ServiceEngineTest.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/ServiceEngineTest.java new file mode 100644 index 000000000..926d7af97 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/ServiceEngineTest.java @@ -0,0 +1,54 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ${artifactId}Test.java + */ + +package enginetest; + +import net.openesb.component.${artifactId}.test.JBIComponentTestClient; +import net.openesb.component.${artifactId}.test.SOAPBindingTestClient; +import java.util.Properties; + import junit.framework.TestCase; + +/** + * The test method in this testcase uses the SOAPBindingTestClient to send the + * input document to the echo service provided by service engine via soap binding + * component and receives the output document which will be placed in test results + * directory under the same package as this test case. + * @see com.sun.jbi.sample.component.test.SOAPBindingTestClinet + * @author chikkala + */ +public class ServiceEngineTest + extends TestCase +{ + public ServiceEngineTest(String testName) { + super(testName); + } + + public void test1() throws Exception { + String testPropertiesPath = "test1.properties"; + JBIComponentTestClient testClient = new SOAPBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public void test2() throws Exception { + String testPropertiesPath = "test2.properties"; + JBIComponentTestClient testClient = new SOAPBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public static void main(String[] args) { + try { + ServiceEngineTest compTest = new ServiceEngineTest("ServiceEngineTest"); + compTest.test1(); + compTest.test2(); + } catch(Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test1.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test1.properties new file mode 100644 index 000000000..fd5ee2403 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test1.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +input.file=test1Input.xml +${symbol_pound} expected.file=Expected.xml +output.file=test1Output.xml +soap.binding.inbound.endpoint.address.location=http://localhost:12010/ServiceEngine/greetings +soap.binding.soapaction=sayHello +fail.on.soap.fault=true + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml new file mode 100644 index 000000000..b1a3ecc9e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test2.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test2.properties new file mode 100644 index 000000000..5a35303e5 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test2.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +input.file=test2Input.xml +${symbol_pound} expected.file=Expected.xml +output.file=test2Output.xml +soap.binding.inbound.endpoint.address.location=http://localhost:12010/ServiceEngine/greetings +soap.binding.soapaction=sayGoodbye +fail.on.soap.fault=true + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml new file mode 100644 index 000000000..47952104c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java new file mode 100644 index 000000000..919ad6829 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java @@ -0,0 +1,298 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JBIComponentTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; + +/** + * This class implements the base framework for the testing the JBI components. + * Testing the JBI component involves may require deploying a service to the + * component(s) to enable the service provided by the test component and then + * invoking the service provided by the test component. If the test component is + * a binding component, then a service provider component such as sample service + * engine is required to test the component end to end. If the test component is a + * service engine, then the service on the test component can be invoked via + * soap/http binding component. + * + * This class provides the utilites to read the test properties, read the input + * message from the file and save the output to the file. The testService + * method implemented here can be executed as the test for the component. The + * testService method calls the invokeService method with the input document and + * expects a output document or error that will be saved to the output file. + * The method invokeService should be implemented by the extended test classes to + * inplement a suitable service consumer implemenation for the test compoent. + * See JMXBindingTestClient.java or SOAPBidningTestClient.java for more details + * on how to implement a partucular test service consumer. + * + * @author chikkala + */ +public abstract class JBIComponentTestClient { + + public static final String TEST_PROPS_FILE_PROP = "test.properties.file"; + public static final String TEST_RESULTS_DIR_PROP = "test.results.dir"; + public static final String TEST_SRC_DIR_PROP = "test.src.dir"; + + public static final String TEST_PACKAGE_PROP = "test.package.name"; + + public static final String INPUT_FILE_PROP = "input.file"; + public static final String EXPECTED_FILE_PROP = "expected.file"; + public static final String OUTPUT_FILE_PROP = "output.file"; + + public static final String DEF_TEST_PROP_FILE = "test.properties"; + public static final String DEF_INPUT_FILE = "Input.xml"; + public static final String DEF_OUTPUT_FILE = "Output.xml"; + public static final String DEF_TEST_RESULTS_DIR = "test-results"; + + public JBIComponentTestClient() { + } + /** + * returns the absolute resource path w.r.t. the packagePath if the resource name + * is relative else return the resourceName as it is. + * @param package name ( dot separated ) + * @param resourcName dot separated name or a absolute resource path + * @return abosolute resource path with path separator + */ + public static String resolveResourcePath(String packageName, String resourceName) { + String resourcePath = resourceName; + if ( !resourceName.startsWith("/")) { + // it is relative resource file. resolve it w.r.t. testPackage + String pkgDir = packageName.trim().replace('.', '/'); + if ( pkgDir.length() != 0 ) { + pkgDir += "/"; + } + resourcePath = "/" + pkgDir + resourceName; + } + return resourcePath; + } + /** + * loads the resource file as properties. + * @param testPackage package name where this test belongs + * @param testPropPath resource path relative to testPackage or absolute resource path + */ + public Properties loadTestProperties(String testPackage, String testPropPath) throws IOException { + String propsResourcePath = resolveResourcePath(testPackage, testPropPath); + + InputStream testPropIS = null; + try { + testPropIS = this.getClass().getResourceAsStream(propsResourcePath); + Properties testProps = new Properties(); + testProps.load(testPropIS); + testProps.setProperty(TEST_PACKAGE_PROP, testPackage); + return testProps; + } finally { + if ( testPropIS != null ) { + try { + testPropIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @param testPropPath resource path relative to testPackage or absolute resource path + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass, String testPropPath) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), testPropPath ); + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), DEF_TEST_PROP_FILE ); + } + /** + * loads the resource file to string bugger + * @param inputFile resource file path + */ + public StringBuffer loadResourceFile(String resourcePath) throws FileNotFoundException, IOException { + + InputStream inputIS = null; + InputStreamReader inputReader = null; + BufferedReader reader = null; + StringWriter strWriter = null; + PrintWriter writer = null; + try { + inputIS = this.getClass().getResourceAsStream(resourcePath); + inputReader = new InputStreamReader(inputIS); + reader = new BufferedReader(inputReader); + strWriter = new StringWriter(); + writer = new PrintWriter(strWriter); + for ( String line = null; (line = reader.readLine()) != null ; ) { + writer.println(line); + } + writer.close(); + strWriter.close(); + return strWriter.getBuffer(); + } finally { + if ( inputIS != null ) { + try { + inputIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + + /** + * reads data from the reader and saves to file + * @param reader reader from which to read the data and save to file + * @param outputFilePath absolute file path + */ + public void saveOutputToFile(Reader reader, String outputFilePath) throws IOException { + + BufferedReader buff = null; + FileWriter fileWriter = null; + PrintWriter writer = null; + try { + buff = new BufferedReader(reader); + fileWriter = new FileWriter(outputFilePath); + writer = new PrintWriter(fileWriter); + for ( String line = null; (line = buff.readLine()) != null ; ) { + writer.println(line); + } + } finally { + if ( writer != null ) { + writer.close(); + } + if ( fileWriter != null ) { + fileWriter.close(); + } + } + } + + /** + * resource path. + */ + public String getInputFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String inputFile = testProps.getProperty(INPUT_FILE_PROP, DEF_INPUT_FILE); + String resourcePath = resolveResourcePath(testPkg, inputFile); + return resourcePath; + } + /** + * return resource path + */ + public String getExpectedFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String resourcePath = null; + String expFile = testProps.getProperty(EXPECTED_FILE_PROP, null); + if ( expFile != null ) { + resourcePath = resolveResourcePath(testPkg, expFile); + } + return resourcePath; + } + /** + * return the absolute path to the output file + */ + public String getOutputFilePath(Properties testProps) { + + String defPackage = this.getClass().getPackage().getName(); + String testPackage = testProps.getProperty(TEST_PACKAGE_PROP, defPackage); + String testPackageDir = testPackage.replace('.','/'); + String outputFile = testProps.getProperty(OUTPUT_FILE_PROP, DEF_OUTPUT_FILE); + + String userHomeDir = System.getProperty("user.home", ""); + String userDir = System.getProperty("user.dir", userHomeDir); + String defResultsDir = userDir + "/" + DEF_TEST_RESULTS_DIR; + String sysResultDir = System.getProperty(TEST_RESULTS_DIR_PROP, defResultsDir); + String resultDir = testProps.getProperty(TEST_RESULTS_DIR_PROP, sysResultDir); + + File outputDir = new File(resultDir, testPackageDir); + // System.out.println("Creating the test results output dir " + outputDir); + outputDir.mkdirs(); + return (new File(outputDir, outputFile)).getAbsolutePath(); + } + + /** + * This is the method where the actual service invocation code based on the + * type of client will be implemented. testService method calls this method + * after preparing the test input and then processes the output returned by + * this method to complte the test. + * @param inputDoc + * @param testProps + * @throws java.lang.Exception + * @return + */ + public abstract StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception; + + /** + * abstract method implemented by the extended classes to compare the output + * document with the expected output to determine the test is a failure or + * success. + * @param outputDoc + * @param expectedDoc + * @param testProps + * @throws java.lang.Exception + */ + public abstract void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, Properties testProps) throws Exception; + + /** + * This is the main test method that a test case will call to test the + * service. The standard steps that required to invoke the service and + * process the output will be done in this method. Each test case creates + * the test Properties required for that test and executes this method for + * testing the service by passing the test properties to it. This method + * prepares the input and executes the invokeService method to invoke a + * service with the prepared input. It then processes the return value from + * the invokeService to complete the test. + * + * @param testProps + * @throws java.lang.Exception + */ + public void testService(Properties testProps) throws Exception { + + String inFilePath = getInputFileResourcePath(testProps); + String outFilePath = getOutputFilePath(testProps); + String expFilePath = getExpectedFileResourcePath(testProps); + File outDir = (new File(outFilePath)).getParentFile(); + outDir.mkdirs(); + + StringBuffer outputDoc = new StringBuffer(); + + try { + StringBuffer inputDoc = loadResourceFile(inFilePath); + outputDoc = invokeService(inputDoc, testProps); + if ( expFilePath != null ) { + StringBuffer expOutputDoc = loadResourceFile(expFilePath); + compareWithExpectedOutput(inputDoc, expOutputDoc, testProps); + } + } catch (Exception ex) { + StringWriter out = new StringWriter(); + ex.printStackTrace(new PrintWriter(out)); + outputDoc.append(out.getBuffer()); + throw ex; + } finally { + if ( outputDoc != null ) { + System.out.println(outputDoc); + this.saveOutputToFile(new StringReader(outputDoc.toString()), outFilePath); + } + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java new file mode 100644 index 000000000..7cc8c103e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java @@ -0,0 +1,136 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the proxy service consumer implementation by a binding component + * that can communicate with the external service consumers using JMX interface. + * @author chikkala + */ +public class JMXBindingTestClient extends JBIComponentTestClient { + + public static final String CONSUMER_EP_INBOUND_OPERATION_PROP = "consumer.jmx.bc.ep.operation"; + public static final String CONSUMER_EP_ADDRESS_MBEAN_PROP = "consumer.jmx.bc.ep.address.mbean"; + public static final String CONSUMER_EP_ADDRESS_URL_PROP = "consumer.jmx.bc.ep.address.serviceURL"; + public static final String CONSUMER_EP_ADDRESS_USERNAME_PROP = "consumer.jmx.bc.ep.address.username"; + public static final String CONSUMER_EP_ADDRESS_PASSWORD_PROP = "consumer.jmx.bc.ep.address.password"; + + public static final String PROVIDER_EP_INBOUND_OPERATION_PROP = "provider.jmx.bc.ep.operation"; + public static final String PROVIDER_EP_ADDRESS_MBEAN_PROP = "provider.jmx.bc.ep.address.mbean"; + public static final String PROVIDER_EP_ADDRESS_URL_PROP = "provider.jmx.bc.ep.address.serviceURL"; + public static final String PROVIDER_EP_ADDRESS_USERNAME_PROP = "provider.jmx.bc.ep.address.username"; + public static final String PROVIDER_EP_ADDRESS_PASSWORD_PROP = "provider.jmx.bc.ep.address.password"; + + + /** + * Creates a new instance of JMXBindingTestClient + */ + public JMXBindingTestClient() { + super(); + } + /** + * creates jmx connection to send the input message to the binding component. + */ + public static MBeanServerConnection getJMXConnection(Properties testProps) + throws MalformedURLException, IOException { + + String jmxUrl = testProps.getProperty(CONSUMER_EP_ADDRESS_URL_PROP); + String username = testProps.getProperty(CONSUMER_EP_ADDRESS_USERNAME_PROP); + String password = testProps.getProperty(CONSUMER_EP_ADDRESS_PASSWORD_PROP); + + Map env = new HashMap(); + if ( username != null ) { + String [] credentials = new String [] {username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, JMXBindingTestClient.class.getClassLoader()); + } + JMXServiceURL serviceURL = new JMXServiceURL(jmxUrl); + JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, env); + MBeanServerConnection mbeanServerConnection = jmxConnector.getMBeanServerConnection(); + return mbeanServerConnection; + } + /** + * constructs the jmx mbean objectname + */ + public static ObjectName createJMXEndpointMBeanObjectName(String endpointAddressMBean) throws MalformedObjectNameException { + // String objectName = JMX_DOMAIN + ":" + JMX_ENDPOINT_ADDRESS_KEY + "=" + endpointAddressMBean; + return new ObjectName(endpointAddressMBean); + } + /** + * invokes a jmx mbean to send message. + */ + public static StringBuffer invokeSendMessage(MBeanServerConnection jmxConn, ObjectName epAddressName, + String operation, StringBuffer inputDoc) + throws MalformedObjectNameException, InstanceNotFoundException, + MBeanException, ReflectionException, IOException { + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if ( result != null ) { + outDoc = (StringBuffer)result; + } + + return outDoc; + } + /** + * invokes the service via jmx interface. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + ObjectName epAddressName = new ObjectName(testProps.getProperty(CONSUMER_EP_ADDRESS_MBEAN_PROP)); + String operation = testProps.getProperty(CONSUMER_EP_INBOUND_OPERATION_PROP); + + MBeanServerConnection jmxConn = getJMXConnection(testProps); + StringBuffer outputDoc = null; + try { + outputDoc = invokeSendMessage(jmxConn, epAddressName, operation, inputDoc); + } catch (MBeanException ex) { + Exception targetEx = ex.getTargetException(); + if ( targetEx != null ) { + throw targetEx; + } else { + throw ex; + } + } + return outputDoc; + } + /** no expected output comparison implemented */ + public void compareWithExpectedOutput(StringBuffer inputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java new file mode 100644 index 000000000..28f534612 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java @@ -0,0 +1,159 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SOAPBindingTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.util.Properties; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPConnection; +import javax.xml.soap.SOAPConnectionFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPFault; +import javax.xml.soap.SOAPMessage; +import javax.xml.soap.SOAPPart; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the Service Engine via SOAP Binding by invoking the service using + * SOAP Client that sends the message to the service provider via soaphttp binding. + * + * @author chikkala + */ +public class SOAPBindingTestClient extends JBIComponentTestClient { + + private static final String ADDRESS_PROP = "soap.binding.inbound.endpoint.address.location"; + private static final String SOAP_ACTION_PROP = "soap.binding.soapaction"; + private static final String FAIL_ON_SOAP_FAULT_PROP = "fail.on.soap.fault"; + + private static MessageFactory messageFactory; + private static SOAPConnectionFactory soapConnFactory; + private static SOAPConnection connection; + + public SOAPBindingTestClient() throws SOAPException { + init(); + } + /** initializes SOAP client */ + private synchronized void init() throws SOAPException { + if ( messageFactory == null ) { + messageFactory = MessageFactory.newInstance(); + } + if ( soapConnFactory == null ) { + soapConnFactory = SOAPConnectionFactory.newInstance(); + } + if ( connection == null ) { + connection = soapConnFactory.createConnection(); + } + } + + /** + * read in a soap message from the given input file + */ + private static SOAPMessage loadMessage(Reader inReader) throws SOAPException, IOException { + //Create and populate the message from a file + SOAPMessage message = messageFactory.createMessage(); + SOAPPart soapPart = message.getSOAPPart(); + StreamSource preppedMsgSrc = new StreamSource(inReader); + soapPart.setContent(preppedMsgSrc); + message.saveChanges(); + return message; + } + /** saves the SOAP message as xml text to a writer */ + private static void saveMessage(SOAPMessage response, Writer outWriter) + throws TransformerConfigurationException, SOAPException, TransformerException { + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute("indent-number", new Integer(2)); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + SOAPPart replySOAPPart = response.getSOAPPart(); + Source sourceContent = replySOAPPart.getContent(); + StreamResult result = new StreamResult(outWriter); + try { + transformer.transform(sourceContent, result); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + } + /** + * Send a soap message + * @param destination URL to send to + * @param message message to send + * @param expectedHttpStatus expected http status code or null if success is expected + * @return reply soap message + */ + private static SOAPMessage sendMessage(String destination, SOAPMessage message, String soapAction) throws SOAPException { + + // Add soapAction if not null + if (soapAction != null) { + MimeHeaders hd = message.getMimeHeaders(); + hd.setHeader("SOAPAction", soapAction); + } + // Send the message and get a reply + SOAPMessage reply = null; + reply = connection.call(message, destination); + return reply; + } + /** check the xml text in the StringBuffer passed contains SOAP Fault. */ + public boolean isSOAPFault(StringBuffer msgBuff) { + SOAPFault soapFault = null; + try { + SOAPMessage inMsg = loadMessage(new StringReader(msgBuff.toString())); + soapFault = inMsg.getSOAPBody().getFault(); + } catch (Exception ex) { + // any exception, means either no fault elem or invalid xml + } + return (soapFault != null); + } + /** + * invokes the service ny sending the input message and return the output + * message returned by the service. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + String soapAction = testProps.getProperty(SOAP_ACTION_PROP); + String destination = testProps.getProperty(ADDRESS_PROP); + SOAPMessage inMsg = loadMessage(new StringReader(inputDoc.toString())); + SOAPMessage outMsg = sendMessage(destination, inMsg, soapAction); + StringWriter out = new StringWriter(); + saveMessage(outMsg, out); + StringBuffer outDoc = out.getBuffer(); + Boolean failOnSoapFault = Boolean.valueOf(testProps.getProperty(FAIL_ON_SOAP_FAULT_PROP, "false")); + if ( failOnSoapFault ) { + if (isSOAPFault(outDoc)) { + StringBuffer errBuff = new StringBuffer("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} SOAP FAULT ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} ${symbol_escape}n"); + errBuff.append(outDoc); + throw new Exception(errBuff.toString()); + } + } + return outDoc; + } + /** comparing the received output document with the expected document. throw + * exception if the docs are not same. throwing the exception in this method + * fails the test. + */ + public void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/build.properties new file mode 100644 index 000000000..945269943 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/build.properties @@ -0,0 +1,22 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service assembly builds +${symbol_pound} user.properties.file=../../user.properties +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +service.assembly.name=testSA + +${symbol_pound}no.deps=true set the no.deps property if there are no SUs to build +${symbol_pound} for each testSU define the properties here. +${symbol_pound} dependent BC SU projects dependency +${symbol_pound} service unit name +service.unit.name.testSUBC=testSUBC +${symbol_pound} service unit project directory +project.testSUBC=testSUBC + +${symbol_pound} service unit name +service.unit.name.testSUSE=testSUSE +${symbol_pound} service unit project directory +project.testSUSE=testSUSE diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..02f75e641 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/build.xml @@ -0,0 +1,140 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..ed9f610e9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,44 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + ${artifactId}_TestSA + This is a test Service Assembly to test Engine + + + + + ${artifactId}_TestSUBC + This service unit enables soap inbound endpoint for a service in service engine + + + testSUBC.zip + sun-http-binding + + + + + ${artifactId}_TestSUSE + This service unit enables greetings service provider in service engine + + + testSUSE.zip + ${artifactId} + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.properties new file mode 100644 index 000000000..1bfd81c69 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.properties @@ -0,0 +1,10 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service unit builds +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +${symbol_pound}build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..777fb3cf9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,74 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC.zip b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC.zip new file mode 100644 index 0000000000000000000000000000000000000000..f4205815d39cfd4aaec83644439b3cde3918d3e4 GIT binary patch literal 1341 zcmWIWW@h2#VgP}Fg7;=%29)3g(!Q=Cj=G+HZu$W*bsS)I!neYX-(X^3DB)vZ03rtW zqSVxq%)Insz4GFeoU7r!_O}cK_J+Tz?HofeUP;oE1p@h=GJLFfc6QIlGe?$KR_PWTk^hvrS#$ zG-GyDUQ3~j=ik&dZzhW?{?xo?D6#$C;!P^+DzD32PkO^~a=W@oPf{|AfNPqIQeV)` z1!X#W7=Ags)=RY*i`>{R@FLq$vfloD?iyaM_F%#1k{2202>CU89(34Kb@|c$PiNJa zo;~~f|NPzD2C>WUyyRHJ$n=Xd=}l0AzofG8;+BK5n|6Kj^nT;)k?ryJSgn}%$7Ke0 zZr!`6%gbez&sKF}{;S7=?OyKHUu0%!3Vf3Il4kWURp{h{j#){Wp?pq^#3CJwzjp;JU<1iWQCpi)5Kl=^k-~R6))HQ zCvW*w-=$vmf4*zJp>WmXf10JUpWXBHwO?6TzHN5&dRrIss3-e;JJso$d_o#Ot|Cz)$PqR|H$i;mAZ|fbmgWgTv^o3zW@Eto73OwosInZ;-=N9@YyAMgFKe5*15X# z-=7NKxGj$oRv4wb&v-4LvbM}sCUtr9-sUKWwU0dP{bf40i*MU$*LER~u`SV~{rQ!j zQuD68=H;r{yZ`NJWiz#nCbOpRXnFtOcM0(hXiNLEQ&O zP2NgMR;=P&{64qSAaIjfbKl}eSu@W1hOv7;=H(J9%uFp5`v1WC%H{&0>3uu0U2K9m zXS(^BNX9$AU2k7~@91Wc3-z$qK|=LiM=|IiCQ2bSqjmN9%~5A+RR9n YLgO&No0Scuf*A-m0_jv15RaD&0Ny4i^#A|> literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl new file mode 100644 index 000000000..038d91bcd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml new file mode 100644 index 000000000..05f4f9bef --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl new file mode 100644 index 000000000..8a160abd0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..05f4f9bef --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.properties new file mode 100644 index 000000000..1bfd81c69 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.properties @@ -0,0 +1,10 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service unit builds +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +${symbol_pound}build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..846415d3a --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,74 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE.zip b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE.zip new file mode 100644 index 0000000000000000000000000000000000000000..2db1a3a5c32b7f22dd9f6213cb0b25c2076d30b3 GIT binary patch literal 3003 zcmaJ@c{G%58y~VYW+wYOQixF25Yk;_84NOZ*@nq(7{s7-7)vjwb7U#YK_Tm)$d*QS z$r9POm~7eRB^4^ZsrUVQ`|3U4{XFNspFghObDih9p5O0xnHe2ofi37g zx5M-kt!r`dG|EIz-t50|Y~SO!C#*Wh7$J}#1O!6AA^HRyF38i*Jy0$r(9LJq8Vx2C zIG$OrM8*@GV3YPdz^?c~YQwr=P=OdbP!{?w|Ct+p2920_>@nejjK-wSe>|fxO0tf>eyn^0%CElHSv{5XjVV}?C9%S zbd5eQEaTc$<9C(mK#9>C7wJqSHs=iq)~3oP{c$Xc8l)q+Q>>@dFAK_>Fee;7ATUW8 zmpa{JHfeq1mj-m+#ALOyq!wx4%e3<&1t3vhab;`C{Kt2tM-&BWXYw9PloLmhqu4dJ z7qwDn60xpK9J*I8iQP6I&%Ji45wfSF8!1Fm<{4|^SoXds7zz4)%iz#B4Cj*I07Dj+ zNi?eYLSxu#YSUJ)R6%d==YyQ5>ZZ#m-(^~1N38PXhE0^3(L_HkSi1wL-+KKdb^Y@}nZ$hXNl#xvkgBaIWh?&D+y)b$zO5cw zVQwu`PwS~)Ek(D#@_xC{X?)&Jbzt27fB<4+$&08hjD(j}&zC6nkcC|bY#1E+W_}%U zVgvWubg3ankvr_|zI1Tr;tUE6iisgLnf4W0m(=X$DQE+={smX0pu)6=FOB&K%c45( zGtpFu=sja&SJcINsYI!S&Rr}bTbd|KxTKczS+j1^$x9$8!gyIEhsP#TDQ5duCJ2}u zi56ynK-lSQ;P{y_URY1LP+uS4B(!&{0xXsWzOcSEGQBmiu4I_p;v5a&&}rw|IZ3b8 zJ6+A)cQ)Si_wl<~@Vn$M4a*X%o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z>GATkp#1aXrr~w-XBK@^27y_Q_%RyZ(_E~ zOA1H3<##fwBRxZMU*ut2 z3967oCG-IDn=v67nt?ED_4^BP*($q>hWGs!WeS2CTF1OiUbFi2IBp}tOHlB+OJ zPFRuUNgs;FVyjqHI%MuSUg3!07uT<;dK^02tsgZbZ+Ba2%2?(K+q~tmiY;4+hjk=D z-+?ujGSxASQogNlW)Hc?l&yDBZzb)blqtel%-+U7)2sTSa!N-4kXyXXGC##BQUDCD zW}fcPgi%qjFKH3x?47J=Pi>xa;gyuZAg!@3^m7n?e5i`jmh*!sh+S=^4%Mn=Rg6n{pLI7-0}${2A?&zJMN+F3K?%So8Iv? z&Dl7*9&KVtp4mFc8w~zP^X2yRAhn;i%LaP*vNdxJO=5oo@Z3%9m$R!LkyTw?`E+Kb zz1Ld?-v=&>QrPGC+`~M#x1ESOxE1`oChv{+6vw0fkGfa+OB;0$4w)G-F!CJwKcgf4 z2cjQ;9uSMJMueNmM$_slK$<*zrlaC zoPXd!bQAi?fPO>%s%8HmFVorcL)m`A{m!y~kSnbJ#yK-1X8Ic;5ElC7LRU|TziJML F{s$_z?xO$z literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl new file mode 100644 index 000000000..038d91bcd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml new file mode 100644 index 000000000..8235893ee --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/goodbye.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/hello.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/xsltmap.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/xsltmap.properties new file mode 100644 index 000000000..44baf5452 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/xsltmap.properties @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} properties will be used to find the xslt file that will be used for invoking a +${symbol_pound} service operation. +${symbol_pound} The "xsltmap.properties" file should contain two types of properties +${symbol_pound} 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +${symbol_pound} "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +${symbol_pound} 2. a service description to xslt file properties with syntax like +${symbol_pound} "{tns-prefix}service-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +${symbol_pound} the service description property is a "." delimited tokens that represents +${symbol_pound} a serive or interface qname and a operation name. To locate xslt file either with +${symbol_pound} service qname or service qname and operaton or serivice qname and interface qname +${symbol_pound} and operation, all the three properties specified above should be there for each xslt file. +${symbol_pound} + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +${symbol_pound} just service level default settings +{greet2}greetService=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl new file mode 100644 index 000000000..8a160abd0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..8235893ee --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/hello.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties new file mode 100644 index 000000000..44baf5452 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} properties will be used to find the xslt file that will be used for invoking a +${symbol_pound} service operation. +${symbol_pound} The "xsltmap.properties" file should contain two types of properties +${symbol_pound} 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +${symbol_pound} "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +${symbol_pound} 2. a service description to xslt file properties with syntax like +${symbol_pound} "{tns-prefix}service-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +${symbol_pound} the service description property is a "." delimited tokens that represents +${symbol_pound} a serive or interface qname and a operation name. To locate xslt file either with +${symbol_pound} service qname or service qname and operaton or serivice qname and interface qname +${symbol_pound} and operation, all the three properties specified above should be there for each xslt file. +${symbol_pound} + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +${symbol_pound} just service level default settings +{greet2}greetService=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/test/resources/projects/basic/archetype.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/src/test/resources/projects/basic/archetype.properties new file mode 100644 index 000000000..c7bdacd1c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/src/test/resources/projects/basic/archetype.properties @@ -0,0 +1,6 @@ +#Tue Jul 30 12:05:58 IST 2013 +package=it.pkg +version=0.1-SNAPSHOT +groupId=archetype.it +artifactId=ServiceEngine-archetype +glassfishLocation=C:\\GlassFishESBv22\\glassfish diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/src/test/resources/projects/basic/goal.txt b/maven-archtype-v2/maven-archetype-service-engine-v2/src/test/resources/projects/basic/goal.txt new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/ServiceEngine-archetype-1.0-SNAPSHOT.jar b/maven-archtype-v2/maven-archetype-service-engine-v2/target/ServiceEngine-archetype-1.0-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..f581fde1a0f8ba5e7f92c587db8be6da93ca6b03 GIT binary patch literal 130878 zcmeFZWo)F|mL+IrW@cuFG&3_ZGcz+YJI&0@%yycYnVIc0W9NO<{ibH7-YsdQ>8c+c zp$NqZeNu$9*WPRGb@ut>rGPwyf4pE-7++aZQfq%dcMm~Mhr=EIZ z2s{`73yKYeU5@2}i8S0HySA1PcT7}#yXj0c5tGG!Gu?8!<~hM5j$uuMH!jFMPbs@D zHg^|5JM{LJr4u~>R1L2%91l!dAvn#FsN2U~$AkvcWK=DS@AzKIsm=RI9eJDcc9_1`%-2jqHGkyg_%3ppsi6i|?mcGIm$+~e_Yjo?> zX?Q<%Z#;WQ{LK12@Ex4$e zBJXYMI-8TBIB0!s^ln*_<-TK-Y=+|zUu#fGvNMC2!DJjf6?=peN7t}qHpC+_e%}AU z(|db$x7Yr(Wkp1=GUS`UY74v(F5Yca1Gcmn_dLC_q)HRq-M<^q7PYxHxVZ;~#NWep z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AL=Qe zkC9LE@;eUNoD{*Y*esz9qzLN6MRX~`UAbv87^Dd5jzjlZKd#wC|Lam@gKhR>Sv6X_ zNh-g-xA@W6PUzt#3H{QBLYId`k2XnTGrI`=x>DD;Nm4)GI;auJjA(P`)r9qHarUYT WTft2h0yzb~9s=v1VJpz(A^#8iRppHU literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/META-INF/maven/archetype-metadata.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/META-INF/maven/archetype-metadata.xml new file mode 100644 index 000000000..ea7fd9335 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,82 @@ + + + + + + + + + C:\\GlassFishESBv22\\glassfish + + + + + test/java + + **/*.xml + **/*.java + **/*.properties + + + + src/java + + **/*.java + + + + test/testSA + + **/*.xml + **/*.properties + + + + nbproject + + **/*.xml + **/*.properties + + + + src/conf + + **/*.xml + + + + nbproject/private + + **/*.xml + **/*.properties + + + + test/testSA + + **/*.xsl + **/*.zip + **/*.wsdl + + + + + + build.xml + install-params.properties + m2nbbuild-impl.xml + m2nbbuild.properties + m2nbbuild.xml + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build.xml new file mode 100644 index 000000000..14afd1d29 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build.xml @@ -0,0 +1,72 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Builds, tests, and runs the project ${artifactId}. + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/pom.xml new file mode 100644 index 000000000..1e58b6067 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/pom.xml @@ -0,0 +1,38 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + 4.0.0 + + ${package} + ${artifactId}-archetype + ${version} + maven-archetype + + ${artifactId}-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml new file mode 100644 index 000000000..c493031be --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml @@ -0,0 +1,33 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml new file mode 100644 index 000000000..2bdebaa2b --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml @@ -0,0 +1,146 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + org.netbeans.modules.apisupport.project + + + ${symbol_dollar}{artifactId} + + + + org.apache.tools.ant.module + + + + 3 + 3.27.0.2 + + + + org.jdesktop.layout + + + + 1 + 1.4 + + + + org.netbeans.modules.java.project + + + + 1 + 1.12 + + + + org.netbeans.modules.project.ant + + + + 1 + 1.16 + + + + org.netbeans.modules.projectapi + + + + 1 + 1.13 + + + + org.netbeans.modules.projectuiapi + + + + 1 + 1.24.0.6 + + + + org.netbeans.modules.queries + + + + 1 + 1.10 + + + + org.openide.actions + + + + 6.6.0.1 + + + + org.openide.awt + + + + 6.11.0.1 + + + + org.openide.dialogs + + + + 7.5 + + + + org.openide.execution + + + + 1.10 + + + + org.openide.filesystems + + + + 7.3 + + + + org.openide.loaders + + + + 6.5 + + + + org.openide.nodes + + + + 7.2.0.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml new file mode 100644 index 000000000..b50d82c16 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test1Input.xml @@ -0,0 +1,18 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml new file mode 100644 index 000000000..947bb579c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/enginetest/test2Input.xml @@ -0,0 +1,18 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..5456aa8f2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml @@ -0,0 +1,143 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..fd6c5a710 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + ${symbol_dollar}{artifactId}_TestSA + This is a test Service Assembly to test Engine + + + + + ${symbol_dollar}{artifactId}_TestSUBC + This service unit enables soap inbound endpoint for a service in service engine + + + testSUBC.zip + sun-http-binding + + + + + ${symbol_dollar}{artifactId}_TestSUSE + This service unit enables greetings service provider in service engine + + + testSUSE.zip + ${symbol_dollar}{artifactId} + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..96e95745f --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml new file mode 100644 index 000000000..251f4073e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..251f4073e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..75340ea7d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml new file mode 100644 index 000000000..1ce2022bf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..1ce2022bf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/install-params.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/install-params.properties new file mode 100644 index 000000000..712a6a3ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/install-params.properties @@ -0,0 +1,3 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild-impl.xml new file mode 100644 index 000000000..2093d6b39 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild-impl.xml @@ -0,0 +1,133 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild.properties new file mode 100644 index 000000000..663de1bb9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild.properties @@ -0,0 +1,48 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} build properties file to set/override the properties of the netbeans project +${symbol_pound} build properties when the netbeans build is called from the maven build lifecycle. +${symbol_pound} Netbeans project when build from the IDE, uses a build.properties from the user.dir +${symbol_pound} of the Netbeans IDE to resolve some of the properties used in the project such as +${symbol_pound} the libraries classpath. +${symbol_pound} When invoking the Netbeans project build from maven, this build.properties file +${symbol_pound} is not available. So, you can add the properties defined in ide build properties +${symbol_pound} that this project uses here. +${symbol_pound} + +${symbol_pound} default local repository settings. If the repository location is different +${symbol_pound} -D command line option should override this (e.g. mvn -Dmaven.repo.local=/my/m2/repository +maven.repo.local=${symbol_dollar}{user.home}/.m2/repository +${symbol_pound} begin jbi admin settings +${symbol_pound} set the below properties if you want to override the properties from nbproject/project.properties +${symbol_pound} that sets the application server admin settings. +${symbol_pound} +${symbol_pound} jbi.as.home=C:/Sun/glassfish-v2-b58g +${symbol_pound} jbi.host=localhost +${symbol_pound} jbi.port=4848 +${symbol_pound} jbi.username=admin +${symbol_pound} jbi.password=adminadmin +${symbol_pound} end jbi admin settings +${symbol_pound} + +${symbol_pound} classpath settings +junit.ant.task.classpath=${symbol_dollar}{maven.repo.local}/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar +junit.runtime.classpath=${symbol_dollar}{maven.repo.local}/junit/junit/3.8.2/junit-3.8.2.jar +libs.junit.classpath=${symbol_dollar}{junit.runtime.classpath}:${symbol_dollar}{junit.ant.task.classpath} +libs.jbi-cdk-ant-tasks.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi-cdk/jbi-cdk-ant-tasks/${version}/jbi-cdk-ant-tasks-${version}.jar + +libs.jbi.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi/1.0/jbi-1.0.jar +libs.wsdl4j.162.classpath=${symbol_dollar}{maven.repo.local}/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar +${symbol_pound} libs.jaxws21.classpath=${symbol_dollar}{jbi.as.home}/lib/javaee.jar:${symbol_dollar}{jbi.as.home}/lib/webservices-rt.jar +libs.jaxws21.classpath=${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/activation/activation/1.1/activation-1.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/ws/jaxws-rt/2.1.2/jaxws-rt-2.1.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild.xml new file mode 100644 index 000000000..31217d15d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/m2nbbuild.xml @@ -0,0 +1,37 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/build-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/build-impl.xml new file mode 100644 index 000000000..2e8e00c93 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/build-impl.xml @@ -0,0 +1,554 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task is getting executed! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task executed successfully! + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/genfiles.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/genfiles.properties new file mode 100644 index 000000000..cfde66418 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/genfiles.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.xml.data.CRC32=ac78c060 +build.xml.script.CRC32=9068f2c7 +build.xml.stylesheet.CRC32=8add101f@1.0 +${symbol_pound} This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +${symbol_pound} Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=ac78c060 +nbproject/build-impl.xml.script.CRC32=d15987fd +nbproject/build-impl.xml.stylesheet.CRC32=4ed53ee0@1.0 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/jbi_admin.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/jbi_admin.xml new file mode 100644 index 000000000..8a7d2a523 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/jbi_admin.xml @@ -0,0 +1,504 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + +This ant script contains the jbi ant tasks and the targets and properties using +which the jbi admin commands can be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Usage : ant -f <fullpath>/jbi_admin.xml [options] [target] + options: -D<property>=<value> + Specify a property/value pairs as options that are valid for the target. + target : ant target name in jbi_admin.xml + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/jbiadmin-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/jbiadmin-impl.xml new file mode 100644 index 000000000..7e7dca2ae --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/jbiadmin-impl.xml @@ -0,0 +1,339 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + Install, uninstall, reinstall, start, stop, shutdown jbi components. + + + + + + + + + + + + + + Must set jbi.host + Must set jbi.port + Must set jbi.username + Must set jbi.password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/private/private.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/private/private.properties new file mode 100644 index 000000000..e540325d5 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/private/private.properties @@ -0,0 +1,6 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +javac.debug=true +javadoc.preview=true +user.properties.file=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working57${symbol_escape}${symbol_escape}.netbeans${symbol_escape}${symbol_escape}openesb${symbol_escape}${symbol_escape}build.properties diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/private/retriever/catalog.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/private/retriever/catalog.xml new file mode 100644 index 000000000..712a6a3ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/private/retriever/catalog.xml @@ -0,0 +1,3 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/project.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/project.properties new file mode 100644 index 000000000..2a9ec25b5 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/project.properties @@ -0,0 +1,93 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.classes.dir=${symbol_dollar}{build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${symbol_dollar}{build.dir}/generated +build.predist.dir=${symbol_dollar}{build.dir}/predist +build.predist.jar=${symbol_dollar}{build.predist.dir}/component.jar +build.predist.lib.dir=${symbol_dollar}{build.predist.dir}/lib +${symbol_pound} Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${symbol_dollar}{build.dir}/test/classes +build.test.dir=${symbol_dollar}{build.dir}/test +build.test.results.dir=${symbol_dollar}{build.dir}/test/results +conf.dir=src/conf +debug.classpath=${symbol_escape} + ${symbol_dollar}{run.classpath} +debug.test.classpath=${symbol_escape} + ${symbol_dollar}{run.test.classpath} +${symbol_pound} This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${symbol_dollar}{dist.dir}/${artifactId}.zip +dist.javadoc.dir=${symbol_dollar}{dist.dir}/javadoc +jar.compress=false +javac.classpath=${symbol_escape} + ${symbol_dollar}{libs.jbi.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.sharedlibs.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.lib.classpath} +${symbol_pound} Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir}:${symbol_escape} + ${symbol_dollar}{libs.junit.classpath}:${symbol_escape} + ${symbol_dollar}{libs.jaxws21.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jbi.ant.tasks.classpath=${symbol_escape} + ${symbol_dollar}{jbi.as.home}/lib/sun-appserv-ant.jar:${symbol_escape} + ${symbol_dollar}{jbi.as.home}/jbi/lib/jbi-ant-tasks.jar +#jbi.as.home=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish +jbi.as.home=${glassfishLocation} +#jbi.as.instance.id=[D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.as.instance.id=[${glassfishLocation}]deployer:Sun:AppServer::localhost:4848 +jbi.component.bootstrap.class=${artifactId}.ProviderSEInstaller +jbi.component.class=${artifactId}.ProviderSERuntime +jbi.component.description=Description of service engine : ${artifactId} +jbi.component.lib.classpath=${symbol_escape} + ${symbol_dollar}{libs.wsdl4j.162.classpath} +jbi.component.name=${artifactId} +jbi.component.sharedlibs.classpath= +jbi.component.type=service-engine +jbi.host=localhost +jbi.install.params.file=install-params.properties +jbi.install.with.params=false +jbi.password=this really long string is used to identify a password that has been stored in the Keyring +jbi.port=4848 +jbi.soap.binding.name=sun-http-binding +jbi.username=admin +meta.inf.dir=${symbol_dollar}{conf.dir}/META-INF +platform.active=default_platform +project.jbi.deploy.plugin=./deploy-plugin +project.testSA=test/testSA +run.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir} +${symbol_pound} Space-separated list of JVM arguments used when running the project +${symbol_pound} (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +${symbol_pound} or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.test.classpath}:${symbol_escape} + ${symbol_dollar}{build.test.classes.dir} +src.dir=src/java +test-sys-prop.test.results.dir=${symbol_dollar}{build.test.results.dir} +test-sys-prop.test.src.dir=test-sys-prop.test.src.dir +test.src.dir=test/java +testSA.enabled=true +testSA.name=${artifactId}_TestSA diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/project.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/project.xml new file mode 100644 index 000000000..942beffad --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/nbproject/project.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + org.netbeans.modules.jbi.apisupport.project.jbicomponent + + + ${artifactId} + service-engine + 1.6.5 + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/pom.xml new file mode 100644 index 000000000..a65255db9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/pom.xml @@ -0,0 +1,282 @@ + + + + 4.0.0 + ${groupId} + ${artifactId} + jar + ${version} + JBI Component[${artifactId}] + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + http://open-esb.org + + build + src/java + test/java + build/classes + build/test/classes + package + + + org.apache.maven.plugins + maven-compiler-plugin + + true + 1.5 + 1.5 + + + **/*.java + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + **/*.* + + + + + maven-surefire-plugin + 2.1.3 + true + + + true + + **/bindingtest/*.java + **/enginetest/*.java + + + + + + maven-antrun-plugin + 1.2 + + + m2nbbuild-compile + compile + + run + + + + + + + + + m2nbbuild-compile-test + test-compile + + run + + + + + + + + + m2nbbuild-package + package + + run + + + + + + + + + m2nbbuild-utest + test + + run + + + + + + + + + m2nbbuild-itest + integration-test + + run + + + + + + + + + m2nbbuild-clean + clean + + run + + + + + + + + + + default-cli + + run + + + + !!!!!!!!!!!!!!!!!!!!!! Moving Files and organizing package !!!!!!!!!!!!!!!!!!!!!!!! + + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + + + + + + + maven2-repo1 + Maven2 Central Repository + http://repo1.maven.org/maven2 + + + download-java-net-maven2-repository + download.java.net Maven 2.x repository + http://download.java.net/maven/2/ + + + maven-repository.dev.java.net-repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + + + ws-zones + ws.zones maven repository + http://ws.zones.apache.org/repository2/ + + + apache.org + Maven Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + + apache.org + Maven Plugin Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + org.apache.maven + maven-ant-tasks + 2.0.7 + + + open-esb.jbi-cdk + jbi-cdk-ant-tasks + 1.0-SNAPSHOT + + + open-esb + jbi + 1.0 + + + wsdl4j + wsdl4j + 1.6.2 + + + com.sun.xml.ws + jaxws-rt + 2.1.2 + test + + + + + ${maven.repo.local} + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/conf/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/conf/META-INF/jbi.xml new file mode 100644 index 000000000..7c40ad15c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/conf/META-INF/jbi.xml @@ -0,0 +1,45 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + ${artifactId} + Description of service engine : ${artifactId} + + + net.openesb.component.${artifactId}.ProviderSERuntime + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + net.openesb.component.${artifactId}.ProviderSEInstaller + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java new file mode 100644 index 000000000..af3bbc2c6 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java @@ -0,0 +1,52 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSEComponentLifeCycle.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.BasicComponentLifeCycle; +import net.openesb.component.${artifactId}.common.DefaultMessageExchangeReceiver; +import net.openesb.component.${artifactId}.common.MessageExchangeReceiver; +import net.openesb.component.${artifactId}.common.RuntimeContext; +import javax.jbi.JBIException; +import javax.jbi.component.Component; + +/** + * This class extends the basic ComponentLifeCycle implementation to provide + * component specific implementation of the ComponentLifeCycle. + * + * @see javax.jbi.ComponentLifeCycle + * @see com.sun.jbi.sample.component.common.BasicComponentLifeCycle + * @author chikkala + */ +public class ProviderSEComponentLifeCycle extends BasicComponentLifeCycle { + + /** + * constructor + */ + public ProviderSEComponentLifeCycle(Component compRuntime) { + super(compRuntime); + } + + /** + * creates DefaultMessageExchangeReceiver to handles receiving and + * processing the message exchanges from the delivery channel. + */ + @Override + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return new DefaultMessageExchangeReceiver(); + } + + /** + * chance to extended classes to do the component specific init + * + * @throws javax.jbi.JBIException + */ + @Override + protected void doInit() throws JBIException { + // NOOP + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEEndpoint.java new file mode 100644 index 000000000..cddaa21da --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEEndpoint.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSEEndpoint.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.MessageExchangeHandler; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.MessageExchangeListener; +import net.openesb.component.${artifactId}.common.deployment.ProviderEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor; +import javax.jbi.JBIException; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.wsdl.Definition; + +/** + * This class extends the ProviderEndpoint to implement component specific + * endpoint configuration. It implements the MessageExchangeListener to receive + * message exchange notifications from the MessageExchangeSupport fired by + * MessageExchangeReceiver and process it using a message exchange handler. + * + * This endpoint is configured for a service provided by this component which + * can receive a xml document and apply xslt transformation and send the results + * back in a InOut message exchange to complete a service invocation on this + * endpoint. + * + * @author chikkala + */ +public class ProviderSEEndpoint extends ProviderEndpoint implements MessageExchangeListener { + + private XSLTFileLocator mXsltFileLocator; + private XSLTService mXsltService; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public ProviderSEEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ProviderSEServiceUnit su) { + super(provides, wsdlDef, su); + } + + /** + * XSLT transformation service used in transformation of the xml documents + * received on this endpoint. + */ + public XSLTService getXSLTService() { + return this.mXsltService; + } + + /** + * returns the XSLTFileLocator object that is created to find the xslt file + * to be used for a particular service operation invocation by looking at + * the mapping file specified in the service unit that deploys this + * endpoint. + */ + public XSLTFileLocator getXSLTFileLocator() { + return this.mXsltFileLocator; + } + + @Override + public void doInit() throws JBIException { + RuntimeHelper.getLogger().info("ProviderSEEndpoint:doInit called"); + ProviderSEServiceUnit su = (ProviderSEServiceUnit) this.getServiceUnit(); + this.mXsltFileLocator = su.getXsltFileLocator(); + this.mXsltService = XSLTService.XSLTServiceImpl.getInstance(); + } + + /** + * creates the message exchange handler that will be used to process the + * message exchange received for this endpoint. + */ + @Override + public MessageExchangeHandler createMessageExchangeHandler() { + return new ProviderSEMessageExchangeHandler(this); + } + + /** + * returns the implementation of the message exchange listener which the + * MessageExchangeSupport invokes when a message exchange is received from + * delivery channel by MessageExchangeReceiver. + */ + @Override + protected MessageExchangeListener createMessageExchangeListener() { + return this; + } + + /** + * implementation of the message exchange received method of the listener. + */ + public void messageExchangeReceived(ExchangeStatus status, MessageExchange me) { + try { + RuntimeHelper.getLogger().fine("MXListener.MessageExchangeReceived: with Status: " + status); + processMessageExchangeWithHandler(status, me); + // processMessageExchange(me); + } catch (Exception ex) { + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEInstaller.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEInstaller.java new file mode 100644 index 000000000..88da303d2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEInstaller.java @@ -0,0 +1,34 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + /* + * ProviderSEInstaller.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.ComponentInstaller; + +/** + * This class extends the ComponentInstaller that implements the + * javax.jbi.component.Bootstrap for a component installation contract. + * + * If the default implemenation of the javax.jbi.component.Bootstrap in + * com.sun.jbi.sample.component.common.ComponentInstaller is not sufficient for + * this components install, uninstall and upgrade requirements, override the + * default implementation here to add component specific installation and + * upgrade tasks such as initializing configuration mbean and creating resources + * specific to component or upgrade workspace and service units during upgrading + * the component. + * + * @see javax.jbi.Bootstrap + * @see com.sun.jbi.sample.component.common.ComponentInstaller + * @author chikkala + */ +public class ProviderSEInstaller extends ComponentInstaller { + + /** + * Constructor to create the MyEngineInstaller. + */ + public ProviderSEInstaller() { + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java new file mode 100644 index 000000000..b3002d6ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java @@ -0,0 +1,171 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSEMessageExchangeHandler.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.AbstractMessageExchangeHandler; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.wsdl.WSDL11JBIWrapper; +import java.io.StringReader; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Source; + +/** + * This class extends the AbstractMessageExchangeHandler to implement the + * component specific message exchange processing on the provider side in a + * service engine. + * + * @author chikkala + */ +public class ProviderSEMessageExchangeHandler extends AbstractMessageExchangeHandler { + + private ProviderSEEndpoint mEndpoint; + + /** + * Creates a new instance of ProviderSEMXHandler + */ + public ProviderSEMessageExchangeHandler(ProviderSEEndpoint endpoint) { + this.mEndpoint = endpoint; + } + + protected Logger getLogger() { + return this.mEndpoint.getLogger(); + } + + protected DeliveryChannel getDeliveryChannel() { + return this.mEndpoint.getDeliveryChannel(); + } + + protected void validateMessageExchange() throws MessagingException { + MessageExchange msgExchange = this.getMessageExchange(); + + if (this.getMessageExchange() == null) { + throw new MessagingException("MessageExchange Object is null in MessageExchageHandler"); + } + + if (MessageExchange.Role.CONSUMER.equals(msgExchange.getRole())) { + throw new MessagingException("Provider Message Exchange Handler can not have MessageExchange with CONSUMER Role"); + } + + if (!(msgExchange instanceof InOut)) { + throw new MessagingException("InOut Message Exchange Handler MessageExchange object should be instanceof javax.jbi.messaging.InOut "); + } + } + + protected void processError(Exception ex) { + MessageExchange msgExchange = this.getMessageExchange(); + Exception errEx = msgExchange.getError(); // get the error and print + RuntimeHelper.getLogger().info( + "InOut Message Exchange Provider received Error: " + errEx.getMessage()); + msgExchange.getError().printStackTrace(); + } + + protected void processDone() { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.getLogger().info("InOut Message Exchange Provider received DONE :" + + " END of service invocation"); + } + + protected void processFault(Fault fault) { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.logError("InOut Message Exchange Provider Handler can not receive Fault on Provider side"); + } + + protected void processMessage() { + try { + processInMessageOnProvider((InOut) this.getMessageExchange()); + } catch (JBIException ex) { + ex.printStackTrace(); + } + } + + protected void processInMessageOnProvider(InOut inOutExchange) throws JBIException { + RuntimeHelper.getLogger().fine("Processing In Message on Provider side " + inOutExchange); + // receive IN message. + NormalizedMessage inMsg = inOutExchange.getInMessage(); + NormalizedMessage outMsg = null; + Fault fault = null; + Source inContent = null; + Source outContent = null; + Source faultContent = null; + String faultAsText = null; + // process in message + inContent = inMsg.getContent(); + // invoke the service operation + try { + QName opName = inOutExchange.getOperation(); + QName svcName = inOutExchange.getEndpoint().getServiceName(); + RuntimeHelper.getLogger().fine("xslt service info " + svcName + opName); + + XSLTFileLocator xsltFileLocator = this.mEndpoint.getXSLTFileLocator(); + XSLTService xsltService = this.mEndpoint.getXSLTService(); + + String xsltPath = xsltFileLocator.findXsltFile(svcName, opName); + RuntimeHelper.getLogger().fine("XsltPath " + xsltPath); + if (xsltPath == null) { + RuntimeHelper.getLogger().fine(" No XSLT File found in MAP " + + xsltFileLocator.printMap()); + } + outContent = xsltService.transform(inContent, xsltPath); + + } catch (Exception ex) { + // exception invoking the operation. so, set exception text as fault content. + ex.printStackTrace(); + faultAsText = RuntimeHelper.getExceptionAsText(ex); + String faultText = RuntimeHelper.getExceptionAsXmlText(ex); + faultContent = RuntimeHelper.createDOMSource(new StringReader(faultText)); + } + // set out or fault message + if (outContent != null) { + // set the out message content. + outMsg = inOutExchange.createMessage(); + inOutExchange.setOutMessage(outMsg); + normalizeOutMessage(inOutExchange, outMsg, outContent); + // outMsg.setContent(outContent); + } else if (faultContent != null) { + fault = inOutExchange.createFault(); + inOutExchange.setFault(fault); + fault.setContent(faultContent); // may need to normalize the content. + } + // send out or fault message. + // this.getDeliveryChannel().sendSync(inOutExchange, SEND_SYNC_TIMEOUT); + this.send(); + } + + private void normalizeOutMessage(MessageExchange me, NormalizedMessage normMsg, Source msgSrc) throws MessagingException { + try { + // DOMSource wrappedSource = wrapOutputMessage(me, msgSrc); + WSDL11JBIWrapper outWrapper = WSDL11JBIWrapper.createOutputWrapper( + this.mEndpoint.getWSDLOperation(me.getOperation())); + + // check if the output from the transformer is in a wrapped form + WSDL11JBIWrapper wrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(msgSrc)); + if (wrapper != null) { + outWrapper.appendParts(wrapper.getParts()); + } else { + outWrapper.appendPart(RuntimeHelper.sourceToDOMSource(msgSrc)); + } + + normMsg.setContent(outWrapper.toDOMSource()); + + } catch (MessagingException ex) { + throw ex; + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSERuntime.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSERuntime.java new file mode 100644 index 000000000..5a395d9ee --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSERuntime.java @@ -0,0 +1,56 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSERuntime.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.ComponentRuntime; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; + +/** + * This class extends the ComponentRuntime that implements + * javax.jbi.component.Component interface required for the component contract + * at runtime. + * + * This class provides the component specific ComponentLifeCycle implementation + * as well as the component specific ServiceUnitManager implementation. + * + * Add any additional component runtime specific functionality here. + * + * @see javax.jbi.component.Component + * @see com.sun.jbi.sample.component.common.ComponentRuntime + * @see com.sun.jbi.sample.component.common.BasicComponentLifecycle + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @author chikkala + */ +public class ProviderSERuntime extends ComponentRuntime { + + /** + * Creates a new instance of MyEngineRuntime + */ + public ProviderSERuntime() { + super(); + } + + /** + * overriding the parent's createComponentLifeCycle to create component + * specific component lifecycle implementation. + */ + @Override + protected ComponentLifeCycle createComponentLifeCycle() { + return new ProviderSEComponentLifeCycle(this); + } + + /** + * overrides the parent's createServiceUnitManager to create component + * specific service unit manager + */ + @Override + protected ServiceUnitManager createServiceUnitManager() { + return new ProviderSESUManager(this); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSESUManager.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSESUManager.java new file mode 100644 index 000000000..ed2cbed58 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSESUManager.java @@ -0,0 +1,49 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSESUManager.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.AbstractServiceUnitManager; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; + +/** + * This class extends the AbstractServiceUnitManager to implement component + * specific service unit manager by creating the component specific ServiceUnit + * implementation. + * + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit + * @author chikkala + */ +public class ProviderSESUManager extends AbstractServiceUnitManager { + + private ProviderSERuntime mRuntime; + + /** + * Creates a new instance of ProviderSESUManager + */ + public ProviderSESUManager(ProviderSERuntime compRuntime) { + super(); + this.mRuntime = compRuntime; + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + protected String getComponentName() { + return RuntimeHelper.getComponentName(); + } + //TODO implement ProviderSEServiceUnit + + protected ServiceUnit createServiceUnit(String suName, String suRootPath) throws DeploymentException { + return new ProviderSEServiceUnit(suName, suRootPath); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java new file mode 100644 index 000000000..e11af0975 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java @@ -0,0 +1,63 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderSEServiceUnit.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import net.openesb.component.${artifactId}.common.deployment.ProviderEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Provides; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; + +/** + * This class extends the ServiceUnit to implement the component specific + * service unit processing. It creates the component specific ProviderEndpoint + * implementation to configure the service provider endpoint on this component + * deployed in the service unit. It also processes the deployment artifacts that + * are specific to the service provided by the component. + * + * @author chikkala + */ +public class ProviderSEServiceUnit extends ServiceUnit { + + private XSLTFileLocator mXsltFileLocator; + + /** + * Creates a new instance of ProviderSEServiceUnit + */ + public ProviderSEServiceUnit(String suName, String suRootPath) { + super(suName, suRootPath); + } + + protected XSLTFileLocator getXsltFileLocator() { + return this.mXsltFileLocator; + } + + @Override + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return new ProviderSEEndpoint(provides, wsdlDef, this); + } + + /** + * load and validates the component specific deployment artifacts. It loads + * the xsltmap properties into XSLTFileLocator which will be used to find + * the xslt file corresponding to a service operation. + */ + @Override + protected void loadOtherArtifacts() throws DeploymentException { + super.loadOtherArtifacts(); + // load any component specific service unit artifacts + if (this.mXsltFileLocator == null) { + try { + this.mXsltFileLocator = + new XSLTFileLocator(this.getSURootPath(), "xsltmap.properties"); + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/XSLTFileLocator.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/XSLTFileLocator.java new file mode 100644 index 000000000..d5189d393 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/XSLTFileLocator.java @@ -0,0 +1,210 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * XSLTFileLocator.java + */ +package net.openesb.component.${artifactId}; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.xml.namespace.QName; + +/** + * This class represents the component specific deployment artifact which reads + * the deployed "xsltmap.properties" file in the service unit and processes it + * to find the xslt file to be used for a particular operation on a service + * provided by the deployment. + *

+ * The "xsltmap.properties" file should contain two types of properties
+ * 1.for namespace prefix to namespaceURI map that starts with "xmlns." prefix like
+ *   "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo"
+ * 2. a service description to xslt file properties with syntax like
+ *   "{tns-prefix}service-name=xslt_file_name"  and
+ *   "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and
+ *   "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" .
+ * the service description property is a "." delimited tokens that represents a serive
+ * or interface qname and a operation name. To locate xslt file either with service qname
+ * or service qname and operaton or serivice qname and interface qname and operation,
+ * all the three properties specified above should be there for each xslt file. for example,
+ *  xmlns.echo1=http://www.sun.com/jbi/examples/sample-service/echo
+ *  xmlns.echo2=http://www.sun.com/jbi/examples/sample-service/echo
+ *  {echo2}echoService=echo.xsl
+ *  {echo2}echoService.{echo1}echo=echo.xsl
+ *  {echo2}echoService.{echo1}echo.echo=echo.xsl
+ * 
+ * + * @author chikkala + */ +public class XSLTFileLocator { + + private Map mXsltFileMap; + + /** + * Creates a new instance of XsltLocator + */ + public XSLTFileLocator(String rootPath, String mapFile) throws Exception { + this.mXsltFileMap = new HashMap(); + initXsltLocator(rootPath, mapFile); + } + + private void initXsltLocator(String rootPath, String mapFilePath) throws Exception { + @SuppressWarnings("unchecked") + Map mapProps = loadMappingProperties(rootPath, mapFilePath); + + Map nsMap = new HashMap(); + Map xsltMap = new HashMap(); + + for (String name : mapProps.keySet()) { + String value = mapProps.get(name); + if (name.startsWith("{")) { + xsltMap.put(name, value); + } else if (name.startsWith("xmlns.")) { + String xmlns = name.substring(6); + nsMap.put(xmlns, value); + } + } + + for (String name : xsltMap.keySet()) { + String value = xsltMap.get(name); + String[] tokens = name.split("${symbol_escape}${symbol_escape}."); + String svcName = null; + String intrName = null; + String opName = null; + + if (tokens.length == 1) { + svcName = expandQName(tokens[0], nsMap); + } else if (tokens.length == 2) { + svcName = expandQName(tokens[0], nsMap); + opName = expandQName(tokens[1], nsMap); + } else if (tokens.length == 3) { + svcName = expandQName(tokens[0], nsMap); + intrName = expandQName(tokens[1], nsMap); + opName = tokens[2]; + } else { + System.out.println("invalid property name in xslt map property" + name); + } + + StringBuffer buff = new StringBuffer(); + buff.append(svcName); + if (intrName != null) { + buff.append("."); + buff.append(intrName); + } + if (opName != null) { + buff.append("."); + buff.append(opName); + } + File file = new File(rootPath, value); + String xsltFile = file.getAbsolutePath(); + this.mXsltFileMap.put(buff.toString(), xsltFile); + } + } + + private String expandQName(String qname, Map xmlnsMap) { + + // qname passed is "{prefix}localname" + QName temp = QName.valueOf(qname); + String prefix = temp.getNamespaceURI(); + String nsURI = xmlnsMap.get(prefix); + if (nsURI == null) { + nsURI = prefix; // just use the prefix as it is. + } + QName realQName = new QName(nsURI, temp.getLocalPart()); + return realQName.toString(); + } + + private Map loadMappingProperties(String rootPath, String mapFilePath) throws Exception { + File mapFile = new File(rootPath, mapFilePath); + Properties mapProps = new Properties(); + if (!mapFile.exists()) { + throw new Exception("Mapping file not found " + mapFilePath); + } + FileInputStream inStream = null; + try { + inStream = new FileInputStream(mapFile); + mapProps.load(inStream); + } catch (FileNotFoundException ex) { + ex.printStackTrace(); + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + if (inStream != null) { + try { + inStream.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + return mapProps; + } + + /** + * return the xslt file mapped to either service name or service qname + + * operation qname + * + * @param serviceQName must be non null qname + * @param opQName can be null the xslt file can be located at service level. + */ + public String findXsltFile(QName serviceQName, QName opQName) { + StringBuffer buff = new StringBuffer(); + buff.append(serviceQName.toString()); + if (opQName != null) { + buff.append("."); + // workaround for the http soap bc bug which does not set the namespace + // uri on the op name. for time being use the serviceQName's namespace + String namespaceURI = opQName.getNamespaceURI(); + if (namespaceURI == null || namespaceURI.length() == 0) { + QName tempOp = + new QName(serviceQName.getNamespaceURI(), opQName.getLocalPart()); + buff.append(tempOp.toString()); + } else { + buff.append(opQName.toString()); + } + } + String xsltFile = this.mXsltFileMap.get(buff.toString()); + return xsltFile; + } + + /** + * return the xslt file mapped to either service name or service qname + + * interface qname + operation + * + * @param serviceQName must be non null service qname + * @param intrQName interface qname + * @param opName operation name ( not a qname) + */ + public String findXsltFile(QName serviceQName, QName intrQName, String opName) { + StringBuffer buff = new StringBuffer(); + buff.append(serviceQName.toString()); + if (intrQName != null) { + buff.append("."); + buff.append(intrQName.toString()); + } + if (opName != null) { + buff.append("."); + buff.append(opName); + } + String xsltFile = this.mXsltFileMap.get(buff.toString()); + return xsltFile; + } + + public String printMap() { + StringWriter buff = new StringWriter(); + PrintWriter out = new PrintWriter(buff); + for (String key : this.mXsltFileMap.keySet()) { + out.println("Key= " + key); + out.println("XsltFile= " + this.mXsltFileMap.get(key)); + } + out.close(); + return buff.getBuffer().toString(); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/XSLTService.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/XSLTService.java new file mode 100644 index 000000000..a303e10a0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/XSLTService.java @@ -0,0 +1,108 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * XSLTService.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.File; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; +import java.util.logging.Logger; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import org.w3c.dom.Document; + +/** + * This is a sample service implementation that takes the input as xml document + * and the xslt file to apply the xslt transformation on the input xml and + * return the transformed output xml. This implementation of the service is + * invoked when a InOut message exchange is processed to invoke a service + * provided by the engine. + * + * @author chikkala + */ +public interface XSLTService { + + /** + * this operation takes the input xml document and constructs the output xml + * document by applying the xslt in the file specified in xsltPath + * + * @param inputDoc input xml document + * @param xsltPath absolute file path of xslt file. + * @return transformed output xml document + */ + Source transform(Source inputDoc, String xsltPath) throws Exception; + + /** + * This class implements the echo service operations which the service + * engine will invoke when a InOut message exchange is processed to invoke a + * service provided by the engine. + */ + public static class XSLTServiceImpl implements XSLTService { + + private XSLTServiceImpl() { + } + + /** + * accessor to create/locate the service implementation + * + * @return echo service implementation + */ + public static XSLTService getInstance() { + return new XSLTServiceImpl(); + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + /** + * this operation takes the input xml document and constructs the output + * xml document with the same data to implement the echo. + * + * @param inputDoc input document + * @return output document + */ + public Source transform(Source inputDoc, String xsltPath) throws Exception { + Document outDoc = null; + StringBuffer inBuff = RuntimeHelper.readFromSource(inputDoc); + + getLogger().fine("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} TRANSFORMER INPUT MESSAGE BEGIN ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}"); + getLogger().fine(inBuff.toString()); + getLogger().fine("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} TRANSFORMER INPUT MESSAGE END ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}"); + + TransformerFactory tf = null; + tf = TransformerFactory.newInstance(); + StreamSource xsltSource = new StreamSource(new File(xsltPath)); + Transformer xformer = tf.newTransformer(xsltSource); + + Properties params = new Properties(); //TODO get the pramas from the user file + for (Object name : params.keySet()) { + xformer.setParameter((String) name, params.get(name)); + } + StringWriter writer = new StringWriter(); + StreamResult result = new StreamResult(writer); + + DOMSource xmlSource = new DOMSource(RuntimeHelper.buildDOMDocument(new StringReader(inBuff.toString()))); + + xformer.transform(xmlSource, result); + + getLogger().fine("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} TRANSFORMER OUTPUT MESSAGE BEGIN ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}"); + getLogger().fine(writer.getBuffer().toString()); + getLogger().fine("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} TRANSFORMER OUTPUT MESSAGE END ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}"); + + outDoc = RuntimeHelper.buildDOMDocument(new StringReader(writer.getBuffer().toString())); + DOMSource outSource = new DOMSource(outDoc); + + return outSource; + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java new file mode 100644 index 000000000..4987029b3 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java @@ -0,0 +1,141 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractMessageExchangeHandler.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.io.StringReader; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.xml.namespace.QName; + +/** + * This class is an abstract implementation of the MessageExchangeHandler which + * provides the base implementation of the ME processing and provides hooks to + * extended classes to implement component specific processing. + * + * @author chikkala + */ +public abstract class AbstractMessageExchangeHandler implements MessageExchangeHandler { + + public static String IN_MESSAGE = "in"; + public static String OUT_MESSAGE = "out"; + + private MessageExchange mMessageExchange; + private ExchangeStatus mStatus; + /** Creates a new instance of AbstractMessageExchangeHandler */ + protected AbstractMessageExchangeHandler() { + this.mMessageExchange = null; + } + + protected abstract Logger getLogger(); + protected abstract DeliveryChannel getDeliveryChannel(); + protected abstract void validateMessageExchange() throws MessagingException; + protected abstract void processError(Exception ex); + protected abstract void processDone(); + protected abstract void processMessage(); + protected abstract void processFault(Fault fault); + + public final MessageExchange getMessageExchange() { + return this.mMessageExchange; + } + + public final void setMessageExchange(MessageExchange msgExchange) { + this.mMessageExchange = msgExchange; + } + + public final ExchangeStatus getMessageExchangeStatus() { + if ( this.mStatus != null ) { + return this.mStatus; + } else if ( this.mMessageExchange != null ) { + return this.mMessageExchange.getStatus(); + } else { + return null; + } + } + + public final void setMessageExchangeStatus(ExchangeStatus status) { + this.mStatus = status; + } + + protected void send() throws MessagingException { + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected boolean sendSync(long timeout) throws MessagingException { + return this.getDeliveryChannel().sendSync(this.mMessageExchange, timeout); + } + + protected void sendDone() throws MessagingException { + this.mMessageExchange.setStatus(ExchangeStatus.DONE); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendError(Exception ex) throws MessagingException { + this.mMessageExchange.setError(ex); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendFault(Exception ex, QName type, String name) throws MessagingException { + Fault fault = this.mMessageExchange.createFault(); + if ( ex != null ) { + String xmlText = RuntimeHelper.getExceptionAsXmlText(ex); + fault.setContent(RuntimeHelper.createDOMSource(new StringReader(xmlText))); + } + this.mMessageExchange.setFault(fault); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void processActive() { + Fault fault = this.getMessageExchange().getFault(); + if ( fault != null ) { + processFault(fault); + } else { + processMessage(); + } + } + /** + * implementation of the MessageExchangeHandler${symbol_pound}processMessageExchange method. + */ + public void processMessageExchange(ExchangeStatus status, MessageExchange msgEx) { + + getLogger().fine("MessageExchangeHandler.processMessageExchange:status: " + status ); + + this.setMessageExchangeStatus(status); + this.setMessageExchange(msgEx); + + try { + validateMessageExchange(); + } catch (MessagingException ex) { + getLogger().log(Level.FINE, "Invalid message exchange for processing ", ex); + if ( this.getMessageExchange() != null ) { + try { + sendError(ex); + } catch (MessagingException errEx) { + getLogger().log(Level.FINE, "Can not send invalid message exchange error", errEx); + } + } + return; + } + + MessageExchange msgExchange = this.getMessageExchange(); + + if (ExchangeStatus.ACTIVE.equals(status) ) { + processActive(); + } else if (ExchangeStatus.DONE.equals(status) ) { + processDone(); + } else if (ExchangeStatus.ERROR.equals(status) ) { + processError(msgExchange.getError()); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java new file mode 100644 index 000000000..d76fbe0f9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java @@ -0,0 +1,398 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractComponentLifeCycle.java + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.MessagingException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.ComponentLifeCycle. This is an + * abstract class that keeps the reference to the component context and the lifecycle + * extension mbeans. It implements the lifecycle method and provide the extended methods + * for each lifecycle methods to implement component specific functionality. + *

+ * It makes sure that the mininum initialization required for the component + * lifecycle is implemented by this class or the classes extending this class. + *

+ * Another important functionality implemented in this class is that it initializes the global + * RuntimeContext for the component with the ComponentContext passed by the JBI runtime and the + * opened delivery channel to make them available globally to any class in the component implementation + * that may need it during component lifecycle + *

+ * Service engine or a binding component lifecycle implementation can directly extend + * this class for their required functionality and override some of the methods to provide + * their own implementation. + * + * @see javax.jbi.ComponentLifeCycle + * @author chikkala + */ +public class BasicComponentLifeCycle implements ComponentLifeCycle { + /** reference to the component runtime */ + private Component mCompRuntime; + /** component context */ + private ComponentContext mComponentContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + /** a message receiver that accepts messages from delivery channel */ + private MessageExchangeReceiver mMsgExchReceiver; + + /** + * constructor for the ComponentLifecycle implementation. + * @param compRuntime + */ + protected BasicComponentLifeCycle(Component compRuntime) { + this.mCompRuntime = compRuntime; + } + /** + * @return Component + */ + public final Component getComponentRuntime() { + return this.mCompRuntime; + } + /** + * @return ComponentContext component context. + */ + public final ComponentContext getComponentContext() { + return mComponentContext; + } + /** + * @return component name + */ + protected String getComponentName() { + return (this.mComponentContext != null) ? + this.mComponentContext.getComponentName() : null; + } + /////////////////////////////////////////////////////////////////////////// + // ComponentLifeCycle interface implemenation + /////////////////////////////////////////////////////////////////////////// + + /** + * Initializes the component lifecycle. This method makes sure that the + * component context passed by the jbi runtime is saved in the lifecycle + * object before calling the other component initialization methods to + * completely initialize the component. + * @param context Component context + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}init(javax.jbi.component.ComponentContext) + * @throws javax.jbi.JBIException on error + */ + public final void init(ComponentContext context) throws JBIException { + + if ( context == null ) { + throw new JBIException("Null Component Context received in " + + "Component Lifecycle init "); + } + this.mComponentContext = context; // 0. save the component context passed by jbi framework. + // initialize the content + initGlobalContext(); // 1. Initialize component runtime context. + registerExtensionMBean(); // 2. Create and register extension mbean. + openDeliveryChannel(); // 3. Open delivery channel. + initMessageExchangeReceiver(); // 4. Create message exchange receiver. + doInit(); // 5. Do any component specific initialization such + // as static service providers and consumers initialization. + + this.getLogger().fine("Component " + this.getComponentName() + " initialized"); + } + + /** + * Starts the component. Extended classes can override/implement the methods called + * in this method to provide component specify start functionality. + * + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}start() + * @throws javax.jbi.JBIException on error + */ + public final void start() throws JBIException { + + doStart(); // 1. do any other component specific start tasks such as + // activating any static service providers and consumers. + startMessageExchangeProcessing(); // 2. begin accepting and processing message exchanges. + + this.getLogger().fine("Component " + this.getComponentName() + " started"); + } + + /** + * Stop the component.Extended classes can override/implement the methods called + * in this method to provide component specify stop functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}stop() + */ + public final void stop() throws JBIException { + + stopMessageExchangeProcessing(); // 1. stop accepting and processing message exchanges. + doStop(); // 2. do any other component specific stop tasks such as + // deactivating any static service providers and consumers. + this.getLogger().fine("Component " + this.getComponentName() + " stopped."); + } + + /** + * Shut down the component. Extended classes can override/implement the methods called + * in this method to provide component specify shut down functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}shutDown() + */ + public final void shutDown() throws JBIException { + // clean up all resources. + shutdownMessageExchangeReceiver(); // 1. remove the message receiver. + closeDeliveryChannel(); // 2. close delivery channel + unregisterExtensionMBean(); // 3. unregister and remove extension mbean if exists. + doShutDown(); // 4. do any other component specific clean up tasks such + // as clean any static service providers and consumer resource. + this.getLogger().fine("Component " + this.getComponentName() + " shut down"); + } + /** + * create jmx object name for the extension mbean. default implementation does + * not required to have the extension mbean. + * @return ObjectName of the extension mbean + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * gets the reference to the extension mbean name. + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}getExtensionMBeanName() + * @return ObjectName of the extension mbean objectname or null if component + * does not support extension mbean + */ + public final ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = this.createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. default + * implementation does not require the extension mbean + * @return the ExtensionMBean implementation as StandardMBean + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * gets the reference to the extension mbean. + * @return extension mbean implementation or null if component does not support. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + * @throws JBIException on error registering mbean + */ + protected final void registerExtensionMBean() throws JBIException { + // creatre the extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server if any. + */ + protected final void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Extension MBean from MBeanServer for " + this.getComponentName(), e); + } + } + /** + * creates MessageExchangeReceiver implementation that handles receiving and processing + * the message exchanges from the delivery channel. Component should implement + * this method to provide the MessageReceiver. + * + * Component may return null indicating that they don't need the message receiver + * that can receive and process message exchanges from delivery channel. For example, + * components that have only service consumers which send a synchronous messages to + * providers don't need this. + * + * @throws java.lang.Exception + * @return MessageExchangeReceiver implementation. null if the component does not support it. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}createMessageExchangeReceiver + */ + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return null; + } + /** + * returns the message exchange receiver implementation reference + * @return MessageExchangeReceiver interface + */ + protected final MessageExchangeReceiver getMessageExchangeReceiver() { + if ( this.mMsgExchReceiver == null ) { + this.mMsgExchReceiver = createMessageExchangeReceiver(); + } + return this.mMsgExchReceiver; + } + /** + * creates a message receiver object as part of the component initialization. + * @throws javax.jbi.JBIException + */ + protected void initMessageExchangeReceiver() throws JBIException { + // create and initialize the MessageExchangeReceiver + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.initReceiver(); + } + } + /** + * allows the component to accept the message exchange objects from the + * delivery channel and process it as part of the component startup process. + * @throws javax.jbi.JBIException + */ + protected void startMessageExchangeProcessing() throws JBIException { + // start message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.startProcessing(); + } + } + /** + * stops the component from accepting the message exchange objects from the + * delivery channel as part of the component stop process + * @throws javax.jbi.JBIException + */ + protected void stopMessageExchangeProcessing() throws JBIException { + // stop message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.stopProcessing(); + } + } + /** + * removes the message receiver as part of the component shutdown process + * @throws javax.jbi.JBIException + */ + protected void shutdownMessageExchangeReceiver() throws JBIException { + // clean up message processing. + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.shutdownReceiver(); + } + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * initializes the RuntimeContext during component init lifecycle phase. This + * includes setting the ComponentContext and loggers etc. extended classes must + * save the component context in the RuntimeContext in this methods implementation. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}initGlobalContext + */ + protected void initGlobalContext() { + RuntimeContext.getInstance().setComponentContext(this.getComponentContext()); + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } + /** opens the delivery channel to accept or send message exchange objects + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}openDeliveryChannel + */ + protected void openDeliveryChannel() { + try { + DeliveryChannel channel = this.getComponentContext().getDeliveryChannel(); + RuntimeContext.getInstance().setDeliveryChannel(channel); + } catch (MessagingException ex) { + ex.printStackTrace(); + } + } + /** closes the delivery channel as part of the component shutdown process. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}closeDeliveryChannel + */ + protected void closeDeliveryChannel() { + // closes delivery channel and remove the reference. + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel != null ) { + channel.close(); + } + } catch (MessagingException ex) { + ex.printStackTrace(); + } finally { + RuntimeContext.getInstance().setDeliveryChannel(null); + } + } + /** + * chance to extended classes to do any extra component specific init tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * initialized here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}init method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}init + */ + protected void doInit() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific start tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * activated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}start method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}start + */ + protected void doStart() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific stop tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * deactivated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}stop method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}stop + */ + protected void doStop() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific shutdown tasks.If the component + * supports static service providers or consumers without deployment support, they can be + * cleaned up here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}shutdown method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}shutdown + */ + protected void doShutDown() throws JBIException { + //NOOP + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java new file mode 100644 index 000000000..7e44dc053 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java @@ -0,0 +1,275 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + /* + * ComponentInstaller.java + */ +package net.openesb.component.${artifactId}.common; + +import java.util.List; +import java.util.logging.Level; +import javax.jbi.component.Bootstrap; +import javax.jbi.component.InstallationContext; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.Bootstrap. This class implements + * the minimum required functionality for component installation contract + * of the jbi component in the jbi environment. It also takes care of maintaining + * the installation context reference and installation specific logger creation and + * installation extension mbean registration and unregistration during initialization + * and cleanup. Extended classes only need to supply the mbean name and its implementation + * object for the installation extensions. + * + * It makes sure that the installation context and the loggers are available to + * the classes extended from this class to add more installation specific functionality. + * + * Service engine or a binding component installation implementation can directly use + * this class or extend this class to add more functionality to their installation + * process. + * + * @see javax.jbi.Bootstrap + * @author chikkala + */ +public class ComponentInstaller implements Bootstrap { + /** default logger*/ + private Logger mDefLogger; + /** bootstrap logger */ + private Logger mBTLogger ; + /** Installation Context . */ + private InstallationContext mInstallationContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + + /** Constructor to create the ComponentInstaller. */ + public ComponentInstaller() { + } + /** + * @return InstallationContext of the component. + */ + public final InstallationContext getInstallationContext() { + return this.mInstallationContext; + } + protected String getComponentName() { + return (this.mInstallationContext != null) ? + this.mInstallationContext.getComponentName() : null; + } + /** + * @return logger initialized from the installation context or a default + * logger. + */ + protected Logger getLogger() { + // try init bootstrap logger + if (this.mBTLogger == null && this.mInstallationContext != null ) { + try { + this.mBTLogger = + this.mInstallationContext.getContext().getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mBTLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mBTLogger != null) ? this.mBTLogger : this.mDefLogger; + } + /** + * Initializes the installation environment for a component. + * @see javax.jbi.component.Bootstrap${symbol_pound}init(javax.jbi.component.InstallationContext) + */ + public final void init(InstallationContext installContext) throws javax.jbi.JBIException { + + if ( installContext == null ) { + throw new JBIException("Null Installation Context received in " + + "Component Bootstrap initialization"); + } + // save the installation context reference passed by the jbi framework. + this.mInstallationContext = installContext; + registerExtensionMBean(); // create and register extension mbean + doInit(); // do any other extra initialization required specific to the component installation. + // initialize logger + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component Installer initialized"); + } + /** + * default implementation just logs the method call. extended classes should override this. + * @see javax.jbi.component.Bootstrap${symbol_pound}onInstall() + */ + public void onInstall() throws javax.jbi.JBIException { + //TODO: do required initializaton and resource creation + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component installed."); + } + /** + * default implementation just logs the method call. + * @see javax.jbi.component.Bootstrap${symbol_pound}onUninstall() + */ + public void onUninstall() throws javax.jbi.JBIException { + //TODO: do clean up the resource and other stuff. + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component uninstalled"); + } + /** + * default noop implementation of the cleanup. + * @see javax.jbi.component.Bootstrap${symbol_pound}cleanUp() + */ + public final void cleanUp() throws javax.jbi.JBIException { + + unregisterExtensionMBean(); // unregister extension mbean and remove it + doCleanUp(); // do any other extra cleanup specific to the component installation. + this.getLogger().fine( this.mInstallationContext.getComponentName() + + " Component Installer Cleaned up"); + } + + /** + * create jmx object name for the extension mbean. Extended classes should + * return the component specific installer extension mbean name here. + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * default implementation that does not have extension mbean return null. + * @see javax.jbi.component.Bootstrap${symbol_pound}getExtensionMBeanName() + */ + public final javax.management.ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. Extended + * classes should return the installer extension mbean implementation as the + * standard mbean. + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * returns the installation extension mbean implementation. + * @return StandardMBean for the extension mbean implementation. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * Chance to extended classes to do the component installation specific init. + * Installation context will be initialized before calling this method. So, + * initialize other things if required in this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller${symbol_pound}init( + * javax.jbi.component.InstallationContext) + */ + protected void doInit() throws JBIException { + this.getLogger().info(this.getInstallationContext().getComponentName() + + " : Component Installer initialized"); + } + /** + * Chance to extended classes to do the component installation specific cleanup. + * ExtensionMbean will be unregistered before calling this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller${symbol_pound}cleanUp( + * javax.jbi.component.InstallationContext) + */ + protected void doCleanUp() throws JBIException { + this.getLogger().fine(this.getInstallationContext().getComponentName() + + " : Component Installer doCleanUp"); + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + */ + protected void registerExtensionMBean() throws JBIException { + // creatre the installation extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation if the object name is created. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Installation Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Installation Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server. + */ + protected void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Installation extension MBean for " + this.getComponentName(), e); + } + } + /** + * This method is called by the JBI runtime to allow a component to upgrade + * it's workspace and any existing Service Units to match the new version of + * the component. The JBI runtime copies the existing workspace root to the + * new workspace root prior to calling this method, so that the component + * can examine the contents of the workspace root to determine the version + * of the component from which the upgrade is being made. All updates to the + * workspace root are done in-place; in the event of a failure, the JBI + * runtime reverts back to the original workspace root, the original install + * root, and the original Service Unit roots for the component. + * + * Note1: The component must ensure that it never holds open references + * to any files in the workspace root or any of the Service Unit roots upon + * returning from this method. Failure to do so will cause problems when + * the runtime attempts to complete the upgrade processing. + * + * Note2: The installation context that is normally initialized + * by the runtime by calling ${symbol_pound}init method of the javax.jbi.Bootstrap interface + * before install and uninstall will not be called before calling this + * upgrade method. So, installation context can not be used in this method's + * implementation. + * + * Note3: Since there won't be any installation context available, the logger + * that returned from the ${symbol_pound}getLogger method is a default logger created using + * the package name of this class or extended class if the method is overridden + * in the extended class. + * + * @param workspaceRoot the workspace root for the new version of the + * component that will replace the currently installed version. This is + * populated with the contents of the original workspace root and the + * component must update it to match the new version of the component. + * @param serviceUnitRoots a list of directory paths to all of the Service + * Units currently deployed to the component. The component must update all + * of these to match the new version of the component. + * @exception JBIException when there is an error requiring that the upgrade + * be terminated. + */ + public void upgrade(String workspaceRoot, List serviceUnitRoots) + throws javax.jbi.JBIException + { + //TODO: override this method in the extended class to handle the + // workspace root and service unit roots upgrade according to the + // component's requirement. + this.getLogger().fine("Default upgrade implementation. " + + "TODO: Implement workspace root and service unit roots upgrade."); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java new file mode 100644 index 000000000..5c32ce274 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java @@ -0,0 +1,174 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ComponentRuntime.java + */ +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Logger; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.servicedesc.ServiceEndpoint; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; + +/** + * This class implements javax.jbi.component.Component interface which is + * responsible for creating the Component Lifecycle implementation and the + * ServiceUnitManager implementation for the jbi component. + * + * This class makes sure that non null component lifecycle implementation is + * returns by this class or any classes extended from this class which is + * required as a component contract. It also provides default implementation of + * all methods of the Component interface which the extended classes can + * override to add more functionality. + * + * @see javax.jbi.component.Component + * @author chikkala + */ +public class ComponentRuntime implements Component { + /** Component LifeCycle implementation */ + private ComponentLifeCycle mLifeCycle; + /** ServiceUnitManager implementation */ + private ServiceUnitManager mSUManager; + /** default logger*/ + private Logger mDefLogger; + + /** Creates a new instance of ComponentImpl */ + public ComponentRuntime() { + this.mLifeCycle = null; + this.mSUManager = null; + } + /** + * returns the ComponentContext. Any component runtime class extended from + * this class can override this method to return their own reference to the + * ComponentContext. + * @return ComponentContext component context. + */ + public ComponentContext getComponentContext() { + ComponentContext ctx = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + ctx = ((BasicComponentLifeCycle) this.mLifeCycle).getComponentContext(); + } + return ctx; + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + public Logger getLogger() { + Logger logger = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + logger = ((BasicComponentLifeCycle) this.mLifeCycle).getLogger(); + } + // init default logger if required + if ( logger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (logger != null) ? logger : this.mDefLogger; + } + /** + * return the ComponentLifeCycle implementation. if returned null, the + * ComponentLifeCycleImpl will be used as the component lifecycle + * Extended classes can override this method and do their own ComponentLifecyle + * specific creation. + */ + protected ComponentLifeCycle createComponentLifeCycle() { + return new BasicComponentLifeCycle(this); + } + /** + * Get the life cycle control interface for this component. + * + * @return the life cycle control interface for this component + * @see javax.jbi.Component${symbol_pound}getLifeCycle() + */ + public final ComponentLifeCycle getLifeCycle() { + if ( this.mLifeCycle == null ) { + this.mLifeCycle = createComponentLifeCycle(); + if ( this.mLifeCycle == null ) { + this.getLogger().fine("Creating basic component lifecycle implemenation"); + // use the default ComponentLifeCycle Impl if a component + // specific implementation return null in createComponentLifeCycle. + this.mLifeCycle = new BasicComponentLifeCycle(this); + } + } + return this.mLifeCycle; + } + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. + * Extended classes can override this method and do their own ServiceUnitManager + * specific creation. + */ + protected ServiceUnitManager createServiceUnitManager() { + return null; + } + /** + * Get the Service Unit manager for this component. + * + * @return the ServiceUnitManager for this component, or + * null if there is none. + * @see javax.jbi.Component${symbol_pound}getServiceUnitManager() + */ + public final ServiceUnitManager getServiceUnitManager() { + if ( this.mSUManager == null ) { + this.mSUManager = createServiceUnitManager(); + } + return this.mSUManager; + } + /** + * Retrieves a DOM representation containing metadata which describes the + * service provided by this component, through the given endpoint. + * + * Default implementation does not support service description. + * + * @see javax.jbi.Component${symbol_pound}getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint) + */ + public Document getServiceDescription(ServiceEndpoint serviceEndpoint) { + return null; + } + /** + * This method is called by JBI to check if this component, in the role of + * provider of the service indicated by the given exchange, can actually + * perform the operation desired. + * + * Default implementation has no policy and allows all exchanges with consumer. + * + * @see javax.jbi.Component${symbol_pound}isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithConsumerOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * This method is called by JBI to check if this component, in the role of + * consumer of the service indicated by the given exchange, can actually + * interact with the provider properly. The provider is described by the + * given endpoint and the service description supplied by that endpoint. + * + * Default implementation has no policy and allows all exchanges with provider. + * + * @see javax.jbi.Component${symbol_pound}isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithProviderOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * Resolve the given endpoint reference. + * + * Default implementation does not have any XML dialect. So can not resolve the + * endpoint from the document fragment. + * + * @see javax.jbi.Component${symbol_pound}resolveEndpointReference(org.w3c.dom.DocumentFragment) + */ + public ServiceEndpoint resolveEndpointReference(DocumentFragment documentFragment) { + return null; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java new file mode 100644 index 000000000..51c85bc6e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java @@ -0,0 +1,180 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * DefaultMessageExchangeReceiver.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; + +/** + * This class implements MessageExchangeReceiver interface. This is a default implementation that + * demonstrates the multi-threaded environment to receive and process message exchanges from the + * delivery channel. It uses a main thread to receive message exchanges from the delivery channel + * and then processes the received message exchanges in a individual threads from the thread pool. + * The controller methods of MessageExchangeReceiver controls the main thread and the thread pool + * execution. + * + * @author chikkala + */ +public class DefaultMessageExchangeReceiver implements MessageExchangeReceiver { + + /** delivery channel accept time out */ + private final static long DC_ACCEPT_TIME_OUT = 3000; // milliseconds + /** receiver thread wait time before polling for messages after woke up **/ + private final static long RECEIVER_WAIT_TIME = 2000; // milliseconds + /** receiver thread wait time before force shutdown */ + private final static long RECEIVER_SHUTDOWN_WAIT_TIME = 10; // seconds + /** handler threads wait time before forced shutdown */ + private final static long HANDLERS_SHUTDOWN_WAIT_TIME = 30; // seconds + /** handler thread pool size */ + private final static int HANDLER_THREAD_POOL_SIZE = 5; + /** receiver thread accept message exchange condition */ + private Boolean mCanAccept = false; + /** receiver thread termination condition */ + private Boolean mContinue = true; + /** receiver thread executor service */ + private ExecutorService mReceiverThreadMgr; + /** handler thread executor service */ + private ExecutorService mHandlerThreadPool; + + /** no default constructor for extended classes */ + public DefaultMessageExchangeReceiver() { + } + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + public final void initReceiver() throws JBIException { + + this.mHandlerThreadPool = Executors.newFixedThreadPool(HANDLER_THREAD_POOL_SIZE); + this.mReceiverThreadMgr = Executors.newSingleThreadExecutor(); + + this.mReceiverThreadMgr.execute(new Runnable() { + public void run() { + Thread t = Thread.currentThread(); + while ( mContinue ) { + if (mCanAccept) { + receiveAndProcessMessageExchange(); + } else { + try { + t.sleep(RECEIVER_WAIT_TIME); + } catch (InterruptedException interruptException) { + // someone must have interrupted this thread + // do nothing + RuntimeHelper.logDebug("Interrupted the MessageReceiverThread in Sleep"); + } + } + } + } + }); + } + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + public final void shutdownReceiver() throws JBIException { + + synchronized ( mContinue ) { + mContinue = false; + } + boolean terminated = false; + try { + this.mReceiverThreadMgr.shutdown(); + terminated = this.mReceiverThreadMgr.awaitTermination( + RECEIVER_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Message Receiver not shutdown. Forcing shutdown"); + this.mReceiverThreadMgr.shutdownNow(); + } + } + shutdownHandlers(); + } + /** + * shutdown all the working threads from the thread pool. + */ + private final void shutdownHandlers() throws JBIException { + + boolean terminated = false; + try { + this.mHandlerThreadPool.shutdown(); + terminated = this.mHandlerThreadPool.awaitTermination( + HANDLERS_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Handler threads not shutdown. Forcing shutdown"); + this.mHandlerThreadPool.shutdownNow(); + } + } + } + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + public final void startProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = true; + } + } + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + public final void stopProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = false; + } + } + + protected MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + private void receiveAndProcessMessageExchange() { + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel == null ) { + RuntimeHelper.logDebug("DeliveryChannel Not Opened for receiving messages"); + return; + } + final MessageExchange msgExchange = channel.accept(DC_ACCEPT_TIME_OUT); + if ( msgExchange == null ) { + // delivery channel timeout occurred. do nothing. + // RuntimeHelper.logDebug("DeliveryChannel returned null message exchange from accept"); + return; + } + final ExchangeStatus status = msgExchange.getStatus(); + // process message exchange in a separate thread + this.mHandlerThreadPool.execute(new Runnable() { + public void run() { + getMessageExchangeSupport().fireMessageExchangeReceived(status, msgExchange); + } + }); + + } catch (MessagingException ex) { + RuntimeHelper.logWarning(ex); + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java new file mode 100644 index 000000000..fed6c987d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeHandler.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface is a Handler to perform message exchanges when the component + * receives the MessageExchange object from the delivery channel. + * Implementation of this interface should implement the processing of + * the active, error, done status of the MessageExchange object according to + * the MEP for which the MessageExchange object is created. + * + * @author chikkala + */ +public interface MessageExchangeHandler { + /** + * this method will be invoked to process the MessageExchange + * object. + * @param msgExchange MessageExchange object to process. + */ + void processMessageExchange(ExchangeStatus status, MessageExchange msgExchange); + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java new file mode 100644 index 000000000..c27c1f221 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java @@ -0,0 +1,36 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeListener.java + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface defines the notification mechanism with which the message exchange object received + * from the delivery channel is processed by the interesting parties. A particular service endpoint + * implementation would first register the implementation of this interface with MessageExchangeSupport + * to get the notification of a received message exchange on a particular service endpoint and the + * implementation of the interface would process the message exchange when notified. + * + * When the com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver receives the message exchange + * object, it asks the MessageExchangeSupport to notify the MessageExchangeLister that is registered for the + * received message exchange object to process the message exchange object. + * @see com.sun.jbi.sample.component.common.MessageExchangeSupport + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public interface MessageExchangeListener { + /** + * MessageExchangeSupport will call this method to notify the lister implementation that a + * message exchange is received from the delivery channel. + * @param me MessageExchange Object + */ + void messageExchangeReceived(ExchangeStatus status, MessageExchange me); +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java new file mode 100644 index 000000000..607146abd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeReceiver.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.JBIException; + +/** + * This interface provides the methods can controls the receiving and processing of the message + * exchange objects from the delivery channel during the component lifecycle operations. + * The implementation of this interface can use multi-threaded environment to receive and process + * message exchanges from the delivery channel during the component lifecycle. + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @author chikkala + */ +public interface MessageExchangeReceiver { + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + void initReceiver() throws JBIException; + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + void startProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + void stopProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + void shutdownReceiver() throws JBIException; + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java new file mode 100644 index 000000000..bddf9a8b1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java @@ -0,0 +1,170 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeSupport.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.xml.namespace.QName; + +/** + * This class supports the registering and unregistering MessageExchangeListeners and the + * MessageExchangeHandlers that can be used to process the received message exchange from a + * delivery channel. A global reference to this class will be created in RuntimeContext object to + * provide access to this class from any where in the component runtime. + * + * A ProviderEndpoint or ConsumerEndpoint interested in a MessageExchange received from a delivery + * channel for a particular service endpoint will register the MessageExchangeListener with this + * class. The DefaultMessageExchangeReceiver when received a message exchange object from the delivery + * channel uses MessageExchangeSupport.processMessageExchange method to notify the registered listener. + * + * The MessageExchangeListener implementation ( ProviderEndpoint or ConsumerEndpoint ) while processing + * received message ( messageExchangeReceived()) will create and register the message exchange handlers + * to process the message exchange. + * + * @see RuntimeContext${symbol_pound}getMessageExchangeSupport + * @see RuntimeHelper${symbol_pound}getMessageExchangeSupport + * @see DefaultMessageExchangeReceiver${symbol_pound}receiveAndProcessMessageExchange + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public class MessageExchangeSupport { + /** listener map to notify a message exchange received event */ + private Map mListeners; + /** handlers that can process the message exchange */ + private Map mHandlers; + /** Creates a new instance of MessageExchangeSupport */ + public MessageExchangeSupport() { + this.mListeners = Collections.synchronizedMap(new HashMap()); + this.mHandlers = Collections.synchronizedMap(new HashMap()); + } + /** + * generates key that will be used to store the MessageExchangeListener objects. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public String createListenerKey(Role role, QName interfaceName, QName serviceName, String endpointName) { + + StringBuffer strBuff = new StringBuffer(); + strBuff.append(interfaceName).append("+"); + strBuff.append(serviceName).append("+"); + strBuff.append(endpointName).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(role) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(role) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + /** + * adds message exchange listener who are interested in receiving the notification when the + * message exchange is received from delivery channel. The listener can be registered with the + * following combination of the parameters: (role,interfaceName,serviceName, endpointName), + * (role,interfaceName,null, null), (role, null,serviceName, endpointName), (role, null,serviceName, null) + * + * @param role role of the message exchange listener PROVIDER or CONSUMER - can not be null. + * @param interfaceName QName of the interface ( protType ) - can be null if the serviceName is not null + * @param serviceName QName of the service - can be null if interfaceName is not null. + * @param endpointName endpoint name of the service. - can be null if the serviceName is not null. + * @param listener MessageExchangeListener object + */ + public synchronized void addMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName, MessageExchangeListener listener) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + this.mListeners.put(key, listener); + } + /** + * removes any message exchange listener registered for the service endpoint specified by the serviceName and + * endpoint name. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public synchronized void removeMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + MessageExchangeListener listener = this.mListeners.remove(key); + if ( listener == null ) { + RuntimeHelper.getLogger().fine("No message exchange listener removed with key " + key); + } + } + /** + * finds the MessageExchangeListner registers for the endpoint for which the message exchange is + * received and call the method on the listener + */ + public boolean fireMessageExchangeReceived(ExchangeStatus status, MessageExchange me) { + boolean notified = false; + Role role = me.getRole(); + QName interfaceName = me.getInterfaceName(); + QName serviceName = me.getEndpoint().getServiceName(); + String endpointName = me.getEndpoint().getEndpointName(); + // lookup with complete service description ( role + interface + service + endpoint ) + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + MessageExchangeListener listener = this.mListeners.get(key); + + if ( listener == null ) { // lookup with role+interface name + key = createListenerKey(role, interfaceName, null, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with role + serviceName + endpointName + key = createListenerKey(role, null, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with with role + serviceName + key = createListenerKey(role, null, serviceName, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { + RuntimeHelper.getLogger().fine("Could not find listener for message exchange" + me); + notified = false; + } else { + listener.messageExchangeReceived(status,me); + notified = true; + } + return notified; + } + /** + * registers the MessageExchangeHandler implementation against the message exchange id. + * @param me MessageExchange for which the handler need to be assigned + * @param handler MessageExchangeHandler implementation that will be registers. + */ + public synchronized void addMessageExchangeHandler(MessageExchange me, MessageExchangeHandler handler) { + this.mHandlers.put(me.getExchangeId(), handler); + } + /** + * removes the MessageExchangeHandler for the particular message exchange object + */ + public synchronized void removeMessageExchangeHandler(MessageExchange me) { + MessageExchangeHandler handler = this.mHandlers.remove(me.getExchangeId()); + if ( handler == null ) { + RuntimeHelper.getLogger().fine("No MessageExchangeHandler found for removing " + me.getExchangeId()); + } + } + /** + * looks up the registered message exchange handler for the message exchange object + * @param me MessageExchangeHandler. + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(MessageExchange me) { + return this.mHandlers.get(me.getExchangeId()); + } + /** + * looks up the registered message exchange handler for the message exchange object with Id + * @param exchangeId message exchange object's id + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(String exchangeId) { + return this.mHandlers.get(exchangeId); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java new file mode 100644 index 000000000..be75c7b7d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java @@ -0,0 +1,176 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * RuntimeContext.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; + +/** + * This class is global context for all the component runtime to store and + * retrieve the information that should be available anywhere in the component runtime. + * + * Each instance variable of this class will be initialized at various points of the + * component runtime using setter methods on this class. + * + * The two important objects that will be initialized and available from this context are + * ComponentContext and the opened DeliveryChannel objects both of which will be set from the + * implementation {@link BasicComponentLifeCycle}. + * + * Note that the ComponentContext from this global context will not be available until + * the jbi framework calls the init method of the ComponentLifeCycle of the component and + * then intern the implementation of the init method sets the context. + * + * @see BasicComponentLifeCycle${symbol_pound}initGlobalContext + * @see BasicComponentLifeCycle${symbol_pound}openDeliveryChannel + * @see BasicComponentLifeCycle${symbol_pound}closeDeliveryChannel + * @author chikkala + */ +public final class RuntimeContext { + /** RuntimeContext singleton instance */ + private static RuntimeContext sRuntimeContext; + /** default logger*/ + private Logger mDefLogger; + /** Logger object. */ + private Logger mLogger; + /** Holds value of property ComponentContext. */ + private ComponentContext mComponentContext; + /** Holds value of property DeliveryChannel. */ + private DeliveryChannel mDeliveryChannel; + /** MessageExchange processing support **/ + private MessageExchangeSupport mMESupport; + + /** outside code can not instantiate RuntimeContext */ + private RuntimeContext() { + } + /** + * @return RuntimeContext instance. + */ + public static RuntimeContext getInstance() { + if ( sRuntimeContext == null ) { + synchronized (RuntimeContext.class) { + if ( sRuntimeContext == null ) { + sRuntimeContext = new RuntimeContext(); + } + } + } + return sRuntimeContext; + } + /** + * Getter for to obtaining ComponentContext from any where in the component runtime. + * @return ComponentContext. + */ + public ComponentContext getComponentContext() { + return this.mComponentContext; + } + /** + * Sets the Component context reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle${symbol_pound}initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle${symbol_pound}initContext + * for details. + * @param componentContext New value of property ComponentContext. + * @see BasicComponentLifeCycle${symbol_pound}initGlobalContext + */ + public void setComponentContext(ComponentContext componentContext) { + if ( this.mComponentContext != null ) { + (new IllegalStateException("Component Context already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mComponentContext = componentContext; + } + /** + * Getter for obtaining opened delivery channel from any where in the component runtime. + * @return DeliveryChannel. + */ + public DeliveryChannel getDeliveryChannel() { + return this.mDeliveryChannel; + } + /** + * Sets the opened delivery channel reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle${symbol_pound}initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle${symbol_pound}initContext + * for details. + * + * @param componentContext New value of property ComponentContext. + */ + public void setDeliveryChannel(DeliveryChannel deliveryChannel) { + if ( deliveryChannel != null && this.mDeliveryChannel != null ) { + (new IllegalStateException("Delivery Channel already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mDeliveryChannel = deliveryChannel; + } + /** + * Sets the logger. + * + * @param name name for the Logger. + * @param resourceBundle resource bundle for the logger. can be null. + */ + public void setLogger(String name, String resourceBundle) { + + if (this.mComponentContext != null) { + // get the logger from component context if the component context is not null + try { + this.mLogger = this.mComponentContext.getLogger(name, resourceBundle); + } catch (Exception ex) { + ex.printStackTrace(); + } + } else { + this.mDefLogger = Logger.getLogger(name, resourceBundle); + } + } + /** + * Returns the logger. + * + * @return Logger + */ + public Logger getLogger() { + + // try init logger + if (this.mLogger == null && this.mComponentContext != null ) { + try { + this.mLogger = + this.mComponentContext.getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mLogger != null) ? this.mLogger : this.mDefLogger; + } + /** + * Returns the Component Name if the ComponentContext is set. else null + * @return component name + */ + public String getComponentName() { + String componentName = null; + if (this.mComponentContext != null) { + componentName = this.mComponentContext.getComponentName(); + } + return componentName; + } + /** + * Global MessageExchangeSupport reference. Various classes in the common + * component runtime would use this method to obtain the MessageExchangeSupport + * for processing message exchange objects received from delivery channel. + */ + public MessageExchangeSupport getMessageExchangeSupport() { + if ( this.mMESupport == null ) { + this.mMESupport = new MessageExchangeSupport(); + } + return this.mMESupport; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java new file mode 100644 index 000000000..f12c2b2f4 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java @@ -0,0 +1,360 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * RuntimeHelper.java + */ + +package net.openesb.component.${artifactId}.common; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * This is a helper class that have bunch of methods for xml processing. + * @author chikkala + */ +public class RuntimeHelper { + + public static Logger getLogger() { + return RuntimeContext.getInstance().getLogger(); + } + + public static void logWarning(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.WARNING, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().warning(logObj.toString()); + } + } + + public static void logError(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.SEVERE, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().severe(logObj.toString()); + } + } + + public static void logDebug(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.FINER, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().finer(logObj.toString()); + } + } + + public static String getComponentName() { + return RuntimeContext.getInstance().getComponentName(); + } + public static ComponentContext getComponentContext() { + return RuntimeContext.getInstance().getComponentContext(); + } + public static DeliveryChannel getDeliveryChannel() { + return RuntimeContext.getInstance().getDeliveryChannel(); + } + + public static MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeContext.getInstance().getMessageExchangeSupport(); + } + + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(Reader xmlReader) throws Exception { + InputSource xmlSource = new InputSource(xmlReader); + return buildDOMDocument(xmlSource); + } + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(InputSource xmlSource) throws Exception { + Document xmlDoc = null; + DocumentBuilderFactory docBuilderFactory = + DocumentBuilderFactory.newInstance(); + docBuilderFactory.setValidating(false); + docBuilderFactory.setNamespaceAware(true); + DocumentBuilder docBuilder = + docBuilderFactory.newDocumentBuilder(); + docBuilder.setErrorHandler( new DefaultHandler() { + public void fatalError(SAXParseException e) + throws SAXException { + throw new SAXException(e.getMessage()); + } + }); + + docBuilder.setEntityResolver(new EntityResolver() { + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + StringReader reader = + new StringReader(""); // NOI18N + InputSource source = new InputSource(reader); + source.setPublicId(publicId); + source.setSystemId(systemId); + return source; + } + }); + + xmlDoc = docBuilder.parse(xmlSource); + + return xmlDoc; + } + /** + * reads xml text from DOMSource to StringBuffer + */ + public static StringBuffer readFromDOMSource(DOMSource domSource) { + + StringWriter writer = new StringWriter(); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer trans = null; + try { + trans = tFactory.newTransformer(); + trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, + "yes"); + trans.setOutputProperty(OutputKeys.INDENT, "yes"); + StreamResult result = new StreamResult(writer); + trans.transform(domSource, result); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads the xml text from InputSource into a StringBuffer + */ + public static StringBuffer readFromInputSource(InputSource inSource) { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + InputStream inStream = inSource.getByteStream(); + Reader reader = inSource.getCharacterStream(); + if ( reader == null ) { + reader = new InputStreamReader(inStream); + } + BufferedReader buff = new BufferedReader(reader); + try { + + for ( String line = null; (line = buff.readLine()) != null ; ) { + out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads xml from from DOM, SAX or Stream Source into a string buffer + */ + public static StringBuffer readFromSource(Source source) { + if ( source instanceof DOMSource ) { + return readFromDOMSource((DOMSource)source); + } else { + InputSource inSource = SAXSource.sourceToInputSource(source); + if ( inSource != null ) { + return readFromInputSource(inSource); + } else { + return null; + } + } + } + /** + * creates a DOMSource from the xml text read from the reader. + */ + public static DOMSource createDOMSource(Reader xmlReader) { + Document doc = null; + try { + doc = buildDOMDocument(xmlReader); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * creates a DOMSource from any source. If the source itself is DOMSource, + * the source is returned as it is as DOMSource. + */ + public static DOMSource sourceToDOMSource(Source source) { + if ( source instanceof DOMSource) { + return (DOMSource) source; + } + InputSource xmlSource = SAXSource.sourceToInputSource(source); + Document doc = null; + try { + doc = buildDOMDocument(xmlSource); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * converts the ex stracktrace to string. + */ + public static StringBuffer getExceptionStackTrace(Exception ex) { + StringWriter strWriter = new StringWriter(); + if ( ex != null ) { + PrintWriter out = new PrintWriter(strWriter); + ex.printStackTrace(out); + } + return strWriter.getBuffer(); + } + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsXmlText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + String exXmlText = + "" + + "" + message + "" + + "" + stackTrace + "" + + "" ; + return exXmlText; + } + + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + StringBuffer buff = new StringBuffer(); + buff.append(message); + buff.append(System.getProperty("line.separator", "${symbol_escape}n")); + buff.append(stackTrace); + return buff.toString(); + } + + + /** + * For attribute values which denote a QName, i.e. include a namespace prefix, + * resolve the value into a QName. + * If a namespace can not be resolved, it is set to empty - it does not + * result in an exception + * @param attrValue the string value of the attribute + * @param element the element the attribute belongs to + */ + public static QName resolveAttrQName(String attrValue, Element element) { + int aColonLoc = attrValue.indexOf(":"); + String aLocalName = attrValue; + String aPrefix = null; + String aNS = null; + if (aColonLoc > -1) { + aPrefix = attrValue.substring(0, aColonLoc); + aLocalName = attrValue.substring(aColonLoc + 1); + + // Traverse up the hierarchy until a namespace definition is found + // or the top of the document is reached. + Node currNode = element; + while ((aNS == null || aNS.equals("")) && currNode != null) { + if (currNode.getNodeType() == Node.ELEMENT_NODE) { + aNS = ((Element) currNode).getAttribute("xmlns:" + aPrefix); + } + currNode = currNode.getParentNode(); + } + } + + QName qName = new QName(aNS, aLocalName, aPrefix); + + return qName; + } + + /** + * replaces the xml entity references with the xml escape chars + * @param xmlString Text with the xml escape chars + * @param Text with the xml entity references + */ + public static String replaceXmlEscapeCharsToEntityRefereces(String xmlString) { + if ( xmlString == null ) { + return xmlString; + } + + // just convert < , > and & only + StringBuffer sbuff = new StringBuffer(2 * xmlString.length()); + for ( int i = 0; i < xmlString.length(); ++i ) { + switch ( xmlString.charAt(i) ) { + case '&': sbuff.append("&"); + break; + case '<': sbuff.append("<"); + break; + case '>': sbuff.append(">"); + break; + default: sbuff.append( xmlString.charAt(i) ); + } + } + return sbuff.toString(); + } + + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + + public static Element getElement(DOMSource domSource) { + return getElement(domSource.getNode()); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java new file mode 100644 index 000000000..fd0fc4f79 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java @@ -0,0 +1,312 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractServiceUnitManager.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.management.DeploymentException; + +/** + * This is an abstract class that implements {@link javax.jbi.component.ServiceUnitManager} to provide a + * service unit deployment support for the component. The implementation supported by this service + * unit manager and related classes in this package provides WSDL1.1 based service unit deployment + * in the component. + * + * @see javax.jbi.component.ServiceUnitManager + * @see ServiceUnit + * + * @author chikkala + */ +public abstract class AbstractServiceUnitManager implements ServiceUnitManager { + + /** Map of ServiceUnit Name to the ServiceUnit Object for all the service units + * deployed in the component */ + private Map mSUMap; + + /** Creates a new instance of AbstractSUManager */ + protected AbstractServiceUnitManager() { + this.mSUMap = Collections.synchronizedMap(new HashMap()); + } + /** returns the component name + * @return component name. + */ + protected abstract String getComponentName(); + /** + * @return Logger + */ + protected abstract Logger getLogger(); + /** + * returns the creation of the ServiceUnit implementation specific to the service unit deployment + * for the component. + * @param suName service unit name + * @param suRootPath service unit root path + * @param concrete implementation of the ServiceUnit class. + */ + protected abstract ServiceUnit createServiceUnit(String suName, String suRootPath) + throws DeploymentException; + /** + * returns the service unit object deployed by the specified name. or null if not deployed. + * @param suName service unit name to look for + * @param ServiceUnit object for the suName. or null if not present. + */ + private ServiceUnit getServiceUnit(String suName) { + return this.mSUMap.get(suName); + } + /** + * lookup for the deployed service unit. If not there, throws a deployment exception. + * @param suName service unit name + * @return ServiceUnit object + * @throws DeploymentException if the service unit is not present. + */ + private ServiceUnit findServiceUnit(String suName) throws DeploymentException { + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return serviceUnit; + } + /** + * add the service unit object to the list of deployed service units. if there is already a + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is added. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit addServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + this.mSUMap.put(suName, su); + return su; + } + /** + * removes service unit object from the list of deployed service units. if there is no + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is being removed. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit removeServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return this.mSUMap.remove(suName); + } + /** + * creates the concrete service unit implementation and calls the load method on it to initialize + * the created service unit. + * @param suName service unit name to create + * @param suRootPath service unit root path. + * @return ServiceUnit that is created and loaded. + */ + private ServiceUnit loadServiceUnit(String suName, String suRootPath) throws DeploymentException { + ServiceUnit serviceUnit = createServiceUnit(suName, suRootPath); + serviceUnit.doLoad(); + return serviceUnit; + } + /** + * deploys a service unit. it creates and loads the service unit object for the suName and then call + * doDeploy on the service unit and adds it to the deployed service unit list + * @return result as jbi management xml + * @throws DeploymentException if there is an error deploying. + */ + private synchronized String deployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + ServiceUnit serviceUnit = loadServiceUnit(suName, suRootPath); + serviceUnit.doDeploy(); + addServiceUnit(serviceUnit); + return result; + } + /** + * Deploy a Service Unit to the component. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}deploy(String, String); + */ + public final String deploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Deploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully deployed service unit " + suName; + Exception errEx = null; + try { + deployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to deploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, ex); + } + return createComponentTaskResultXML(compName, "deployTask", isSuccess, mainMsg, errEx); + } + + /** + * undeploys the service unit. it looks up the existing deployed service unit and call doUndeploy + * on it and then removes from the deployed service unit list. + */ + private synchronized String undeployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit serviceUnit = findServiceUnit(suName); + serviceUnit.doUndeploy(); + removeServiceUnit(serviceUnit); + return result; + } + /** + * Undeploy a service unit from the component. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}undeploy(String, String); + */ + public final String undeploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Undeploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully undeployed service unit " + suName; + Exception errEx = null; + try { + undeployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to undeploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, errEx); + } + return createComponentTaskResultXML(compName, "undeployTask", isSuccess, mainMsg, errEx); + } + /** + * Initialize the given deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}init(String, String); */ + public final void init(String suName, String suRootPath) + throws DeploymentException { + this.getLogger().fine("Initializing service unit " + suName + " with suRootPath " + suRootPath); + String result = suName; + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { // if the service unit not exists, create and add + serviceUnit = loadServiceUnit(suName, suRootPath); // create and load service unit + addServiceUnit(serviceUnit); // add service unit to existing service units + } + serviceUnit.doInit(); // Do Service unit initialization tasks + this.getLogger().fine("Service unit initialized:" + suName); + } + /** + * Shut down the deployment. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}shutdown(String); + */ + public final void shutDown(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doShutdown(); // Do Service unit shutdown tasks + this.getLogger().fine("Service unit shut down:" + suName); + } + /** + * Start the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}start(String); + */ + public final void start(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStart(); // Do service unit start tasks. + this.getLogger().fine("Service unit started:" + suName ); + } + /** + * Stop the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}stop(String); + */ + public final void stop(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStop(); // do service unit stop tasks + this.getLogger().fine("Service unit stopped: " + suName + " stopped."); + } + + /** + * helper method to create result message as jbi management message xml. + * @param componentName name of the component for this xml. + * @param taskId task id + * @param isSuccess true to format a success result, false to format a failed result. + * @param mainMsg main result message + * @param errEx Exception, null if there is no exception in failure message. + * @return XML string. + */ + protected static String createComponentTaskResultXML( + String componentName, String taskId, boolean isSuccess, String mainMsg, Exception errEx ) { + + String exMsgXml = getComponentTaskResultExceptionXML(errEx); + String mainMsgXmlEsc = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces(mainMsg); + String taskResult = isSuccess ? "SUCCESS" : "FAILED"; + String msgType = isSuccess ? "INFO" : "ERROR"; + + String xmlResult = + "" + + " " + componentName + "" + + " " + + " " + + " " + taskId + "" + + " " + taskResult + "" + + " " + msgType + "" + + " " + + " " + + " SU_MGR_MSG_ID" + + " " + mainMsgXmlEsc + "" + + " " + + " " + + exMsgXml + + " " + + " " + + ""; + + return xmlResult; + } + /** + * converts the exception to the jbi management message xml chunk. + */ + private static String getComponentTaskResultExceptionXML(Exception errEx) { + StringBuffer exMsgBuff = new StringBuffer(); + if ( errEx == null ) { + return exMsgBuff.toString(); // empty string. + } + + List exList = new ArrayList(); + int exLevel = 0; + for ( Throwable cause = errEx ; cause != null ; cause = cause.getCause() ) { + String causeMsg = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + cause.getMessage()); + StringWriter stBuff = new StringWriter(); + PrintWriter stOut = new PrintWriter(stBuff); + StackTraceElement[] stList = cause.getStackTrace(); + for (StackTraceElement stEl : stList) { + stOut.println(stEl.toString()); + } + stOut.close(); + String causeStackTrace = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + stBuff.getBuffer().toString()); + + exMsgBuff.append(""); + exMsgBuff.append(" " + exLevel + ""); + exMsgBuff.append(" " + "SU_MGR_EXP_ID"); + exMsgBuff.append(" " + causeMsg + ""); + exMsgBuff.append(" "); + exMsgBuff.append(" " + causeStackTrace + ""); + exMsgBuff.append(""); + ++exLevel; + } + + return exMsgBuff.toString(); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java new file mode 100644 index 000000000..e9537ca9e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java @@ -0,0 +1,208 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ConsumerEndpoint.java + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.messaging.MessageExchangeFactory; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service consumer. {@link ServiceUnit${symbol_pound}createConsumerEndpoint} creates the object of this + * type to implement the service consumer functionality. + * + * @see ServiceUnit${symbol_pound}createConsumerEndpoint + * @author chikkala + */ + +public class ConsumerEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with CONSUMER role and makes sure that the service + * description passed to it is of consumer description. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(Role.CONSUMER, consumes, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef) { + this(consumes, wsdlDef, null); + } + public final void init() throws JBIException { + getLogger().fine("ConsumerEndpoint: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + public final void activate() throws JBIException { + getLogger().fine("ConsumerEndpoint: activate called"); + //1. do common ativation tasks. + doActivate(); //2. do any other activation related tasks. + } + + public final void deactivate() throws JBIException { + getLogger().fine("ConsumerEndpoint: deactivate called"); + //1. do common deactivation tasks. + doDeactivate(); //2. do any other deactivation related tasks. + } + + public final void clean() throws JBIException { + getLogger().fine("ConsumerEndpoint: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + + /** + * helper method to find the active ServiceEndpiont for the service described with the + * serviceDescriptor. This method looks for the Active ServiceEndpoint using interface or + * service name or service name and the endpoint name. + */ + public ServiceEndpoint findServiceEndpoint() { + + QName serviceType = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + + ServiceEndpoint [] refs = null; + ServiceEndpoint serviceEndpoint = null; + ComponentContext compContext = this.getComponentContext(); + + if ( compContext == null ) { + this.getLogger().info("Null Component context. Can not find ServiceEndpoint"); + return null; + } + // lookup ServiceEndpiont with concrete service(serice qname + endpoint name). + if ( serviceName != null && endpointName != null ) { + this.getLogger().info("Looking for ServiceEndpoint with:" + + " ServiceName: " + serviceName + " EndpointName: " + endpointName); + serviceEndpoint = compContext.getEndpoint(serviceName, endpointName); + } + // else lookup ServiceEndpiont with Service Name + if ( serviceEndpoint == null && serviceName != null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service name: " + serviceName); + refs = compContext.getEndpointsForService(serviceName); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + // else lookup ServiceEndpont with serviceType + if ( serviceEndpoint == null && serviceType != null && + serviceName == null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service type: " + serviceType); + refs = compContext.getEndpoints(serviceType); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + + return serviceEndpoint; + } + + /** + * this method creates a InOutMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOut createInOutMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for ${symbol_escape}n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOut inOutME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOutME = factory.createInOutExchange(); + // set operation + inOutME.setOperation(operation); + // set interface if that is not set + if ( inOutME.getInterfaceName() == null ) { + inOutME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOutME.createMessage(); + // set IN Normalized message on message exchange + inOutME.setInMessage(inMsg); + + return inOutME; + } + + /** + * this method creates a InOnlyMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOnly createInOnlyMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for ${symbol_escape}n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOnly inOnlyME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOnlyME = factory.createInOnlyExchange(); + // set operation + inOnlyME.setOperation(operation); + // set interface if that is not set + if ( inOnlyME.getInterfaceName() == null ) { + inOnlyME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOnlyME.createMessage(); + // set IN Normalized message on message exchange + inOnlyME.setInMessage(inMsg); + + return inOnlyME; + } + + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java new file mode 100644 index 000000000..359114ed2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java @@ -0,0 +1,289 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * Endpoint.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.MessageExchangeHandler; +import net.openesb.component.${artifactId}.common.MessageExchangeListener; +import net.openesb.component.${artifactId}.common.MessageExchangeSupport; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; + +/** + * This is an abstract class that represents the Endpoint defined for service provisioning or + * consumption in a jbi component. It stores the required service description ( wsdl definition, + * role, service unit to which it belongs etc) and defines the lifecycle operations {@link ${symbol_pound}init}, + * {@link ${symbol_pound}activate}, {@link ${symbol_pound}deactivate}, {@link ${symbol_pound}clean} to control a service endpoint that + * provides or consumes the service. + *

+ * Extended classes implement the abstract methods defined in this class to implement the endpoint + * functionality by providing the functionality to process the deployment artifacts specific to this + * endpoint, configure the endpoint to send/receive messages to/from delivery channel and process them + * according to the specific service implementation. + * + * @author chikkala + */ +public abstract class Endpoint { + /** Role of this endpoint. CONSUMER or PROVIDER */ + private Role mRole; + /** Service description from the SU descriptor for which this endpoint is configured */ + private SUDescriptor.Service mService; + /** WSDL definition corresponding to this endpoint */ + private Definition mWsdlDef; + /** service endpoint corresponding to this endpoint */ + private ServiceEndpoint mServiceEndpoint; + /** service unit from which this endpoint is created */ + private ServiceUnit mSU; // can be null + /** private constructor to force extended classes to use the parameterized constructor */ + private Endpoint() { + } + /** Creates a new instance of Endpoint + * @param role CONSUMER or PRVODER role. + * @param service service description from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + * @param su service unit object which created this endpoint. + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl, ServiceUnit su) { + this.mService = service; + this.mRole = role; + this.mWsdlDef = wsdl; + this.mSU = su; + } + /** Creates a new instance of Endpoint without service unit. may be useful for static endpoints that + * are not part of the deployment + * @param role CONSUMER or PRVODER role. + * @param service service info from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl) { + this(role, service, wsdl, null); + } + /** + * should be called to initialize any resources related to this endpoint object + * throws JBIException + */ + public abstract void init() throws JBIException; + /** + * activates the endpoint to send/receive messages + * throws JBIException + */ + public abstract void activate() throws JBIException; + /** + * deactivates the endpoint + * throws JBIException + */ + public abstract void deactivate() throws JBIException; + /** + * clean endpoint + * throws JBIException + */ + public abstract void clean() throws JBIException; + + public final Role getRole() { + return this.mRole; + } + public final boolean isProvider() { + return (Role.PROVIDER.equals(this.getRole())); + } + public final boolean isConsumer() { + return (Role.CONSUMER.equals(this.getRole())); + } + public final Definition getWSDL() { + return this.mWsdlDef; + } + public final SUDescriptor.Service getService() { + return this.mService; + } + public final ServiceEndpoint getServiceEndpoint() { + return this.mServiceEndpoint; + } + protected final void setServiceEndpoint(ServiceEndpoint svcEP) { + this.mServiceEndpoint = svcEP; + } + public final ServiceUnit getServiceUnit() { + return this.mSU; + } + /** + * generates an ID that would uniquely identify this endpoint implementation. Use as a key to map + * any information to store that is related to this endpoint. + */ + public final String getID() { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(this.mService.getInterface()).append("+"); + strBuff.append(this.mService.getServiceName()).append("+"); + strBuff.append(this.mService.getEndpointName()).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(this.mRole) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(this.mRole) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + + @Override + public String toString() { + return "Endpoint : " + "${symbol_escape}n" + this.mService; + } + /** + * checks if this endpoint is configured for the binding component or service engine. + */ + public boolean isForBindingComponent() { + boolean isForBindingComponent = false; + if ( this.mSU != null ) { + try { + isForBindingComponent = this.mSU.getSUDescriptor().isForBindingComponent(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + return isForBindingComponent; + } + + public QName getOperationQName(String opName) { + return new QName(this.getService().getInterface().getNamespaceURI(), opName); + } + + public Operation getWSDLOperation(QName opQName) { + String opName = null; + if ( opQName != null ) { + opName = opQName.getLocalPart(); + } + Operation operation = WSDLProcessor.findOperation(this.getWSDL(), + this.getService().getInterface(), opName); + return operation; + } + + public Binding getWSDLBinding() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + if ( serviceName != null ) { + return WSDLProcessor.findServiceBinding(this.getWSDL(), serviceName, endpointName); + } else { + return WSDLProcessor.findInterfaceBinding(this.getWSDL(), interfaceName, null); + } + } + /** @return logger */ + public Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** @return ComponentContext */ + public ComponentContext getComponentContext() { + return RuntimeHelper.getComponentContext(); + } + /** @return DeliveryChannel */ + public DeliveryChannel getDeliveryChannel() { + return RuntimeHelper.getDeliveryChannel(); + } + /** + * helper function to get the MessageExchangeSupport object + */ + public MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + public MessageExchangeHandler createMessageExchangeHandler() { + return null; + } + /** + * creates the message exchange listener. Extended classes should return + * MessageExchangeListener implementation. + * @return MessageExchangeListener or null. + * + */ + protected MessageExchangeListener createMessageExchangeListener() { + return null; + } + /** + * Creates and adds message exchange listener to receive message exchange received notification. + */ + protected void addMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeListener meListener = createMessageExchangeListener(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null && meListener != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName, meListener); + if ( serviceName != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), null, serviceName, endpointName, meListener); + } + } + } + /** + * Removes message exchange listener from the MessageExchangeSupport. + */ + protected void removeMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName); + if ( serviceName != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), null, serviceName, endpointName); + } + } + } + + public final boolean processMessageExchangeWithHandler(ExchangeStatus status, MessageExchange me) { + + //1. lookup handler + //2. if not there create one and register + //3. call process message exchange on it + //4. check status. if that is the end, remove the handler + + MessageExchangeSupport support = this.getMessageExchangeSupport(); + if ( support == null ) { + getLogger().fine("No MessageExchangeSupport present"); + return false; + } + MessageExchangeHandler handler = support.findMessageExchangeHandler(me); + if ( handler == null ) { + handler = this.createMessageExchangeHandler(); + if ( handler == null ) { + getLogger().fine("MessageExchangeHandler not supported"); + return false; + } + support.addMessageExchangeHandler(me, handler); + } + + handler.processMessageExchange(status, me); + + getLogger().fine("XXX MX Handler processed ME with STATUS: " + status); + + if (!ExchangeStatus.ACTIVE.equals(status) ) { + // DONE or ERROR means done with the me. + getLogger().fine("End of ME processing. STATUS: " + status + + ". Removing the MX Handler ..."); + support.removeMessageExchangeHandler(me); + } + + return true; + } + +} + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java new file mode 100644 index 000000000..4bd932fc1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java @@ -0,0 +1,107 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderEndpoint.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Service; +import javax.jbi.JBIException; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service provider. {@link ServiceUnit${symbol_pound}createProviderEndpoint} creates the object of this + * type to implement the service provider functionality. It makes sure that this class or the extended + * classes will activate or deactivate the ServiceEndpoint corresponding to the service + * provided by the endpoint is performed during the activate and deactivate method calls as part of the + * endpoint lifecycle. + * + * @see ServiceUnit${symbol_pound}createProviderEndpoint + * @author chikkala + */ + +public class ProviderEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with PROVIDER role and makes sure that the service + * description passed to it is of provider description. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(Role.PROVIDER, provides, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef) { + this(provides, wsdlDef, null); + } + /** + * initializes the endpoint and creates and registers the MessageExchangeListener with + * MessageExchangeSupport. + */ + public final void init() throws JBIException { + getLogger().fine("ProviderEndpiont: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + /** + * calls activatesServiceEndpoint for the Provider. + */ + public final void activate() throws JBIException { + getLogger().fine("ProviderEndpiont: activate called"); + activateServiceEndpoint(); //1. activate service endpoint in NMR + doActivate(); //2. do any other activation related tasks. + } + /** + * calls deactivateServiceEndpoint for the Provider. + */ + public final void deactivate() throws JBIException { + getLogger().fine("ProviderEndpiont: deactivate called"); + deactivateServiceEndpoint(); //1. deactivates the service endpoint in NMR + doDeactivate(); //2. do any other deactivation related tasks. + } + /** + * removes the message exchange listener. cleans up other resources + */ + public final void clean() throws JBIException { + getLogger().fine("ProviderEndpiont: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + /** + * Activates the ServiceEndpoint with NMR + */ + private void activateServiceEndpoint() throws JBIException { + Service service = this.getService(); + ServiceEndpoint svcEP = this.getComponentContext().activateEndpoint( + service.getServiceName(), service.getEndpointName()); + this.setServiceEndpoint(svcEP); + } + /** + * Deactivates ServiceEndpoint in NMR + */ + private void deactivateServiceEndpoint() throws JBIException { + this.getComponentContext().deactivateEndpoint(this.getServiceEndpoint()); + this.setServiceEndpoint(null); + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java new file mode 100644 index 000000000..1919647be --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java @@ -0,0 +1,364 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SUDescriptor.java + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import javax.jbi.management.DeploymentException; +import javax.xml.namespace.QName; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * This interface represent the service unit descriptor (jbi.xml) model. This will be used in + * ServiceUnit implementation to find the services provided and consumed by this service unit. + * {@link SUDescriptorFactory${symbol_pound}getSUDescriptor} method reads the jbi.xml in the service unit to + * to the implementation of this interface. + * + * @see SUDescriptorFactory + * @see Consumes + * @see Provides + * @see ServiceUnit + * + * @author chikkala + */ +public interface SUDescriptor { + + Collection getProvidedServices(); + + Collection getConsumedServices(); + + boolean isForBindingComponent(); + + /** + * base interface that models the service information described in the service unit descriptor for + * consumed services and provided services. + */ + public interface Service { + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + QName getInterface(); + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + QName getServiceName(); + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + String getEndpointName(); + } + /** + * marker interface that represents the provided services in the service unit + */ + public interface Provides extends Service { + } + /** + * this interface represents the consumed service information in the su descriptor. + */ + public interface Consumes extends Service { + + public final static String STANDARD_LINK = "standard"; + public final static String SOFT_LINK = "soft"; + public final static String HARD_LINK = "hard"; + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + String getLinkType(); + } + /** + * This is a factory class that can build the Service Unit Descriptor model from the jbi.xml + */ + public static class SUDescriptorFactory { + + protected final static String JBI_TAG_NAME = "services"; + protected final static String SERVICES_TAG_NAME = "services"; + protected final static String BC_TAG_NAME = "binding-component"; + protected final static String PROVIDES_TAG_NAME = "provides"; + protected final static String CONSUMES_TAG_NAME = "consumes"; + protected final static String INTERFACE_TAG_NAME = "interface-name"; + protected final static String SERVICE_TAG_NAME = "service-name"; + protected final static String ENDPOINT_TAG_NAME = "endpoint-name"; + protected final static String LINK_TYPE_TAG_NAME = "link-type"; + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(String jbiXmlPath) throws Exception { + FileReader reader = null; + try { + reader = new FileReader(jbiXmlPath); + SUDescriptor suDesc = getSUDescriptor(reader); + return suDesc; + } finally { + if ( reader != null ) { + try { + reader.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(Reader reader) throws Exception { + SUDescriptor suDescriptor = null; + Document suDescDoc = RuntimeHelper.buildDOMDocument(reader); + Element jbiEl = suDescDoc.getDocumentElement(); + if (JBI_TAG_NAME.equals(jbiEl.getTagName())) { + throw new DeploymentException("Invalid service unit descriptor : no jbi root element"); + } + + NodeList servicesNL = jbiEl.getElementsByTagName(SERVICES_TAG_NAME); + if (servicesNL != null && servicesNL.getLength() == 1) { + Element servicesEl = (Element) servicesNL.item(0); + suDescriptor = SUDescriptorImpl.createSUDescriptor(servicesEl); + } else { + throw new DeploymentException("Invalid service unit descriptor : invalid services element"); + } + + return suDescriptor; + } + + } + /** + * This class implements SUDescriptor + */ + public static class SUDescriptorImpl implements SUDescriptor { + + private List mConsumedList; + private List mProvidedList; + private boolean mIsForBindingComponent; + + protected SUDescriptorImpl(boolean isForBindingComponent) { + this.mIsForBindingComponent = isForBindingComponent; + this.mConsumedList = new ArrayList(); + this.mProvidedList = new ArrayList(); + } + + protected void addProvidedService(Provides provides) { + this.mProvidedList.add(provides); + } + + protected void addConsumedService(Consumes consumes) { + this.mConsumedList.add(consumes); + } + + public Collection getProvidedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mProvidedList); + } + + public Collection getConsumedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mConsumedList); + } + + public boolean isForBindingComponent() { + return this.mIsForBindingComponent; + } + + protected static SUDescriptor createSUDescriptor(Element servicesEl) throws Exception { + boolean isForBC = false; + String bcTagString = servicesEl.getAttribute(SUDescriptorFactory.BC_TAG_NAME); + isForBC = Boolean.valueOf(bcTagString).booleanValue(); + SUDescriptorImpl suDesc = new SUDescriptorImpl(isForBC); + // add consumes + NodeList consumesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.CONSUMES_TAG_NAME); + for ( int i=0; i < consumesNL.getLength(); ++i) { + Element consumesEl = (Element) consumesNL.item(i); + Consumes consumes = ConsumedService.createConsumedService(consumesEl); + suDesc.addConsumedService(consumes); + } + // add provides + NodeList providesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.PROVIDES_TAG_NAME); + for ( int i=0; i < providesNL.getLength(); ++i) { + Element providesEl = (Element) providesNL.item(i); + Provides provides = ProvidedService.createProvidedService(providesEl); + suDesc.addProvidedService(provides); + } + + return suDesc; + } + } + /** + * Base class that implements the Service interface + */ + public static abstract class AbstractService implements Service { + + private QName mInterface; + private QName mServiceName; + private String mEndpointName; + + private AbstractService() { + } + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + public QName getInterface() { + return this.mInterface; + } + + /** + * Setter for property interfaceQName. + * @param interfaceQName New value of property interfaceQName. + */ + protected void setInterface(QName interfaceQName) { + this.mInterface = interfaceQName; + } + + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + public QName getServiceName() { + return this.mServiceName; + } + + /** + * Setter for property serviceName. + * @param serviceName New value of property serviceName. + */ + protected void setServiceName(QName serviceName) { + this.mServiceName = serviceName; + } + + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + public String getEndpointName() { + return this.mEndpointName; + } + + /** + * Setter for property endpointName. + * @param endpointName New value of property endpointName. + */ + protected void setEndpointName(String endpointName) { + this.mEndpointName = endpointName; + } + + } + /** + * This class implements the Provides interface + */ + public static class ProvidedService + extends AbstractService + implements Provides { + protected ProvidedService(QName interfaceQName, QName serviceName, String endpointName) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + } + + @Override + public String toString() { + return "Provides :" + + "${symbol_escape}n${symbol_escape}t interface-name= " + getInterface() + + "${symbol_escape}n${symbol_escape}t service-name= " + getServiceName() + + "${symbol_escape}n${symbol_escape}t endpont-name= " + getEndpointName(); + } + + protected static Provides createProvidedService(Element providesEl) throws Exception { + + String ifName = providesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = providesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = providesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + if ( ifName == null || serviceName == null || endpointName == null ) { + throw new Exception("Invalid provides element: missing " + SUDescriptorFactory.INTERFACE_TAG_NAME + + " or " + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, providesEl); + QName serviceQName = RuntimeHelper.resolveAttrQName(serviceName, providesEl); + + return new ProvidedService(ifQName, serviceQName, endpointName); + } + } + /** + * This class implements the Consumes interface. + */ + public static class ConsumedService + extends AbstractService + implements Consumes { + private String mLinkType; + protected ConsumedService(QName interfaceQName, + QName serviceName, String endpointName, String linkType) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + this.mLinkType = linkType; + } + + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + public String getLinkType() { + return this.mLinkType; + } + + @Override + public String toString() { + return "Cosumes :" + + "${symbol_escape}n${symbol_escape}t interface-name= " + getInterface() + + "${symbol_escape}n${symbol_escape}t service-name= " + getServiceName() + + "${symbol_escape}n${symbol_escape}t endpont-name= " + getEndpointName() + + "${symbol_escape}n${symbol_escape}t link-type= " + getLinkType(); + } + + protected static Consumes createConsumedService(Element consumesEl) throws Exception { + + String ifName = consumesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = consumesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = consumesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + String linkType = consumesEl.getAttribute(SUDescriptorFactory.LINK_TYPE_TAG_NAME); + if ( linkType == null || linkType.trim().length() == 0 ) { + linkType = STANDARD_LINK; + } + + if ( ifName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.INTERFACE_TAG_NAME ); + } + if ( serviceName == null || endpointName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, consumesEl); + QName serviceQName = null; + if ( serviceName != null ) { + serviceQName = RuntimeHelper.resolveAttrQName(serviceName, consumesEl); + } + if ( serviceQName != null && endpointName != null && linkType != null ) { + if (!(STANDARD_LINK.equals(linkType) || + SOFT_LINK.equals(linkType) || HARD_LINK.equals(linkType)) ) { + throw new Exception("Invalid consumes attribute value" + + SUDescriptorFactory.LINK_TYPE_TAG_NAME + "=" + linkType); + } + } + return new ConsumedService(ifQName, serviceQName, endpointName, linkType); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java new file mode 100644 index 000000000..365633ddc --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java @@ -0,0 +1,464 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ServiceUnit.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Provides; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Service; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; + +/** + * This is an abstract class that implements the service unit functionality in the component which + * processes the service unit artifacts and implement the actual service unit lifecycle functionality. + * The AbstractServiceUnitManager and its extended classes that implement the ServiceUnitManager + * functionality creates and maintains the reference to the concrete implementation of this class to + * invoke the functionality implemented by this class and its concrete implementation during the + * execution of the ServiceUnitMangers lifecycle methods by the jbi runtime. + *

+ * The main lifecycle methods of this class that will be called by the ServiceUnitManger implementation + * during the service unit deployment lifecycle are {@link ${symbol_pound}doload}, {@link ${symbol_pound}doDeploy}, {@link ${symbol_pound}doUndeploy}, + * {@link ${symbol_pound}doInit}, {@link ${symbol_pound}doStart}, {@link ${symbol_pound}doStop} and {@link ${symbol_pound}doShutdown} + *

+ * Service unit processing supported by this implementation is based on wsdl 1.1 deployments where the + * services provided and consumed in this service unit are described using wsdl 1.1 definitions. + *

+ * The main service unit artifacts that will be processed during deployment lifecycle of the service + * unit are 1.Service unit descriptor(jbi.xml) that describes the services provided and consumed by + * this service unit. 2.WSDL 1.1 document that describes the service definition 3.Component specific + * configurations related to services provided and consumed by this service unit. + *

+ * When the service unit is for Binding Component, the component specific configurations are read + * from the WSDL1.1 extensions defined in the WSDL document corresponding to the service provider + * or consumer deployed with this service unit. + *

+ * When the service unit is for Service Engine, the component specific configurations are read + * from the deployment artifacts such as xslt files and mapping files in the service unit zip file + * along with the WSDL document corresponding to the service provider or consumer deployed with this + * service unit. + * + * @see SUDescriptor + * @see Endpoint + * @see ProviderEndpoint + * @see ConsumerEndpoint + * @see WSDLProcessor + * @author chikkala + */ +public abstract class ServiceUnit { + /** Service Unit Name */ + private String mSUName; + /** Service Unit Root path passed by jbi runtime */ + private String mSURootPath; + /** service unit descriptor model unmarshalled from service unit jbi.xml */ + private SUDescriptor mSUDescriptor; + /** Map of Endpoint Key to ProviderEndpoint configurations in this service unit */ + private Map mProviderEndpointMap; + /** Map of Endpoint Key to ConsumerEndpoint configurations in this service unit */ + private Map mConsumerEndpointMap; + /** Map of Service Key to the WSDL Definition in this service unit */ + private Map mWSDLMap; + /** WSDLProcessor configured for this service unit to process wsdls in the service unit */ + private WSDLProcessor mWSDLProcessor; + /** + * + * @param suName + * @param suRootPath + */ + protected ServiceUnit(String suName, String suRootPath) { + this.mSUName = suName; + this.mSURootPath = suRootPath; + this.mSUDescriptor = null; + this.mWSDLMap = new HashMap(); + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + } + /** returns service unit name + * @return service unit name + */ + public String getName() { + return this.mSUName; + } + /** returns service unit root path where the su artifacts are unzipped by the jbi runtime + * @return path to the service unit root directory. + */ + public String getSURootPath() { + return this.mSURootPath; + } + protected SUDescriptor createSUDescriptor() throws Exception { + File jbiXmlFile = new File(this.getSURootPath(), "META-INF/jbi.xml"); + String jbiXmlPath = jbiXmlFile.getAbsolutePath(); + return SUDescriptor.SUDescriptorFactory.getSUDescriptor(jbiXmlPath); + } + /** return the Service unit descriptor model that was read from the jbi.xml + * @return SUDescriptor + */ + public SUDescriptor getSUDescriptor() throws Exception { + if ( this.mSUDescriptor == null ) { + this.mSUDescriptor = createSUDescriptor(); + } + return this.mSUDescriptor; + } + public ProviderEndpoint getProviderEndpoint(String providerID) { + return this.mProviderEndpointMap.get(providerID); + } + public Collection getProviderEndpoints() { + return Collections.unmodifiableCollection(this.mProviderEndpointMap.values()); + } + public ConsumerEndpoint getConsumerEndpoint(String cosumerID) { + return this.mConsumerEndpointMap.get(cosumerID); + } + + public Collection getConsumerEndpoints() { + return Collections.unmodifiableCollection(this.mConsumerEndpointMap.values()); + } + /** + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * extended classes implement this method to create the su specific WSDLProcessor. for examples, + * a su supporting binding component may have wsdl extensions that it want to registry for reading + * the configurations from the wsdl file. + * @return WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + */ + protected WSDLProcessor createWSDLProcessor() { + return new WSDLProcessor(this.getSURootPath()); + } + /** + * return the WSDLProcessor reference by creates if it is not yet created. + * @return WSDLProcessor. + */ + public final WSDLProcessor getWSDLProcessor() { + if ( this.mWSDLProcessor == null ) { + this.mWSDLProcessor = createWSDLProcessor(); + } + return this.mWSDLProcessor; + } + /** + * loads the service unit artifacts into the SU model. AbstractServiceUnitManager implementation + * calls this method during the during deploy and init lifecycle methods when the service unit + * object is newly created. + */ + public void doLoad() throws DeploymentException { + try { + SUDescriptor suDesc = getSUDescriptor(); // load jbi.xml + loadServiceDefinitions(); // check if the wsdls are valid for corresponding services. + loadOtherArtifacts(); // additional validations specific to component deployment features. + loadEndpoints(); // create endpoints + } catch ( DeploymentException jbiEx) { + throw jbiEx; + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + /** extended classes implement this method to perform the su specific deployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doDeploy() throws DeploymentException { + // NOOP. doLoad has done it all. + this.getLogger().fine("ServiceUnit.doDeploy"); + } + /** extended classes implement this method to perform the su specific undeployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doUndeploy() throws DeploymentException { + //NOOP + this.getLogger().fine("ServiceUnit.doUndeploy"); + } + /** extended classes implement this method to perform the su specific initialization tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doInit() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doInit"); + this.doInitEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on start in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStart() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStart"); + this.doActivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on stop in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStop() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStop"); + this.doDeactivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on shutdown in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doShutdown() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doShutdown"); + this.doCleanEndpoints(); + } + /** + * create the ProviderEndpoint that implement the service provider implementation specific to this su. + * @return ProviderEndpoint or null if the SU does not support the service provider access + */ + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return null; + } + /** + * create the ProviderEndpoint that implement the service consumer implementation specific to this su. + * @return ConsumerEndpoint or null if the SU does not support the service consumer access + */ + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return null; + } + /** + * generates the key based on the service to store the wsdl definitions . + */ + protected String getServiceKey(Service service) { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(service.getInterface()).append("+"); + strBuff.append(service.getServiceName()).append("+"); + strBuff.append(service.getEndpointName()); + return strBuff.toString(); + } + /** + * looks up the wsdl definition loaded for this service. + */ + protected Definition findWSDLFor(Service service) throws WSDLException { + Definition wsdlDef = null; + String key = this.getServiceKey(service); + wsdlDef = this.mWSDLMap.get(key); + return wsdlDef; + } + + protected Definition findWSDL(List wsdlList, Service service, boolean ignoreEndpointLookup) { + Definition foundDef = null; + for ( Definition def : wsdlList ) { + if ( WSDLProcessor.isWSDLFor(def, service.getInterface(), service.getServiceName(), + ((ignoreEndpointLookup) ? null : service.getEndpointName()) ) ) { + foundDef = def; + break; + } + } + return foundDef; + } + /** + * loads the WSDL definitions corresponds to the service providers and consumers defined in the + * service unit descriptor. + */ + protected void loadServiceDefinitions() throws Exception { + + this.mWSDLMap = new HashMap(); + + WSDLProcessor wsdlProcessor = getWSDLProcessor(); + List wsdlList = wsdlProcessor.readWSDLs(this.getSURootPath()); + this.getLogger().fine("Number of wsdl definitions in service unit " + wsdlList.size()); + + List services = new ArrayList(); + services.addAll(this.getSUDescriptor().getProvidedServices()); + services.addAll(this.getSUDescriptor().getConsumedServices()); + + boolean isForBinding = this.getSUDescriptor().isForBindingComponent(); + this.getLogger().fine("Is this service unit for Binding? " + isForBinding); + + for ( Service service : services ) { + this.getLogger().fine("Looking up WSDL for service " + service); + boolean ignoreEndpointLookup = false; + boolean providerAtEngine = false; + if ( !isForBinding && service instanceof Provides ) { + ignoreEndpointLookup = true; + providerAtEngine = true; + } + Definition def = findWSDL(wsdlList, service, ignoreEndpointLookup); + if ( def == null ) { + throw new Exception("WSDL Definition not found for " + service); + } + this.mWSDLMap.put(getServiceKey(service), def); + if ( providerAtEngine ) { + // provider at engine. so add engine binding and endpoint to the wsdl + wsdlProcessor.create${artifactId}Binding(def, + service.getInterface(), service.getServiceName(), service.getEndpointName()); + } + } + } + /** extended classes implement this method to perform the su specific artifacts validation in + * this method implementation. + * @throws DeploymentException on error. + */ + protected void loadOtherArtifacts() throws DeploymentException { + // nothing to validate further. + this.getLogger().fine("ServiceUnit.loadOtherArtifacts"); + } + /** + * creates ProviderEndpoint and ConsumerEndpoint objects corresponding to the service providers + * and consumers described in the su descriptor ( jbi.xml ) + */ + protected void loadEndpoints() throws Exception { + + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + + Collection providesList = this.getSUDescriptor().getProvidedServices(); + for ( Provides provides : providesList ) { + Definition wsdlDef = findWSDLFor(provides); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + provides); + } + ProviderEndpoint provider = createProviderEndpoint(provides, wsdlDef); + this.mProviderEndpointMap.put(provider.getID(), provider); + } + + Collection consumesList = this.getSUDescriptor().getConsumedServices(); + for ( Consumes consumes : consumesList ) { + Definition wsdlDef = findWSDLFor(consumes); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + consumes); + } + ConsumerEndpoint consumer = createConsumerEndpoint(consumes, wsdlDef); + this.mConsumerEndpointMap.put(consumer.getID(), consumer); + } + } + /** + * initializes the Endpoint objects created corresponding to the consumer and providers defined + * in the su descriptor + */ + protected void doInitEndpoints() throws DeploymentException { + // init endpoints. if any initialization fails, rollback the already inited endpoints + List initedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.init(); + initedEndpoints.add(endpoint); + } catch ( Exception initEx) { + doCleanEndpoints(initedEndpoints); + throw new DeploymentException(initEx); + } + } + + } + /** + * invokes activates method of all provider and consumer endpoint object in this su. if there is + * and error activating any one the endpoints, it deactivates the already activated ones and throws + * the error + */ + protected void doActivateEndpoints() throws DeploymentException { + // activate providers first and then consumers + List activatedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.activate(); + activatedEndpoints.add(endpoint); + } catch ( Exception actEx) { + doDeactivateEndpoints(activatedEndpoints); + throw new DeploymentException(actEx); + } + } + } + /** + * invokes deactivate method on the list of Endpoint objects passed to this method + */ + protected void doDeactivateEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.deactivate(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes deactivate method on the all consumer and provider endpoint objects + */ + protected void doDeactivateEndpoints() { + // deactivate consumers first and then the providers + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doDeactivateEndpoints(allEndpoints); + } + /** + * invokes clean method on the list of endpoint objects + */ + protected void doCleanEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.clean(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes clean method on the all consumer and provider endpoint objects in this su. + */ + protected void doCleanEndpoints() { + + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doCleanEndpoints(allEndpoints); + } + /** + * prints the service unit description + */ + protected final String printDetails() { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + + out.println("ServiceUnit Name : " + this.getName()); + out.println("ServiceUnit Root : " + this.getSURootPath()); + + SUDescriptor suDesc = null; + try { + suDesc = this.getSUDescriptor(); + for ( SUDescriptor.Consumes consumer : suDesc.getConsumedServices()) { + out.println(consumer); + } + for ( SUDescriptor.Provides provides : suDesc.getProvidedServices()) { + out.println(provides); + } + } catch (Exception ex) { + ex.printStackTrace(out); + } + return writer.getBuffer().toString(); + } + + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java new file mode 100644 index 000000000..67bbf5a45 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java @@ -0,0 +1,44 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensibilityElement.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This is an abstract class which can be extended to create jwsdl (wsdl4j's) extension elements model to + * read/write the wsdl extension elements in wsdl 1.1 xml. + * + * @author chikkala + */ +public abstract class AbstractExtensibilityElement implements ExtensibilityElement, java.io.Serializable { + public static final long serialVersionUID = 1; + private QName mElementType; + private Boolean mRequired; + + /** Creates a new instance of AbstractExtensibilityElement */ + protected AbstractExtensibilityElement() { + } + + public void setElementType(QName elementType) { + this.mElementType = elementType; + } + + public QName getElementType() { + return this.mElementType; + } + + public void setRequired(Boolean required) { + this.mRequired = required; + } + + public Boolean getRequired() { + return this.mRequired; + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java new file mode 100644 index 000000000..5233aeee2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java @@ -0,0 +1,45 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensionRegistry.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.List; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This is the abstract class used to add the wsdl extension serializers and deserializers to the + * wsdl extension registry configured to read/write wsdl extensions into a know java model. + * @see AbstractExtensionSerializer + * @see WSDLProcessor + * @author chikkala + */ +public abstract class AbstractExtensionRegistry extends ExtensionRegistry { + + /** Creates a new instance of AbstractSerializer + * it calls the createSerializers method to get the list of + * serializers and then call registerSerializer on each AbstractExtensionSerializer + * to register them with this registry. + * @see AbstractExtensionSerializer${symbol_pound}registerSerializer + */ + protected AbstractExtensionRegistry() { + super(); + List list = createSerializers(); + for (AbstractExtensionSerializer ser : list ) { + ser.registerSerializer(this); + } + // register ${artifactId} Binding serializers + AbstractExtensionSerializer seBindingSer = new SEBindingExt.SEBindingExtSerializer(); + seBindingSer.registerSerializer(this); + } + /** + * create wsdl extension serializers for each extension element to register with the extension + * registry. + * @return List of AbstractExtensionSerializer objects for serializing/deserializing the wsdl extensions. + * @see AbstractExtensionSerializer + */ + protected abstract List createSerializers(); +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java new file mode 100644 index 000000000..4ac1b37d6 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java @@ -0,0 +1,123 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensionSerializer.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.PrintWriter; +import java.io.Serializable; +import java.util.Set; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionDeserializer; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.extensions.ExtensionSerializer; +import javax.xml.namespace.QName; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +/** + * This class is an abstract class that should be extended to implements extension serializer and + * deserializer. This class implements the code required for registering the serializer and deserializer + * implemented by this class. THe AbstractExtensionRegistry class calls the ${symbol_pound}registerSerializer method + * to register the concrete implementation of this class with extension registry. + * @see AbstractExtensionRegistry + * @author chikkala + */ +public abstract class AbstractExtensionSerializer + implements ExtensionSerializer, ExtensionDeserializer, Serializable { + + public static final long serialVersionUID = 1; + + private Class mParentType; + private Class mExtensionType; + private QName mElementType; + + /** Creates a new instance of AbstractSerializer */ + public AbstractExtensionSerializer(Class parentType, QName elementType, Class extensionType) { + this.mParentType = parentType; + this.mElementType = elementType; + this.mExtensionType = extensionType; + } + + public Class getParentType() { + return this.mParentType; + } + public QName getElementType() { + return this.mElementType; + } + public Class getExtensionType() { + return this.mExtensionType; + } + + public void registerSerializer(ExtensionRegistry extReg) { + extReg.registerSerializer(this.mParentType, this.mElementType, this); + extReg.registerDeserializer(this.mParentType, this.mElementType, this); + extReg.mapExtensionTypes(this.mParentType, this.mElementType, this.mExtensionType); + } + + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + // DO NOTHING. Binding component runtime does not need to serialize the wsdl extensions. + } + + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + return null; + } + + public static String getAttribute(Element el, String attrName) { + String attrValue = null; + Attr attr = el.getAttributeNode(attrName); + if ( attr != null ) { + attrValue = attr.getValue(); + } + return attrValue; + } + + protected String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + /** + * @return the name with the prefix defined for the namespaceURI in the wsdl definition. + * @throws WSDLException if the prefix not found in the wsdl definition. note that the + * default prefix is an empty string. + */ + protected String getQualifiedName(Definition def, + String namespaceURI, String localName) throws WSDLException { + String prefix = null; + if (namespaceURI != null && !namespaceURI.equals("")) { + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + throw new WSDLException(WSDLException.OTHER_ERROR, + "Can not find prefix in WSDL Definition for " + namespaceURI); + } + } + if ( prefix != null && !prefix.equals("")) { + return prefix + ":" + localName; + } else { + return localName; + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java new file mode 100644 index 000000000..b10800550 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java @@ -0,0 +1,229 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractNormalizer.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.ArrayList; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Part; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * This is an abstract class that implements most of the functionality to normalize the binding protocol + * specific concrete message to jbi wrapper and and denormalize jbi wrapper to the concrete binding + * protocol specific message. + *

+ * The extended classes specific to particular binding protocol will be used when a jbi binding + * component is sending and receiving messages from the external service providers and consumers using + * a particular binding protocol known to this class. Extended implementation of this class should make + * use of the helper methods in this class in normalizing and denormalizing the messages. + * @see JMXBindingNormalizer + * @author chikkala + */ +public abstract class AbstractNormalizer { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + /** wsdl definition to use when normalizing and denormalizing */ + private Definition mWSDL; + /** Binding definition to use when normalizing and denormalizing */ + private Binding mBinding; + + private AbstractNormalizer() {} + /** Creates a new instance of JMXBCNormalizer */ + public AbstractNormalizer(Definition wsdl, Binding binding) { + this.mWSDL = wsdl; + this.mBinding = binding; + } + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete mssage of a particular binding protocol. + */ + public abstract void normalizeInput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeOutput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be de-normalized. + * @param normMsg NormalizedMessage which should be used to create de-normalized message. + */ + public abstract DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + + /** + * denormalized the normalized fault message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException; + /** + * @return the wsdl definition to use in normalizing and denormalizing the message + */ + protected Definition getWSDL() { + return this.mWSDL; + } + /** + * @return the wsdl binding definition to use in normalizing and denormalizing the message + */ + protected Binding getBinding() { + return this.mBinding; + } + /** + * create and add message parts to the jbiWrapper according to the abstract message model. This + * method assumes that the each element in the msgParts list passed to it is mapped to the part + * of the abstract wsdl message and uses the type or element attribute of the abstract message to + * determine whether the element is actual part element or a wrapped part type. + * Use this method in normalizing the concrete protocol specific message to jbi wrapper message. + * @param jbiWrapper object that holds the jbi wrapper information. + * @param wsdlMsg abstract message from the wsdl definition + * @param msgParts actual message parts from the concrete message + */ + protected void addMessagePartsToJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg, List msgParts) throws MessagingException { + List wsdlParts = wsdlMsg.getOrderedParts(null); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= msgParts.size() ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + Element msgPart = msgParts.get(i); + if ( wsdlPart.getElementName() != null ) { + jbiWrapper.appendPart(msgPart); + } else { + // it is type. + // check the element name is same as part + if ( !wsdlPart.getName().equals(msgPart.getLocalName()) ) { + throw new MessagingException("mismatched message content for part " + wsdlPart.getName()); + } + if ( !wsdlMsg.getQName().getNamespaceURI().equals(msgPart.getNamespaceURI()) ) { + throw new MessagingException("mismatched message content namespace for part " + wsdlPart.getName()); + } + // check the content is text or element. + List partContent = getChildElements(msgPart); + if ( partContent.size() > 0 ) { + // add content as part elements + jbiWrapper.appendPart(partContent); + } else { + // add the content as text + jbiWrapper.appendPart(msgPart.getTextContent()); + } + } + } + } + /** + * extracts the message parts from the jbiWrapper according to the abstract wsdl message + * definition passed to it. Use this method in denormalizing the jbi wrapper message into the + * binding protocol specific concrete message. + * @param jbiWrapper jbi wrapper object that contains message parts and the message type information. + * @param wsdlMsg abstract wsdl message definition to use in constructing the part elements. + */ + protected List getMessagePartsFromJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg) + throws MessagingException, ParserConfigurationException { + + List msgParts = new ArrayList(); + int jbiPartCount = jbiWrapper.getPartCount(); + List wsdlParts = wsdlMsg.getOrderedParts(null); + QName msgType = jbiWrapper.getType(); + if (!wsdlMsg.getQName().getNamespaceURI().equals(msgType.getNamespaceURI())) { + throw new MessagingException("Namespace mismatch between jbi wrapper message type and wsdl message"); + } + Document newDoc = jbiWrapper.getDocumentBuilder().newDocument(); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= jbiPartCount ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + if ( wsdlPart.getElementName() != null ) { + msgParts.add(jbiWrapper.getPartAsElement(i)); + } else { + // it is type. create a new element for a typed part + // check the element name is same as part + String prefix = msgType.getPrefix(); + String nsURI = msgType.getNamespaceURI(); + String localName = wsdlPart.getName(); + Element partEl = newDoc.createElementNS(nsURI, prefix + ":" + localName); + partEl.setAttributeNS(XMLNS_NS, "xmlns:"+prefix, nsURI); + NodeList partContent = jbiWrapper.getPart(i); + appendChildren(partEl, partContent, newDoc, true); + msgParts.add(partEl); + } + } + return msgParts; + } + /** + * utility method that can append the nodeList passed to it to the element children. + * @param el element node to which the nodeList should be appended + * @param doc the document object that should be used to import the nodeList + * @param importNode true if the nodeList should be imported while appending the nodeList to the + * element children. false if no import is necessary. + */ + protected void appendChildren(Element el, NodeList nodeList, Document doc, boolean importNode) { + + for ( int pIdx = 0; pIdx < nodeList.getLength(); ++pIdx) { + Node node = nodeList.item(pIdx); + if ( importNode ) { + node = doc.importNode(node, true); + } + el.appendChild(node); + } + } + /** + * @param el element from which to extract the child elements + * @return List list of child Element nodes. + */ + protected List getChildElements(Element el) { + List list = new ArrayList(); + NodeList nodeList = el.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if (!(node instanceof Element) ){ + continue; + } + list.add((Element)node); + } + return list; + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java new file mode 100644 index 000000000..30663d867 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java @@ -0,0 +1,99 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SEBindingExt.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation classes implement wsdl 1.1 extension model for the + * jbi service engine binding that is defined in jsr 208(sec. 5.5.6.1). to read/write concrete binding + * element in the wsdl definition for the service endpoint binding provided by the service engine. + * The wsdl definition with this binding information can be used in providing the service provider + * metadata returned by the service engine in Component.getServiceDescription. + *

+ * AbstractExtensionRegistry by default include this extension serializers in the + * registry to read/write this service engine binding type in the wsdl definition. + *

+ * During a service unit deployment/initialization in the service engine, the deployed wsdl definition + * is loaded and modified to provide this binding for the service provided by the engine. + * + * @see WSDLProcessor${symbol_pound}create${artifactId}Binding + * @see AbstractExtensionRegistry + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit${symbol_pound}loadServiceDefinitions + * @author chikkala + */ +public interface SEBindingExt extends ExtensibilityElement, java.io.Serializable { + + public static final String NS_URI = "http://java.sun.com/xml/ns/jbi/binding/service+engine"; + public static final String NS_DEF_PREFIX = "jbise"; + /** Element names. */ + public static final String EL_BINDING_EXT = "binding"; + /**Qualified element names.*/ + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + + public static class SEBindingExtImpl extends AbstractExtensibilityElement implements SEBindingExt { + + public SEBindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + @Override + public String toString() { + StringBuffer buff = new StringBuffer(); + buff.append("<"+NS_DEF_PREFIX+":"+EL_BINDING_EXT); + buff.append("/>"); + return buff.toString(); + } + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static SEBindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + SEBindingExtImpl bindingExt = new SEBindingExt.SEBindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, SEBindingExt.NS_DEF_PREFIX); + return bindingExt; + } + } + /** + * serializer and descrializer implementation for the binding extension element. + */ + public static class SEBindingExtSerializer extends AbstractExtensionSerializer { + + public SEBindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, SEBindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + SEBindingExt extObj = (SEBindingExt)extReg.createExtension(parentType, elementType); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + + SEBindingExt extObj = (SEBindingExt)extension; + + StringBuffer buff = new StringBuffer(); + buff.append("<" + elName ); + buff.append("/>"); + pw.println(buff.toString()); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java new file mode 100644 index 000000000..92606104d --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java @@ -0,0 +1,471 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDL11JBIWrapper.java + * + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +/** + * This class wraps the wsdl11 messages to the jbi wrapper message suitable for + * processing in the wsdl2.0 model of the normalized message in jbi as defined in jsr208 like + * + * + * + * + * + * + * + * + * + * + * @author chikkala + */ +public class WSDL11JBIWrapper { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + public static final String WRAPPER_NAMESPACE = "http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; + public static final String DEF_NS_PREFIX = "jbiwrp"; + public static final String DEF_MESSAGE_NS_PREFIX = "msgns"; + public static final String JBI_MESSAGE_EL = "message"; + public static final String JBI_PART_EL = "part"; + public static final String VERSION_ATTR = "version"; + public static final String VERSION_ATTR_VALUE = "1.0"; + public static final String TYPE_ATTR = "type"; + public static final String NAME_ATTR = "name"; + + private static DocumentBuilder sDocBuilder = null; + /** qname of message attribute from wsdl:input, wsdl:output or wsdl:fault */ + private QName mType; + /** optional name attribute from wsdl:input, wsdl:output or wsdl:fault */ + private String mName; + /** each parts contents as node list */ + List mPartConentList = new ArrayList(); + + /** Creates a new instance of WSDL11JBIWrapper */ + public WSDL11JBIWrapper() { + } + /** creates the namespace aware document builder. extended classes can override this method + * to return the doc builder created else where. + */ + protected DocumentBuilder createDocumentBuilder() throws ParserConfigurationException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + return factory.newDocumentBuilder(); + } + /** return the document builder + * @return DocumentBuilder + */ + public final DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { + if ( WSDL11JBIWrapper.sDocBuilder == null ) { + WSDL11JBIWrapper.sDocBuilder = createDocumentBuilder(); + } + return WSDL11JBIWrapper.sDocBuilder; + } + /** + * @return type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public QName getType() { + return this.mType; + } + /** + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public void setType(QName type) { + this.mType = type; + } + /** @return name attribute from wsdl:input, wsdl:output or wsdl:fault. or null if not set. */ + public String getName() { + return this.mName; + } + /** + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault. can be null. + */ + public void setName(String name) { + this.mName = name; + } + /** + * appends part content as node list + */ + public void appendPart(NodeList partContent) { + this.mPartConentList.add(partContent); + } + /** + * append part content from the List of nodes + */ + public void appendPart(List partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content as element + */ + public void appendPart(Element partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content from DOMSource + */ + public void appendPart(DOMSource partContent) { + Element partConentEl = getElement(partContent.getNode()); + this.mPartConentList.add(new NodeListImpl(partConentEl)); + } + /** + * append part content as text node. + */ + public void appendPart(String partContent) { + Text textContent = null; + try { + textContent = this.getDocumentBuilder().newDocument().createTextNode(partContent); + } catch (ParserConfigurationException ex) { + ex.printStackTrace(); + } + if ( textContent != null ) { + this.mPartConentList.add(new NodeListImpl(textContent)); + } + } + /** + * append list of part contents each is a NodeList to the parts + */ + public void appendParts(List partContentList) { + this.mPartConentList.addAll(partContentList); + } + /** + * returned the ordered list of part contents. + */ + public List getParts() { + return Collections.unmodifiableList(this.mPartConentList); + } + /** + * return the number of parts + */ + public int getPartCount() { + return this.mPartConentList.size(); + } + /** + * return the part content at a particular index as NodeList. + */ + public NodeList getPart(int idx) { + return this.mPartConentList.get(idx); + } + /** + * return part context at a particular index as text + */ + public String getPartAsText(int idx) { + NodeList partNodes = getPart(idx); + Document doc; + try { + doc = this.getDocumentBuilder().newDocument(); + Element el = doc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + for ( int i=0; i < partNodes.getLength(); ++i) { + el.appendChild(partNodes.item(i)); + } + return el.getTextContent(); + } catch (ParserConfigurationException ex) { + return null; + } + } + /** + * return part context at a particular index as Element + */ + public Element getPartAsElement(int idx) { + Element contentEl = null; + NodeList partNodes = getPart(idx); + for ( int i=0; i < partNodes.getLength(); ++i) { + Node node = partNodes.item(i); + if ( node instanceof Element) { + contentEl = (Element)node; + break; + } + } + return contentEl; + } + /** + * creates Document from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return Document containing the wsdl 11 wrapper xml + */ + public Document toDocument() throws ParserConfigurationException { + + Document wrapperDoc = getDocumentBuilder().newDocument(); + Element jbiMessage = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_MESSAGE_EL); + jbiMessage.setAttribute(VERSION_ATTR, VERSION_ATTR_VALUE); + wrapperDoc.appendChild(jbiMessage); + + QName type = this.getType(); + if ( type == null ) { + type = new QName("", "", DEF_MESSAGE_NS_PREFIX); + } + // set the jbiMessage attributes + String prefix = type.getPrefix(); + if (prefix == null || prefix.length() == 0) { + prefix = DEF_MESSAGE_NS_PREFIX; + } + jbiMessage.setAttribute(TYPE_ATTR, prefix + ":" + type.getLocalPart()); + jbiMessage.setAttributeNS( XMLNS_NS, "xmlns:" + prefix, type.getNamespaceURI()); + + String name = this.getName(); + if (name != null && name.trim().length() > 0 ) { + jbiMessage.setAttribute(NAME_ATTR, name); + } + + List partContentList = this.getParts(); + for ( NodeList nodeList : partContentList ) { + // set jbi part message + Element jbiPart = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + jbiMessage.appendChild(jbiPart); + for ( int i =0; i < nodeList.getLength(); ++i ) { + Node importedMsgNode = wrapperDoc.importNode(nodeList.item(i), true); + jbiPart.appendChild(importedMsgNode); + } + } + + return wrapperDoc; + + } + /** + * creates DOMSource from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return DOMSource containing the wsdl 11 wrapper xml + */ + public DOMSource toDOMSource() throws ParserConfigurationException { + DOMSource wrappedSource = new DOMSource(); + wrappedSource.setNode(toDocument()); + return wrappedSource; + } + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + /** + * creates wrapper object from the DOMSource that has wsdl 11 wrapper xml. + * @param wrappedMsg wsdl 11 wrapper xml as DOMSource + * @return WSDL11JBIWrapper representing the wrapper xml. + */ + public static WSDL11JBIWrapper sourceToWrapper(DOMSource wrappedMsg) { + Element jbiMessage = getElement(wrappedMsg.getNode()); + if ( jbiMessage == null ) { + return null; + } + String nsURI = jbiMessage.getNamespaceURI(); + String tagName = jbiMessage.getLocalName(); + if (!WRAPPER_NAMESPACE.equals(nsURI) || !JBI_MESSAGE_EL.equals(tagName)) { + return null; + } + String name = jbiMessage.getAttribute(NAME_ATTR); + String typeQN = jbiMessage.getAttribute(TYPE_ATTR); + String typePrefix = ""; + String typeName = ""; + if ( typeQN != null && typeQN.trim().length() > 0 ) { + int idx = typeQN.indexOf(':'); + if ( idx >= 0 ) { + typePrefix = typeQN.substring(0, idx); + if ( typeQN.length() > idx ) { + typeName = typeQN.substring(idx+1); + } + } else { + typePrefix = ""; + typeName = typeQN; + } + } + String typeURI = jbiMessage.getAttribute("xmlns:" + typePrefix); + QName typeQName = new QName(typeURI, typeName, typePrefix); + + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(typeQName); + NodeList jbiPartList = jbiMessage.getElementsByTagNameNS(WRAPPER_NAMESPACE, JBI_PART_EL); + for ( int i=0; i < jbiPartList.getLength(); ++i) { + Node jbiPart = jbiPartList.item(i); + wrapper.appendPart(jbiPart.getChildNodes()); + } + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object and sets the type and name of the object + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name ) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(type); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content has multiple child element. + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, NodeList partContent) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + wrapper.appendPart(partContent); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content is a single element + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, Element msgEl) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name, new WSDL11JBIWrapper.NodeListImpl(msgEl)); + return wrapper; + } + + public static WSDL11JBIWrapper createWrapper(QName type, String name, DOMSource inputSource) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + Node msgNode = getElement(inputSource.getNode()); + NodeList nodeList = new WSDL11JBIWrapper.NodeListImpl(msgNode); + wrapper.appendPart(nodeList); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations input element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createInputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Input input = operation.getInput(); + if ( input == null ) { + return null; + } + name = input.getName(); + Message wsdlMsg = input.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createOutputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Output output = operation.getOutput(); + if ( output == null) { + return null; + } + name = output.getName(); + Message wsdlMsg = output.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @param faultName fault name, can be null to look for the fault with no name. + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createFaultWrapper(Operation operation, String faultName) throws ParserConfigurationException { + QName type = null; + String name = null; + @SuppressWarnings("unchecked") + Map faultMap = operation.getFaults(); + Fault fault = faultMap.get(faultName); + + if ( fault == null ) { + return null; + } + name = fault.getName(); + Message wsdlMsg = fault.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * NodeList implementation. + */ + public static class NodeListImpl extends ArrayList implements NodeList { + + public NodeListImpl() { + super(); + } + + public NodeListImpl(Node aNode) { + super(); + if (aNode != null) { + this.add(aNode); + } + } + + public NodeListImpl(List nodes) { + if (nodes != null) { + this.addAll(nodes); + } + } + + public int getLength() { + return this.size(); + } + + public Node item(int idx) { + return this.get(idx); + } + + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java new file mode 100644 index 000000000..6e0c0993f --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java @@ -0,0 +1,419 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDLProcessor.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.wsdl.Port; +import javax.wsdl.PortType; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ElementExtensible; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.wsdl.xml.WSDLWriter; +import javax.xml.namespace.QName; + +/** + * This class is used to configure jwsdl(wsdl4j) to read and process wsdl documents with wsdl extensions. + * It provides set of helper methods to read and process the wsdl definitions from files with .wsdl + * extension from a specified directory. + *

+ * A Binding Component that is processing the wsdl extensions for its deployment configuration would + * extend this class and provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + *

+ * A Service Engine that is processing the wsdl during deployment can directly use this class + * to process the wsdl as the default implementation returned by this class configures the wsdl extension + * registry to read/write the service engine binding extensions. + * + * @see AbstractExtensionRegistry + * @see SEBindingExt + * @author chikkala + */ +public class WSDLProcessor { + + private String mXmlCatalogPath = "xml-catalog.xml"; + private String mWsdlDirPath = ""; + private WSDLReader mReader; + + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir) { + this(wsdlDir, null); + } + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir, String xmlCatPath) { + if ( wsdlDir != null ) { + this.mWsdlDirPath = wsdlDir; + } + if ( xmlCatPath != null ) { + this.mXmlCatalogPath = xmlCatPath; + } + } + /** @return directory path from which this class reads the wsdl files with .wsdl as file extension. */ + public String getWSDLDirectory() { + return this.mWsdlDirPath; + } + /** path to the xml catalog file in the service unit which can be used for Catalog-based entity + * and URI resolution. + */ + public String getXmlCatelogPath() { + return this.mXmlCatalogPath; + } + /** wsdl extension registry required for processing the wsdl extensions in the wsdl definition to + * java model. Binding component that is processing the wsdl extensions for its deployment + * configuration would provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + * @return ExtensionSerializer + * @see AbstractExtensionSerializer + */ + protected ExtensionRegistry getExtensionRegistry() { + return new AbstractExtensionRegistry() { + protected List createSerializers() { + return new ArrayList(); + } + }; + } + /** + * @return the WSDLReader configured with extension registry to process the wsdl extensions. + */ + public final WSDLReader getWSDLReader() throws WSDLException { + if ( this.mReader == null ) { + WSDLFactory factory = WSDLFactory.newInstance(); + this.mReader = factory.newWSDLReader(); + // reader.setFeature("javax.wsdl.verbose", true); + // reader.setFeature("javax.wsdl.importDocuments", true); + this.mReader.setExtensionRegistry(getExtensionRegistry()); + } + return this.mReader; + } + /** + * reads the wsdl file and returns the wsdl definition jwsdl model. + * @param wsldFilePath relative path to wsdl file from the the root wsdl directory returns from + * ${symbol_pound}getWSDLDirectory in the service unit or or absolute path . + * @return Definition + */ + public Definition readWSDL(String wsdlFilePath) throws WSDLException { + File wsdlFile = new File(wsdlFilePath); + if ( !wsdlFile.isAbsolute() ) { + wsdlFile = new File(this.mWsdlDirPath, wsdlFilePath); + } + return getWSDLReader().readWSDL(wsdlFile.getAbsolutePath()); + } + /** + * reads the files with .wsdl file extension in a directory. If the directory should + * be searched recursively, it searches this directory, all child directories of this + * directory and then to their child directories recursively. + * @param dir directory file to search for .wsdl files + * @param rec if set to true, it recursively searches the directory. if set to false, only + * this directory is searched. + * @return List of Files with .wsdl extension. + */ + public List listWSDLFiles(File dir, final boolean rec) throws IOException { + if ( dir == null || !dir.isDirectory()) { + throw new IOException(dir + " is not a directory for looking up wsdl files"); + } + List wsdlList = new ArrayList(); + File[] files = dir.listFiles(new FileFilter() { + public boolean accept(File pathname) { + if ( rec && pathname.isDirectory()) { + return true; + } else { + String name = pathname.getName(); + int idx = name.lastIndexOf('.'); + if ( idx < 0 ) { + return false; + } + String ext = name.substring(idx); + return ".wsdl".equalsIgnoreCase(ext); + } + } + }); + for ( File file : files ) { + if ( rec && file.isDirectory()) { + List wsdlFiles = listWSDLFiles(file, rec); + wsdlList.addAll(wsdlFiles); + } else { + wsdlList.add(file); + } + } + return wsdlList; + } + /** + * reads the files with .wsdl file extension in a directory fromDir and return the list of + * wsdl definitions corresponding to them. + * @param fromDir path to the directory relative to the root wsdl directory returns from + * ${symbol_pound}getWSDLDirectory or the absolute path to the directory. + */ + public List readWSDLs(String fromDir) throws WSDLException { + if ( fromDir == null ) { fromDir = ""; } + File wsdlDir = new File(fromDir); + if (!wsdlDir.isAbsolute()) { + wsdlDir = new File(this.mWsdlDirPath, fromDir); + } + + List wsdlFiles = new ArrayList(); + try { + wsdlFiles = listWSDLFiles(wsdlDir, true); + } catch (IOException ioEx) { + throw new WSDLException("WSDLFileReadError", ioEx.getMessage(),ioEx); + } + + List wsdlPaths = new ArrayList(); + for ( File wsdlFile : wsdlFiles) { + wsdlPaths.add(wsdlFile.getAbsolutePath()); + } + Collections.sort(wsdlPaths); + + List wsdlList = new ArrayList(); + for ( String wsdlPath : wsdlPaths ) { + Definition wsdlDef = readWSDL(wsdlPath); + wsdlList.add(wsdlDef); + } + return wsdlList; + } + /** + * finds PortType using port type ( interface ) qname. + */ + public static PortType findInterface(Definition wsdlDef, QName interfaceName) { + return wsdlDef.getPortType(interfaceName); + } + /** finds the Service using service qname */ + public static Service findService(Definition wsdlDef, QName serviceName) { + return wsdlDef.getService(serviceName); + } + /** finds the wsdl port using service qname and endpoint name */ + public static Port findServiceEndpoint(Definition wsdlDef, QName serviceName, String endpointName) { + Service service = null; + Port port = null; + service = findService(wsdlDef, serviceName); + if ( service != null ) { + port = service.getPort(endpointName); + } + return port; + } + /** + * finds the binding definition to which the service with serviceName and endpointName was bound. + */ + public static Binding findServiceBinding(Definition wsdlDef, QName serviceName, String endpointName) { + Binding binding = null; + Port port = findServiceEndpoint(wsdlDef, serviceName, endpointName); + if ( port != null ) { + binding = port.getBinding(); + } + return binding; + } + /** + * finds the binding definition using the interface(portType) qname with a + */ + public static Binding findInterfaceBinding(Definition wsdlDef, + QName interfaceQName, QName extQName) { + Map bindingMap = wsdlDef.getBindings(); + @SuppressWarnings("unchecked") + Collection bindings = bindingMap.values(); + for ( Binding binding : bindings ) { + if ( binding.getPortType().getQName().equals(interfaceQName)) { + return binding; + } + } + return null; + } + + /** + * find the wsdl4j operation corresponds to the interface+operation. + * @param wsdlDef wsdl definition + * @param portTypeQName portType QName + * @param opName operation name. if null, first operation in the portType + * is returned. + * @return Operation corresponding to the portType+opName + */ + public static Operation findOperation(Definition wsdlDef, + QName portTypeQName, String opName) { + Operation operation = null; + PortType portType = wsdlDef.getPortType(portTypeQName); + if ( portType != null ) { + if ( opName != null ) { + operation = portType.getOperation(opName, null, null); + } else { + @SuppressWarnings("unchecked") + List list = portType.getOperations(); + if ( list != null && list.size() > 0 ) { + operation = list.get(0); + } + } + } + return operation; + } + /** + * verifies whether the wsdl definition contains the specified service descriptions or not. Used + * to locate the wsdl definition for the services describes in service unit deployment + * descriptor(jbi.xm). + * @param interfaceName portType qname to find in the definition. can be null if you are trying to + * find only service endpoint description. + * @param serviceName qname for the service to find in this wsdl. can be null if + * you are trying to find only portType (abstract service) description. + * @param endpointName port name to find in the service definition. null if only + * service with any port should be looked up. + * + * @return true if the wsdl definition contains the specified service description. + */ + public static boolean isWSDLFor(Definition wsdlDef, + QName interfaceName, QName serviceName, String endpointName) { + PortType portType = null; + Service service = null; + Port port = null; + if ( interfaceName != null ) { + portType = findInterface(wsdlDef, interfaceName); + } + + if ( serviceName != null ) { + service = findService(wsdlDef, serviceName); + } + + if ( endpointName != null && service != null ) { + port = service.getPort(endpointName); + } + + boolean isWSDL = true; + + if ( (interfaceName != null && portType == null) || + ( serviceName != null && service == null ) || + ( endpointName != null && (service == null || port == null)) ) { + isWSDL = false; + } + + return isWSDL; + } + /** + * creates a binding definition that contains a service engine binding elements in the specified + * wsdl definition for a portType. It will try to find/create the binding element with interface + * local name with a "_JBISEBinding" suffix and add service engine binding element to it if it + * is not present. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding create${artifactId}Binding(Definition wsdl, QName interfaceName) { + QName bindingQName = new QName(wsdl.getQName().getNamespaceURI(), + interfaceName.getLocalPart() + "_JBISEBinding"); + Binding binding = wsdl.getBinding(bindingQName); + if ( binding == null ) { + binding = wsdl.createBinding(); + binding.setQName(bindingQName); + binding.setPortType(wsdl.getPortType(interfaceName)); + binding.setUndefined(false); + + ExtensibilityElement bindingExt = + SEBindingExt.SEBindingExtImpl.addExtensibilityElement(wsdl, binding); + + wsdl.addBinding(binding); + } + return binding; + } + /** + * creates port and binding elements that provide the the service engine binding for a service. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @param serviceName service under which the port definition bound to the service engine binding + * should be created. + * @param endpointName port name. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding create${artifactId}Binding(Definition wsdl, QName interfaceName, QName serviceName, String endpointName ) { + Binding binding = null; + Service service = findService(wsdl, serviceName); + if ( service == null ) { + return null; + } + Port port = service.getPort(endpointName); + if ( port != null ) { + binding = port.getBinding(); + } else { + // create port + port = wsdl.createPort(); + port.setName(endpointName); + binding = create${artifactId}Binding(wsdl, interfaceName); + port.setBinding(binding); + service.addPort(port); + } + return binding; + } + /** prints the wsdl to text from the wsdl definition */ + public static void printWSDL(PrintWriter out, Definition def) { + try { + WSDLFactory factory = WSDLFactory.newInstance(); + WSDLWriter wsdlWriter = factory.newWSDLWriter(); + wsdlWriter.writeWSDL(def, out); + } catch (WSDLException ex) { + ex.printStackTrace(out); + } + } + /** prints the wsdl to text from the wsdl definition */ + public static String printWSDLToString(Definition def) { + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + printWSDL(out, def); + out.close(); + return writer.getBuffer().toString(); + } + /** returns an existing namespace prefix or create one if not exists for the corresponding namespaceURI */ + public static String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static void addExtensibilityElement(Definition wsdlDef, + ElementExtensible extensibleEl, ExtensibilityElement extEl, String defPrefix) { + QName elementType = extEl.getElementType(); + String namespaceURI = elementType.getNamespaceURI(); + String prefix = wsdlDef.getPrefix(namespaceURI); + if ( prefix == null ) { + // no namespace prefix defined. create one. + prefix = WSDLProcessor.getNamespacePrefix(wsdlDef, namespaceURI, defPrefix); + wsdlDef.addNamespace(prefix, namespaceURI); + } + extensibleEl.addExtensibilityElement(extEl); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/ServiceEngineTest.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/ServiceEngineTest.java new file mode 100644 index 000000000..926d7af97 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/ServiceEngineTest.java @@ -0,0 +1,54 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ${artifactId}Test.java + */ + +package enginetest; + +import net.openesb.component.${artifactId}.test.JBIComponentTestClient; +import net.openesb.component.${artifactId}.test.SOAPBindingTestClient; +import java.util.Properties; + import junit.framework.TestCase; + +/** + * The test method in this testcase uses the SOAPBindingTestClient to send the + * input document to the echo service provided by service engine via soap binding + * component and receives the output document which will be placed in test results + * directory under the same package as this test case. + * @see com.sun.jbi.sample.component.test.SOAPBindingTestClinet + * @author chikkala + */ +public class ServiceEngineTest + extends TestCase +{ + public ServiceEngineTest(String testName) { + super(testName); + } + + public void test1() throws Exception { + String testPropertiesPath = "test1.properties"; + JBIComponentTestClient testClient = new SOAPBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public void test2() throws Exception { + String testPropertiesPath = "test2.properties"; + JBIComponentTestClient testClient = new SOAPBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public static void main(String[] args) { + try { + ServiceEngineTest compTest = new ServiceEngineTest("ServiceEngineTest"); + compTest.test1(); + compTest.test2(); + } catch(Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test1.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test1.properties new file mode 100644 index 000000000..fd5ee2403 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test1.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +input.file=test1Input.xml +${symbol_pound} expected.file=Expected.xml +output.file=test1Output.xml +soap.binding.inbound.endpoint.address.location=http://localhost:12010/ServiceEngine/greetings +soap.binding.soapaction=sayHello +fail.on.soap.fault=true + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test1Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test1Input.xml new file mode 100644 index 000000000..b1a3ecc9e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test1Input.xml @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test2.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test2.properties new file mode 100644 index 000000000..5a35303e5 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test2.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +input.file=test2Input.xml +${symbol_pound} expected.file=Expected.xml +output.file=test2Output.xml +soap.binding.inbound.endpoint.address.location=http://localhost:12010/ServiceEngine/greetings +soap.binding.soapaction=sayGoodbye +fail.on.soap.fault=true + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test2Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test2Input.xml new file mode 100644 index 000000000..47952104c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/enginetest/test2Input.xml @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java new file mode 100644 index 000000000..919ad6829 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java @@ -0,0 +1,298 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JBIComponentTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; + +/** + * This class implements the base framework for the testing the JBI components. + * Testing the JBI component involves may require deploying a service to the + * component(s) to enable the service provided by the test component and then + * invoking the service provided by the test component. If the test component is + * a binding component, then a service provider component such as sample service + * engine is required to test the component end to end. If the test component is a + * service engine, then the service on the test component can be invoked via + * soap/http binding component. + * + * This class provides the utilites to read the test properties, read the input + * message from the file and save the output to the file. The testService + * method implemented here can be executed as the test for the component. The + * testService method calls the invokeService method with the input document and + * expects a output document or error that will be saved to the output file. + * The method invokeService should be implemented by the extended test classes to + * inplement a suitable service consumer implemenation for the test compoent. + * See JMXBindingTestClient.java or SOAPBidningTestClient.java for more details + * on how to implement a partucular test service consumer. + * + * @author chikkala + */ +public abstract class JBIComponentTestClient { + + public static final String TEST_PROPS_FILE_PROP = "test.properties.file"; + public static final String TEST_RESULTS_DIR_PROP = "test.results.dir"; + public static final String TEST_SRC_DIR_PROP = "test.src.dir"; + + public static final String TEST_PACKAGE_PROP = "test.package.name"; + + public static final String INPUT_FILE_PROP = "input.file"; + public static final String EXPECTED_FILE_PROP = "expected.file"; + public static final String OUTPUT_FILE_PROP = "output.file"; + + public static final String DEF_TEST_PROP_FILE = "test.properties"; + public static final String DEF_INPUT_FILE = "Input.xml"; + public static final String DEF_OUTPUT_FILE = "Output.xml"; + public static final String DEF_TEST_RESULTS_DIR = "test-results"; + + public JBIComponentTestClient() { + } + /** + * returns the absolute resource path w.r.t. the packagePath if the resource name + * is relative else return the resourceName as it is. + * @param package name ( dot separated ) + * @param resourcName dot separated name or a absolute resource path + * @return abosolute resource path with path separator + */ + public static String resolveResourcePath(String packageName, String resourceName) { + String resourcePath = resourceName; + if ( !resourceName.startsWith("/")) { + // it is relative resource file. resolve it w.r.t. testPackage + String pkgDir = packageName.trim().replace('.', '/'); + if ( pkgDir.length() != 0 ) { + pkgDir += "/"; + } + resourcePath = "/" + pkgDir + resourceName; + } + return resourcePath; + } + /** + * loads the resource file as properties. + * @param testPackage package name where this test belongs + * @param testPropPath resource path relative to testPackage or absolute resource path + */ + public Properties loadTestProperties(String testPackage, String testPropPath) throws IOException { + String propsResourcePath = resolveResourcePath(testPackage, testPropPath); + + InputStream testPropIS = null; + try { + testPropIS = this.getClass().getResourceAsStream(propsResourcePath); + Properties testProps = new Properties(); + testProps.load(testPropIS); + testProps.setProperty(TEST_PACKAGE_PROP, testPackage); + return testProps; + } finally { + if ( testPropIS != null ) { + try { + testPropIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @param testPropPath resource path relative to testPackage or absolute resource path + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass, String testPropPath) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), testPropPath ); + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), DEF_TEST_PROP_FILE ); + } + /** + * loads the resource file to string bugger + * @param inputFile resource file path + */ + public StringBuffer loadResourceFile(String resourcePath) throws FileNotFoundException, IOException { + + InputStream inputIS = null; + InputStreamReader inputReader = null; + BufferedReader reader = null; + StringWriter strWriter = null; + PrintWriter writer = null; + try { + inputIS = this.getClass().getResourceAsStream(resourcePath); + inputReader = new InputStreamReader(inputIS); + reader = new BufferedReader(inputReader); + strWriter = new StringWriter(); + writer = new PrintWriter(strWriter); + for ( String line = null; (line = reader.readLine()) != null ; ) { + writer.println(line); + } + writer.close(); + strWriter.close(); + return strWriter.getBuffer(); + } finally { + if ( inputIS != null ) { + try { + inputIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + + /** + * reads data from the reader and saves to file + * @param reader reader from which to read the data and save to file + * @param outputFilePath absolute file path + */ + public void saveOutputToFile(Reader reader, String outputFilePath) throws IOException { + + BufferedReader buff = null; + FileWriter fileWriter = null; + PrintWriter writer = null; + try { + buff = new BufferedReader(reader); + fileWriter = new FileWriter(outputFilePath); + writer = new PrintWriter(fileWriter); + for ( String line = null; (line = buff.readLine()) != null ; ) { + writer.println(line); + } + } finally { + if ( writer != null ) { + writer.close(); + } + if ( fileWriter != null ) { + fileWriter.close(); + } + } + } + + /** + * resource path. + */ + public String getInputFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String inputFile = testProps.getProperty(INPUT_FILE_PROP, DEF_INPUT_FILE); + String resourcePath = resolveResourcePath(testPkg, inputFile); + return resourcePath; + } + /** + * return resource path + */ + public String getExpectedFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String resourcePath = null; + String expFile = testProps.getProperty(EXPECTED_FILE_PROP, null); + if ( expFile != null ) { + resourcePath = resolveResourcePath(testPkg, expFile); + } + return resourcePath; + } + /** + * return the absolute path to the output file + */ + public String getOutputFilePath(Properties testProps) { + + String defPackage = this.getClass().getPackage().getName(); + String testPackage = testProps.getProperty(TEST_PACKAGE_PROP, defPackage); + String testPackageDir = testPackage.replace('.','/'); + String outputFile = testProps.getProperty(OUTPUT_FILE_PROP, DEF_OUTPUT_FILE); + + String userHomeDir = System.getProperty("user.home", ""); + String userDir = System.getProperty("user.dir", userHomeDir); + String defResultsDir = userDir + "/" + DEF_TEST_RESULTS_DIR; + String sysResultDir = System.getProperty(TEST_RESULTS_DIR_PROP, defResultsDir); + String resultDir = testProps.getProperty(TEST_RESULTS_DIR_PROP, sysResultDir); + + File outputDir = new File(resultDir, testPackageDir); + // System.out.println("Creating the test results output dir " + outputDir); + outputDir.mkdirs(); + return (new File(outputDir, outputFile)).getAbsolutePath(); + } + + /** + * This is the method where the actual service invocation code based on the + * type of client will be implemented. testService method calls this method + * after preparing the test input and then processes the output returned by + * this method to complte the test. + * @param inputDoc + * @param testProps + * @throws java.lang.Exception + * @return + */ + public abstract StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception; + + /** + * abstract method implemented by the extended classes to compare the output + * document with the expected output to determine the test is a failure or + * success. + * @param outputDoc + * @param expectedDoc + * @param testProps + * @throws java.lang.Exception + */ + public abstract void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, Properties testProps) throws Exception; + + /** + * This is the main test method that a test case will call to test the + * service. The standard steps that required to invoke the service and + * process the output will be done in this method. Each test case creates + * the test Properties required for that test and executes this method for + * testing the service by passing the test properties to it. This method + * prepares the input and executes the invokeService method to invoke a + * service with the prepared input. It then processes the return value from + * the invokeService to complete the test. + * + * @param testProps + * @throws java.lang.Exception + */ + public void testService(Properties testProps) throws Exception { + + String inFilePath = getInputFileResourcePath(testProps); + String outFilePath = getOutputFilePath(testProps); + String expFilePath = getExpectedFileResourcePath(testProps); + File outDir = (new File(outFilePath)).getParentFile(); + outDir.mkdirs(); + + StringBuffer outputDoc = new StringBuffer(); + + try { + StringBuffer inputDoc = loadResourceFile(inFilePath); + outputDoc = invokeService(inputDoc, testProps); + if ( expFilePath != null ) { + StringBuffer expOutputDoc = loadResourceFile(expFilePath); + compareWithExpectedOutput(inputDoc, expOutputDoc, testProps); + } + } catch (Exception ex) { + StringWriter out = new StringWriter(); + ex.printStackTrace(new PrintWriter(out)); + outputDoc.append(out.getBuffer()); + throw ex; + } finally { + if ( outputDoc != null ) { + System.out.println(outputDoc); + this.saveOutputToFile(new StringReader(outputDoc.toString()), outFilePath); + } + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java new file mode 100644 index 000000000..7cc8c103e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java @@ -0,0 +1,136 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the proxy service consumer implementation by a binding component + * that can communicate with the external service consumers using JMX interface. + * @author chikkala + */ +public class JMXBindingTestClient extends JBIComponentTestClient { + + public static final String CONSUMER_EP_INBOUND_OPERATION_PROP = "consumer.jmx.bc.ep.operation"; + public static final String CONSUMER_EP_ADDRESS_MBEAN_PROP = "consumer.jmx.bc.ep.address.mbean"; + public static final String CONSUMER_EP_ADDRESS_URL_PROP = "consumer.jmx.bc.ep.address.serviceURL"; + public static final String CONSUMER_EP_ADDRESS_USERNAME_PROP = "consumer.jmx.bc.ep.address.username"; + public static final String CONSUMER_EP_ADDRESS_PASSWORD_PROP = "consumer.jmx.bc.ep.address.password"; + + public static final String PROVIDER_EP_INBOUND_OPERATION_PROP = "provider.jmx.bc.ep.operation"; + public static final String PROVIDER_EP_ADDRESS_MBEAN_PROP = "provider.jmx.bc.ep.address.mbean"; + public static final String PROVIDER_EP_ADDRESS_URL_PROP = "provider.jmx.bc.ep.address.serviceURL"; + public static final String PROVIDER_EP_ADDRESS_USERNAME_PROP = "provider.jmx.bc.ep.address.username"; + public static final String PROVIDER_EP_ADDRESS_PASSWORD_PROP = "provider.jmx.bc.ep.address.password"; + + + /** + * Creates a new instance of JMXBindingTestClient + */ + public JMXBindingTestClient() { + super(); + } + /** + * creates jmx connection to send the input message to the binding component. + */ + public static MBeanServerConnection getJMXConnection(Properties testProps) + throws MalformedURLException, IOException { + + String jmxUrl = testProps.getProperty(CONSUMER_EP_ADDRESS_URL_PROP); + String username = testProps.getProperty(CONSUMER_EP_ADDRESS_USERNAME_PROP); + String password = testProps.getProperty(CONSUMER_EP_ADDRESS_PASSWORD_PROP); + + Map env = new HashMap(); + if ( username != null ) { + String [] credentials = new String [] {username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, JMXBindingTestClient.class.getClassLoader()); + } + JMXServiceURL serviceURL = new JMXServiceURL(jmxUrl); + JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, env); + MBeanServerConnection mbeanServerConnection = jmxConnector.getMBeanServerConnection(); + return mbeanServerConnection; + } + /** + * constructs the jmx mbean objectname + */ + public static ObjectName createJMXEndpointMBeanObjectName(String endpointAddressMBean) throws MalformedObjectNameException { + // String objectName = JMX_DOMAIN + ":" + JMX_ENDPOINT_ADDRESS_KEY + "=" + endpointAddressMBean; + return new ObjectName(endpointAddressMBean); + } + /** + * invokes a jmx mbean to send message. + */ + public static StringBuffer invokeSendMessage(MBeanServerConnection jmxConn, ObjectName epAddressName, + String operation, StringBuffer inputDoc) + throws MalformedObjectNameException, InstanceNotFoundException, + MBeanException, ReflectionException, IOException { + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if ( result != null ) { + outDoc = (StringBuffer)result; + } + + return outDoc; + } + /** + * invokes the service via jmx interface. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + ObjectName epAddressName = new ObjectName(testProps.getProperty(CONSUMER_EP_ADDRESS_MBEAN_PROP)); + String operation = testProps.getProperty(CONSUMER_EP_INBOUND_OPERATION_PROP); + + MBeanServerConnection jmxConn = getJMXConnection(testProps); + StringBuffer outputDoc = null; + try { + outputDoc = invokeSendMessage(jmxConn, epAddressName, operation, inputDoc); + } catch (MBeanException ex) { + Exception targetEx = ex.getTargetException(); + if ( targetEx != null ) { + throw targetEx; + } else { + throw ex; + } + } + return outputDoc; + } + /** no expected output comparison implemented */ + public void compareWithExpectedOutput(StringBuffer inputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java new file mode 100644 index 000000000..28f534612 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java @@ -0,0 +1,159 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SOAPBindingTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.util.Properties; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPConnection; +import javax.xml.soap.SOAPConnectionFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPFault; +import javax.xml.soap.SOAPMessage; +import javax.xml.soap.SOAPPart; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the Service Engine via SOAP Binding by invoking the service using + * SOAP Client that sends the message to the service provider via soaphttp binding. + * + * @author chikkala + */ +public class SOAPBindingTestClient extends JBIComponentTestClient { + + private static final String ADDRESS_PROP = "soap.binding.inbound.endpoint.address.location"; + private static final String SOAP_ACTION_PROP = "soap.binding.soapaction"; + private static final String FAIL_ON_SOAP_FAULT_PROP = "fail.on.soap.fault"; + + private static MessageFactory messageFactory; + private static SOAPConnectionFactory soapConnFactory; + private static SOAPConnection connection; + + public SOAPBindingTestClient() throws SOAPException { + init(); + } + /** initializes SOAP client */ + private synchronized void init() throws SOAPException { + if ( messageFactory == null ) { + messageFactory = MessageFactory.newInstance(); + } + if ( soapConnFactory == null ) { + soapConnFactory = SOAPConnectionFactory.newInstance(); + } + if ( connection == null ) { + connection = soapConnFactory.createConnection(); + } + } + + /** + * read in a soap message from the given input file + */ + private static SOAPMessage loadMessage(Reader inReader) throws SOAPException, IOException { + //Create and populate the message from a file + SOAPMessage message = messageFactory.createMessage(); + SOAPPart soapPart = message.getSOAPPart(); + StreamSource preppedMsgSrc = new StreamSource(inReader); + soapPart.setContent(preppedMsgSrc); + message.saveChanges(); + return message; + } + /** saves the SOAP message as xml text to a writer */ + private static void saveMessage(SOAPMessage response, Writer outWriter) + throws TransformerConfigurationException, SOAPException, TransformerException { + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute("indent-number", new Integer(2)); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + SOAPPart replySOAPPart = response.getSOAPPart(); + Source sourceContent = replySOAPPart.getContent(); + StreamResult result = new StreamResult(outWriter); + try { + transformer.transform(sourceContent, result); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + } + /** + * Send a soap message + * @param destination URL to send to + * @param message message to send + * @param expectedHttpStatus expected http status code or null if success is expected + * @return reply soap message + */ + private static SOAPMessage sendMessage(String destination, SOAPMessage message, String soapAction) throws SOAPException { + + // Add soapAction if not null + if (soapAction != null) { + MimeHeaders hd = message.getMimeHeaders(); + hd.setHeader("SOAPAction", soapAction); + } + // Send the message and get a reply + SOAPMessage reply = null; + reply = connection.call(message, destination); + return reply; + } + /** check the xml text in the StringBuffer passed contains SOAP Fault. */ + public boolean isSOAPFault(StringBuffer msgBuff) { + SOAPFault soapFault = null; + try { + SOAPMessage inMsg = loadMessage(new StringReader(msgBuff.toString())); + soapFault = inMsg.getSOAPBody().getFault(); + } catch (Exception ex) { + // any exception, means either no fault elem or invalid xml + } + return (soapFault != null); + } + /** + * invokes the service ny sending the input message and return the output + * message returned by the service. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + String soapAction = testProps.getProperty(SOAP_ACTION_PROP); + String destination = testProps.getProperty(ADDRESS_PROP); + SOAPMessage inMsg = loadMessage(new StringReader(inputDoc.toString())); + SOAPMessage outMsg = sendMessage(destination, inMsg, soapAction); + StringWriter out = new StringWriter(); + saveMessage(outMsg, out); + StringBuffer outDoc = out.getBuffer(); + Boolean failOnSoapFault = Boolean.valueOf(testProps.getProperty(FAIL_ON_SOAP_FAULT_PROP, "false")); + if ( failOnSoapFault ) { + if (isSOAPFault(outDoc)) { + StringBuffer errBuff = new StringBuffer("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} SOAP FAULT ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} ${symbol_escape}n"); + errBuff.append(outDoc); + throw new Exception(errBuff.toString()); + } + } + return outDoc; + } + /** comparing the received output document with the expected document. throw + * exception if the docs are not same. throwing the exception in this method + * fails the test. + */ + public void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/build.properties new file mode 100644 index 000000000..945269943 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/build.properties @@ -0,0 +1,22 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service assembly builds +${symbol_pound} user.properties.file=../../user.properties +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +service.assembly.name=testSA + +${symbol_pound}no.deps=true set the no.deps property if there are no SUs to build +${symbol_pound} for each testSU define the properties here. +${symbol_pound} dependent BC SU projects dependency +${symbol_pound} service unit name +service.unit.name.testSUBC=testSUBC +${symbol_pound} service unit project directory +project.testSUBC=testSUBC + +${symbol_pound} service unit name +service.unit.name.testSUSE=testSUSE +${symbol_pound} service unit project directory +project.testSUSE=testSUSE diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..02f75e641 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/build.xml @@ -0,0 +1,140 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..ed9f610e9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,44 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + ${artifactId}_TestSA + This is a test Service Assembly to test Engine + + + + + ${artifactId}_TestSUBC + This service unit enables soap inbound endpoint for a service in service engine + + + testSUBC.zip + sun-http-binding + + + + + ${artifactId}_TestSUSE + This service unit enables greetings service provider in service engine + + + testSUSE.zip + ${artifactId} + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.properties new file mode 100644 index 000000000..1bfd81c69 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.properties @@ -0,0 +1,10 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service unit builds +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +${symbol_pound}build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..777fb3cf9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,74 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC.zip b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC.zip new file mode 100644 index 0000000000000000000000000000000000000000..f4205815d39cfd4aaec83644439b3cde3918d3e4 GIT binary patch literal 1341 zcmWIWW@h2#VgP}Fg7;=%29)3g(!Q=Cj=G+HZu$W*bsS)I!neYX-(X^3DB)vZ03rtW zqSVxq%)Insz4GFeoU7r!_O}cK_J+Tz?HofeUP;oE1p@h=GJLFfc6QIlGe?$KR_PWTk^hvrS#$ zG-GyDUQ3~j=ik&dZzhW?{?xo?D6#$C;!P^+DzD32PkO^~a=W@oPf{|AfNPqIQeV)` z1!X#W7=Ags)=RY*i`>{R@FLq$vfloD?iyaM_F%#1k{2202>CU89(34Kb@|c$PiNJa zo;~~f|NPzD2C>WUyyRHJ$n=Xd=}l0AzofG8;+BK5n|6Kj^nT;)k?ryJSgn}%$7Ke0 zZr!`6%gbez&sKF}{;S7=?OyKHUu0%!3Vf3Il4kWURp{h{j#){Wp?pq^#3CJwzjp;JU<1iWQCpi)5Kl=^k-~R6))HQ zCvW*w-=$vmf4*zJp>WmXf10JUpWXBHwO?6TzHN5&dRrIss3-e;JJso$d_o#Ot|Cz)$PqR|H$i;mAZ|fbmgWgTv^o3zW@Eto73OwosInZ;-=N9@YyAMgFKe5*15X# z-=7NKxGj$oRv4wb&v-4LvbM}sCUtr9-sUKWwU0dP{bf40i*MU$*LER~u`SV~{rQ!j zQuD68=H;r{yZ`NJWiz#nCbOpRXnFtOcM0(hXiNLEQ&O zP2NgMR;=P&{64qSAaIjfbKl}eSu@W1hOv7;=H(J9%uFp5`v1WC%H{&0>3uu0U2K9m zXS(^BNX9$AU2k7~@91Wc3-z$qK|=LiM=|IiCQ2bSqjmN9%~5A+RR9n YLgO&No0Scuf*A-m0_jv15RaD&0Ny4i^#A|> literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl new file mode 100644 index 000000000..038d91bcd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml new file mode 100644 index 000000000..05f4f9bef --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl new file mode 100644 index 000000000..8a160abd0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..05f4f9bef --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.properties new file mode 100644 index 000000000..1bfd81c69 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.properties @@ -0,0 +1,10 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service unit builds +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +${symbol_pound}build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..846415d3a --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,74 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE.zip b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE.zip new file mode 100644 index 0000000000000000000000000000000000000000..2db1a3a5c32b7f22dd9f6213cb0b25c2076d30b3 GIT binary patch literal 3003 zcmaJ@c{G%58y~VYW+wYOQixF25Yk;_84NOZ*@nq(7{s7-7)vjwb7U#YK_Tm)$d*QS z$r9POm~7eRB^4^ZsrUVQ`|3U4{XFNspFghObDih9p5O0xnHe2ofi37g zx5M-kt!r`dG|EIz-t50|Y~SO!C#*Wh7$J}#1O!6AA^HRyF38i*Jy0$r(9LJq8Vx2C zIG$OrM8*@GV3YPdz^?c~YQwr=P=OdbP!{?w|Ct+p2920_>@nejjK-wSe>|fxO0tf>eyn^0%CElHSv{5XjVV}?C9%S zbd5eQEaTc$<9C(mK#9>C7wJqSHs=iq)~3oP{c$Xc8l)q+Q>>@dFAK_>Fee;7ATUW8 zmpa{JHfeq1mj-m+#ALOyq!wx4%e3<&1t3vhab;`C{Kt2tM-&BWXYw9PloLmhqu4dJ z7qwDn60xpK9J*I8iQP6I&%Ji45wfSF8!1Fm<{4|^SoXds7zz4)%iz#B4Cj*I07Dj+ zNi?eYLSxu#YSUJ)R6%d==YyQ5>ZZ#m-(^~1N38PXhE0^3(L_HkSi1wL-+KKdb^Y@}nZ$hXNl#xvkgBaIWh?&D+y)b$zO5cw zVQwu`PwS~)Ek(D#@_xC{X?)&Jbzt27fB<4+$&08hjD(j}&zC6nkcC|bY#1E+W_}%U zVgvWubg3ankvr_|zI1Tr;tUE6iisgLnf4W0m(=X$DQE+={smX0pu)6=FOB&K%c45( zGtpFu=sja&SJcINsYI!S&Rr}bTbd|KxTKczS+j1^$x9$8!gyIEhsP#TDQ5duC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#Zhhvhq7=_7-+V3U2P6_;WO*=$~b>vQ^t{ zQ<7og?zQS?;~1{hdF&7pt0|eJ_(zY8!~NRVkq@2-v$59#R84sn;}YR$h2{iq!p5`` z>GATkp#1aXrr~w-XBK@^27y_Q_%RyZ(_E~ zOA1H3<##fwBRxZMU*ut2 z3967oCG-IDn=v67nt?ED_4^BP*($q>hWGs!WeS2CTF1OiUbFi2IBp}tOHlB+OJ zPFRuUNgs;FVyjqHI%MuSUg3!07uT<;dK^02tsgZbZ+Ba2%2?(K+q~tmiY;4+hjk=D z-+?ujGSxASQogNlW)Hc?l&yDBZzb)blqtel%-+U7)2sTSa!N-4kXyXXGC##BQUDCD zW}fcPgi%qjFKH3x?47J=Pi>xa;gyuZAg!@3^m7n?e5i`jmh*!sh+S=^4%Mn=Rg6n{pLI7-0}${2A?&zJMN+F3K?%So8Iv? z&Dl7*9&KVtp4mFc8w~zP^X2yRAhn;i%LaP*vNdxJO=5oo@Z3%9m$R!LkyTw?`E+Kb zz1Ld?-v=&>QrPGC+`~M#x1ESOxE1`oChv{+6vw0fkGfa+OB;0$4w)G-F!CJwKcgf4 z2cjQ;9uSMJMueNmM$_slK$<*zrlaC zoPXd!bQAi?fPO>%s%8HmFVorcL)m`A{m!y~kSnbJ#yK-1X8Ic;5ElC7LRU|TziJML F{s$_z?xO$z literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl new file mode 100644 index 000000000..038d91bcd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml new file mode 100644 index 000000000..8235893ee --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/goodbye.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/hello.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/xsltmap.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/xsltmap.properties new file mode 100644 index 000000000..44baf5452 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/build/testSUSE/xsltmap.properties @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} properties will be used to find the xslt file that will be used for invoking a +${symbol_pound} service operation. +${symbol_pound} The "xsltmap.properties" file should contain two types of properties +${symbol_pound} 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +${symbol_pound} "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +${symbol_pound} 2. a service description to xslt file properties with syntax like +${symbol_pound} "{tns-prefix}service-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +${symbol_pound} the service description property is a "." delimited tokens that represents +${symbol_pound} a serive or interface qname and a operation name. To locate xslt file either with +${symbol_pound} service qname or service qname and operaton or serivice qname and interface qname +${symbol_pound} and operation, all the three properties specified above should be there for each xslt file. +${symbol_pound} + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +${symbol_pound} just service level default settings +{greet2}greetService=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl new file mode 100644 index 000000000..8a160abd0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..8235893ee --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/hello.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties new file mode 100644 index 000000000..44baf5452 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} properties will be used to find the xslt file that will be used for invoking a +${symbol_pound} service operation. +${symbol_pound} The "xsltmap.properties" file should contain two types of properties +${symbol_pound} 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +${symbol_pound} "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +${symbol_pound} 2. a service description to xslt file properties with syntax like +${symbol_pound} "{tns-prefix}service-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +${symbol_pound} the service description property is a "." delimited tokens that represents +${symbol_pound} a serive or interface qname and a operation name. To locate xslt file either with +${symbol_pound} service qname or service qname and operaton or serivice qname and interface qname +${symbol_pound} and operation, all the three properties specified above should be there for each xslt file. +${symbol_pound} + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +${symbol_pound} just service level default settings +{greet2}greetService=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/archetype.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/archetype.properties new file mode 100644 index 000000000..c7bdacd1c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/archetype.properties @@ -0,0 +1,6 @@ +#Tue Jul 30 12:05:58 IST 2013 +package=it.pkg +version=0.1-SNAPSHOT +groupId=archetype.it +artifactId=ServiceEngine-archetype +glassfishLocation=C:\\GlassFishESBv22\\glassfish diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/goal.txt b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/goal.txt new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/build.log b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/build.log new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/build.xml new file mode 100644 index 000000000..577e396e4 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/build.xml @@ -0,0 +1,69 @@ + + + + + + Builds, tests, and runs the project ServiceEngine-archetype. + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/install-params.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/install-params.properties new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild-impl.xml new file mode 100644 index 000000000..9687b905b --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild-impl.xml @@ -0,0 +1,130 @@ + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild.properties new file mode 100644 index 000000000..5bab5aa6b --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild.properties @@ -0,0 +1,45 @@ +# build properties file to set/override the properties of the netbeans project +# build properties when the netbeans build is called from the maven build lifecycle. +# Netbeans project when build from the IDE, uses a build.properties from the user.dir +# of the Netbeans IDE to resolve some of the properties used in the project such as +# the libraries classpath. +# When invoking the Netbeans project build from maven, this build.properties file +# is not available. So, you can add the properties defined in ide build properties +# that this project uses here. +# + +# default local repository settings. If the repository location is different +# -D command line option should override this (e.g. mvn -Dmaven.repo.local=/my/m2/repository +maven.repo.local=${user.home}/.m2/repository +# begin jbi admin settings +# set the below properties if you want to override the properties from nbproject/project.properties +# that sets the application server admin settings. +# +# jbi.as.home=C:/Sun/glassfish-v2-b58g +# jbi.host=localhost +# jbi.port=4848 +# jbi.username=admin +# jbi.password=adminadmin +# end jbi admin settings +# + +# classpath settings +junit.ant.task.classpath=${maven.repo.local}/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar +junit.runtime.classpath=${maven.repo.local}/junit/junit/3.8.2/junit-3.8.2.jar +libs.junit.classpath=${junit.runtime.classpath}:${junit.ant.task.classpath} +libs.jbi-cdk-ant-tasks.classpath=${maven.repo.local}/open-esb/jbi-cdk/jbi-cdk-ant-tasks/0.1-SNAPSHOT/jbi-cdk-ant-tasks-0.1-SNAPSHOT.jar + +libs.jbi.classpath=${maven.repo.local}/open-esb/jbi/1.0/jbi-1.0.jar +libs.wsdl4j.162.classpath=${maven.repo.local}/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar +# libs.jaxws21.classpath=${jbi.as.home}/lib/javaee.jar:${jbi.as.home}/lib/webservices-rt.jar +libs.jaxws21.classpath=\ +${maven.repo.local}/javax/activation/activation/1.1/activation-1.1.jar:\ +${maven.repo.local}/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:\ +${maven.repo.local}/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:\ +${maven.repo.local}/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:\ +${maven.repo.local}/com/sun/xml/ws/jaxws-rt/2.1.2/jaxws-rt-2.1.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild.xml new file mode 100644 index 000000000..6557242cf --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/m2nbbuild.xml @@ -0,0 +1,34 @@ + + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/build-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/build-impl.xml new file mode 100644 index 000000000..379b61c75 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/build-impl.xml @@ -0,0 +1,551 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task is getting executed! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task executed successfully! + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/genfiles.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/genfiles.properties new file mode 100644 index 000000000..2e46a992c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=ac78c060 +build.xml.script.CRC32=9068f2c7 +build.xml.stylesheet.CRC32=8add101f@1.0 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=ac78c060 +nbproject/build-impl.xml.script.CRC32=d15987fd +nbproject/build-impl.xml.stylesheet.CRC32=4ed53ee0@1.0 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/jbi_admin.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/jbi_admin.xml new file mode 100644 index 000000000..623507a02 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/jbi_admin.xml @@ -0,0 +1,501 @@ + + + + + +This ant script contains the jbi ant tasks and the targets and properties using +which the jbi admin commands can be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Usage : ant -f <fullpath>/jbi_admin.xml [options] [target] + options: -D<property>=<value> + Specify a property/value pairs as options that are valid for the target. + target : ant target name in jbi_admin.xml + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/jbiadmin-impl.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/jbiadmin-impl.xml new file mode 100644 index 000000000..cde39fb8b --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/jbiadmin-impl.xml @@ -0,0 +1,336 @@ + + + Install, uninstall, reinstall, start, stop, shutdown jbi components. + + + + + + + + + + + + + + Must set jbi.host + Must set jbi.port + Must set jbi.username + Must set jbi.password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/private/private.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/private/private.properties new file mode 100644 index 000000000..f4fdfea51 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/private/private.properties @@ -0,0 +1,3 @@ +javac.debug=true +javadoc.preview=true +user.properties.file=D:\\softwares\\openesb_logicoy_last_working57\\.netbeans\\openesb\\build.properties diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/private/retriever/catalog.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/private/retriever/catalog.xml new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/project.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/project.properties new file mode 100644 index 000000000..1d28e94eb --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/project.properties @@ -0,0 +1,90 @@ +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.predist.dir=${build.dir}/predist +build.predist.jar=${build.predist.dir}/component.jar +build.predist.lib.dir=${build.predist.dir}/lib +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.dir=${build.dir}/test +build.test.results.dir=${build.dir}/test/results +conf.dir=src/conf +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ServiceEngine-archetype.zip +dist.javadoc.dir=${dist.dir}/javadoc +jar.compress=false +javac.classpath=\ + ${libs.jbi.classpath}:\ + ${jbi.component.sharedlibs.classpath}:\ + ${jbi.component.lib.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.jaxws21.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jbi.ant.tasks.classpath=\ + ${jbi.as.home}/lib/sun-appserv-ant.jar:\ + ${jbi.as.home}/jbi/lib/jbi-ant-tasks.jar +#jbi.as.home=D:\\softwares\\openesb_logicoy_last_working53\\glassfish +jbi.as.home=C:\GlassFishESBv22\glassfish +#jbi.as.instance.id=[D:\\softwares\\openesb_logicoy_last_working53\\glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.as.instance.id=[C:\GlassFishESBv22\glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.component.bootstrap.class=ServiceEngine-archetype.ProviderSEInstaller +jbi.component.class=ServiceEngine-archetype.ProviderSERuntime +jbi.component.description=Description of service engine : ServiceEngine-archetype +jbi.component.lib.classpath=\ + ${libs.wsdl4j.162.classpath} +jbi.component.name=ServiceEngine-archetype +jbi.component.sharedlibs.classpath= +jbi.component.type=service-engine +jbi.host=localhost +jbi.install.params.file=install-params.properties +jbi.install.with.params=false +jbi.password=this really long string is used to identify a password that has been stored in the Keyring +jbi.port=4848 +jbi.soap.binding.name=sun-http-binding +jbi.username=admin +meta.inf.dir=${conf.dir}/META-INF +platform.active=default_platform +project.jbi.deploy.plugin=./deploy-plugin +project.testSA=test/testSA +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src/java +test-sys-prop.test.results.dir=${build.test.results.dir} +test-sys-prop.test.src.dir=test-sys-prop.test.src.dir +test.src.dir=test/java +testSA.enabled=true +testSA.name=ServiceEngine-archetype_TestSA diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/project.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/project.xml new file mode 100644 index 000000000..5a82a69e2 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/nbproject/project.xml @@ -0,0 +1,17 @@ + + + org.netbeans.modules.jbi.apisupport.project.jbicomponent + + + ServiceEngine-archetype + service-engine + 1.6.5 + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/pom.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/pom.xml new file mode 100644 index 000000000..f6911fd30 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/pom.xml @@ -0,0 +1,282 @@ + + + + 4.0.0 + archetype.it + ServiceEngine-archetype + jar + 0.1-SNAPSHOT + JBI Component[ServiceEngine-archetype] + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + http://open-esb.org + + build + src/java + test/java + build/classes + build/test/classes + package + + + org.apache.maven.plugins + maven-compiler-plugin + + true + 1.5 + 1.5 + + + **/*.java + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + **/*.* + + + + + maven-surefire-plugin + 2.1.3 + true + + + true + + **/bindingtest/*.java + **/enginetest/*.java + + + + + + maven-antrun-plugin + 1.2 + + + m2nbbuild-compile + compile + + run + + + + + + + + + m2nbbuild-compile-test + test-compile + + run + + + + + + + + + m2nbbuild-package + package + + run + + + + + + + + + m2nbbuild-utest + test + + run + + + + + + + + + m2nbbuild-itest + integration-test + + run + + + + + + + + + m2nbbuild-clean + clean + + run + + + + + + + + + + default-cli + + run + + + + !!!!!!!!!!!!!!!!!!!!!! Moving Files and organizing package !!!!!!!!!!!!!!!!!!!!!!!! + + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + + + + + + + maven2-repo1 + Maven2 Central Repository + http://repo1.maven.org/maven2 + + + download-java-net-maven2-repository + download.java.net Maven 2.x repository + http://download.java.net/maven/2/ + + + maven-repository.dev.java.net-repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + + + ws-zones + ws.zones maven repository + http://ws.zones.apache.org/repository2/ + + + apache.org + Maven Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + + apache.org + Maven Plugin Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + org.apache.maven + maven-ant-tasks + 2.0.7 + + + open-esb.jbi-cdk + jbi-cdk-ant-tasks + 1.0-SNAPSHOT + + + open-esb + jbi + 1.0 + + + wsdl4j + wsdl4j + 1.6.2 + + + com.sun.xml.ws + jaxws-rt + 2.1.2 + test + + + + + ${maven.repo.local} + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/conf/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/conf/META-INF/jbi.xml new file mode 100644 index 000000000..1f29286a1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/conf/META-INF/jbi.xml @@ -0,0 +1,42 @@ + + + + + + + ServiceEngine-archetype + Description of service engine : ServiceEngine-archetype + + + net.openesb.component.ServiceEngine-archetype.ProviderSERuntime + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + net.openesb.component.ServiceEngine-archetype.ProviderSEInstaller + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java new file mode 100644 index 000000000..1f439ae06 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEComponentLifeCycle.java @@ -0,0 +1,49 @@ +/* + * ProviderSEComponentLifeCycle.java + */ +package net.openesb.component.ServiceEngine-archetype; + +import net.openesb.component.ServiceEngine-archetype.common.BasicComponentLifeCycle; +import net.openesb.component.ServiceEngine-archetype.common.DefaultMessageExchangeReceiver; +import net.openesb.component.ServiceEngine-archetype.common.MessageExchangeReceiver; +import net.openesb.component.ServiceEngine-archetype.common.RuntimeContext; +import javax.jbi.JBIException; +import javax.jbi.component.Component; + +/** + * This class extends the basic ComponentLifeCycle implementation to provide + * component specific implementation of the ComponentLifeCycle. + * + * @see javax.jbi.ComponentLifeCycle + * @see com.sun.jbi.sample.component.common.BasicComponentLifeCycle + * @author chikkala + */ +public class ProviderSEComponentLifeCycle extends BasicComponentLifeCycle { + + /** + * constructor + */ + public ProviderSEComponentLifeCycle(Component compRuntime) { + super(compRuntime); + } + + /** + * creates DefaultMessageExchangeReceiver to handles receiving and + * processing the message exchanges from the delivery channel. + */ + @Override + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return new DefaultMessageExchangeReceiver(); + } + + /** + * chance to extended classes to do the component specific init + * + * @throws javax.jbi.JBIException + */ + @Override + protected void doInit() throws JBIException { + // NOOP + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEEndpoint.java new file mode 100644 index 000000000..4bd540df4 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEEndpoint.java @@ -0,0 +1,98 @@ +/* + * ProviderSEEndpoint.java + */ +package net.openesb.component.ServiceEngine-archetype; + +import net.openesb.component.ServiceEngine-archetype.common.MessageExchangeHandler; +import net.openesb.component.ServiceEngine-archetype.common.RuntimeHelper; +import net.openesb.component.ServiceEngine-archetype.common.MessageExchangeListener; +import net.openesb.component.ServiceEngine-archetype.common.deployment.ProviderEndpoint; +import net.openesb.component.ServiceEngine-archetype.common.deployment.SUDescriptor; +import javax.jbi.JBIException; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.wsdl.Definition; + +/** + * This class extends the ProviderEndpoint to implement component specific + * endpoint configuration. It implements the MessageExchangeListener to receive + * message exchange notifications from the MessageExchangeSupport fired by + * MessageExchangeReceiver and process it using a message exchange handler. + * + * This endpoint is configured for a service provided by this component which + * can receive a xml document and apply xslt transformation and send the results + * back in a InOut message exchange to complete a service invocation on this + * endpoint. + * + * @author chikkala + */ +public class ProviderSEEndpoint extends ProviderEndpoint implements MessageExchangeListener { + + private XSLTFileLocator mXsltFileLocator; + private XSLTService mXsltService; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public ProviderSEEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ProviderSEServiceUnit su) { + super(provides, wsdlDef, su); + } + + /** + * XSLT transformation service used in transformation of the xml documents + * received on this endpoint. + */ + public XSLTService getXSLTService() { + return this.mXsltService; + } + + /** + * returns the XSLTFileLocator object that is created to find the xslt file + * to be used for a particular service operation invocation by looking at + * the mapping file specified in the service unit that deploys this + * endpoint. + */ + public XSLTFileLocator getXSLTFileLocator() { + return this.mXsltFileLocator; + } + + @Override + public void doInit() throws JBIException { + RuntimeHelper.getLogger().info("ProviderSEEndpoint:doInit called"); + ProviderSEServiceUnit su = (ProviderSEServiceUnit) this.getServiceUnit(); + this.mXsltFileLocator = su.getXsltFileLocator(); + this.mXsltService = XSLTService.XSLTServiceImpl.getInstance(); + } + + /** + * creates the message exchange handler that will be used to process the + * message exchange received for this endpoint. + */ + @Override + public MessageExchangeHandler createMessageExchangeHandler() { + return new ProviderSEMessageExchangeHandler(this); + } + + /** + * returns the implementation of the message exchange listener which the + * MessageExchangeSupport invokes when a message exchange is received from + * delivery channel by MessageExchangeReceiver. + */ + @Override + protected MessageExchangeListener createMessageExchangeListener() { + return this; + } + + /** + * implementation of the message exchange received method of the listener. + */ + public void messageExchangeReceived(ExchangeStatus status, MessageExchange me) { + try { + RuntimeHelper.getLogger().fine("MXListener.MessageExchangeReceived: with Status: " + status); + processMessageExchangeWithHandler(status, me); + // processMessageExchange(me); + } catch (Exception ex) { + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEInstaller.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEInstaller.java new file mode 100644 index 000000000..cb5e197e4 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEInstaller.java @@ -0,0 +1,31 @@ + /* + * ProviderSEInstaller.java + */ +package net.openesb.component.ServiceEngine-archetype; + +import net.openesb.component.ServiceEngine-archetype.common.ComponentInstaller; + +/** + * This class extends the ComponentInstaller that implements the + * javax.jbi.component.Bootstrap for a component installation contract. + * + * If the default implemenation of the javax.jbi.component.Bootstrap in + * com.sun.jbi.sample.component.common.ComponentInstaller is not sufficient for + * this components install, uninstall and upgrade requirements, override the + * default implementation here to add component specific installation and + * upgrade tasks such as initializing configuration mbean and creating resources + * specific to component or upgrade workspace and service units during upgrading + * the component. + * + * @see javax.jbi.Bootstrap + * @see com.sun.jbi.sample.component.common.ComponentInstaller + * @author chikkala + */ +public class ProviderSEInstaller extends ComponentInstaller { + + /** + * Constructor to create the MyEngineInstaller. + */ + public ProviderSEInstaller() { + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java new file mode 100644 index 000000000..8e6d9abfd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEMessageExchangeHandler.java @@ -0,0 +1,168 @@ +/* + * ProviderSEMessageExchangeHandler.java + * + */ +package net.openesb.component.ServiceEngine-archetype; + +import net.openesb.component.ServiceEngine-archetype.common.AbstractMessageExchangeHandler; +import net.openesb.component.ServiceEngine-archetype.common.RuntimeHelper; +import net.openesb.component.ServiceEngine-archetype.common.wsdl.WSDL11JBIWrapper; +import java.io.StringReader; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Source; + +/** + * This class extends the AbstractMessageExchangeHandler to implement the + * component specific message exchange processing on the provider side in a + * service engine. + * + * @author chikkala + */ +public class ProviderSEMessageExchangeHandler extends AbstractMessageExchangeHandler { + + private ProviderSEEndpoint mEndpoint; + + /** + * Creates a new instance of ProviderSEMXHandler + */ + public ProviderSEMessageExchangeHandler(ProviderSEEndpoint endpoint) { + this.mEndpoint = endpoint; + } + + protected Logger getLogger() { + return this.mEndpoint.getLogger(); + } + + protected DeliveryChannel getDeliveryChannel() { + return this.mEndpoint.getDeliveryChannel(); + } + + protected void validateMessageExchange() throws MessagingException { + MessageExchange msgExchange = this.getMessageExchange(); + + if (this.getMessageExchange() == null) { + throw new MessagingException("MessageExchange Object is null in MessageExchageHandler"); + } + + if (MessageExchange.Role.CONSUMER.equals(msgExchange.getRole())) { + throw new MessagingException("Provider Message Exchange Handler can not have MessageExchange with CONSUMER Role"); + } + + if (!(msgExchange instanceof InOut)) { + throw new MessagingException("InOut Message Exchange Handler MessageExchange object should be instanceof javax.jbi.messaging.InOut "); + } + } + + protected void processError(Exception ex) { + MessageExchange msgExchange = this.getMessageExchange(); + Exception errEx = msgExchange.getError(); // get the error and print + RuntimeHelper.getLogger().info( + "InOut Message Exchange Provider received Error: " + errEx.getMessage()); + msgExchange.getError().printStackTrace(); + } + + protected void processDone() { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.getLogger().info("InOut Message Exchange Provider received DONE :" + + " END of service invocation"); + } + + protected void processFault(Fault fault) { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.logError("InOut Message Exchange Provider Handler can not receive Fault on Provider side"); + } + + protected void processMessage() { + try { + processInMessageOnProvider((InOut) this.getMessageExchange()); + } catch (JBIException ex) { + ex.printStackTrace(); + } + } + + protected void processInMessageOnProvider(InOut inOutExchange) throws JBIException { + RuntimeHelper.getLogger().fine("Processing In Message on Provider side " + inOutExchange); + // receive IN message. + NormalizedMessage inMsg = inOutExchange.getInMessage(); + NormalizedMessage outMsg = null; + Fault fault = null; + Source inContent = null; + Source outContent = null; + Source faultContent = null; + String faultAsText = null; + // process in message + inContent = inMsg.getContent(); + // invoke the service operation + try { + QName opName = inOutExchange.getOperation(); + QName svcName = inOutExchange.getEndpoint().getServiceName(); + RuntimeHelper.getLogger().fine("xslt service info " + svcName + opName); + + XSLTFileLocator xsltFileLocator = this.mEndpoint.getXSLTFileLocator(); + XSLTService xsltService = this.mEndpoint.getXSLTService(); + + String xsltPath = xsltFileLocator.findXsltFile(svcName, opName); + RuntimeHelper.getLogger().fine("XsltPath " + xsltPath); + if (xsltPath == null) { + RuntimeHelper.getLogger().fine(" No XSLT File found in MAP " + + xsltFileLocator.printMap()); + } + outContent = xsltService.transform(inContent, xsltPath); + + } catch (Exception ex) { + // exception invoking the operation. so, set exception text as fault content. + ex.printStackTrace(); + faultAsText = RuntimeHelper.getExceptionAsText(ex); + String faultText = RuntimeHelper.getExceptionAsXmlText(ex); + faultContent = RuntimeHelper.createDOMSource(new StringReader(faultText)); + } + // set out or fault message + if (outContent != null) { + // set the out message content. + outMsg = inOutExchange.createMessage(); + inOutExchange.setOutMessage(outMsg); + normalizeOutMessage(inOutExchange, outMsg, outContent); + // outMsg.setContent(outContent); + } else if (faultContent != null) { + fault = inOutExchange.createFault(); + inOutExchange.setFault(fault); + fault.setContent(faultContent); // may need to normalize the content. + } + // send out or fault message. + // this.getDeliveryChannel().sendSync(inOutExchange, SEND_SYNC_TIMEOUT); + this.send(); + } + + private void normalizeOutMessage(MessageExchange me, NormalizedMessage normMsg, Source msgSrc) throws MessagingException { + try { + // DOMSource wrappedSource = wrapOutputMessage(me, msgSrc); + WSDL11JBIWrapper outWrapper = WSDL11JBIWrapper.createOutputWrapper( + this.mEndpoint.getWSDLOperation(me.getOperation())); + + // check if the output from the transformer is in a wrapped form + WSDL11JBIWrapper wrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(msgSrc)); + if (wrapper != null) { + outWrapper.appendParts(wrapper.getParts()); + } else { + outWrapper.appendPart(RuntimeHelper.sourceToDOMSource(msgSrc)); + } + + normMsg.setContent(outWrapper.toDOMSource()); + + } catch (MessagingException ex) { + throw ex; + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSERuntime.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSERuntime.java new file mode 100644 index 000000000..fdad11739 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSERuntime.java @@ -0,0 +1,53 @@ +/* + * ProviderSERuntime.java + */ +package net.openesb.component.ServiceEngine-archetype; + +import net.openesb.component.ServiceEngine-archetype.common.ComponentRuntime; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; + +/** + * This class extends the ComponentRuntime that implements + * javax.jbi.component.Component interface required for the component contract + * at runtime. + * + * This class provides the component specific ComponentLifeCycle implementation + * as well as the component specific ServiceUnitManager implementation. + * + * Add any additional component runtime specific functionality here. + * + * @see javax.jbi.component.Component + * @see com.sun.jbi.sample.component.common.ComponentRuntime + * @see com.sun.jbi.sample.component.common.BasicComponentLifecycle + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @author chikkala + */ +public class ProviderSERuntime extends ComponentRuntime { + + /** + * Creates a new instance of MyEngineRuntime + */ + public ProviderSERuntime() { + super(); + } + + /** + * overriding the parent's createComponentLifeCycle to create component + * specific component lifecycle implementation. + */ + @Override + protected ComponentLifeCycle createComponentLifeCycle() { + return new ProviderSEComponentLifeCycle(this); + } + + /** + * overrides the parent's createServiceUnitManager to create component + * specific service unit manager + */ + @Override + protected ServiceUnitManager createServiceUnitManager() { + return new ProviderSESUManager(this); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSESUManager.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSESUManager.java new file mode 100644 index 000000000..e5350b2f8 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSESUManager.java @@ -0,0 +1,46 @@ +/* + * ProviderSESUManager.java + */ +package net.openesb.component.ServiceEngine-archetype; + +import net.openesb.component.ServiceEngine-archetype.common.RuntimeHelper; +import net.openesb.component.ServiceEngine-archetype.common.deployment.AbstractServiceUnitManager; +import net.openesb.component.ServiceEngine-archetype.common.deployment.ServiceUnit; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; + +/** + * This class extends the AbstractServiceUnitManager to implement component + * specific service unit manager by creating the component specific ServiceUnit + * implementation. + * + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit + * @author chikkala + */ +public class ProviderSESUManager extends AbstractServiceUnitManager { + + private ProviderSERuntime mRuntime; + + /** + * Creates a new instance of ProviderSESUManager + */ + public ProviderSESUManager(ProviderSERuntime compRuntime) { + super(); + this.mRuntime = compRuntime; + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + protected String getComponentName() { + return RuntimeHelper.getComponentName(); + } + //TODO implement ProviderSEServiceUnit + + protected ServiceUnit createServiceUnit(String suName, String suRootPath) throws DeploymentException { + return new ProviderSEServiceUnit(suName, suRootPath); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java new file mode 100644 index 000000000..14f80d8db --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/ProviderSEServiceUnit.java @@ -0,0 +1,60 @@ +/* + * ProviderSEServiceUnit.java + * + */ +package net.openesb.component.ServiceEngine-archetype; + +import net.openesb.component.ServiceEngine-archetype.common.deployment.ServiceUnit; +import net.openesb.component.ServiceEngine-archetype.common.deployment.ProviderEndpoint; +import net.openesb.component.ServiceEngine-archetype.common.deployment.SUDescriptor.Provides; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; + +/** + * This class extends the ServiceUnit to implement the component specific + * service unit processing. It creates the component specific ProviderEndpoint + * implementation to configure the service provider endpoint on this component + * deployed in the service unit. It also processes the deployment artifacts that + * are specific to the service provided by the component. + * + * @author chikkala + */ +public class ProviderSEServiceUnit extends ServiceUnit { + + private XSLTFileLocator mXsltFileLocator; + + /** + * Creates a new instance of ProviderSEServiceUnit + */ + public ProviderSEServiceUnit(String suName, String suRootPath) { + super(suName, suRootPath); + } + + protected XSLTFileLocator getXsltFileLocator() { + return this.mXsltFileLocator; + } + + @Override + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return new ProviderSEEndpoint(provides, wsdlDef, this); + } + + /** + * load and validates the component specific deployment artifacts. It loads + * the xsltmap properties into XSLTFileLocator which will be used to find + * the xslt file corresponding to a service operation. + */ + @Override + protected void loadOtherArtifacts() throws DeploymentException { + super.loadOtherArtifacts(); + // load any component specific service unit artifacts + if (this.mXsltFileLocator == null) { + try { + this.mXsltFileLocator = + new XSLTFileLocator(this.getSURootPath(), "xsltmap.properties"); + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/XSLTFileLocator.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/XSLTFileLocator.java new file mode 100644 index 000000000..a9ea5c3ac --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/XSLTFileLocator.java @@ -0,0 +1,207 @@ +/* + * XSLTFileLocator.java + */ +package net.openesb.component.ServiceEngine-archetype; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.xml.namespace.QName; + +/** + * This class represents the component specific deployment artifact which reads + * the deployed "xsltmap.properties" file in the service unit and processes it + * to find the xslt file to be used for a particular operation on a service + * provided by the deployment. + *

+ * The "xsltmap.properties" file should contain two types of properties
+ * 1.for namespace prefix to namespaceURI map that starts with "xmlns." prefix like
+ *   "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo"
+ * 2. a service description to xslt file properties with syntax like
+ *   "{tns-prefix}service-name=xslt_file_name"  and
+ *   "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and
+ *   "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" .
+ * the service description property is a "." delimited tokens that represents a serive
+ * or interface qname and a operation name. To locate xslt file either with service qname
+ * or service qname and operaton or serivice qname and interface qname and operation,
+ * all the three properties specified above should be there for each xslt file. for example,
+ *  xmlns.echo1=http://www.sun.com/jbi/examples/sample-service/echo
+ *  xmlns.echo2=http://www.sun.com/jbi/examples/sample-service/echo
+ *  {echo2}echoService=echo.xsl
+ *  {echo2}echoService.{echo1}echo=echo.xsl
+ *  {echo2}echoService.{echo1}echo.echo=echo.xsl
+ * 
+ * + * @author chikkala + */ +public class XSLTFileLocator { + + private Map mXsltFileMap; + + /** + * Creates a new instance of XsltLocator + */ + public XSLTFileLocator(String rootPath, String mapFile) throws Exception { + this.mXsltFileMap = new HashMap(); + initXsltLocator(rootPath, mapFile); + } + + private void initXsltLocator(String rootPath, String mapFilePath) throws Exception { + @SuppressWarnings("unchecked") + Map mapProps = loadMappingProperties(rootPath, mapFilePath); + + Map nsMap = new HashMap(); + Map xsltMap = new HashMap(); + + for (String name : mapProps.keySet()) { + String value = mapProps.get(name); + if (name.startsWith("{")) { + xsltMap.put(name, value); + } else if (name.startsWith("xmlns.")) { + String xmlns = name.substring(6); + nsMap.put(xmlns, value); + } + } + + for (String name : xsltMap.keySet()) { + String value = xsltMap.get(name); + String[] tokens = name.split("\\."); + String svcName = null; + String intrName = null; + String opName = null; + + if (tokens.length == 1) { + svcName = expandQName(tokens[0], nsMap); + } else if (tokens.length == 2) { + svcName = expandQName(tokens[0], nsMap); + opName = expandQName(tokens[1], nsMap); + } else if (tokens.length == 3) { + svcName = expandQName(tokens[0], nsMap); + intrName = expandQName(tokens[1], nsMap); + opName = tokens[2]; + } else { + System.out.println("invalid property name in xslt map property" + name); + } + + StringBuffer buff = new StringBuffer(); + buff.append(svcName); + if (intrName != null) { + buff.append("."); + buff.append(intrName); + } + if (opName != null) { + buff.append("."); + buff.append(opName); + } + File file = new File(rootPath, value); + String xsltFile = file.getAbsolutePath(); + this.mXsltFileMap.put(buff.toString(), xsltFile); + } + } + + private String expandQName(String qname, Map xmlnsMap) { + + // qname passed is "{prefix}localname" + QName temp = QName.valueOf(qname); + String prefix = temp.getNamespaceURI(); + String nsURI = xmlnsMap.get(prefix); + if (nsURI == null) { + nsURI = prefix; // just use the prefix as it is. + } + QName realQName = new QName(nsURI, temp.getLocalPart()); + return realQName.toString(); + } + + private Map loadMappingProperties(String rootPath, String mapFilePath) throws Exception { + File mapFile = new File(rootPath, mapFilePath); + Properties mapProps = new Properties(); + if (!mapFile.exists()) { + throw new Exception("Mapping file not found " + mapFilePath); + } + FileInputStream inStream = null; + try { + inStream = new FileInputStream(mapFile); + mapProps.load(inStream); + } catch (FileNotFoundException ex) { + ex.printStackTrace(); + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + if (inStream != null) { + try { + inStream.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + return mapProps; + } + + /** + * return the xslt file mapped to either service name or service qname + + * operation qname + * + * @param serviceQName must be non null qname + * @param opQName can be null the xslt file can be located at service level. + */ + public String findXsltFile(QName serviceQName, QName opQName) { + StringBuffer buff = new StringBuffer(); + buff.append(serviceQName.toString()); + if (opQName != null) { + buff.append("."); + // workaround for the http soap bc bug which does not set the namespace + // uri on the op name. for time being use the serviceQName's namespace + String namespaceURI = opQName.getNamespaceURI(); + if (namespaceURI == null || namespaceURI.length() == 0) { + QName tempOp = + new QName(serviceQName.getNamespaceURI(), opQName.getLocalPart()); + buff.append(tempOp.toString()); + } else { + buff.append(opQName.toString()); + } + } + String xsltFile = this.mXsltFileMap.get(buff.toString()); + return xsltFile; + } + + /** + * return the xslt file mapped to either service name or service qname + + * interface qname + operation + * + * @param serviceQName must be non null service qname + * @param intrQName interface qname + * @param opName operation name ( not a qname) + */ + public String findXsltFile(QName serviceQName, QName intrQName, String opName) { + StringBuffer buff = new StringBuffer(); + buff.append(serviceQName.toString()); + if (intrQName != null) { + buff.append("."); + buff.append(intrQName.toString()); + } + if (opName != null) { + buff.append("."); + buff.append(opName); + } + String xsltFile = this.mXsltFileMap.get(buff.toString()); + return xsltFile; + } + + public String printMap() { + StringWriter buff = new StringWriter(); + PrintWriter out = new PrintWriter(buff); + for (String key : this.mXsltFileMap.keySet()) { + out.println("Key= " + key); + out.println("XsltFile= " + this.mXsltFileMap.get(key)); + } + out.close(); + return buff.getBuffer().toString(); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/XSLTService.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/XSLTService.java new file mode 100644 index 000000000..0b55945c8 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/XSLTService.java @@ -0,0 +1,105 @@ +/* + * XSLTService.java + */ +package net.openesb.component.ServiceEngine-archetype; + +import net.openesb.component.ServiceEngine-archetype.common.RuntimeHelper; +import java.io.File; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; +import java.util.logging.Logger; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import org.w3c.dom.Document; + +/** + * This is a sample service implementation that takes the input as xml document + * and the xslt file to apply the xslt transformation on the input xml and + * return the transformed output xml. This implementation of the service is + * invoked when a InOut message exchange is processed to invoke a service + * provided by the engine. + * + * @author chikkala + */ +public interface XSLTService { + + /** + * this operation takes the input xml document and constructs the output xml + * document by applying the xslt in the file specified in xsltPath + * + * @param inputDoc input xml document + * @param xsltPath absolute file path of xslt file. + * @return transformed output xml document + */ + Source transform(Source inputDoc, String xsltPath) throws Exception; + + /** + * This class implements the echo service operations which the service + * engine will invoke when a InOut message exchange is processed to invoke a + * service provided by the engine. + */ + public static class XSLTServiceImpl implements XSLTService { + + private XSLTServiceImpl() { + } + + /** + * accessor to create/locate the service implementation + * + * @return echo service implementation + */ + public static XSLTService getInstance() { + return new XSLTServiceImpl(); + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + /** + * this operation takes the input xml document and constructs the output + * xml document with the same data to implement the echo. + * + * @param inputDoc input document + * @return output document + */ + public Source transform(Source inputDoc, String xsltPath) throws Exception { + Document outDoc = null; + StringBuffer inBuff = RuntimeHelper.readFromSource(inputDoc); + + getLogger().fine("############### TRANSFORMER INPUT MESSAGE BEGIN #################"); + getLogger().fine(inBuff.toString()); + getLogger().fine("############### TRANSFORMER INPUT MESSAGE END ##################"); + + TransformerFactory tf = null; + tf = TransformerFactory.newInstance(); + StreamSource xsltSource = new StreamSource(new File(xsltPath)); + Transformer xformer = tf.newTransformer(xsltSource); + + Properties params = new Properties(); //TODO get the pramas from the user file + for (Object name : params.keySet()) { + xformer.setParameter((String) name, params.get(name)); + } + StringWriter writer = new StringWriter(); + StreamResult result = new StreamResult(writer); + + DOMSource xmlSource = new DOMSource(RuntimeHelper.buildDOMDocument(new StringReader(inBuff.toString()))); + + xformer.transform(xmlSource, result); + + getLogger().fine("############### TRANSFORMER OUTPUT MESSAGE BEGIN #################"); + getLogger().fine(writer.getBuffer().toString()); + getLogger().fine("############### TRANSFORMER OUTPUT MESSAGE END ##################"); + + outDoc = RuntimeHelper.buildDOMDocument(new StringReader(writer.getBuffer().toString())); + DOMSource outSource = new DOMSource(outDoc); + + return outSource; + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java new file mode 100644 index 000000000..103e5c3b9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java @@ -0,0 +1,138 @@ +/* + * AbstractMessageExchangeHandler.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import java.io.StringReader; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.xml.namespace.QName; + +/** + * This class is an abstract implementation of the MessageExchangeHandler which + * provides the base implementation of the ME processing and provides hooks to + * extended classes to implement component specific processing. + * + * @author chikkala + */ +public abstract class AbstractMessageExchangeHandler implements MessageExchangeHandler { + + public static String IN_MESSAGE = "in"; + public static String OUT_MESSAGE = "out"; + + private MessageExchange mMessageExchange; + private ExchangeStatus mStatus; + /** Creates a new instance of AbstractMessageExchangeHandler */ + protected AbstractMessageExchangeHandler() { + this.mMessageExchange = null; + } + + protected abstract Logger getLogger(); + protected abstract DeliveryChannel getDeliveryChannel(); + protected abstract void validateMessageExchange() throws MessagingException; + protected abstract void processError(Exception ex); + protected abstract void processDone(); + protected abstract void processMessage(); + protected abstract void processFault(Fault fault); + + public final MessageExchange getMessageExchange() { + return this.mMessageExchange; + } + + public final void setMessageExchange(MessageExchange msgExchange) { + this.mMessageExchange = msgExchange; + } + + public final ExchangeStatus getMessageExchangeStatus() { + if ( this.mStatus != null ) { + return this.mStatus; + } else if ( this.mMessageExchange != null ) { + return this.mMessageExchange.getStatus(); + } else { + return null; + } + } + + public final void setMessageExchangeStatus(ExchangeStatus status) { + this.mStatus = status; + } + + protected void send() throws MessagingException { + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected boolean sendSync(long timeout) throws MessagingException { + return this.getDeliveryChannel().sendSync(this.mMessageExchange, timeout); + } + + protected void sendDone() throws MessagingException { + this.mMessageExchange.setStatus(ExchangeStatus.DONE); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendError(Exception ex) throws MessagingException { + this.mMessageExchange.setError(ex); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendFault(Exception ex, QName type, String name) throws MessagingException { + Fault fault = this.mMessageExchange.createFault(); + if ( ex != null ) { + String xmlText = RuntimeHelper.getExceptionAsXmlText(ex); + fault.setContent(RuntimeHelper.createDOMSource(new StringReader(xmlText))); + } + this.mMessageExchange.setFault(fault); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void processActive() { + Fault fault = this.getMessageExchange().getFault(); + if ( fault != null ) { + processFault(fault); + } else { + processMessage(); + } + } + /** + * implementation of the MessageExchangeHandler#processMessageExchange method. + */ + public void processMessageExchange(ExchangeStatus status, MessageExchange msgEx) { + + getLogger().fine("MessageExchangeHandler.processMessageExchange:status: " + status ); + + this.setMessageExchangeStatus(status); + this.setMessageExchange(msgEx); + + try { + validateMessageExchange(); + } catch (MessagingException ex) { + getLogger().log(Level.FINE, "Invalid message exchange for processing ", ex); + if ( this.getMessageExchange() != null ) { + try { + sendError(ex); + } catch (MessagingException errEx) { + getLogger().log(Level.FINE, "Can not send invalid message exchange error", errEx); + } + } + return; + } + + MessageExchange msgExchange = this.getMessageExchange(); + + if (ExchangeStatus.ACTIVE.equals(status) ) { + processActive(); + } else if (ExchangeStatus.DONE.equals(status) ) { + processDone(); + } else if (ExchangeStatus.ERROR.equals(status) ) { + processError(msgExchange.getError()); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java new file mode 100644 index 000000000..2b05babe7 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java @@ -0,0 +1,395 @@ +/* + * AbstractComponentLifeCycle.java + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.MessagingException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.ComponentLifeCycle. This is an + * abstract class that keeps the reference to the component context and the lifecycle + * extension mbeans. It implements the lifecycle method and provide the extended methods + * for each lifecycle methods to implement component specific functionality. + *

+ * It makes sure that the mininum initialization required for the component + * lifecycle is implemented by this class or the classes extending this class. + *

+ * Another important functionality implemented in this class is that it initializes the global + * RuntimeContext for the component with the ComponentContext passed by the JBI runtime and the + * opened delivery channel to make them available globally to any class in the component implementation + * that may need it during component lifecycle + *

+ * Service engine or a binding component lifecycle implementation can directly extend + * this class for their required functionality and override some of the methods to provide + * their own implementation. + * + * @see javax.jbi.ComponentLifeCycle + * @author chikkala + */ +public class BasicComponentLifeCycle implements ComponentLifeCycle { + /** reference to the component runtime */ + private Component mCompRuntime; + /** component context */ + private ComponentContext mComponentContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + /** a message receiver that accepts messages from delivery channel */ + private MessageExchangeReceiver mMsgExchReceiver; + + /** + * constructor for the ComponentLifecycle implementation. + * @param compRuntime + */ + protected BasicComponentLifeCycle(Component compRuntime) { + this.mCompRuntime = compRuntime; + } + /** + * @return Component + */ + public final Component getComponentRuntime() { + return this.mCompRuntime; + } + /** + * @return ComponentContext component context. + */ + public final ComponentContext getComponentContext() { + return mComponentContext; + } + /** + * @return component name + */ + protected String getComponentName() { + return (this.mComponentContext != null) ? + this.mComponentContext.getComponentName() : null; + } + /////////////////////////////////////////////////////////////////////////// + // ComponentLifeCycle interface implemenation + /////////////////////////////////////////////////////////////////////////// + + /** + * Initializes the component lifecycle. This method makes sure that the + * component context passed by the jbi runtime is saved in the lifecycle + * object before calling the other component initialization methods to + * completely initialize the component. + * @param context Component context + * @see javax.jbi.component.ComponentLifeCycle#init(javax.jbi.component.ComponentContext) + * @throws javax.jbi.JBIException on error + */ + public final void init(ComponentContext context) throws JBIException { + + if ( context == null ) { + throw new JBIException("Null Component Context received in " + + "Component Lifecycle init "); + } + this.mComponentContext = context; // 0. save the component context passed by jbi framework. + // initialize the content + initGlobalContext(); // 1. Initialize component runtime context. + registerExtensionMBean(); // 2. Create and register extension mbean. + openDeliveryChannel(); // 3. Open delivery channel. + initMessageExchangeReceiver(); // 4. Create message exchange receiver. + doInit(); // 5. Do any component specific initialization such + // as static service providers and consumers initialization. + + this.getLogger().fine("Component " + this.getComponentName() + " initialized"); + } + + /** + * Starts the component. Extended classes can override/implement the methods called + * in this method to provide component specify start functionality. + * + * @see javax.jbi.component.ComponentLifeCycle#start() + * @throws javax.jbi.JBIException on error + */ + public final void start() throws JBIException { + + doStart(); // 1. do any other component specific start tasks such as + // activating any static service providers and consumers. + startMessageExchangeProcessing(); // 2. begin accepting and processing message exchanges. + + this.getLogger().fine("Component " + this.getComponentName() + " started"); + } + + /** + * Stop the component.Extended classes can override/implement the methods called + * in this method to provide component specify stop functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle#stop() + */ + public final void stop() throws JBIException { + + stopMessageExchangeProcessing(); // 1. stop accepting and processing message exchanges. + doStop(); // 2. do any other component specific stop tasks such as + // deactivating any static service providers and consumers. + this.getLogger().fine("Component " + this.getComponentName() + " stopped."); + } + + /** + * Shut down the component. Extended classes can override/implement the methods called + * in this method to provide component specify shut down functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle#shutDown() + */ + public final void shutDown() throws JBIException { + // clean up all resources. + shutdownMessageExchangeReceiver(); // 1. remove the message receiver. + closeDeliveryChannel(); // 2. close delivery channel + unregisterExtensionMBean(); // 3. unregister and remove extension mbean if exists. + doShutDown(); // 4. do any other component specific clean up tasks such + // as clean any static service providers and consumer resource. + this.getLogger().fine("Component " + this.getComponentName() + " shut down"); + } + /** + * create jmx object name for the extension mbean. default implementation does + * not required to have the extension mbean. + * @return ObjectName of the extension mbean + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * gets the reference to the extension mbean name. + * @see javax.jbi.component.ComponentLifeCycle#getExtensionMBeanName() + * @return ObjectName of the extension mbean objectname or null if component + * does not support extension mbean + */ + public final ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = this.createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. default + * implementation does not require the extension mbean + * @return the ExtensionMBean implementation as StandardMBean + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * gets the reference to the extension mbean. + * @return extension mbean implementation or null if component does not support. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + * @throws JBIException on error registering mbean + */ + protected final void registerExtensionMBean() throws JBIException { + // creatre the extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server if any. + */ + protected final void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Extension MBean from MBeanServer for " + this.getComponentName(), e); + } + } + /** + * creates MessageExchangeReceiver implementation that handles receiving and processing + * the message exchanges from the delivery channel. Component should implement + * this method to provide the MessageReceiver. + * + * Component may return null indicating that they don't need the message receiver + * that can receive and process message exchanges from delivery channel. For example, + * components that have only service consumers which send a synchronous messages to + * providers don't need this. + * + * @throws java.lang.Exception + * @return MessageExchangeReceiver implementation. null if the component does not support it. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle#createMessageExchangeReceiver + */ + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return null; + } + /** + * returns the message exchange receiver implementation reference + * @return MessageExchangeReceiver interface + */ + protected final MessageExchangeReceiver getMessageExchangeReceiver() { + if ( this.mMsgExchReceiver == null ) { + this.mMsgExchReceiver = createMessageExchangeReceiver(); + } + return this.mMsgExchReceiver; + } + /** + * creates a message receiver object as part of the component initialization. + * @throws javax.jbi.JBIException + */ + protected void initMessageExchangeReceiver() throws JBIException { + // create and initialize the MessageExchangeReceiver + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.initReceiver(); + } + } + /** + * allows the component to accept the message exchange objects from the + * delivery channel and process it as part of the component startup process. + * @throws javax.jbi.JBIException + */ + protected void startMessageExchangeProcessing() throws JBIException { + // start message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.startProcessing(); + } + } + /** + * stops the component from accepting the message exchange objects from the + * delivery channel as part of the component stop process + * @throws javax.jbi.JBIException + */ + protected void stopMessageExchangeProcessing() throws JBIException { + // stop message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.stopProcessing(); + } + } + /** + * removes the message receiver as part of the component shutdown process + * @throws javax.jbi.JBIException + */ + protected void shutdownMessageExchangeReceiver() throws JBIException { + // clean up message processing. + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.shutdownReceiver(); + } + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * initializes the RuntimeContext during component init lifecycle phase. This + * includes setting the ComponentContext and loggers etc. extended classes must + * save the component context in the RuntimeContext in this methods implementation. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle#initGlobalContext + */ + protected void initGlobalContext() { + RuntimeContext.getInstance().setComponentContext(this.getComponentContext()); + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } + /** opens the delivery channel to accept or send message exchange objects + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle#openDeliveryChannel + */ + protected void openDeliveryChannel() { + try { + DeliveryChannel channel = this.getComponentContext().getDeliveryChannel(); + RuntimeContext.getInstance().setDeliveryChannel(channel); + } catch (MessagingException ex) { + ex.printStackTrace(); + } + } + /** closes the delivery channel as part of the component shutdown process. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle#closeDeliveryChannel + */ + protected void closeDeliveryChannel() { + // closes delivery channel and remove the reference. + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel != null ) { + channel.close(); + } + } catch (MessagingException ex) { + ex.printStackTrace(); + } finally { + RuntimeContext.getInstance().setDeliveryChannel(null); + } + } + /** + * chance to extended classes to do any extra component specific init tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * initialized here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle#init method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle#init + */ + protected void doInit() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific start tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * activated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle#start method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle#start + */ + protected void doStart() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific stop tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * deactivated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle#stop method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle#stop + */ + protected void doStop() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific shutdown tasks.If the component + * supports static service providers or consumers without deployment support, they can be + * cleaned up here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle#shutdown method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle#shutdown + */ + protected void doShutDown() throws JBIException { + //NOOP + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/ComponentInstaller.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/ComponentInstaller.java new file mode 100644 index 000000000..04848ffa1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/ComponentInstaller.java @@ -0,0 +1,272 @@ + /* + * ComponentInstaller.java + */ +package net.openesb.component.ServiceEngine-archetype.common; + +import java.util.List; +import java.util.logging.Level; +import javax.jbi.component.Bootstrap; +import javax.jbi.component.InstallationContext; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.Bootstrap. This class implements + * the minimum required functionality for component installation contract + * of the jbi component in the jbi environment. It also takes care of maintaining + * the installation context reference and installation specific logger creation and + * installation extension mbean registration and unregistration during initialization + * and cleanup. Extended classes only need to supply the mbean name and its implementation + * object for the installation extensions. + * + * It makes sure that the installation context and the loggers are available to + * the classes extended from this class to add more installation specific functionality. + * + * Service engine or a binding component installation implementation can directly use + * this class or extend this class to add more functionality to their installation + * process. + * + * @see javax.jbi.Bootstrap + * @author chikkala + */ +public class ComponentInstaller implements Bootstrap { + /** default logger*/ + private Logger mDefLogger; + /** bootstrap logger */ + private Logger mBTLogger ; + /** Installation Context . */ + private InstallationContext mInstallationContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + + /** Constructor to create the ComponentInstaller. */ + public ComponentInstaller() { + } + /** + * @return InstallationContext of the component. + */ + public final InstallationContext getInstallationContext() { + return this.mInstallationContext; + } + protected String getComponentName() { + return (this.mInstallationContext != null) ? + this.mInstallationContext.getComponentName() : null; + } + /** + * @return logger initialized from the installation context or a default + * logger. + */ + protected Logger getLogger() { + // try init bootstrap logger + if (this.mBTLogger == null && this.mInstallationContext != null ) { + try { + this.mBTLogger = + this.mInstallationContext.getContext().getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mBTLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mBTLogger != null) ? this.mBTLogger : this.mDefLogger; + } + /** + * Initializes the installation environment for a component. + * @see javax.jbi.component.Bootstrap#init(javax.jbi.component.InstallationContext) + */ + public final void init(InstallationContext installContext) throws javax.jbi.JBIException { + + if ( installContext == null ) { + throw new JBIException("Null Installation Context received in " + + "Component Bootstrap initialization"); + } + // save the installation context reference passed by the jbi framework. + this.mInstallationContext = installContext; + registerExtensionMBean(); // create and register extension mbean + doInit(); // do any other extra initialization required specific to the component installation. + // initialize logger + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component Installer initialized"); + } + /** + * default implementation just logs the method call. extended classes should override this. + * @see javax.jbi.component.Bootstrap#onInstall() + */ + public void onInstall() throws javax.jbi.JBIException { + //TODO: do required initializaton and resource creation + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component installed."); + } + /** + * default implementation just logs the method call. + * @see javax.jbi.component.Bootstrap#onUninstall() + */ + public void onUninstall() throws javax.jbi.JBIException { + //TODO: do clean up the resource and other stuff. + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component uninstalled"); + } + /** + * default noop implementation of the cleanup. + * @see javax.jbi.component.Bootstrap#cleanUp() + */ + public final void cleanUp() throws javax.jbi.JBIException { + + unregisterExtensionMBean(); // unregister extension mbean and remove it + doCleanUp(); // do any other extra cleanup specific to the component installation. + this.getLogger().fine( this.mInstallationContext.getComponentName() + + " Component Installer Cleaned up"); + } + + /** + * create jmx object name for the extension mbean. Extended classes should + * return the component specific installer extension mbean name here. + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * default implementation that does not have extension mbean return null. + * @see javax.jbi.component.Bootstrap#getExtensionMBeanName() + */ + public final javax.management.ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. Extended + * classes should return the installer extension mbean implementation as the + * standard mbean. + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * returns the installation extension mbean implementation. + * @return StandardMBean for the extension mbean implementation. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * Chance to extended classes to do the component installation specific init. + * Installation context will be initialized before calling this method. So, + * initialize other things if required in this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller#init( + * javax.jbi.component.InstallationContext) + */ + protected void doInit() throws JBIException { + this.getLogger().info(this.getInstallationContext().getComponentName() + + " : Component Installer initialized"); + } + /** + * Chance to extended classes to do the component installation specific cleanup. + * ExtensionMbean will be unregistered before calling this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller#cleanUp( + * javax.jbi.component.InstallationContext) + */ + protected void doCleanUp() throws JBIException { + this.getLogger().fine(this.getInstallationContext().getComponentName() + + " : Component Installer doCleanUp"); + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + */ + protected void registerExtensionMBean() throws JBIException { + // creatre the installation extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation if the object name is created. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Installation Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Installation Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server. + */ + protected void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Installation extension MBean for " + this.getComponentName(), e); + } + } + /** + * This method is called by the JBI runtime to allow a component to upgrade + * it's workspace and any existing Service Units to match the new version of + * the component. The JBI runtime copies the existing workspace root to the + * new workspace root prior to calling this method, so that the component + * can examine the contents of the workspace root to determine the version + * of the component from which the upgrade is being made. All updates to the + * workspace root are done in-place; in the event of a failure, the JBI + * runtime reverts back to the original workspace root, the original install + * root, and the original Service Unit roots for the component. + * + * Note1: The component must ensure that it never holds open references + * to any files in the workspace root or any of the Service Unit roots upon + * returning from this method. Failure to do so will cause problems when + * the runtime attempts to complete the upgrade processing. + * + * Note2: The installation context that is normally initialized + * by the runtime by calling #init method of the javax.jbi.Bootstrap interface + * before install and uninstall will not be called before calling this + * upgrade method. So, installation context can not be used in this method's + * implementation. + * + * Note3: Since there won't be any installation context available, the logger + * that returned from the #getLogger method is a default logger created using + * the package name of this class or extended class if the method is overridden + * in the extended class. + * + * @param workspaceRoot the workspace root for the new version of the + * component that will replace the currently installed version. This is + * populated with the contents of the original workspace root and the + * component must update it to match the new version of the component. + * @param serviceUnitRoots a list of directory paths to all of the Service + * Units currently deployed to the component. The component must update all + * of these to match the new version of the component. + * @exception JBIException when there is an error requiring that the upgrade + * be terminated. + */ + public void upgrade(String workspaceRoot, List serviceUnitRoots) + throws javax.jbi.JBIException + { + //TODO: override this method in the extended class to handle the + // workspace root and service unit roots upgrade according to the + // component's requirement. + this.getLogger().fine("Default upgrade implementation. " + + "TODO: Implement workspace root and service unit roots upgrade."); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/ComponentRuntime.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/ComponentRuntime.java new file mode 100644 index 000000000..6631df0ea --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/ComponentRuntime.java @@ -0,0 +1,171 @@ +/* + * ComponentRuntime.java + */ +package net.openesb.component.ServiceEngine-archetype.common; + +import java.util.logging.Logger; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.servicedesc.ServiceEndpoint; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; + +/** + * This class implements javax.jbi.component.Component interface which is + * responsible for creating the Component Lifecycle implementation and the + * ServiceUnitManager implementation for the jbi component. + * + * This class makes sure that non null component lifecycle implementation is + * returns by this class or any classes extended from this class which is + * required as a component contract. It also provides default implementation of + * all methods of the Component interface which the extended classes can + * override to add more functionality. + * + * @see javax.jbi.component.Component + * @author chikkala + */ +public class ComponentRuntime implements Component { + /** Component LifeCycle implementation */ + private ComponentLifeCycle mLifeCycle; + /** ServiceUnitManager implementation */ + private ServiceUnitManager mSUManager; + /** default logger*/ + private Logger mDefLogger; + + /** Creates a new instance of ComponentImpl */ + public ComponentRuntime() { + this.mLifeCycle = null; + this.mSUManager = null; + } + /** + * returns the ComponentContext. Any component runtime class extended from + * this class can override this method to return their own reference to the + * ComponentContext. + * @return ComponentContext component context. + */ + public ComponentContext getComponentContext() { + ComponentContext ctx = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + ctx = ((BasicComponentLifeCycle) this.mLifeCycle).getComponentContext(); + } + return ctx; + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + public Logger getLogger() { + Logger logger = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + logger = ((BasicComponentLifeCycle) this.mLifeCycle).getLogger(); + } + // init default logger if required + if ( logger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (logger != null) ? logger : this.mDefLogger; + } + /** + * return the ComponentLifeCycle implementation. if returned null, the + * ComponentLifeCycleImpl will be used as the component lifecycle + * Extended classes can override this method and do their own ComponentLifecyle + * specific creation. + */ + protected ComponentLifeCycle createComponentLifeCycle() { + return new BasicComponentLifeCycle(this); + } + /** + * Get the life cycle control interface for this component. + * + * @return the life cycle control interface for this component + * @see javax.jbi.Component#getLifeCycle() + */ + public final ComponentLifeCycle getLifeCycle() { + if ( this.mLifeCycle == null ) { + this.mLifeCycle = createComponentLifeCycle(); + if ( this.mLifeCycle == null ) { + this.getLogger().fine("Creating basic component lifecycle implemenation"); + // use the default ComponentLifeCycle Impl if a component + // specific implementation return null in createComponentLifeCycle. + this.mLifeCycle = new BasicComponentLifeCycle(this); + } + } + return this.mLifeCycle; + } + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. + * Extended classes can override this method and do their own ServiceUnitManager + * specific creation. + */ + protected ServiceUnitManager createServiceUnitManager() { + return null; + } + /** + * Get the Service Unit manager for this component. + * + * @return the ServiceUnitManager for this component, or + * null if there is none. + * @see javax.jbi.Component#getServiceUnitManager() + */ + public final ServiceUnitManager getServiceUnitManager() { + if ( this.mSUManager == null ) { + this.mSUManager = createServiceUnitManager(); + } + return this.mSUManager; + } + /** + * Retrieves a DOM representation containing metadata which describes the + * service provided by this component, through the given endpoint. + * + * Default implementation does not support service description. + * + * @see javax.jbi.Component#getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint) + */ + public Document getServiceDescription(ServiceEndpoint serviceEndpoint) { + return null; + } + /** + * This method is called by JBI to check if this component, in the role of + * provider of the service indicated by the given exchange, can actually + * perform the operation desired. + * + * Default implementation has no policy and allows all exchanges with consumer. + * + * @see javax.jbi.Component#isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithConsumerOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * This method is called by JBI to check if this component, in the role of + * consumer of the service indicated by the given exchange, can actually + * interact with the provider properly. The provider is described by the + * given endpoint and the service description supplied by that endpoint. + * + * Default implementation has no policy and allows all exchanges with provider. + * + * @see javax.jbi.Component#isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithProviderOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * Resolve the given endpoint reference. + * + * Default implementation does not have any XML dialect. So can not resolve the + * endpoint from the document fragment. + * + * @see javax.jbi.Component#resolveEndpointReference(org.w3c.dom.DocumentFragment) + */ + public ServiceEndpoint resolveEndpointReference(DocumentFragment documentFragment) { + return null; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java new file mode 100644 index 000000000..7a9b7cf4a --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java @@ -0,0 +1,177 @@ +/* + * DefaultMessageExchangeReceiver.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; + +/** + * This class implements MessageExchangeReceiver interface. This is a default implementation that + * demonstrates the multi-threaded environment to receive and process message exchanges from the + * delivery channel. It uses a main thread to receive message exchanges from the delivery channel + * and then processes the received message exchanges in a individual threads from the thread pool. + * The controller methods of MessageExchangeReceiver controls the main thread and the thread pool + * execution. + * + * @author chikkala + */ +public class DefaultMessageExchangeReceiver implements MessageExchangeReceiver { + + /** delivery channel accept time out */ + private final static long DC_ACCEPT_TIME_OUT = 3000; // milliseconds + /** receiver thread wait time before polling for messages after woke up **/ + private final static long RECEIVER_WAIT_TIME = 2000; // milliseconds + /** receiver thread wait time before force shutdown */ + private final static long RECEIVER_SHUTDOWN_WAIT_TIME = 10; // seconds + /** handler threads wait time before forced shutdown */ + private final static long HANDLERS_SHUTDOWN_WAIT_TIME = 30; // seconds + /** handler thread pool size */ + private final static int HANDLER_THREAD_POOL_SIZE = 5; + /** receiver thread accept message exchange condition */ + private Boolean mCanAccept = false; + /** receiver thread termination condition */ + private Boolean mContinue = true; + /** receiver thread executor service */ + private ExecutorService mReceiverThreadMgr; + /** handler thread executor service */ + private ExecutorService mHandlerThreadPool; + + /** no default constructor for extended classes */ + public DefaultMessageExchangeReceiver() { + } + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + public final void initReceiver() throws JBIException { + + this.mHandlerThreadPool = Executors.newFixedThreadPool(HANDLER_THREAD_POOL_SIZE); + this.mReceiverThreadMgr = Executors.newSingleThreadExecutor(); + + this.mReceiverThreadMgr.execute(new Runnable() { + public void run() { + Thread t = Thread.currentThread(); + while ( mContinue ) { + if (mCanAccept) { + receiveAndProcessMessageExchange(); + } else { + try { + t.sleep(RECEIVER_WAIT_TIME); + } catch (InterruptedException interruptException) { + // someone must have interrupted this thread + // do nothing + RuntimeHelper.logDebug("Interrupted the MessageReceiverThread in Sleep"); + } + } + } + } + }); + } + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + public final void shutdownReceiver() throws JBIException { + + synchronized ( mContinue ) { + mContinue = false; + } + boolean terminated = false; + try { + this.mReceiverThreadMgr.shutdown(); + terminated = this.mReceiverThreadMgr.awaitTermination( + RECEIVER_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Message Receiver not shutdown. Forcing shutdown"); + this.mReceiverThreadMgr.shutdownNow(); + } + } + shutdownHandlers(); + } + /** + * shutdown all the working threads from the thread pool. + */ + private final void shutdownHandlers() throws JBIException { + + boolean terminated = false; + try { + this.mHandlerThreadPool.shutdown(); + terminated = this.mHandlerThreadPool.awaitTermination( + HANDLERS_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Handler threads not shutdown. Forcing shutdown"); + this.mHandlerThreadPool.shutdownNow(); + } + } + } + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + public final void startProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = true; + } + } + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + public final void stopProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = false; + } + } + + protected MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + private void receiveAndProcessMessageExchange() { + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel == null ) { + RuntimeHelper.logDebug("DeliveryChannel Not Opened for receiving messages"); + return; + } + final MessageExchange msgExchange = channel.accept(DC_ACCEPT_TIME_OUT); + if ( msgExchange == null ) { + // delivery channel timeout occurred. do nothing. + // RuntimeHelper.logDebug("DeliveryChannel returned null message exchange from accept"); + return; + } + final ExchangeStatus status = msgExchange.getStatus(); + // process message exchange in a separate thread + this.mHandlerThreadPool.execute(new Runnable() { + public void run() { + getMessageExchangeSupport().fireMessageExchangeReceived(status, msgExchange); + } + }); + + } catch (MessagingException ex) { + RuntimeHelper.logWarning(ex); + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java new file mode 100644 index 000000000..2288d287e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java @@ -0,0 +1,28 @@ +/* + * MessageExchangeHandler.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface is a Handler to perform message exchanges when the component + * receives the MessageExchange object from the delivery channel. + * Implementation of this interface should implement the processing of + * the active, error, done status of the MessageExchange object according to + * the MEP for which the MessageExchange object is created. + * + * @author chikkala + */ +public interface MessageExchangeHandler { + /** + * this method will be invoked to process the MessageExchange + * object. + * @param msgExchange MessageExchange object to process. + */ + void processMessageExchange(ExchangeStatus status, MessageExchange msgExchange); + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeListener.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeListener.java new file mode 100644 index 000000000..8098dfbb9 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeListener.java @@ -0,0 +1,33 @@ +/* + * MessageExchangeListener.java + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface defines the notification mechanism with which the message exchange object received + * from the delivery channel is processed by the interesting parties. A particular service endpoint + * implementation would first register the implementation of this interface with MessageExchangeSupport + * to get the notification of a received message exchange on a particular service endpoint and the + * implementation of the interface would process the message exchange when notified. + * + * When the com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver receives the message exchange + * object, it asks the MessageExchangeSupport to notify the MessageExchangeLister that is registered for the + * received message exchange object to process the message exchange object. + * @see com.sun.jbi.sample.component.common.MessageExchangeSupport + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public interface MessageExchangeListener { + /** + * MessageExchangeSupport will call this method to notify the lister implementation that a + * message exchange is received from the delivery channel. + * @param me MessageExchange Object + */ + void messageExchangeReceived(ExchangeStatus status, MessageExchange me); +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java new file mode 100644 index 000000000..b60587454 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java @@ -0,0 +1,44 @@ +/* + * MessageExchangeReceiver.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import javax.jbi.JBIException; + +/** + * This interface provides the methods can controls the receiving and processing of the message + * exchange objects from the delivery channel during the component lifecycle operations. + * The implementation of this interface can use multi-threaded environment to receive and process + * message exchanges from the delivery channel during the component lifecycle. + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @author chikkala + */ +public interface MessageExchangeReceiver { + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + void initReceiver() throws JBIException; + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + void startProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + void stopProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + void shutdownReceiver() throws JBIException; + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java new file mode 100644 index 000000000..3297b3430 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java @@ -0,0 +1,167 @@ +/* + * MessageExchangeSupport.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.xml.namespace.QName; + +/** + * This class supports the registering and unregistering MessageExchangeListeners and the + * MessageExchangeHandlers that can be used to process the received message exchange from a + * delivery channel. A global reference to this class will be created in RuntimeContext object to + * provide access to this class from any where in the component runtime. + * + * A ProviderEndpoint or ConsumerEndpoint interested in a MessageExchange received from a delivery + * channel for a particular service endpoint will register the MessageExchangeListener with this + * class. The DefaultMessageExchangeReceiver when received a message exchange object from the delivery + * channel uses MessageExchangeSupport.processMessageExchange method to notify the registered listener. + * + * The MessageExchangeListener implementation ( ProviderEndpoint or ConsumerEndpoint ) while processing + * received message ( messageExchangeReceived()) will create and register the message exchange handlers + * to process the message exchange. + * + * @see RuntimeContext#getMessageExchangeSupport + * @see RuntimeHelper#getMessageExchangeSupport + * @see DefaultMessageExchangeReceiver#receiveAndProcessMessageExchange + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public class MessageExchangeSupport { + /** listener map to notify a message exchange received event */ + private Map mListeners; + /** handlers that can process the message exchange */ + private Map mHandlers; + /** Creates a new instance of MessageExchangeSupport */ + public MessageExchangeSupport() { + this.mListeners = Collections.synchronizedMap(new HashMap()); + this.mHandlers = Collections.synchronizedMap(new HashMap()); + } + /** + * generates key that will be used to store the MessageExchangeListener objects. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public String createListenerKey(Role role, QName interfaceName, QName serviceName, String endpointName) { + + StringBuffer strBuff = new StringBuffer(); + strBuff.append(interfaceName).append("+"); + strBuff.append(serviceName).append("+"); + strBuff.append(endpointName).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(role) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(role) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + /** + * adds message exchange listener who are interested in receiving the notification when the + * message exchange is received from delivery channel. The listener can be registered with the + * following combination of the parameters: (role,interfaceName,serviceName, endpointName), + * (role,interfaceName,null, null), (role, null,serviceName, endpointName), (role, null,serviceName, null) + * + * @param role role of the message exchange listener PROVIDER or CONSUMER - can not be null. + * @param interfaceName QName of the interface ( protType ) - can be null if the serviceName is not null + * @param serviceName QName of the service - can be null if interfaceName is not null. + * @param endpointName endpoint name of the service. - can be null if the serviceName is not null. + * @param listener MessageExchangeListener object + */ + public synchronized void addMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName, MessageExchangeListener listener) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + this.mListeners.put(key, listener); + } + /** + * removes any message exchange listener registered for the service endpoint specified by the serviceName and + * endpoint name. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public synchronized void removeMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + MessageExchangeListener listener = this.mListeners.remove(key); + if ( listener == null ) { + RuntimeHelper.getLogger().fine("No message exchange listener removed with key " + key); + } + } + /** + * finds the MessageExchangeListner registers for the endpoint for which the message exchange is + * received and call the method on the listener + */ + public boolean fireMessageExchangeReceived(ExchangeStatus status, MessageExchange me) { + boolean notified = false; + Role role = me.getRole(); + QName interfaceName = me.getInterfaceName(); + QName serviceName = me.getEndpoint().getServiceName(); + String endpointName = me.getEndpoint().getEndpointName(); + // lookup with complete service description ( role + interface + service + endpoint ) + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + MessageExchangeListener listener = this.mListeners.get(key); + + if ( listener == null ) { // lookup with role+interface name + key = createListenerKey(role, interfaceName, null, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with role + serviceName + endpointName + key = createListenerKey(role, null, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with with role + serviceName + key = createListenerKey(role, null, serviceName, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { + RuntimeHelper.getLogger().fine("Could not find listener for message exchange" + me); + notified = false; + } else { + listener.messageExchangeReceived(status,me); + notified = true; + } + return notified; + } + /** + * registers the MessageExchangeHandler implementation against the message exchange id. + * @param me MessageExchange for which the handler need to be assigned + * @param handler MessageExchangeHandler implementation that will be registers. + */ + public synchronized void addMessageExchangeHandler(MessageExchange me, MessageExchangeHandler handler) { + this.mHandlers.put(me.getExchangeId(), handler); + } + /** + * removes the MessageExchangeHandler for the particular message exchange object + */ + public synchronized void removeMessageExchangeHandler(MessageExchange me) { + MessageExchangeHandler handler = this.mHandlers.remove(me.getExchangeId()); + if ( handler == null ) { + RuntimeHelper.getLogger().fine("No MessageExchangeHandler found for removing " + me.getExchangeId()); + } + } + /** + * looks up the registered message exchange handler for the message exchange object + * @param me MessageExchangeHandler. + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(MessageExchange me) { + return this.mHandlers.get(me.getExchangeId()); + } + /** + * looks up the registered message exchange handler for the message exchange object with Id + * @param exchangeId message exchange object's id + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(String exchangeId) { + return this.mHandlers.get(exchangeId); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/RuntimeContext.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/RuntimeContext.java new file mode 100644 index 000000000..ecab3761e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/RuntimeContext.java @@ -0,0 +1,173 @@ +/* + * RuntimeContext.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; + +/** + * This class is global context for all the component runtime to store and + * retrieve the information that should be available anywhere in the component runtime. + * + * Each instance variable of this class will be initialized at various points of the + * component runtime using setter methods on this class. + * + * The two important objects that will be initialized and available from this context are + * ComponentContext and the opened DeliveryChannel objects both of which will be set from the + * implementation {@link BasicComponentLifeCycle}. + * + * Note that the ComponentContext from this global context will not be available until + * the jbi framework calls the init method of the ComponentLifeCycle of the component and + * then intern the implementation of the init method sets the context. + * + * @see BasicComponentLifeCycle#initGlobalContext + * @see BasicComponentLifeCycle#openDeliveryChannel + * @see BasicComponentLifeCycle#closeDeliveryChannel + * @author chikkala + */ +public final class RuntimeContext { + /** RuntimeContext singleton instance */ + private static RuntimeContext sRuntimeContext; + /** default logger*/ + private Logger mDefLogger; + /** Logger object. */ + private Logger mLogger; + /** Holds value of property ComponentContext. */ + private ComponentContext mComponentContext; + /** Holds value of property DeliveryChannel. */ + private DeliveryChannel mDeliveryChannel; + /** MessageExchange processing support **/ + private MessageExchangeSupport mMESupport; + + /** outside code can not instantiate RuntimeContext */ + private RuntimeContext() { + } + /** + * @return RuntimeContext instance. + */ + public static RuntimeContext getInstance() { + if ( sRuntimeContext == null ) { + synchronized (RuntimeContext.class) { + if ( sRuntimeContext == null ) { + sRuntimeContext = new RuntimeContext(); + } + } + } + return sRuntimeContext; + } + /** + * Getter for to obtaining ComponentContext from any where in the component runtime. + * @return ComponentContext. + */ + public ComponentContext getComponentContext() { + return this.mComponentContext; + } + /** + * Sets the Component context reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle#initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle#initContext + * for details. + * @param componentContext New value of property ComponentContext. + * @see BasicComponentLifeCycle#initGlobalContext + */ + public void setComponentContext(ComponentContext componentContext) { + if ( this.mComponentContext != null ) { + (new IllegalStateException("Component Context already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mComponentContext = componentContext; + } + /** + * Getter for obtaining opened delivery channel from any where in the component runtime. + * @return DeliveryChannel. + */ + public DeliveryChannel getDeliveryChannel() { + return this.mDeliveryChannel; + } + /** + * Sets the opened delivery channel reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle#initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle#initContext + * for details. + * + * @param componentContext New value of property ComponentContext. + */ + public void setDeliveryChannel(DeliveryChannel deliveryChannel) { + if ( deliveryChannel != null && this.mDeliveryChannel != null ) { + (new IllegalStateException("Delivery Channel already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mDeliveryChannel = deliveryChannel; + } + /** + * Sets the logger. + * + * @param name name for the Logger. + * @param resourceBundle resource bundle for the logger. can be null. + */ + public void setLogger(String name, String resourceBundle) { + + if (this.mComponentContext != null) { + // get the logger from component context if the component context is not null + try { + this.mLogger = this.mComponentContext.getLogger(name, resourceBundle); + } catch (Exception ex) { + ex.printStackTrace(); + } + } else { + this.mDefLogger = Logger.getLogger(name, resourceBundle); + } + } + /** + * Returns the logger. + * + * @return Logger + */ + public Logger getLogger() { + + // try init logger + if (this.mLogger == null && this.mComponentContext != null ) { + try { + this.mLogger = + this.mComponentContext.getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mLogger != null) ? this.mLogger : this.mDefLogger; + } + /** + * Returns the Component Name if the ComponentContext is set. else null + * @return component name + */ + public String getComponentName() { + String componentName = null; + if (this.mComponentContext != null) { + componentName = this.mComponentContext.getComponentName(); + } + return componentName; + } + /** + * Global MessageExchangeSupport reference. Various classes in the common + * component runtime would use this method to obtain the MessageExchangeSupport + * for processing message exchange objects received from delivery channel. + */ + public MessageExchangeSupport getMessageExchangeSupport() { + if ( this.mMESupport == null ) { + this.mMESupport = new MessageExchangeSupport(); + } + return this.mMESupport; + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/RuntimeHelper.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/RuntimeHelper.java new file mode 100644 index 000000000..633ce58ca --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/RuntimeHelper.java @@ -0,0 +1,357 @@ +/* + * RuntimeHelper.java + */ + +package net.openesb.component.ServiceEngine-archetype.common; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * This is a helper class that have bunch of methods for xml processing. + * @author chikkala + */ +public class RuntimeHelper { + + public static Logger getLogger() { + return RuntimeContext.getInstance().getLogger(); + } + + public static void logWarning(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.WARNING, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().warning(logObj.toString()); + } + } + + public static void logError(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.SEVERE, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().severe(logObj.toString()); + } + } + + public static void logDebug(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.FINER, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().finer(logObj.toString()); + } + } + + public static String getComponentName() { + return RuntimeContext.getInstance().getComponentName(); + } + public static ComponentContext getComponentContext() { + return RuntimeContext.getInstance().getComponentContext(); + } + public static DeliveryChannel getDeliveryChannel() { + return RuntimeContext.getInstance().getDeliveryChannel(); + } + + public static MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeContext.getInstance().getMessageExchangeSupport(); + } + + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(Reader xmlReader) throws Exception { + InputSource xmlSource = new InputSource(xmlReader); + return buildDOMDocument(xmlSource); + } + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(InputSource xmlSource) throws Exception { + Document xmlDoc = null; + DocumentBuilderFactory docBuilderFactory = + DocumentBuilderFactory.newInstance(); + docBuilderFactory.setValidating(false); + docBuilderFactory.setNamespaceAware(true); + DocumentBuilder docBuilder = + docBuilderFactory.newDocumentBuilder(); + docBuilder.setErrorHandler( new DefaultHandler() { + public void fatalError(SAXParseException e) + throws SAXException { + throw new SAXException(e.getMessage()); + } + }); + + docBuilder.setEntityResolver(new EntityResolver() { + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + StringReader reader = + new StringReader(""); // NOI18N + InputSource source = new InputSource(reader); + source.setPublicId(publicId); + source.setSystemId(systemId); + return source; + } + }); + + xmlDoc = docBuilder.parse(xmlSource); + + return xmlDoc; + } + /** + * reads xml text from DOMSource to StringBuffer + */ + public static StringBuffer readFromDOMSource(DOMSource domSource) { + + StringWriter writer = new StringWriter(); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer trans = null; + try { + trans = tFactory.newTransformer(); + trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, + "yes"); + trans.setOutputProperty(OutputKeys.INDENT, "yes"); + StreamResult result = new StreamResult(writer); + trans.transform(domSource, result); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads the xml text from InputSource into a StringBuffer + */ + public static StringBuffer readFromInputSource(InputSource inSource) { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + InputStream inStream = inSource.getByteStream(); + Reader reader = inSource.getCharacterStream(); + if ( reader == null ) { + reader = new InputStreamReader(inStream); + } + BufferedReader buff = new BufferedReader(reader); + try { + + for ( String line = null; (line = buff.readLine()) != null ; ) { + out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads xml from from DOM, SAX or Stream Source into a string buffer + */ + public static StringBuffer readFromSource(Source source) { + if ( source instanceof DOMSource ) { + return readFromDOMSource((DOMSource)source); + } else { + InputSource inSource = SAXSource.sourceToInputSource(source); + if ( inSource != null ) { + return readFromInputSource(inSource); + } else { + return null; + } + } + } + /** + * creates a DOMSource from the xml text read from the reader. + */ + public static DOMSource createDOMSource(Reader xmlReader) { + Document doc = null; + try { + doc = buildDOMDocument(xmlReader); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * creates a DOMSource from any source. If the source itself is DOMSource, + * the source is returned as it is as DOMSource. + */ + public static DOMSource sourceToDOMSource(Source source) { + if ( source instanceof DOMSource) { + return (DOMSource) source; + } + InputSource xmlSource = SAXSource.sourceToInputSource(source); + Document doc = null; + try { + doc = buildDOMDocument(xmlSource); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * converts the ex stracktrace to string. + */ + public static StringBuffer getExceptionStackTrace(Exception ex) { + StringWriter strWriter = new StringWriter(); + if ( ex != null ) { + PrintWriter out = new PrintWriter(strWriter); + ex.printStackTrace(out); + } + return strWriter.getBuffer(); + } + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsXmlText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + String exXmlText = + "" + + "" + message + "" + + "" + stackTrace + "" + + "" ; + return exXmlText; + } + + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + StringBuffer buff = new StringBuffer(); + buff.append(message); + buff.append(System.getProperty("line.separator", "\n")); + buff.append(stackTrace); + return buff.toString(); + } + + + /** + * For attribute values which denote a QName, i.e. include a namespace prefix, + * resolve the value into a QName. + * If a namespace can not be resolved, it is set to empty - it does not + * result in an exception + * @param attrValue the string value of the attribute + * @param element the element the attribute belongs to + */ + public static QName resolveAttrQName(String attrValue, Element element) { + int aColonLoc = attrValue.indexOf(":"); + String aLocalName = attrValue; + String aPrefix = null; + String aNS = null; + if (aColonLoc > -1) { + aPrefix = attrValue.substring(0, aColonLoc); + aLocalName = attrValue.substring(aColonLoc + 1); + + // Traverse up the hierarchy until a namespace definition is found + // or the top of the document is reached. + Node currNode = element; + while ((aNS == null || aNS.equals("")) && currNode != null) { + if (currNode.getNodeType() == Node.ELEMENT_NODE) { + aNS = ((Element) currNode).getAttribute("xmlns:" + aPrefix); + } + currNode = currNode.getParentNode(); + } + } + + QName qName = new QName(aNS, aLocalName, aPrefix); + + return qName; + } + + /** + * replaces the xml entity references with the xml escape chars + * @param xmlString Text with the xml escape chars + * @param Text with the xml entity references + */ + public static String replaceXmlEscapeCharsToEntityRefereces(String xmlString) { + if ( xmlString == null ) { + return xmlString; + } + + // just convert < , > and & only + StringBuffer sbuff = new StringBuffer(2 * xmlString.length()); + for ( int i = 0; i < xmlString.length(); ++i ) { + switch ( xmlString.charAt(i) ) { + case '&': sbuff.append("&"); + break; + case '<': sbuff.append("<"); + break; + case '>': sbuff.append(">"); + break; + default: sbuff.append( xmlString.charAt(i) ); + } + } + return sbuff.toString(); + } + + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + + public static Element getElement(DOMSource domSource) { + return getElement(domSource.getNode()); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java new file mode 100644 index 000000000..5880a9c61 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java @@ -0,0 +1,309 @@ +/* + * AbstractServiceUnitManager.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common.deployment; + +import net.openesb.component.ServiceEngine-archetype.common.RuntimeHelper; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.management.DeploymentException; + +/** + * This is an abstract class that implements {@link javax.jbi.component.ServiceUnitManager} to provide a + * service unit deployment support for the component. The implementation supported by this service + * unit manager and related classes in this package provides WSDL1.1 based service unit deployment + * in the component. + * + * @see javax.jbi.component.ServiceUnitManager + * @see ServiceUnit + * + * @author chikkala + */ +public abstract class AbstractServiceUnitManager implements ServiceUnitManager { + + /** Map of ServiceUnit Name to the ServiceUnit Object for all the service units + * deployed in the component */ + private Map mSUMap; + + /** Creates a new instance of AbstractSUManager */ + protected AbstractServiceUnitManager() { + this.mSUMap = Collections.synchronizedMap(new HashMap()); + } + /** returns the component name + * @return component name. + */ + protected abstract String getComponentName(); + /** + * @return Logger + */ + protected abstract Logger getLogger(); + /** + * returns the creation of the ServiceUnit implementation specific to the service unit deployment + * for the component. + * @param suName service unit name + * @param suRootPath service unit root path + * @param concrete implementation of the ServiceUnit class. + */ + protected abstract ServiceUnit createServiceUnit(String suName, String suRootPath) + throws DeploymentException; + /** + * returns the service unit object deployed by the specified name. or null if not deployed. + * @param suName service unit name to look for + * @param ServiceUnit object for the suName. or null if not present. + */ + private ServiceUnit getServiceUnit(String suName) { + return this.mSUMap.get(suName); + } + /** + * lookup for the deployed service unit. If not there, throws a deployment exception. + * @param suName service unit name + * @return ServiceUnit object + * @throws DeploymentException if the service unit is not present. + */ + private ServiceUnit findServiceUnit(String suName) throws DeploymentException { + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return serviceUnit; + } + /** + * add the service unit object to the list of deployed service units. if there is already a + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is added. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit addServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + this.mSUMap.put(suName, su); + return su; + } + /** + * removes service unit object from the list of deployed service units. if there is no + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is being removed. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit removeServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return this.mSUMap.remove(suName); + } + /** + * creates the concrete service unit implementation and calls the load method on it to initialize + * the created service unit. + * @param suName service unit name to create + * @param suRootPath service unit root path. + * @return ServiceUnit that is created and loaded. + */ + private ServiceUnit loadServiceUnit(String suName, String suRootPath) throws DeploymentException { + ServiceUnit serviceUnit = createServiceUnit(suName, suRootPath); + serviceUnit.doLoad(); + return serviceUnit; + } + /** + * deploys a service unit. it creates and loads the service unit object for the suName and then call + * doDeploy on the service unit and adds it to the deployed service unit list + * @return result as jbi management xml + * @throws DeploymentException if there is an error deploying. + */ + private synchronized String deployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + ServiceUnit serviceUnit = loadServiceUnit(suName, suRootPath); + serviceUnit.doDeploy(); + addServiceUnit(serviceUnit); + return result; + } + /** + * Deploy a Service Unit to the component. + * @see javax.jbi.component.ServiceUnitManager#deploy(String, String); + */ + public final String deploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Deploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully deployed service unit " + suName; + Exception errEx = null; + try { + deployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to deploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, ex); + } + return createComponentTaskResultXML(compName, "deployTask", isSuccess, mainMsg, errEx); + } + + /** + * undeploys the service unit. it looks up the existing deployed service unit and call doUndeploy + * on it and then removes from the deployed service unit list. + */ + private synchronized String undeployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit serviceUnit = findServiceUnit(suName); + serviceUnit.doUndeploy(); + removeServiceUnit(serviceUnit); + return result; + } + /** + * Undeploy a service unit from the component. + * @see javax.jbi.component.ServiceUnitManager#undeploy(String, String); + */ + public final String undeploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Undeploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully undeployed service unit " + suName; + Exception errEx = null; + try { + undeployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to undeploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, errEx); + } + return createComponentTaskResultXML(compName, "undeployTask", isSuccess, mainMsg, errEx); + } + /** + * Initialize the given deployed service unit. + * @see javax.jbi.component.ServiceUnitManager#init(String, String); */ + public final void init(String suName, String suRootPath) + throws DeploymentException { + this.getLogger().fine("Initializing service unit " + suName + " with suRootPath " + suRootPath); + String result = suName; + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { // if the service unit not exists, create and add + serviceUnit = loadServiceUnit(suName, suRootPath); // create and load service unit + addServiceUnit(serviceUnit); // add service unit to existing service units + } + serviceUnit.doInit(); // Do Service unit initialization tasks + this.getLogger().fine("Service unit initialized:" + suName); + } + /** + * Shut down the deployment. + * @see javax.jbi.component.ServiceUnitManager#shutdown(String); + */ + public final void shutDown(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doShutdown(); // Do Service unit shutdown tasks + this.getLogger().fine("Service unit shut down:" + suName); + } + /** + * Start the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager#start(String); + */ + public final void start(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStart(); // Do service unit start tasks. + this.getLogger().fine("Service unit started:" + suName ); + } + /** + * Stop the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager#stop(String); + */ + public final void stop(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStop(); // do service unit stop tasks + this.getLogger().fine("Service unit stopped: " + suName + " stopped."); + } + + /** + * helper method to create result message as jbi management message xml. + * @param componentName name of the component for this xml. + * @param taskId task id + * @param isSuccess true to format a success result, false to format a failed result. + * @param mainMsg main result message + * @param errEx Exception, null if there is no exception in failure message. + * @return XML string. + */ + protected static String createComponentTaskResultXML( + String componentName, String taskId, boolean isSuccess, String mainMsg, Exception errEx ) { + + String exMsgXml = getComponentTaskResultExceptionXML(errEx); + String mainMsgXmlEsc = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces(mainMsg); + String taskResult = isSuccess ? "SUCCESS" : "FAILED"; + String msgType = isSuccess ? "INFO" : "ERROR"; + + String xmlResult = + "" + + " " + componentName + "" + + " " + + " " + + " " + taskId + "" + + " " + taskResult + "" + + " " + msgType + "" + + " " + + " " + + " SU_MGR_MSG_ID" + + " " + mainMsgXmlEsc + "" + + " " + + " " + + exMsgXml + + " " + + " " + + ""; + + return xmlResult; + } + /** + * converts the exception to the jbi management message xml chunk. + */ + private static String getComponentTaskResultExceptionXML(Exception errEx) { + StringBuffer exMsgBuff = new StringBuffer(); + if ( errEx == null ) { + return exMsgBuff.toString(); // empty string. + } + + List exList = new ArrayList(); + int exLevel = 0; + for ( Throwable cause = errEx ; cause != null ; cause = cause.getCause() ) { + String causeMsg = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + cause.getMessage()); + StringWriter stBuff = new StringWriter(); + PrintWriter stOut = new PrintWriter(stBuff); + StackTraceElement[] stList = cause.getStackTrace(); + for (StackTraceElement stEl : stList) { + stOut.println(stEl.toString()); + } + stOut.close(); + String causeStackTrace = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + stBuff.getBuffer().toString()); + + exMsgBuff.append(""); + exMsgBuff.append(" " + exLevel + ""); + exMsgBuff.append(" " + "SU_MGR_EXP_ID"); + exMsgBuff.append(" " + causeMsg + ""); + exMsgBuff.append(" "); + exMsgBuff.append(" " + causeStackTrace + ""); + exMsgBuff.append(""); + ++exLevel; + } + + return exMsgBuff.toString(); + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java new file mode 100644 index 000000000..425c7c875 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java @@ -0,0 +1,205 @@ +/* + * ConsumerEndpoint.java + */ + +package net.openesb.component.ServiceEngine-archetype.common.deployment; + +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.messaging.MessageExchangeFactory; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service consumer. {@link ServiceUnit#createConsumerEndpoint} creates the object of this + * type to implement the service consumer functionality. + * + * @see ServiceUnit#createConsumerEndpoint + * @author chikkala + */ + +public class ConsumerEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with CONSUMER role and makes sure that the service + * description passed to it is of consumer description. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(Role.CONSUMER, consumes, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef) { + this(consumes, wsdlDef, null); + } + public final void init() throws JBIException { + getLogger().fine("ConsumerEndpoint: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + public final void activate() throws JBIException { + getLogger().fine("ConsumerEndpoint: activate called"); + //1. do common ativation tasks. + doActivate(); //2. do any other activation related tasks. + } + + public final void deactivate() throws JBIException { + getLogger().fine("ConsumerEndpoint: deactivate called"); + //1. do common deactivation tasks. + doDeactivate(); //2. do any other deactivation related tasks. + } + + public final void clean() throws JBIException { + getLogger().fine("ConsumerEndpoint: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + + /** + * helper method to find the active ServiceEndpiont for the service described with the + * serviceDescriptor. This method looks for the Active ServiceEndpoint using interface or + * service name or service name and the endpoint name. + */ + public ServiceEndpoint findServiceEndpoint() { + + QName serviceType = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + + ServiceEndpoint [] refs = null; + ServiceEndpoint serviceEndpoint = null; + ComponentContext compContext = this.getComponentContext(); + + if ( compContext == null ) { + this.getLogger().info("Null Component context. Can not find ServiceEndpoint"); + return null; + } + // lookup ServiceEndpiont with concrete service(serice qname + endpoint name). + if ( serviceName != null && endpointName != null ) { + this.getLogger().info("Looking for ServiceEndpoint with:" + + " ServiceName: " + serviceName + " EndpointName: " + endpointName); + serviceEndpoint = compContext.getEndpoint(serviceName, endpointName); + } + // else lookup ServiceEndpiont with Service Name + if ( serviceEndpoint == null && serviceName != null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service name: " + serviceName); + refs = compContext.getEndpointsForService(serviceName); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + // else lookup ServiceEndpont with serviceType + if ( serviceEndpoint == null && serviceType != null && + serviceName == null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service type: " + serviceType); + refs = compContext.getEndpoints(serviceType); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + + return serviceEndpoint; + } + + /** + * this method creates a InOutMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOut createInOutMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for \n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOut inOutME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOutME = factory.createInOutExchange(); + // set operation + inOutME.setOperation(operation); + // set interface if that is not set + if ( inOutME.getInterfaceName() == null ) { + inOutME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOutME.createMessage(); + // set IN Normalized message on message exchange + inOutME.setInMessage(inMsg); + + return inOutME; + } + + /** + * this method creates a InOnlyMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOnly createInOnlyMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for \n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOnly inOnlyME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOnlyME = factory.createInOnlyExchange(); + // set operation + inOnlyME.setOperation(operation); + // set interface if that is not set + if ( inOnlyME.getInterfaceName() == null ) { + inOnlyME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOnlyME.createMessage(); + // set IN Normalized message on message exchange + inOnlyME.setInMessage(inMsg); + + return inOnlyME; + } + + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/Endpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/Endpoint.java new file mode 100644 index 000000000..261897d19 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/Endpoint.java @@ -0,0 +1,286 @@ +/* + * Endpoint.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common.deployment; + +import net.openesb.component.ServiceEngine-archetype.common.MessageExchangeHandler; +import net.openesb.component.ServiceEngine-archetype.common.MessageExchangeListener; +import net.openesb.component.ServiceEngine-archetype.common.MessageExchangeSupport; +import net.openesb.component.ServiceEngine-archetype.common.RuntimeHelper; +import net.openesb.component.ServiceEngine-archetype.common.wsdl.WSDLProcessor; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; + +/** + * This is an abstract class that represents the Endpoint defined for service provisioning or + * consumption in a jbi component. It stores the required service description ( wsdl definition, + * role, service unit to which it belongs etc) and defines the lifecycle operations {@link #init}, + * {@link #activate}, {@link #deactivate}, {@link #clean} to control a service endpoint that + * provides or consumes the service. + *

+ * Extended classes implement the abstract methods defined in this class to implement the endpoint + * functionality by providing the functionality to process the deployment artifacts specific to this + * endpoint, configure the endpoint to send/receive messages to/from delivery channel and process them + * according to the specific service implementation. + * + * @author chikkala + */ +public abstract class Endpoint { + /** Role of this endpoint. CONSUMER or PROVIDER */ + private Role mRole; + /** Service description from the SU descriptor for which this endpoint is configured */ + private SUDescriptor.Service mService; + /** WSDL definition corresponding to this endpoint */ + private Definition mWsdlDef; + /** service endpoint corresponding to this endpoint */ + private ServiceEndpoint mServiceEndpoint; + /** service unit from which this endpoint is created */ + private ServiceUnit mSU; // can be null + /** private constructor to force extended classes to use the parameterized constructor */ + private Endpoint() { + } + /** Creates a new instance of Endpoint + * @param role CONSUMER or PRVODER role. + * @param service service description from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + * @param su service unit object which created this endpoint. + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl, ServiceUnit su) { + this.mService = service; + this.mRole = role; + this.mWsdlDef = wsdl; + this.mSU = su; + } + /** Creates a new instance of Endpoint without service unit. may be useful for static endpoints that + * are not part of the deployment + * @param role CONSUMER or PRVODER role. + * @param service service info from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl) { + this(role, service, wsdl, null); + } + /** + * should be called to initialize any resources related to this endpoint object + * throws JBIException + */ + public abstract void init() throws JBIException; + /** + * activates the endpoint to send/receive messages + * throws JBIException + */ + public abstract void activate() throws JBIException; + /** + * deactivates the endpoint + * throws JBIException + */ + public abstract void deactivate() throws JBIException; + /** + * clean endpoint + * throws JBIException + */ + public abstract void clean() throws JBIException; + + public final Role getRole() { + return this.mRole; + } + public final boolean isProvider() { + return (Role.PROVIDER.equals(this.getRole())); + } + public final boolean isConsumer() { + return (Role.CONSUMER.equals(this.getRole())); + } + public final Definition getWSDL() { + return this.mWsdlDef; + } + public final SUDescriptor.Service getService() { + return this.mService; + } + public final ServiceEndpoint getServiceEndpoint() { + return this.mServiceEndpoint; + } + protected final void setServiceEndpoint(ServiceEndpoint svcEP) { + this.mServiceEndpoint = svcEP; + } + public final ServiceUnit getServiceUnit() { + return this.mSU; + } + /** + * generates an ID that would uniquely identify this endpoint implementation. Use as a key to map + * any information to store that is related to this endpoint. + */ + public final String getID() { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(this.mService.getInterface()).append("+"); + strBuff.append(this.mService.getServiceName()).append("+"); + strBuff.append(this.mService.getEndpointName()).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(this.mRole) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(this.mRole) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + + @Override + public String toString() { + return "Endpoint : " + "\n" + this.mService; + } + /** + * checks if this endpoint is configured for the binding component or service engine. + */ + public boolean isForBindingComponent() { + boolean isForBindingComponent = false; + if ( this.mSU != null ) { + try { + isForBindingComponent = this.mSU.getSUDescriptor().isForBindingComponent(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + return isForBindingComponent; + } + + public QName getOperationQName(String opName) { + return new QName(this.getService().getInterface().getNamespaceURI(), opName); + } + + public Operation getWSDLOperation(QName opQName) { + String opName = null; + if ( opQName != null ) { + opName = opQName.getLocalPart(); + } + Operation operation = WSDLProcessor.findOperation(this.getWSDL(), + this.getService().getInterface(), opName); + return operation; + } + + public Binding getWSDLBinding() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + if ( serviceName != null ) { + return WSDLProcessor.findServiceBinding(this.getWSDL(), serviceName, endpointName); + } else { + return WSDLProcessor.findInterfaceBinding(this.getWSDL(), interfaceName, null); + } + } + /** @return logger */ + public Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** @return ComponentContext */ + public ComponentContext getComponentContext() { + return RuntimeHelper.getComponentContext(); + } + /** @return DeliveryChannel */ + public DeliveryChannel getDeliveryChannel() { + return RuntimeHelper.getDeliveryChannel(); + } + /** + * helper function to get the MessageExchangeSupport object + */ + public MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + public MessageExchangeHandler createMessageExchangeHandler() { + return null; + } + /** + * creates the message exchange listener. Extended classes should return + * MessageExchangeListener implementation. + * @return MessageExchangeListener or null. + * + */ + protected MessageExchangeListener createMessageExchangeListener() { + return null; + } + /** + * Creates and adds message exchange listener to receive message exchange received notification. + */ + protected void addMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeListener meListener = createMessageExchangeListener(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null && meListener != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName, meListener); + if ( serviceName != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), null, serviceName, endpointName, meListener); + } + } + } + /** + * Removes message exchange listener from the MessageExchangeSupport. + */ + protected void removeMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName); + if ( serviceName != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), null, serviceName, endpointName); + } + } + } + + public final boolean processMessageExchangeWithHandler(ExchangeStatus status, MessageExchange me) { + + //1. lookup handler + //2. if not there create one and register + //3. call process message exchange on it + //4. check status. if that is the end, remove the handler + + MessageExchangeSupport support = this.getMessageExchangeSupport(); + if ( support == null ) { + getLogger().fine("No MessageExchangeSupport present"); + return false; + } + MessageExchangeHandler handler = support.findMessageExchangeHandler(me); + if ( handler == null ) { + handler = this.createMessageExchangeHandler(); + if ( handler == null ) { + getLogger().fine("MessageExchangeHandler not supported"); + return false; + } + support.addMessageExchangeHandler(me, handler); + } + + handler.processMessageExchange(status, me); + + getLogger().fine("XXX MX Handler processed ME with STATUS: " + status); + + if (!ExchangeStatus.ACTIVE.equals(status) ) { + // DONE or ERROR means done with the me. + getLogger().fine("End of ME processing. STATUS: " + status + + ". Removing the MX Handler ..."); + support.removeMessageExchangeHandler(me); + } + + return true; + } + +} + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java new file mode 100644 index 000000000..ec4b11155 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java @@ -0,0 +1,104 @@ +/* + * ProviderEndpoint.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common.deployment; + +import net.openesb.component.ServiceEngine-archetype.common.deployment.SUDescriptor.Service; +import javax.jbi.JBIException; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service provider. {@link ServiceUnit#createProviderEndpoint} creates the object of this + * type to implement the service provider functionality. It makes sure that this class or the extended + * classes will activate or deactivate the ServiceEndpoint corresponding to the service + * provided by the endpoint is performed during the activate and deactivate method calls as part of the + * endpoint lifecycle. + * + * @see ServiceUnit#createProviderEndpoint + * @author chikkala + */ + +public class ProviderEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with PROVIDER role and makes sure that the service + * description passed to it is of provider description. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(Role.PROVIDER, provides, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef) { + this(provides, wsdlDef, null); + } + /** + * initializes the endpoint and creates and registers the MessageExchangeListener with + * MessageExchangeSupport. + */ + public final void init() throws JBIException { + getLogger().fine("ProviderEndpiont: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + /** + * calls activatesServiceEndpoint for the Provider. + */ + public final void activate() throws JBIException { + getLogger().fine("ProviderEndpiont: activate called"); + activateServiceEndpoint(); //1. activate service endpoint in NMR + doActivate(); //2. do any other activation related tasks. + } + /** + * calls deactivateServiceEndpoint for the Provider. + */ + public final void deactivate() throws JBIException { + getLogger().fine("ProviderEndpiont: deactivate called"); + deactivateServiceEndpoint(); //1. deactivates the service endpoint in NMR + doDeactivate(); //2. do any other deactivation related tasks. + } + /** + * removes the message exchange listener. cleans up other resources + */ + public final void clean() throws JBIException { + getLogger().fine("ProviderEndpiont: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + /** + * Activates the ServiceEndpoint with NMR + */ + private void activateServiceEndpoint() throws JBIException { + Service service = this.getService(); + ServiceEndpoint svcEP = this.getComponentContext().activateEndpoint( + service.getServiceName(), service.getEndpointName()); + this.setServiceEndpoint(svcEP); + } + /** + * Deactivates ServiceEndpoint in NMR + */ + private void deactivateServiceEndpoint() throws JBIException { + this.getComponentContext().deactivateEndpoint(this.getServiceEndpoint()); + this.setServiceEndpoint(null); + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java new file mode 100644 index 000000000..859de8570 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java @@ -0,0 +1,361 @@ +/* + * SUDescriptor.java + */ + +package net.openesb.component.ServiceEngine-archetype.common.deployment; + +import net.openesb.component.ServiceEngine-archetype.common.RuntimeHelper; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import javax.jbi.management.DeploymentException; +import javax.xml.namespace.QName; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * This interface represent the service unit descriptor (jbi.xml) model. This will be used in + * ServiceUnit implementation to find the services provided and consumed by this service unit. + * {@link SUDescriptorFactory#getSUDescriptor} method reads the jbi.xml in the service unit to + * to the implementation of this interface. + * + * @see SUDescriptorFactory + * @see Consumes + * @see Provides + * @see ServiceUnit + * + * @author chikkala + */ +public interface SUDescriptor { + + Collection getProvidedServices(); + + Collection getConsumedServices(); + + boolean isForBindingComponent(); + + /** + * base interface that models the service information described in the service unit descriptor for + * consumed services and provided services. + */ + public interface Service { + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + QName getInterface(); + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + QName getServiceName(); + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + String getEndpointName(); + } + /** + * marker interface that represents the provided services in the service unit + */ + public interface Provides extends Service { + } + /** + * this interface represents the consumed service information in the su descriptor. + */ + public interface Consumes extends Service { + + public final static String STANDARD_LINK = "standard"; + public final static String SOFT_LINK = "soft"; + public final static String HARD_LINK = "hard"; + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + String getLinkType(); + } + /** + * This is a factory class that can build the Service Unit Descriptor model from the jbi.xml + */ + public static class SUDescriptorFactory { + + protected final static String JBI_TAG_NAME = "services"; + protected final static String SERVICES_TAG_NAME = "services"; + protected final static String BC_TAG_NAME = "binding-component"; + protected final static String PROVIDES_TAG_NAME = "provides"; + protected final static String CONSUMES_TAG_NAME = "consumes"; + protected final static String INTERFACE_TAG_NAME = "interface-name"; + protected final static String SERVICE_TAG_NAME = "service-name"; + protected final static String ENDPOINT_TAG_NAME = "endpoint-name"; + protected final static String LINK_TYPE_TAG_NAME = "link-type"; + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(String jbiXmlPath) throws Exception { + FileReader reader = null; + try { + reader = new FileReader(jbiXmlPath); + SUDescriptor suDesc = getSUDescriptor(reader); + return suDesc; + } finally { + if ( reader != null ) { + try { + reader.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(Reader reader) throws Exception { + SUDescriptor suDescriptor = null; + Document suDescDoc = RuntimeHelper.buildDOMDocument(reader); + Element jbiEl = suDescDoc.getDocumentElement(); + if (JBI_TAG_NAME.equals(jbiEl.getTagName())) { + throw new DeploymentException("Invalid service unit descriptor : no jbi root element"); + } + + NodeList servicesNL = jbiEl.getElementsByTagName(SERVICES_TAG_NAME); + if (servicesNL != null && servicesNL.getLength() == 1) { + Element servicesEl = (Element) servicesNL.item(0); + suDescriptor = SUDescriptorImpl.createSUDescriptor(servicesEl); + } else { + throw new DeploymentException("Invalid service unit descriptor : invalid services element"); + } + + return suDescriptor; + } + + } + /** + * This class implements SUDescriptor + */ + public static class SUDescriptorImpl implements SUDescriptor { + + private List mConsumedList; + private List mProvidedList; + private boolean mIsForBindingComponent; + + protected SUDescriptorImpl(boolean isForBindingComponent) { + this.mIsForBindingComponent = isForBindingComponent; + this.mConsumedList = new ArrayList(); + this.mProvidedList = new ArrayList(); + } + + protected void addProvidedService(Provides provides) { + this.mProvidedList.add(provides); + } + + protected void addConsumedService(Consumes consumes) { + this.mConsumedList.add(consumes); + } + + public Collection getProvidedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mProvidedList); + } + + public Collection getConsumedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mConsumedList); + } + + public boolean isForBindingComponent() { + return this.mIsForBindingComponent; + } + + protected static SUDescriptor createSUDescriptor(Element servicesEl) throws Exception { + boolean isForBC = false; + String bcTagString = servicesEl.getAttribute(SUDescriptorFactory.BC_TAG_NAME); + isForBC = Boolean.valueOf(bcTagString).booleanValue(); + SUDescriptorImpl suDesc = new SUDescriptorImpl(isForBC); + // add consumes + NodeList consumesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.CONSUMES_TAG_NAME); + for ( int i=0; i < consumesNL.getLength(); ++i) { + Element consumesEl = (Element) consumesNL.item(i); + Consumes consumes = ConsumedService.createConsumedService(consumesEl); + suDesc.addConsumedService(consumes); + } + // add provides + NodeList providesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.PROVIDES_TAG_NAME); + for ( int i=0; i < providesNL.getLength(); ++i) { + Element providesEl = (Element) providesNL.item(i); + Provides provides = ProvidedService.createProvidedService(providesEl); + suDesc.addProvidedService(provides); + } + + return suDesc; + } + } + /** + * Base class that implements the Service interface + */ + public static abstract class AbstractService implements Service { + + private QName mInterface; + private QName mServiceName; + private String mEndpointName; + + private AbstractService() { + } + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + public QName getInterface() { + return this.mInterface; + } + + /** + * Setter for property interfaceQName. + * @param interfaceQName New value of property interfaceQName. + */ + protected void setInterface(QName interfaceQName) { + this.mInterface = interfaceQName; + } + + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + public QName getServiceName() { + return this.mServiceName; + } + + /** + * Setter for property serviceName. + * @param serviceName New value of property serviceName. + */ + protected void setServiceName(QName serviceName) { + this.mServiceName = serviceName; + } + + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + public String getEndpointName() { + return this.mEndpointName; + } + + /** + * Setter for property endpointName. + * @param endpointName New value of property endpointName. + */ + protected void setEndpointName(String endpointName) { + this.mEndpointName = endpointName; + } + + } + /** + * This class implements the Provides interface + */ + public static class ProvidedService + extends AbstractService + implements Provides { + protected ProvidedService(QName interfaceQName, QName serviceName, String endpointName) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + } + + @Override + public String toString() { + return "Provides :" + + "\n\t interface-name= " + getInterface() + + "\n\t service-name= " + getServiceName() + + "\n\t endpont-name= " + getEndpointName(); + } + + protected static Provides createProvidedService(Element providesEl) throws Exception { + + String ifName = providesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = providesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = providesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + if ( ifName == null || serviceName == null || endpointName == null ) { + throw new Exception("Invalid provides element: missing " + SUDescriptorFactory.INTERFACE_TAG_NAME + + " or " + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, providesEl); + QName serviceQName = RuntimeHelper.resolveAttrQName(serviceName, providesEl); + + return new ProvidedService(ifQName, serviceQName, endpointName); + } + } + /** + * This class implements the Consumes interface. + */ + public static class ConsumedService + extends AbstractService + implements Consumes { + private String mLinkType; + protected ConsumedService(QName interfaceQName, + QName serviceName, String endpointName, String linkType) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + this.mLinkType = linkType; + } + + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + public String getLinkType() { + return this.mLinkType; + } + + @Override + public String toString() { + return "Cosumes :" + + "\n\t interface-name= " + getInterface() + + "\n\t service-name= " + getServiceName() + + "\n\t endpont-name= " + getEndpointName() + + "\n\t link-type= " + getLinkType(); + } + + protected static Consumes createConsumedService(Element consumesEl) throws Exception { + + String ifName = consumesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = consumesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = consumesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + String linkType = consumesEl.getAttribute(SUDescriptorFactory.LINK_TYPE_TAG_NAME); + if ( linkType == null || linkType.trim().length() == 0 ) { + linkType = STANDARD_LINK; + } + + if ( ifName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.INTERFACE_TAG_NAME ); + } + if ( serviceName == null || endpointName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, consumesEl); + QName serviceQName = null; + if ( serviceName != null ) { + serviceQName = RuntimeHelper.resolveAttrQName(serviceName, consumesEl); + } + if ( serviceQName != null && endpointName != null && linkType != null ) { + if (!(STANDARD_LINK.equals(linkType) || + SOFT_LINK.equals(linkType) || HARD_LINK.equals(linkType)) ) { + throw new Exception("Invalid consumes attribute value" + + SUDescriptorFactory.LINK_TYPE_TAG_NAME + "=" + linkType); + } + } + return new ConsumedService(ifQName, serviceQName, endpointName, linkType); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java new file mode 100644 index 000000000..f7bd96d2c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java @@ -0,0 +1,461 @@ +/* + * ServiceUnit.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common.deployment; + +import net.openesb.component.ServiceEngine-archetype.common.RuntimeHelper; +import net.openesb.component.ServiceEngine-archetype.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.ServiceEngine-archetype.common.deployment.SUDescriptor.Provides; +import net.openesb.component.ServiceEngine-archetype.common.deployment.SUDescriptor.Service; +import net.openesb.component.ServiceEngine-archetype.common.wsdl.WSDLProcessor; +import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; + +/** + * This is an abstract class that implements the service unit functionality in the component which + * processes the service unit artifacts and implement the actual service unit lifecycle functionality. + * The AbstractServiceUnitManager and its extended classes that implement the ServiceUnitManager + * functionality creates and maintains the reference to the concrete implementation of this class to + * invoke the functionality implemented by this class and its concrete implementation during the + * execution of the ServiceUnitMangers lifecycle methods by the jbi runtime. + *

+ * The main lifecycle methods of this class that will be called by the ServiceUnitManger implementation + * during the service unit deployment lifecycle are {@link #doload}, {@link #doDeploy}, {@link #doUndeploy}, + * {@link #doInit}, {@link #doStart}, {@link #doStop} and {@link #doShutdown} + *

+ * Service unit processing supported by this implementation is based on wsdl 1.1 deployments where the + * services provided and consumed in this service unit are described using wsdl 1.1 definitions. + *

+ * The main service unit artifacts that will be processed during deployment lifecycle of the service + * unit are 1.Service unit descriptor(jbi.xml) that describes the services provided and consumed by + * this service unit. 2.WSDL 1.1 document that describes the service definition 3.Component specific + * configurations related to services provided and consumed by this service unit. + *

+ * When the service unit is for Binding Component, the component specific configurations are read + * from the WSDL1.1 extensions defined in the WSDL document corresponding to the service provider + * or consumer deployed with this service unit. + *

+ * When the service unit is for Service Engine, the component specific configurations are read + * from the deployment artifacts such as xslt files and mapping files in the service unit zip file + * along with the WSDL document corresponding to the service provider or consumer deployed with this + * service unit. + * + * @see SUDescriptor + * @see Endpoint + * @see ProviderEndpoint + * @see ConsumerEndpoint + * @see WSDLProcessor + * @author chikkala + */ +public abstract class ServiceUnit { + /** Service Unit Name */ + private String mSUName; + /** Service Unit Root path passed by jbi runtime */ + private String mSURootPath; + /** service unit descriptor model unmarshalled from service unit jbi.xml */ + private SUDescriptor mSUDescriptor; + /** Map of Endpoint Key to ProviderEndpoint configurations in this service unit */ + private Map mProviderEndpointMap; + /** Map of Endpoint Key to ConsumerEndpoint configurations in this service unit */ + private Map mConsumerEndpointMap; + /** Map of Service Key to the WSDL Definition in this service unit */ + private Map mWSDLMap; + /** WSDLProcessor configured for this service unit to process wsdls in the service unit */ + private WSDLProcessor mWSDLProcessor; + /** + * + * @param suName + * @param suRootPath + */ + protected ServiceUnit(String suName, String suRootPath) { + this.mSUName = suName; + this.mSURootPath = suRootPath; + this.mSUDescriptor = null; + this.mWSDLMap = new HashMap(); + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + } + /** returns service unit name + * @return service unit name + */ + public String getName() { + return this.mSUName; + } + /** returns service unit root path where the su artifacts are unzipped by the jbi runtime + * @return path to the service unit root directory. + */ + public String getSURootPath() { + return this.mSURootPath; + } + protected SUDescriptor createSUDescriptor() throws Exception { + File jbiXmlFile = new File(this.getSURootPath(), "META-INF/jbi.xml"); + String jbiXmlPath = jbiXmlFile.getAbsolutePath(); + return SUDescriptor.SUDescriptorFactory.getSUDescriptor(jbiXmlPath); + } + /** return the Service unit descriptor model that was read from the jbi.xml + * @return SUDescriptor + */ + public SUDescriptor getSUDescriptor() throws Exception { + if ( this.mSUDescriptor == null ) { + this.mSUDescriptor = createSUDescriptor(); + } + return this.mSUDescriptor; + } + public ProviderEndpoint getProviderEndpoint(String providerID) { + return this.mProviderEndpointMap.get(providerID); + } + public Collection getProviderEndpoints() { + return Collections.unmodifiableCollection(this.mProviderEndpointMap.values()); + } + public ConsumerEndpoint getConsumerEndpoint(String cosumerID) { + return this.mConsumerEndpointMap.get(cosumerID); + } + + public Collection getConsumerEndpoints() { + return Collections.unmodifiableCollection(this.mConsumerEndpointMap.values()); + } + /** + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * extended classes implement this method to create the su specific WSDLProcessor. for examples, + * a su supporting binding component may have wsdl extensions that it want to registry for reading + * the configurations from the wsdl file. + * @return WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + */ + protected WSDLProcessor createWSDLProcessor() { + return new WSDLProcessor(this.getSURootPath()); + } + /** + * return the WSDLProcessor reference by creates if it is not yet created. + * @return WSDLProcessor. + */ + public final WSDLProcessor getWSDLProcessor() { + if ( this.mWSDLProcessor == null ) { + this.mWSDLProcessor = createWSDLProcessor(); + } + return this.mWSDLProcessor; + } + /** + * loads the service unit artifacts into the SU model. AbstractServiceUnitManager implementation + * calls this method during the during deploy and init lifecycle methods when the service unit + * object is newly created. + */ + public void doLoad() throws DeploymentException { + try { + SUDescriptor suDesc = getSUDescriptor(); // load jbi.xml + loadServiceDefinitions(); // check if the wsdls are valid for corresponding services. + loadOtherArtifacts(); // additional validations specific to component deployment features. + loadEndpoints(); // create endpoints + } catch ( DeploymentException jbiEx) { + throw jbiEx; + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + /** extended classes implement this method to perform the su specific deployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doDeploy() throws DeploymentException { + // NOOP. doLoad has done it all. + this.getLogger().fine("ServiceUnit.doDeploy"); + } + /** extended classes implement this method to perform the su specific undeployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doUndeploy() throws DeploymentException { + //NOOP + this.getLogger().fine("ServiceUnit.doUndeploy"); + } + /** extended classes implement this method to perform the su specific initialization tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doInit() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doInit"); + this.doInitEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on start in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStart() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStart"); + this.doActivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on stop in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStop() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStop"); + this.doDeactivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on shutdown in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doShutdown() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doShutdown"); + this.doCleanEndpoints(); + } + /** + * create the ProviderEndpoint that implement the service provider implementation specific to this su. + * @return ProviderEndpoint or null if the SU does not support the service provider access + */ + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return null; + } + /** + * create the ProviderEndpoint that implement the service consumer implementation specific to this su. + * @return ConsumerEndpoint or null if the SU does not support the service consumer access + */ + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return null; + } + /** + * generates the key based on the service to store the wsdl definitions . + */ + protected String getServiceKey(Service service) { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(service.getInterface()).append("+"); + strBuff.append(service.getServiceName()).append("+"); + strBuff.append(service.getEndpointName()); + return strBuff.toString(); + } + /** + * looks up the wsdl definition loaded for this service. + */ + protected Definition findWSDLFor(Service service) throws WSDLException { + Definition wsdlDef = null; + String key = this.getServiceKey(service); + wsdlDef = this.mWSDLMap.get(key); + return wsdlDef; + } + + protected Definition findWSDL(List wsdlList, Service service, boolean ignoreEndpointLookup) { + Definition foundDef = null; + for ( Definition def : wsdlList ) { + if ( WSDLProcessor.isWSDLFor(def, service.getInterface(), service.getServiceName(), + ((ignoreEndpointLookup) ? null : service.getEndpointName()) ) ) { + foundDef = def; + break; + } + } + return foundDef; + } + /** + * loads the WSDL definitions corresponds to the service providers and consumers defined in the + * service unit descriptor. + */ + protected void loadServiceDefinitions() throws Exception { + + this.mWSDLMap = new HashMap(); + + WSDLProcessor wsdlProcessor = getWSDLProcessor(); + List wsdlList = wsdlProcessor.readWSDLs(this.getSURootPath()); + this.getLogger().fine("Number of wsdl definitions in service unit " + wsdlList.size()); + + List services = new ArrayList(); + services.addAll(this.getSUDescriptor().getProvidedServices()); + services.addAll(this.getSUDescriptor().getConsumedServices()); + + boolean isForBinding = this.getSUDescriptor().isForBindingComponent(); + this.getLogger().fine("Is this service unit for Binding? " + isForBinding); + + for ( Service service : services ) { + this.getLogger().fine("Looking up WSDL for service " + service); + boolean ignoreEndpointLookup = false; + boolean providerAtEngine = false; + if ( !isForBinding && service instanceof Provides ) { + ignoreEndpointLookup = true; + providerAtEngine = true; + } + Definition def = findWSDL(wsdlList, service, ignoreEndpointLookup); + if ( def == null ) { + throw new Exception("WSDL Definition not found for " + service); + } + this.mWSDLMap.put(getServiceKey(service), def); + if ( providerAtEngine ) { + // provider at engine. so add engine binding and endpoint to the wsdl + wsdlProcessor.createServiceEngine-archetypeBinding(def, + service.getInterface(), service.getServiceName(), service.getEndpointName()); + } + } + } + /** extended classes implement this method to perform the su specific artifacts validation in + * this method implementation. + * @throws DeploymentException on error. + */ + protected void loadOtherArtifacts() throws DeploymentException { + // nothing to validate further. + this.getLogger().fine("ServiceUnit.loadOtherArtifacts"); + } + /** + * creates ProviderEndpoint and ConsumerEndpoint objects corresponding to the service providers + * and consumers described in the su descriptor ( jbi.xml ) + */ + protected void loadEndpoints() throws Exception { + + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + + Collection providesList = this.getSUDescriptor().getProvidedServices(); + for ( Provides provides : providesList ) { + Definition wsdlDef = findWSDLFor(provides); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + provides); + } + ProviderEndpoint provider = createProviderEndpoint(provides, wsdlDef); + this.mProviderEndpointMap.put(provider.getID(), provider); + } + + Collection consumesList = this.getSUDescriptor().getConsumedServices(); + for ( Consumes consumes : consumesList ) { + Definition wsdlDef = findWSDLFor(consumes); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + consumes); + } + ConsumerEndpoint consumer = createConsumerEndpoint(consumes, wsdlDef); + this.mConsumerEndpointMap.put(consumer.getID(), consumer); + } + } + /** + * initializes the Endpoint objects created corresponding to the consumer and providers defined + * in the su descriptor + */ + protected void doInitEndpoints() throws DeploymentException { + // init endpoints. if any initialization fails, rollback the already inited endpoints + List initedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.init(); + initedEndpoints.add(endpoint); + } catch ( Exception initEx) { + doCleanEndpoints(initedEndpoints); + throw new DeploymentException(initEx); + } + } + + } + /** + * invokes activates method of all provider and consumer endpoint object in this su. if there is + * and error activating any one the endpoints, it deactivates the already activated ones and throws + * the error + */ + protected void doActivateEndpoints() throws DeploymentException { + // activate providers first and then consumers + List activatedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.activate(); + activatedEndpoints.add(endpoint); + } catch ( Exception actEx) { + doDeactivateEndpoints(activatedEndpoints); + throw new DeploymentException(actEx); + } + } + } + /** + * invokes deactivate method on the list of Endpoint objects passed to this method + */ + protected void doDeactivateEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.deactivate(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes deactivate method on the all consumer and provider endpoint objects + */ + protected void doDeactivateEndpoints() { + // deactivate consumers first and then the providers + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doDeactivateEndpoints(allEndpoints); + } + /** + * invokes clean method on the list of endpoint objects + */ + protected void doCleanEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.clean(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes clean method on the all consumer and provider endpoint objects in this su. + */ + protected void doCleanEndpoints() { + + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doCleanEndpoints(allEndpoints); + } + /** + * prints the service unit description + */ + protected final String printDetails() { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + + out.println("ServiceUnit Name : " + this.getName()); + out.println("ServiceUnit Root : " + this.getSURootPath()); + + SUDescriptor suDesc = null; + try { + suDesc = this.getSUDescriptor(); + for ( SUDescriptor.Consumes consumer : suDesc.getConsumedServices()) { + out.println(consumer); + } + for ( SUDescriptor.Provides provides : suDesc.getProvidedServices()) { + out.println(provides); + } + } catch (Exception ex) { + ex.printStackTrace(out); + } + return writer.getBuffer().toString(); + } + + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java new file mode 100644 index 000000000..ea83df638 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java @@ -0,0 +1,41 @@ +/* + * AbstractExtensibilityElement.java + */ + +package net.openesb.component.ServiceEngine-archetype.common.wsdl; + +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This is an abstract class which can be extended to create jwsdl (wsdl4j's) extension elements model to + * read/write the wsdl extension elements in wsdl 1.1 xml. + * + * @author chikkala + */ +public abstract class AbstractExtensibilityElement implements ExtensibilityElement, java.io.Serializable { + public static final long serialVersionUID = 1; + private QName mElementType; + private Boolean mRequired; + + /** Creates a new instance of AbstractExtensibilityElement */ + protected AbstractExtensibilityElement() { + } + + public void setElementType(QName elementType) { + this.mElementType = elementType; + } + + public QName getElementType() { + return this.mElementType; + } + + public void setRequired(Boolean required) { + this.mRequired = required; + } + + public Boolean getRequired() { + return this.mRequired; + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java new file mode 100644 index 000000000..f958a6a4b --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java @@ -0,0 +1,42 @@ +/* + * AbstractExtensionRegistry.java + */ + +package net.openesb.component.ServiceEngine-archetype.common.wsdl; + +import java.util.List; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This is the abstract class used to add the wsdl extension serializers and deserializers to the + * wsdl extension registry configured to read/write wsdl extensions into a know java model. + * @see AbstractExtensionSerializer + * @see WSDLProcessor + * @author chikkala + */ +public abstract class AbstractExtensionRegistry extends ExtensionRegistry { + + /** Creates a new instance of AbstractSerializer + * it calls the createSerializers method to get the list of + * serializers and then call registerSerializer on each AbstractExtensionSerializer + * to register them with this registry. + * @see AbstractExtensionSerializer#registerSerializer + */ + protected AbstractExtensionRegistry() { + super(); + List list = createSerializers(); + for (AbstractExtensionSerializer ser : list ) { + ser.registerSerializer(this); + } + // register ServiceEngine-archetype Binding serializers + AbstractExtensionSerializer seBindingSer = new SEBindingExt.SEBindingExtSerializer(); + seBindingSer.registerSerializer(this); + } + /** + * create wsdl extension serializers for each extension element to register with the extension + * registry. + * @return List of AbstractExtensionSerializer objects for serializing/deserializing the wsdl extensions. + * @see AbstractExtensionSerializer + */ + protected abstract List createSerializers(); +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java new file mode 100644 index 000000000..98b448d70 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java @@ -0,0 +1,120 @@ +/* + * AbstractExtensionSerializer.java + */ + +package net.openesb.component.ServiceEngine-archetype.common.wsdl; + +import java.io.PrintWriter; +import java.io.Serializable; +import java.util.Set; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionDeserializer; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.extensions.ExtensionSerializer; +import javax.xml.namespace.QName; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +/** + * This class is an abstract class that should be extended to implements extension serializer and + * deserializer. This class implements the code required for registering the serializer and deserializer + * implemented by this class. THe AbstractExtensionRegistry class calls the #registerSerializer method + * to register the concrete implementation of this class with extension registry. + * @see AbstractExtensionRegistry + * @author chikkala + */ +public abstract class AbstractExtensionSerializer + implements ExtensionSerializer, ExtensionDeserializer, Serializable { + + public static final long serialVersionUID = 1; + + private Class mParentType; + private Class mExtensionType; + private QName mElementType; + + /** Creates a new instance of AbstractSerializer */ + public AbstractExtensionSerializer(Class parentType, QName elementType, Class extensionType) { + this.mParentType = parentType; + this.mElementType = elementType; + this.mExtensionType = extensionType; + } + + public Class getParentType() { + return this.mParentType; + } + public QName getElementType() { + return this.mElementType; + } + public Class getExtensionType() { + return this.mExtensionType; + } + + public void registerSerializer(ExtensionRegistry extReg) { + extReg.registerSerializer(this.mParentType, this.mElementType, this); + extReg.registerDeserializer(this.mParentType, this.mElementType, this); + extReg.mapExtensionTypes(this.mParentType, this.mElementType, this.mExtensionType); + } + + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + // DO NOTHING. Binding component runtime does not need to serialize the wsdl extensions. + } + + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + return null; + } + + public static String getAttribute(Element el, String attrName) { + String attrValue = null; + Attr attr = el.getAttributeNode(attrName); + if ( attr != null ) { + attrValue = attr.getValue(); + } + return attrValue; + } + + protected String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + /** + * @return the name with the prefix defined for the namespaceURI in the wsdl definition. + * @throws WSDLException if the prefix not found in the wsdl definition. note that the + * default prefix is an empty string. + */ + protected String getQualifiedName(Definition def, + String namespaceURI, String localName) throws WSDLException { + String prefix = null; + if (namespaceURI != null && !namespaceURI.equals("")) { + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + throw new WSDLException(WSDLException.OTHER_ERROR, + "Can not find prefix in WSDL Definition for " + namespaceURI); + } + } + if ( prefix != null && !prefix.equals("")) { + return prefix + ":" + localName; + } else { + return localName; + } + } +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java new file mode 100644 index 000000000..55d9e358e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java @@ -0,0 +1,226 @@ +/* + * AbstractNormalizer.java + */ + +package net.openesb.component.ServiceEngine-archetype.common.wsdl; + +import java.util.ArrayList; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Part; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * This is an abstract class that implements most of the functionality to normalize the binding protocol + * specific concrete message to jbi wrapper and and denormalize jbi wrapper to the concrete binding + * protocol specific message. + *

+ * The extended classes specific to particular binding protocol will be used when a jbi binding + * component is sending and receiving messages from the external service providers and consumers using + * a particular binding protocol known to this class. Extended implementation of this class should make + * use of the helper methods in this class in normalizing and denormalizing the messages. + * @see JMXBindingNormalizer + * @author chikkala + */ +public abstract class AbstractNormalizer { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + /** wsdl definition to use when normalizing and denormalizing */ + private Definition mWSDL; + /** Binding definition to use when normalizing and denormalizing */ + private Binding mBinding; + + private AbstractNormalizer() {} + /** Creates a new instance of JMXBCNormalizer */ + public AbstractNormalizer(Definition wsdl, Binding binding) { + this.mWSDL = wsdl; + this.mBinding = binding; + } + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete mssage of a particular binding protocol. + */ + public abstract void normalizeInput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeOutput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be de-normalized. + * @param normMsg NormalizedMessage which should be used to create de-normalized message. + */ + public abstract DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + + /** + * denormalized the normalized fault message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException; + /** + * @return the wsdl definition to use in normalizing and denormalizing the message + */ + protected Definition getWSDL() { + return this.mWSDL; + } + /** + * @return the wsdl binding definition to use in normalizing and denormalizing the message + */ + protected Binding getBinding() { + return this.mBinding; + } + /** + * create and add message parts to the jbiWrapper according to the abstract message model. This + * method assumes that the each element in the msgParts list passed to it is mapped to the part + * of the abstract wsdl message and uses the type or element attribute of the abstract message to + * determine whether the element is actual part element or a wrapped part type. + * Use this method in normalizing the concrete protocol specific message to jbi wrapper message. + * @param jbiWrapper object that holds the jbi wrapper information. + * @param wsdlMsg abstract message from the wsdl definition + * @param msgParts actual message parts from the concrete message + */ + protected void addMessagePartsToJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg, List msgParts) throws MessagingException { + List wsdlParts = wsdlMsg.getOrderedParts(null); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= msgParts.size() ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + Element msgPart = msgParts.get(i); + if ( wsdlPart.getElementName() != null ) { + jbiWrapper.appendPart(msgPart); + } else { + // it is type. + // check the element name is same as part + if ( !wsdlPart.getName().equals(msgPart.getLocalName()) ) { + throw new MessagingException("mismatched message content for part " + wsdlPart.getName()); + } + if ( !wsdlMsg.getQName().getNamespaceURI().equals(msgPart.getNamespaceURI()) ) { + throw new MessagingException("mismatched message content namespace for part " + wsdlPart.getName()); + } + // check the content is text or element. + List partContent = getChildElements(msgPart); + if ( partContent.size() > 0 ) { + // add content as part elements + jbiWrapper.appendPart(partContent); + } else { + // add the content as text + jbiWrapper.appendPart(msgPart.getTextContent()); + } + } + } + } + /** + * extracts the message parts from the jbiWrapper according to the abstract wsdl message + * definition passed to it. Use this method in denormalizing the jbi wrapper message into the + * binding protocol specific concrete message. + * @param jbiWrapper jbi wrapper object that contains message parts and the message type information. + * @param wsdlMsg abstract wsdl message definition to use in constructing the part elements. + */ + protected List getMessagePartsFromJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg) + throws MessagingException, ParserConfigurationException { + + List msgParts = new ArrayList(); + int jbiPartCount = jbiWrapper.getPartCount(); + List wsdlParts = wsdlMsg.getOrderedParts(null); + QName msgType = jbiWrapper.getType(); + if (!wsdlMsg.getQName().getNamespaceURI().equals(msgType.getNamespaceURI())) { + throw new MessagingException("Namespace mismatch between jbi wrapper message type and wsdl message"); + } + Document newDoc = jbiWrapper.getDocumentBuilder().newDocument(); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= jbiPartCount ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + if ( wsdlPart.getElementName() != null ) { + msgParts.add(jbiWrapper.getPartAsElement(i)); + } else { + // it is type. create a new element for a typed part + // check the element name is same as part + String prefix = msgType.getPrefix(); + String nsURI = msgType.getNamespaceURI(); + String localName = wsdlPart.getName(); + Element partEl = newDoc.createElementNS(nsURI, prefix + ":" + localName); + partEl.setAttributeNS(XMLNS_NS, "xmlns:"+prefix, nsURI); + NodeList partContent = jbiWrapper.getPart(i); + appendChildren(partEl, partContent, newDoc, true); + msgParts.add(partEl); + } + } + return msgParts; + } + /** + * utility method that can append the nodeList passed to it to the element children. + * @param el element node to which the nodeList should be appended + * @param doc the document object that should be used to import the nodeList + * @param importNode true if the nodeList should be imported while appending the nodeList to the + * element children. false if no import is necessary. + */ + protected void appendChildren(Element el, NodeList nodeList, Document doc, boolean importNode) { + + for ( int pIdx = 0; pIdx < nodeList.getLength(); ++pIdx) { + Node node = nodeList.item(pIdx); + if ( importNode ) { + node = doc.importNode(node, true); + } + el.appendChild(node); + } + } + /** + * @param el element from which to extract the child elements + * @return List list of child Element nodes. + */ + protected List getChildElements(Element el) { + List list = new ArrayList(); + NodeList nodeList = el.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if (!(node instanceof Element) ){ + continue; + } + list.add((Element)node); + } + return list; + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java new file mode 100644 index 000000000..2cede99c7 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java @@ -0,0 +1,96 @@ +/* + * SEBindingExt.java + */ + +package net.openesb.component.ServiceEngine-archetype.common.wsdl; + +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation classes implement wsdl 1.1 extension model for the + * jbi service engine binding that is defined in jsr 208(sec. 5.5.6.1). to read/write concrete binding + * element in the wsdl definition for the service endpoint binding provided by the service engine. + * The wsdl definition with this binding information can be used in providing the service provider + * metadata returned by the service engine in Component.getServiceDescription. + *

+ * AbstractExtensionRegistry by default include this extension serializers in the + * registry to read/write this service engine binding type in the wsdl definition. + *

+ * During a service unit deployment/initialization in the service engine, the deployed wsdl definition + * is loaded and modified to provide this binding for the service provided by the engine. + * + * @see WSDLProcessor#createServiceEngine-archetypeBinding + * @see AbstractExtensionRegistry + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit#loadServiceDefinitions + * @author chikkala + */ +public interface SEBindingExt extends ExtensibilityElement, java.io.Serializable { + + public static final String NS_URI = "http://java.sun.com/xml/ns/jbi/binding/service+engine"; + public static final String NS_DEF_PREFIX = "jbise"; + /** Element names. */ + public static final String EL_BINDING_EXT = "binding"; + /**Qualified element names.*/ + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + + public static class SEBindingExtImpl extends AbstractExtensibilityElement implements SEBindingExt { + + public SEBindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + @Override + public String toString() { + StringBuffer buff = new StringBuffer(); + buff.append("<"+NS_DEF_PREFIX+":"+EL_BINDING_EXT); + buff.append("/>"); + return buff.toString(); + } + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static SEBindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + SEBindingExtImpl bindingExt = new SEBindingExt.SEBindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, SEBindingExt.NS_DEF_PREFIX); + return bindingExt; + } + } + /** + * serializer and descrializer implementation for the binding extension element. + */ + public static class SEBindingExtSerializer extends AbstractExtensionSerializer { + + public SEBindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, SEBindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + SEBindingExt extObj = (SEBindingExt)extReg.createExtension(parentType, elementType); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + + SEBindingExt extObj = (SEBindingExt)extension; + + StringBuffer buff = new StringBuffer(); + buff.append("<" + elName ); + buff.append("/>"); + pw.println(buff.toString()); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java new file mode 100644 index 000000000..40480696c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java @@ -0,0 +1,468 @@ +/* + * WSDL11JBIWrapper.java + * + */ + +package net.openesb.component.ServiceEngine-archetype.common.wsdl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +/** + * This class wraps the wsdl11 messages to the jbi wrapper message suitable for + * processing in the wsdl2.0 model of the normalized message in jbi as defined in jsr208 like + * + * + * + * + * + * + * + * + * + * + * @author chikkala + */ +public class WSDL11JBIWrapper { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + public static final String WRAPPER_NAMESPACE = "http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; + public static final String DEF_NS_PREFIX = "jbiwrp"; + public static final String DEF_MESSAGE_NS_PREFIX = "msgns"; + public static final String JBI_MESSAGE_EL = "message"; + public static final String JBI_PART_EL = "part"; + public static final String VERSION_ATTR = "version"; + public static final String VERSION_ATTR_VALUE = "1.0"; + public static final String TYPE_ATTR = "type"; + public static final String NAME_ATTR = "name"; + + private static DocumentBuilder sDocBuilder = null; + /** qname of message attribute from wsdl:input, wsdl:output or wsdl:fault */ + private QName mType; + /** optional name attribute from wsdl:input, wsdl:output or wsdl:fault */ + private String mName; + /** each parts contents as node list */ + List mPartConentList = new ArrayList(); + + /** Creates a new instance of WSDL11JBIWrapper */ + public WSDL11JBIWrapper() { + } + /** creates the namespace aware document builder. extended classes can override this method + * to return the doc builder created else where. + */ + protected DocumentBuilder createDocumentBuilder() throws ParserConfigurationException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + return factory.newDocumentBuilder(); + } + /** return the document builder + * @return DocumentBuilder + */ + public final DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { + if ( WSDL11JBIWrapper.sDocBuilder == null ) { + WSDL11JBIWrapper.sDocBuilder = createDocumentBuilder(); + } + return WSDL11JBIWrapper.sDocBuilder; + } + /** + * @return type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public QName getType() { + return this.mType; + } + /** + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public void setType(QName type) { + this.mType = type; + } + /** @return name attribute from wsdl:input, wsdl:output or wsdl:fault. or null if not set. */ + public String getName() { + return this.mName; + } + /** + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault. can be null. + */ + public void setName(String name) { + this.mName = name; + } + /** + * appends part content as node list + */ + public void appendPart(NodeList partContent) { + this.mPartConentList.add(partContent); + } + /** + * append part content from the List of nodes + */ + public void appendPart(List partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content as element + */ + public void appendPart(Element partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content from DOMSource + */ + public void appendPart(DOMSource partContent) { + Element partConentEl = getElement(partContent.getNode()); + this.mPartConentList.add(new NodeListImpl(partConentEl)); + } + /** + * append part content as text node. + */ + public void appendPart(String partContent) { + Text textContent = null; + try { + textContent = this.getDocumentBuilder().newDocument().createTextNode(partContent); + } catch (ParserConfigurationException ex) { + ex.printStackTrace(); + } + if ( textContent != null ) { + this.mPartConentList.add(new NodeListImpl(textContent)); + } + } + /** + * append list of part contents each is a NodeList to the parts + */ + public void appendParts(List partContentList) { + this.mPartConentList.addAll(partContentList); + } + /** + * returned the ordered list of part contents. + */ + public List getParts() { + return Collections.unmodifiableList(this.mPartConentList); + } + /** + * return the number of parts + */ + public int getPartCount() { + return this.mPartConentList.size(); + } + /** + * return the part content at a particular index as NodeList. + */ + public NodeList getPart(int idx) { + return this.mPartConentList.get(idx); + } + /** + * return part context at a particular index as text + */ + public String getPartAsText(int idx) { + NodeList partNodes = getPart(idx); + Document doc; + try { + doc = this.getDocumentBuilder().newDocument(); + Element el = doc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + for ( int i=0; i < partNodes.getLength(); ++i) { + el.appendChild(partNodes.item(i)); + } + return el.getTextContent(); + } catch (ParserConfigurationException ex) { + return null; + } + } + /** + * return part context at a particular index as Element + */ + public Element getPartAsElement(int idx) { + Element contentEl = null; + NodeList partNodes = getPart(idx); + for ( int i=0; i < partNodes.getLength(); ++i) { + Node node = partNodes.item(i); + if ( node instanceof Element) { + contentEl = (Element)node; + break; + } + } + return contentEl; + } + /** + * creates Document from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return Document containing the wsdl 11 wrapper xml + */ + public Document toDocument() throws ParserConfigurationException { + + Document wrapperDoc = getDocumentBuilder().newDocument(); + Element jbiMessage = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_MESSAGE_EL); + jbiMessage.setAttribute(VERSION_ATTR, VERSION_ATTR_VALUE); + wrapperDoc.appendChild(jbiMessage); + + QName type = this.getType(); + if ( type == null ) { + type = new QName("", "", DEF_MESSAGE_NS_PREFIX); + } + // set the jbiMessage attributes + String prefix = type.getPrefix(); + if (prefix == null || prefix.length() == 0) { + prefix = DEF_MESSAGE_NS_PREFIX; + } + jbiMessage.setAttribute(TYPE_ATTR, prefix + ":" + type.getLocalPart()); + jbiMessage.setAttributeNS( XMLNS_NS, "xmlns:" + prefix, type.getNamespaceURI()); + + String name = this.getName(); + if (name != null && name.trim().length() > 0 ) { + jbiMessage.setAttribute(NAME_ATTR, name); + } + + List partContentList = this.getParts(); + for ( NodeList nodeList : partContentList ) { + // set jbi part message + Element jbiPart = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + jbiMessage.appendChild(jbiPart); + for ( int i =0; i < nodeList.getLength(); ++i ) { + Node importedMsgNode = wrapperDoc.importNode(nodeList.item(i), true); + jbiPart.appendChild(importedMsgNode); + } + } + + return wrapperDoc; + + } + /** + * creates DOMSource from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return DOMSource containing the wsdl 11 wrapper xml + */ + public DOMSource toDOMSource() throws ParserConfigurationException { + DOMSource wrappedSource = new DOMSource(); + wrappedSource.setNode(toDocument()); + return wrappedSource; + } + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + /** + * creates wrapper object from the DOMSource that has wsdl 11 wrapper xml. + * @param wrappedMsg wsdl 11 wrapper xml as DOMSource + * @return WSDL11JBIWrapper representing the wrapper xml. + */ + public static WSDL11JBIWrapper sourceToWrapper(DOMSource wrappedMsg) { + Element jbiMessage = getElement(wrappedMsg.getNode()); + if ( jbiMessage == null ) { + return null; + } + String nsURI = jbiMessage.getNamespaceURI(); + String tagName = jbiMessage.getLocalName(); + if (!WRAPPER_NAMESPACE.equals(nsURI) || !JBI_MESSAGE_EL.equals(tagName)) { + return null; + } + String name = jbiMessage.getAttribute(NAME_ATTR); + String typeQN = jbiMessage.getAttribute(TYPE_ATTR); + String typePrefix = ""; + String typeName = ""; + if ( typeQN != null && typeQN.trim().length() > 0 ) { + int idx = typeQN.indexOf(':'); + if ( idx >= 0 ) { + typePrefix = typeQN.substring(0, idx); + if ( typeQN.length() > idx ) { + typeName = typeQN.substring(idx+1); + } + } else { + typePrefix = ""; + typeName = typeQN; + } + } + String typeURI = jbiMessage.getAttribute("xmlns:" + typePrefix); + QName typeQName = new QName(typeURI, typeName, typePrefix); + + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(typeQName); + NodeList jbiPartList = jbiMessage.getElementsByTagNameNS(WRAPPER_NAMESPACE, JBI_PART_EL); + for ( int i=0; i < jbiPartList.getLength(); ++i) { + Node jbiPart = jbiPartList.item(i); + wrapper.appendPart(jbiPart.getChildNodes()); + } + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object and sets the type and name of the object + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name ) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(type); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content has multiple child element. + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, NodeList partContent) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + wrapper.appendPart(partContent); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content is a single element + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, Element msgEl) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name, new WSDL11JBIWrapper.NodeListImpl(msgEl)); + return wrapper; + } + + public static WSDL11JBIWrapper createWrapper(QName type, String name, DOMSource inputSource) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + Node msgNode = getElement(inputSource.getNode()); + NodeList nodeList = new WSDL11JBIWrapper.NodeListImpl(msgNode); + wrapper.appendPart(nodeList); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations input element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createInputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Input input = operation.getInput(); + if ( input == null ) { + return null; + } + name = input.getName(); + Message wsdlMsg = input.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createOutputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Output output = operation.getOutput(); + if ( output == null) { + return null; + } + name = output.getName(); + Message wsdlMsg = output.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @param faultName fault name, can be null to look for the fault with no name. + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createFaultWrapper(Operation operation, String faultName) throws ParserConfigurationException { + QName type = null; + String name = null; + @SuppressWarnings("unchecked") + Map faultMap = operation.getFaults(); + Fault fault = faultMap.get(faultName); + + if ( fault == null ) { + return null; + } + name = fault.getName(); + Message wsdlMsg = fault.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * NodeList implementation. + */ + public static class NodeListImpl extends ArrayList implements NodeList { + + public NodeListImpl() { + super(); + } + + public NodeListImpl(Node aNode) { + super(); + if (aNode != null) { + this.add(aNode); + } + } + + public NodeListImpl(List nodes) { + if (nodes != null) { + this.addAll(nodes); + } + } + + public int getLength() { + return this.size(); + } + + public Node item(int idx) { + return this.get(idx); + } + + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java new file mode 100644 index 000000000..311dc0c26 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java @@ -0,0 +1,416 @@ +/* + * WSDLProcessor.java + */ + +package net.openesb.component.ServiceEngine-archetype.common.wsdl; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.wsdl.Port; +import javax.wsdl.PortType; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ElementExtensible; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.wsdl.xml.WSDLWriter; +import javax.xml.namespace.QName; + +/** + * This class is used to configure jwsdl(wsdl4j) to read and process wsdl documents with wsdl extensions. + * It provides set of helper methods to read and process the wsdl definitions from files with .wsdl + * extension from a specified directory. + *

+ * A Binding Component that is processing the wsdl extensions for its deployment configuration would + * extend this class and provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + *

+ * A Service Engine that is processing the wsdl during deployment can directly use this class + * to process the wsdl as the default implementation returned by this class configures the wsdl extension + * registry to read/write the service engine binding extensions. + * + * @see AbstractExtensionRegistry + * @see SEBindingExt + * @author chikkala + */ +public class WSDLProcessor { + + private String mXmlCatalogPath = "xml-catalog.xml"; + private String mWsdlDirPath = ""; + private WSDLReader mReader; + + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir) { + this(wsdlDir, null); + } + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir, String xmlCatPath) { + if ( wsdlDir != null ) { + this.mWsdlDirPath = wsdlDir; + } + if ( xmlCatPath != null ) { + this.mXmlCatalogPath = xmlCatPath; + } + } + /** @return directory path from which this class reads the wsdl files with .wsdl as file extension. */ + public String getWSDLDirectory() { + return this.mWsdlDirPath; + } + /** path to the xml catalog file in the service unit which can be used for Catalog-based entity + * and URI resolution. + */ + public String getXmlCatelogPath() { + return this.mXmlCatalogPath; + } + /** wsdl extension registry required for processing the wsdl extensions in the wsdl definition to + * java model. Binding component that is processing the wsdl extensions for its deployment + * configuration would provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + * @return ExtensionSerializer + * @see AbstractExtensionSerializer + */ + protected ExtensionRegistry getExtensionRegistry() { + return new AbstractExtensionRegistry() { + protected List createSerializers() { + return new ArrayList(); + } + }; + } + /** + * @return the WSDLReader configured with extension registry to process the wsdl extensions. + */ + public final WSDLReader getWSDLReader() throws WSDLException { + if ( this.mReader == null ) { + WSDLFactory factory = WSDLFactory.newInstance(); + this.mReader = factory.newWSDLReader(); + // reader.setFeature("javax.wsdl.verbose", true); + // reader.setFeature("javax.wsdl.importDocuments", true); + this.mReader.setExtensionRegistry(getExtensionRegistry()); + } + return this.mReader; + } + /** + * reads the wsdl file and returns the wsdl definition jwsdl model. + * @param wsldFilePath relative path to wsdl file from the the root wsdl directory returns from + * #getWSDLDirectory in the service unit or or absolute path . + * @return Definition + */ + public Definition readWSDL(String wsdlFilePath) throws WSDLException { + File wsdlFile = new File(wsdlFilePath); + if ( !wsdlFile.isAbsolute() ) { + wsdlFile = new File(this.mWsdlDirPath, wsdlFilePath); + } + return getWSDLReader().readWSDL(wsdlFile.getAbsolutePath()); + } + /** + * reads the files with .wsdl file extension in a directory. If the directory should + * be searched recursively, it searches this directory, all child directories of this + * directory and then to their child directories recursively. + * @param dir directory file to search for .wsdl files + * @param rec if set to true, it recursively searches the directory. if set to false, only + * this directory is searched. + * @return List of Files with .wsdl extension. + */ + public List listWSDLFiles(File dir, final boolean rec) throws IOException { + if ( dir == null || !dir.isDirectory()) { + throw new IOException(dir + " is not a directory for looking up wsdl files"); + } + List wsdlList = new ArrayList(); + File[] files = dir.listFiles(new FileFilter() { + public boolean accept(File pathname) { + if ( rec && pathname.isDirectory()) { + return true; + } else { + String name = pathname.getName(); + int idx = name.lastIndexOf('.'); + if ( idx < 0 ) { + return false; + } + String ext = name.substring(idx); + return ".wsdl".equalsIgnoreCase(ext); + } + } + }); + for ( File file : files ) { + if ( rec && file.isDirectory()) { + List wsdlFiles = listWSDLFiles(file, rec); + wsdlList.addAll(wsdlFiles); + } else { + wsdlList.add(file); + } + } + return wsdlList; + } + /** + * reads the files with .wsdl file extension in a directory fromDir and return the list of + * wsdl definitions corresponding to them. + * @param fromDir path to the directory relative to the root wsdl directory returns from + * #getWSDLDirectory or the absolute path to the directory. + */ + public List readWSDLs(String fromDir) throws WSDLException { + if ( fromDir == null ) { fromDir = ""; } + File wsdlDir = new File(fromDir); + if (!wsdlDir.isAbsolute()) { + wsdlDir = new File(this.mWsdlDirPath, fromDir); + } + + List wsdlFiles = new ArrayList(); + try { + wsdlFiles = listWSDLFiles(wsdlDir, true); + } catch (IOException ioEx) { + throw new WSDLException("WSDLFileReadError", ioEx.getMessage(),ioEx); + } + + List wsdlPaths = new ArrayList(); + for ( File wsdlFile : wsdlFiles) { + wsdlPaths.add(wsdlFile.getAbsolutePath()); + } + Collections.sort(wsdlPaths); + + List wsdlList = new ArrayList(); + for ( String wsdlPath : wsdlPaths ) { + Definition wsdlDef = readWSDL(wsdlPath); + wsdlList.add(wsdlDef); + } + return wsdlList; + } + /** + * finds PortType using port type ( interface ) qname. + */ + public static PortType findInterface(Definition wsdlDef, QName interfaceName) { + return wsdlDef.getPortType(interfaceName); + } + /** finds the Service using service qname */ + public static Service findService(Definition wsdlDef, QName serviceName) { + return wsdlDef.getService(serviceName); + } + /** finds the wsdl port using service qname and endpoint name */ + public static Port findServiceEndpoint(Definition wsdlDef, QName serviceName, String endpointName) { + Service service = null; + Port port = null; + service = findService(wsdlDef, serviceName); + if ( service != null ) { + port = service.getPort(endpointName); + } + return port; + } + /** + * finds the binding definition to which the service with serviceName and endpointName was bound. + */ + public static Binding findServiceBinding(Definition wsdlDef, QName serviceName, String endpointName) { + Binding binding = null; + Port port = findServiceEndpoint(wsdlDef, serviceName, endpointName); + if ( port != null ) { + binding = port.getBinding(); + } + return binding; + } + /** + * finds the binding definition using the interface(portType) qname with a + */ + public static Binding findInterfaceBinding(Definition wsdlDef, + QName interfaceQName, QName extQName) { + Map bindingMap = wsdlDef.getBindings(); + @SuppressWarnings("unchecked") + Collection bindings = bindingMap.values(); + for ( Binding binding : bindings ) { + if ( binding.getPortType().getQName().equals(interfaceQName)) { + return binding; + } + } + return null; + } + + /** + * find the wsdl4j operation corresponds to the interface+operation. + * @param wsdlDef wsdl definition + * @param portTypeQName portType QName + * @param opName operation name. if null, first operation in the portType + * is returned. + * @return Operation corresponding to the portType+opName + */ + public static Operation findOperation(Definition wsdlDef, + QName portTypeQName, String opName) { + Operation operation = null; + PortType portType = wsdlDef.getPortType(portTypeQName); + if ( portType != null ) { + if ( opName != null ) { + operation = portType.getOperation(opName, null, null); + } else { + @SuppressWarnings("unchecked") + List list = portType.getOperations(); + if ( list != null && list.size() > 0 ) { + operation = list.get(0); + } + } + } + return operation; + } + /** + * verifies whether the wsdl definition contains the specified service descriptions or not. Used + * to locate the wsdl definition for the services describes in service unit deployment + * descriptor(jbi.xm). + * @param interfaceName portType qname to find in the definition. can be null if you are trying to + * find only service endpoint description. + * @param serviceName qname for the service to find in this wsdl. can be null if + * you are trying to find only portType (abstract service) description. + * @param endpointName port name to find in the service definition. null if only + * service with any port should be looked up. + * + * @return true if the wsdl definition contains the specified service description. + */ + public static boolean isWSDLFor(Definition wsdlDef, + QName interfaceName, QName serviceName, String endpointName) { + PortType portType = null; + Service service = null; + Port port = null; + if ( interfaceName != null ) { + portType = findInterface(wsdlDef, interfaceName); + } + + if ( serviceName != null ) { + service = findService(wsdlDef, serviceName); + } + + if ( endpointName != null && service != null ) { + port = service.getPort(endpointName); + } + + boolean isWSDL = true; + + if ( (interfaceName != null && portType == null) || + ( serviceName != null && service == null ) || + ( endpointName != null && (service == null || port == null)) ) { + isWSDL = false; + } + + return isWSDL; + } + /** + * creates a binding definition that contains a service engine binding elements in the specified + * wsdl definition for a portType. It will try to find/create the binding element with interface + * local name with a "_JBISEBinding" suffix and add service engine binding element to it if it + * is not present. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding createServiceEngine-archetypeBinding(Definition wsdl, QName interfaceName) { + QName bindingQName = new QName(wsdl.getQName().getNamespaceURI(), + interfaceName.getLocalPart() + "_JBISEBinding"); + Binding binding = wsdl.getBinding(bindingQName); + if ( binding == null ) { + binding = wsdl.createBinding(); + binding.setQName(bindingQName); + binding.setPortType(wsdl.getPortType(interfaceName)); + binding.setUndefined(false); + + ExtensibilityElement bindingExt = + SEBindingExt.SEBindingExtImpl.addExtensibilityElement(wsdl, binding); + + wsdl.addBinding(binding); + } + return binding; + } + /** + * creates port and binding elements that provide the the service engine binding for a service. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @param serviceName service under which the port definition bound to the service engine binding + * should be created. + * @param endpointName port name. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding createServiceEngine-archetypeBinding(Definition wsdl, QName interfaceName, QName serviceName, String endpointName ) { + Binding binding = null; + Service service = findService(wsdl, serviceName); + if ( service == null ) { + return null; + } + Port port = service.getPort(endpointName); + if ( port != null ) { + binding = port.getBinding(); + } else { + // create port + port = wsdl.createPort(); + port.setName(endpointName); + binding = createServiceEngine-archetypeBinding(wsdl, interfaceName); + port.setBinding(binding); + service.addPort(port); + } + return binding; + } + /** prints the wsdl to text from the wsdl definition */ + public static void printWSDL(PrintWriter out, Definition def) { + try { + WSDLFactory factory = WSDLFactory.newInstance(); + WSDLWriter wsdlWriter = factory.newWSDLWriter(); + wsdlWriter.writeWSDL(def, out); + } catch (WSDLException ex) { + ex.printStackTrace(out); + } + } + /** prints the wsdl to text from the wsdl definition */ + public static String printWSDLToString(Definition def) { + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + printWSDL(out, def); + out.close(); + return writer.getBuffer().toString(); + } + /** returns an existing namespace prefix or create one if not exists for the corresponding namespaceURI */ + public static String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static void addExtensibilityElement(Definition wsdlDef, + ElementExtensible extensibleEl, ExtensibilityElement extEl, String defPrefix) { + QName elementType = extEl.getElementType(); + String namespaceURI = elementType.getNamespaceURI(); + String prefix = wsdlDef.getPrefix(namespaceURI); + if ( prefix == null ) { + // no namespace prefix defined. create one. + prefix = WSDLProcessor.getNamespacePrefix(wsdlDef, namespaceURI, defPrefix); + wsdlDef.addNamespace(prefix, namespaceURI); + } + extensibleEl.addExtensibilityElement(extEl); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/ServiceEngineTest.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/ServiceEngineTest.java new file mode 100644 index 000000000..fd9622623 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/ServiceEngineTest.java @@ -0,0 +1,51 @@ +/* + * ServiceEngine-archetypeTest.java + */ + +package enginetest; + +import net.openesb.component.ServiceEngine-archetype.test.JBIComponentTestClient; +import net.openesb.component.ServiceEngine-archetype.test.SOAPBindingTestClient; +import java.util.Properties; + import junit.framework.TestCase; + +/** + * The test method in this testcase uses the SOAPBindingTestClient to send the + * input document to the echo service provided by service engine via soap binding + * component and receives the output document which will be placed in test results + * directory under the same package as this test case. + * @see com.sun.jbi.sample.component.test.SOAPBindingTestClinet + * @author chikkala + */ +public class ServiceEngineTest + extends TestCase +{ + public ServiceEngineTest(String testName) { + super(testName); + } + + public void test1() throws Exception { + String testPropertiesPath = "test1.properties"; + JBIComponentTestClient testClient = new SOAPBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public void test2() throws Exception { + String testPropertiesPath = "test2.properties"; + JBIComponentTestClient testClient = new SOAPBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public static void main(String[] args) { + try { + ServiceEngineTest compTest = new ServiceEngineTest("ServiceEngineTest"); + compTest.test1(); + compTest.test2(); + } catch(Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test1.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test1.properties new file mode 100644 index 000000000..4a9f71699 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test1.properties @@ -0,0 +1,8 @@ +input.file=test1Input.xml +# expected.file=Expected.xml +output.file=test1Output.xml +soap.binding.inbound.endpoint.address.location=http://localhost:12010/ServiceEngine/greetings +soap.binding.soapaction=sayHello +fail.on.soap.fault=true + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test1Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test1Input.xml new file mode 100644 index 000000000..123c4fcb8 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test1Input.xml @@ -0,0 +1,12 @@ + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test2.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test2.properties new file mode 100644 index 000000000..584b79c72 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test2.properties @@ -0,0 +1,8 @@ +input.file=test2Input.xml +# expected.file=Expected.xml +output.file=test2Output.xml +soap.binding.inbound.endpoint.address.location=http://localhost:12010/ServiceEngine/greetings +soap.binding.soapaction=sayGoodbye +fail.on.soap.fault=true + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test2Input.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test2Input.xml new file mode 100644 index 000000000..c9ea58761 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/enginetest/test2Input.xml @@ -0,0 +1,12 @@ + + + + + + Srinivasan + Chikkala + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java new file mode 100644 index 000000000..b8137523c --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java @@ -0,0 +1,295 @@ +/* + * JBIComponentTestClient.java + */ + +package net.openesb.component.ServiceEngine-archetype.test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; + +/** + * This class implements the base framework for the testing the JBI components. + * Testing the JBI component involves may require deploying a service to the + * component(s) to enable the service provided by the test component and then + * invoking the service provided by the test component. If the test component is + * a binding component, then a service provider component such as sample service + * engine is required to test the component end to end. If the test component is a + * service engine, then the service on the test component can be invoked via + * soap/http binding component. + * + * This class provides the utilites to read the test properties, read the input + * message from the file and save the output to the file. The testService + * method implemented here can be executed as the test for the component. The + * testService method calls the invokeService method with the input document and + * expects a output document or error that will be saved to the output file. + * The method invokeService should be implemented by the extended test classes to + * inplement a suitable service consumer implemenation for the test compoent. + * See JMXBindingTestClient.java or SOAPBidningTestClient.java for more details + * on how to implement a partucular test service consumer. + * + * @author chikkala + */ +public abstract class JBIComponentTestClient { + + public static final String TEST_PROPS_FILE_PROP = "test.properties.file"; + public static final String TEST_RESULTS_DIR_PROP = "test.results.dir"; + public static final String TEST_SRC_DIR_PROP = "test.src.dir"; + + public static final String TEST_PACKAGE_PROP = "test.package.name"; + + public static final String INPUT_FILE_PROP = "input.file"; + public static final String EXPECTED_FILE_PROP = "expected.file"; + public static final String OUTPUT_FILE_PROP = "output.file"; + + public static final String DEF_TEST_PROP_FILE = "test.properties"; + public static final String DEF_INPUT_FILE = "Input.xml"; + public static final String DEF_OUTPUT_FILE = "Output.xml"; + public static final String DEF_TEST_RESULTS_DIR = "test-results"; + + public JBIComponentTestClient() { + } + /** + * returns the absolute resource path w.r.t. the packagePath if the resource name + * is relative else return the resourceName as it is. + * @param package name ( dot separated ) + * @param resourcName dot separated name or a absolute resource path + * @return abosolute resource path with path separator + */ + public static String resolveResourcePath(String packageName, String resourceName) { + String resourcePath = resourceName; + if ( !resourceName.startsWith("/")) { + // it is relative resource file. resolve it w.r.t. testPackage + String pkgDir = packageName.trim().replace('.', '/'); + if ( pkgDir.length() != 0 ) { + pkgDir += "/"; + } + resourcePath = "/" + pkgDir + resourceName; + } + return resourcePath; + } + /** + * loads the resource file as properties. + * @param testPackage package name where this test belongs + * @param testPropPath resource path relative to testPackage or absolute resource path + */ + public Properties loadTestProperties(String testPackage, String testPropPath) throws IOException { + String propsResourcePath = resolveResourcePath(testPackage, testPropPath); + + InputStream testPropIS = null; + try { + testPropIS = this.getClass().getResourceAsStream(propsResourcePath); + Properties testProps = new Properties(); + testProps.load(testPropIS); + testProps.setProperty(TEST_PACKAGE_PROP, testPackage); + return testProps; + } finally { + if ( testPropIS != null ) { + try { + testPropIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @param testPropPath resource path relative to testPackage or absolute resource path + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass, String testPropPath) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), testPropPath ); + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), DEF_TEST_PROP_FILE ); + } + /** + * loads the resource file to string bugger + * @param inputFile resource file path + */ + public StringBuffer loadResourceFile(String resourcePath) throws FileNotFoundException, IOException { + + InputStream inputIS = null; + InputStreamReader inputReader = null; + BufferedReader reader = null; + StringWriter strWriter = null; + PrintWriter writer = null; + try { + inputIS = this.getClass().getResourceAsStream(resourcePath); + inputReader = new InputStreamReader(inputIS); + reader = new BufferedReader(inputReader); + strWriter = new StringWriter(); + writer = new PrintWriter(strWriter); + for ( String line = null; (line = reader.readLine()) != null ; ) { + writer.println(line); + } + writer.close(); + strWriter.close(); + return strWriter.getBuffer(); + } finally { + if ( inputIS != null ) { + try { + inputIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + + /** + * reads data from the reader and saves to file + * @param reader reader from which to read the data and save to file + * @param outputFilePath absolute file path + */ + public void saveOutputToFile(Reader reader, String outputFilePath) throws IOException { + + BufferedReader buff = null; + FileWriter fileWriter = null; + PrintWriter writer = null; + try { + buff = new BufferedReader(reader); + fileWriter = new FileWriter(outputFilePath); + writer = new PrintWriter(fileWriter); + for ( String line = null; (line = buff.readLine()) != null ; ) { + writer.println(line); + } + } finally { + if ( writer != null ) { + writer.close(); + } + if ( fileWriter != null ) { + fileWriter.close(); + } + } + } + + /** + * resource path. + */ + public String getInputFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String inputFile = testProps.getProperty(INPUT_FILE_PROP, DEF_INPUT_FILE); + String resourcePath = resolveResourcePath(testPkg, inputFile); + return resourcePath; + } + /** + * return resource path + */ + public String getExpectedFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String resourcePath = null; + String expFile = testProps.getProperty(EXPECTED_FILE_PROP, null); + if ( expFile != null ) { + resourcePath = resolveResourcePath(testPkg, expFile); + } + return resourcePath; + } + /** + * return the absolute path to the output file + */ + public String getOutputFilePath(Properties testProps) { + + String defPackage = this.getClass().getPackage().getName(); + String testPackage = testProps.getProperty(TEST_PACKAGE_PROP, defPackage); + String testPackageDir = testPackage.replace('.','/'); + String outputFile = testProps.getProperty(OUTPUT_FILE_PROP, DEF_OUTPUT_FILE); + + String userHomeDir = System.getProperty("user.home", ""); + String userDir = System.getProperty("user.dir", userHomeDir); + String defResultsDir = userDir + "/" + DEF_TEST_RESULTS_DIR; + String sysResultDir = System.getProperty(TEST_RESULTS_DIR_PROP, defResultsDir); + String resultDir = testProps.getProperty(TEST_RESULTS_DIR_PROP, sysResultDir); + + File outputDir = new File(resultDir, testPackageDir); + // System.out.println("Creating the test results output dir " + outputDir); + outputDir.mkdirs(); + return (new File(outputDir, outputFile)).getAbsolutePath(); + } + + /** + * This is the method where the actual service invocation code based on the + * type of client will be implemented. testService method calls this method + * after preparing the test input and then processes the output returned by + * this method to complte the test. + * @param inputDoc + * @param testProps + * @throws java.lang.Exception + * @return + */ + public abstract StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception; + + /** + * abstract method implemented by the extended classes to compare the output + * document with the expected output to determine the test is a failure or + * success. + * @param outputDoc + * @param expectedDoc + * @param testProps + * @throws java.lang.Exception + */ + public abstract void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, Properties testProps) throws Exception; + + /** + * This is the main test method that a test case will call to test the + * service. The standard steps that required to invoke the service and + * process the output will be done in this method. Each test case creates + * the test Properties required for that test and executes this method for + * testing the service by passing the test properties to it. This method + * prepares the input and executes the invokeService method to invoke a + * service with the prepared input. It then processes the return value from + * the invokeService to complete the test. + * + * @param testProps + * @throws java.lang.Exception + */ + public void testService(Properties testProps) throws Exception { + + String inFilePath = getInputFileResourcePath(testProps); + String outFilePath = getOutputFilePath(testProps); + String expFilePath = getExpectedFileResourcePath(testProps); + File outDir = (new File(outFilePath)).getParentFile(); + outDir.mkdirs(); + + StringBuffer outputDoc = new StringBuffer(); + + try { + StringBuffer inputDoc = loadResourceFile(inFilePath); + outputDoc = invokeService(inputDoc, testProps); + if ( expFilePath != null ) { + StringBuffer expOutputDoc = loadResourceFile(expFilePath); + compareWithExpectedOutput(inputDoc, expOutputDoc, testProps); + } + } catch (Exception ex) { + StringWriter out = new StringWriter(); + ex.printStackTrace(new PrintWriter(out)); + outputDoc.append(out.getBuffer()); + throw ex; + } finally { + if ( outputDoc != null ) { + System.out.println(outputDoc); + this.saveOutputToFile(new StringReader(outputDoc.toString()), outFilePath); + } + } + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java new file mode 100644 index 000000000..32cc645ff --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java @@ -0,0 +1,133 @@ +/* + * JMXBindingTestClient.java + */ + +package net.openesb.component.ServiceEngine-archetype.test; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the proxy service consumer implementation by a binding component + * that can communicate with the external service consumers using JMX interface. + * @author chikkala + */ +public class JMXBindingTestClient extends JBIComponentTestClient { + + public static final String CONSUMER_EP_INBOUND_OPERATION_PROP = "consumer.jmx.bc.ep.operation"; + public static final String CONSUMER_EP_ADDRESS_MBEAN_PROP = "consumer.jmx.bc.ep.address.mbean"; + public static final String CONSUMER_EP_ADDRESS_URL_PROP = "consumer.jmx.bc.ep.address.serviceURL"; + public static final String CONSUMER_EP_ADDRESS_USERNAME_PROP = "consumer.jmx.bc.ep.address.username"; + public static final String CONSUMER_EP_ADDRESS_PASSWORD_PROP = "consumer.jmx.bc.ep.address.password"; + + public static final String PROVIDER_EP_INBOUND_OPERATION_PROP = "provider.jmx.bc.ep.operation"; + public static final String PROVIDER_EP_ADDRESS_MBEAN_PROP = "provider.jmx.bc.ep.address.mbean"; + public static final String PROVIDER_EP_ADDRESS_URL_PROP = "provider.jmx.bc.ep.address.serviceURL"; + public static final String PROVIDER_EP_ADDRESS_USERNAME_PROP = "provider.jmx.bc.ep.address.username"; + public static final String PROVIDER_EP_ADDRESS_PASSWORD_PROP = "provider.jmx.bc.ep.address.password"; + + + /** + * Creates a new instance of JMXBindingTestClient + */ + public JMXBindingTestClient() { + super(); + } + /** + * creates jmx connection to send the input message to the binding component. + */ + public static MBeanServerConnection getJMXConnection(Properties testProps) + throws MalformedURLException, IOException { + + String jmxUrl = testProps.getProperty(CONSUMER_EP_ADDRESS_URL_PROP); + String username = testProps.getProperty(CONSUMER_EP_ADDRESS_USERNAME_PROP); + String password = testProps.getProperty(CONSUMER_EP_ADDRESS_PASSWORD_PROP); + + Map env = new HashMap(); + if ( username != null ) { + String [] credentials = new String [] {username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, JMXBindingTestClient.class.getClassLoader()); + } + JMXServiceURL serviceURL = new JMXServiceURL(jmxUrl); + JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, env); + MBeanServerConnection mbeanServerConnection = jmxConnector.getMBeanServerConnection(); + return mbeanServerConnection; + } + /** + * constructs the jmx mbean objectname + */ + public static ObjectName createJMXEndpointMBeanObjectName(String endpointAddressMBean) throws MalformedObjectNameException { + // String objectName = JMX_DOMAIN + ":" + JMX_ENDPOINT_ADDRESS_KEY + "=" + endpointAddressMBean; + return new ObjectName(endpointAddressMBean); + } + /** + * invokes a jmx mbean to send message. + */ + public static StringBuffer invokeSendMessage(MBeanServerConnection jmxConn, ObjectName epAddressName, + String operation, StringBuffer inputDoc) + throws MalformedObjectNameException, InstanceNotFoundException, + MBeanException, ReflectionException, IOException { + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if ( result != null ) { + outDoc = (StringBuffer)result; + } + + return outDoc; + } + /** + * invokes the service via jmx interface. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + ObjectName epAddressName = new ObjectName(testProps.getProperty(CONSUMER_EP_ADDRESS_MBEAN_PROP)); + String operation = testProps.getProperty(CONSUMER_EP_INBOUND_OPERATION_PROP); + + MBeanServerConnection jmxConn = getJMXConnection(testProps); + StringBuffer outputDoc = null; + try { + outputDoc = invokeSendMessage(jmxConn, epAddressName, operation, inputDoc); + } catch (MBeanException ex) { + Exception targetEx = ex.getTargetException(); + if ( targetEx != null ) { + throw targetEx; + } else { + throw ex; + } + } + return outputDoc; + } + /** no expected output comparison implemented */ + public void compareWithExpectedOutput(StringBuffer inputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java new file mode 100644 index 000000000..c84a6f78a --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java @@ -0,0 +1,156 @@ +/* + * SOAPBindingTestClient.java + */ + +package net.openesb.component.ServiceEngine-archetype.test; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.util.Properties; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPConnection; +import javax.xml.soap.SOAPConnectionFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPFault; +import javax.xml.soap.SOAPMessage; +import javax.xml.soap.SOAPPart; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the Service Engine via SOAP Binding by invoking the service using + * SOAP Client that sends the message to the service provider via soaphttp binding. + * + * @author chikkala + */ +public class SOAPBindingTestClient extends JBIComponentTestClient { + + private static final String ADDRESS_PROP = "soap.binding.inbound.endpoint.address.location"; + private static final String SOAP_ACTION_PROP = "soap.binding.soapaction"; + private static final String FAIL_ON_SOAP_FAULT_PROP = "fail.on.soap.fault"; + + private static MessageFactory messageFactory; + private static SOAPConnectionFactory soapConnFactory; + private static SOAPConnection connection; + + public SOAPBindingTestClient() throws SOAPException { + init(); + } + /** initializes SOAP client */ + private synchronized void init() throws SOAPException { + if ( messageFactory == null ) { + messageFactory = MessageFactory.newInstance(); + } + if ( soapConnFactory == null ) { + soapConnFactory = SOAPConnectionFactory.newInstance(); + } + if ( connection == null ) { + connection = soapConnFactory.createConnection(); + } + } + + /** + * read in a soap message from the given input file + */ + private static SOAPMessage loadMessage(Reader inReader) throws SOAPException, IOException { + //Create and populate the message from a file + SOAPMessage message = messageFactory.createMessage(); + SOAPPart soapPart = message.getSOAPPart(); + StreamSource preppedMsgSrc = new StreamSource(inReader); + soapPart.setContent(preppedMsgSrc); + message.saveChanges(); + return message; + } + /** saves the SOAP message as xml text to a writer */ + private static void saveMessage(SOAPMessage response, Writer outWriter) + throws TransformerConfigurationException, SOAPException, TransformerException { + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute("indent-number", new Integer(2)); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + SOAPPart replySOAPPart = response.getSOAPPart(); + Source sourceContent = replySOAPPart.getContent(); + StreamResult result = new StreamResult(outWriter); + try { + transformer.transform(sourceContent, result); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + } + /** + * Send a soap message + * @param destination URL to send to + * @param message message to send + * @param expectedHttpStatus expected http status code or null if success is expected + * @return reply soap message + */ + private static SOAPMessage sendMessage(String destination, SOAPMessage message, String soapAction) throws SOAPException { + + // Add soapAction if not null + if (soapAction != null) { + MimeHeaders hd = message.getMimeHeaders(); + hd.setHeader("SOAPAction", soapAction); + } + // Send the message and get a reply + SOAPMessage reply = null; + reply = connection.call(message, destination); + return reply; + } + /** check the xml text in the StringBuffer passed contains SOAP Fault. */ + public boolean isSOAPFault(StringBuffer msgBuff) { + SOAPFault soapFault = null; + try { + SOAPMessage inMsg = loadMessage(new StringReader(msgBuff.toString())); + soapFault = inMsg.getSOAPBody().getFault(); + } catch (Exception ex) { + // any exception, means either no fault elem or invalid xml + } + return (soapFault != null); + } + /** + * invokes the service ny sending the input message and return the output + * message returned by the service. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + String soapAction = testProps.getProperty(SOAP_ACTION_PROP); + String destination = testProps.getProperty(ADDRESS_PROP); + SOAPMessage inMsg = loadMessage(new StringReader(inputDoc.toString())); + SOAPMessage outMsg = sendMessage(destination, inMsg, soapAction); + StringWriter out = new StringWriter(); + saveMessage(outMsg, out); + StringBuffer outDoc = out.getBuffer(); + Boolean failOnSoapFault = Boolean.valueOf(testProps.getProperty(FAIL_ON_SOAP_FAULT_PROP, "false")); + if ( failOnSoapFault ) { + if (isSOAPFault(outDoc)) { + StringBuffer errBuff = new StringBuffer("########## SOAP FAULT ############ \n"); + errBuff.append(outDoc); + throw new Exception(errBuff.toString()); + } + } + return outDoc; + } + /** comparing the received output document with the expected document. throw + * exception if the docs are not same. throwing the exception in this method + * fails the test. + */ + public void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/build.properties new file mode 100644 index 000000000..8770a8330 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/build.properties @@ -0,0 +1,19 @@ +# Build properties for the service assembly builds +# user.properties.file=../../user.properties +src.dir=src +# This directory is removed when the project is cleaned: +build.dir=build +service.assembly.name=testSA + +#no.deps=true set the no.deps property if there are no SUs to build +# for each testSU define the properties here. +# dependent BC SU projects dependency +# service unit name +service.unit.name.testSUBC=testSUBC +# service unit project directory +project.testSUBC=testSUBC + +# service unit name +service.unit.name.testSUSE=testSUSE +# service unit project directory +project.testSUSE=testSUSE diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/build.xml new file mode 100644 index 000000000..12d519c6a --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/build.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..e19a6cf78 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,41 @@ + + + + + ServiceEngine-archetype_TestSA + This is a test Service Assembly to test Engine + + + + + ServiceEngine-archetype_TestSUBC + This service unit enables soap inbound endpoint for a service in service engine + + + testSUBC.zip + sun-http-binding + + + + + ServiceEngine-archetype_TestSUSE + This service unit enables greetings service provider in service engine + + + testSUSE.zip + ServiceEngine-archetype + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build.properties new file mode 100644 index 000000000..387359c01 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build.properties @@ -0,0 +1,7 @@ +# Build properties for the service unit builds +src.dir=src +# This directory is removed when the project is cleaned: +#build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..4c4b3d9a1 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC.zip b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC.zip new file mode 100644 index 0000000000000000000000000000000000000000..f4205815d39cfd4aaec83644439b3cde3918d3e4 GIT binary patch literal 1341 zcmWIWW@h2#VgP}Fg7;=%29)3g(!Q=Cj=G+HZu$W*bsS)I!neYX-(X^3DB)vZ03rtW zqSVxq%)Insz4GFeoU7r!_O}cK_J+Tz?HofeUP;oE1p@h=GJLFfc6QIlGe?$KR_PWTk^hvrS#$ zG-GyDUQ3~j=ik&dZzhW?{?xo?D6#$C;!P^+DzD32PkO^~a=W@oPf{|AfNPqIQeV)` z1!X#W7=Ags)=RY*i`>{R@FLq$vfloD?iyaM_F%#1k{2202>CU89(34Kb@|c$PiNJa zo;~~f|NPzD2C>WUyyRHJ$n=Xd=}l0AzofG8;+BK5n|6Kj^nT;)k?ryJSgn}%$7Ke0 zZr!`6%gbez&sKF}{;S7=?OyKHUu0%!3Vf3Il4kWURp{h{j#){Wp?pq^#3CJwzjp;JU<1iWQCpi)5Kl=^k-~R6))HQ zCvW*w-=$vmf4*zJp>WmXf10JUpWXBHwO?6TzHN5&dRrIss3-e;JJso$d_o#Ot|Cz)$PqR|H$i;mAZ|fbmgWgTv^o3zW@Eto73OwosInZ;-=N9@YyAMgFKe5*15X# z-=7NKxGj$oRv4wb&v-4LvbM}sCUtr9-sUKWwU0dP{bf40i*MU$*LER~u`SV~{rQ!j zQuD68=H;r{yZ`NJWiz#nCbOpRXnFtOcM0(hXiNLEQ&O zP2NgMR;=P&{64qSAaIjfbKl}eSu@W1hOv7;=H(J9%uFp5`v1WC%H{&0>3uu0U2K9m zXS(^BNX9$AU2k7~@91Wc3-z$qK|=LiM=|IiCQ2bSqjmN9%~5A+RR9n YLgO&No0Scuf*A-m0_jv15RaD&0Ny4i^#A|> literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl new file mode 100644 index 000000000..038d91bcd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC/Greetings.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml new file mode 100644 index 000000000..d468f995e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/build/testSUBC/META-INF/jbi.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/src/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/src/Greetings.wsdl new file mode 100644 index 000000000..8a160abd0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..d468f995e --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build.properties new file mode 100644 index 000000000..387359c01 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build.properties @@ -0,0 +1,7 @@ +# Build properties for the service unit builds +src.dir=src +# This directory is removed when the project is cleaned: +#build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..38fc64f50 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE.zip b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE.zip new file mode 100644 index 0000000000000000000000000000000000000000..2db1a3a5c32b7f22dd9f6213cb0b25c2076d30b3 GIT binary patch literal 3003 zcmaJ@c{G%58y~VYW+wYOQixF25Yk;_84NOZ*@nq(7{s7-7)vjwb7U#YK_Tm)$d*QS z$r9POm~7eRB^4^ZsrUVQ`|3U4{XFNspFghObDih9p5O0xnHe2ofi37g zx5M-kt!r`dG|EIz-t50|Y~SO!C#*Wh7$J}#1O!6AA^HRyF38i*Jy0$r(9LJq8Vx2C zIG$OrM8*@GV3YPdz^?c~YQwr=P=OdbP!{?w|Ct+p2920_>@nejjK-wSe>|fxO0tf>eyn^0%CElHSv{5XjVV}?C9%S zbd5eQEaTc$<9C(mK#9>C7wJqSHs=iq)~3oP{c$Xc8l)q+Q>>@dFAK_>Fee;7ATUW8 zmpa{JHfeq1mj-m+#ALOyq!wx4%e3<&1t3vhab;`C{Kt2tM-&BWXYw9PloLmhqu4dJ z7qwDn60xpK9J*I8iQP6I&%Ji45wfSF8!1Fm<{4|^SoXds7zz4)%iz#B4Cj*I07Dj+ zNi?eYLSxu#YSUJ)R6%d==YyQ5>ZZ#m-(^~1N38PXhE0^3(L_HkSi1wL-+KKdb^Y@}nZ$hXNl#xvkgBaIWh?&D+y)b$zO5cw zVQwu`PwS~)Ek(D#@_xC{X?)&Jbzt27fB<4+$&08hjD(j}&zC6nkcC|bY#1E+W_}%U zVgvWubg3ankvr_|zI1Tr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7Kz4NH&7KXzm zJ{fdNOtCXo3>r(nvgTfY!VX>xwF<$ZNZax$Qd_lY|4q3n0fSY7uwvUtw}@JR=jem! zgi~cQr@EUTD&4B|j=3z!#Zhhvhq7=_7-+V3U2P6_;WO*=$~b>vQ^t{ zQ<7og?zQS?;~1{hdF&7pt0|eJ_(zY8!~NRVkq@2-v$59#R84sn;}YR$h2{iq!p5`` z>GATkp#1aXrr~w-XBK@^27y_Q_%RyZ(_E~ zOA1H3<##fwBRxZMU*ut2 z3967oCG-IDn=v67nt?ED_4^BP*($q>hWGs!WeS2CTF1OiUbFi2IBp}tOHlB+OJ zPFRuUNgs;FVyjqHI%MuSUg3!07uT<;dK^02tsgZbZ+Ba2%2?(K+q~tmiY;4+hjk=D z-+?ujGSxASQogNlW)Hc?l&yDBZzb)blqtel%-+U7)2sTSa!N-4kXyXXGC##BQUDCD zW}fcPgi%qjFKH3x?47J=Pi>xa;gyuZAg!@3^m7n?e5i`jmh*!sh+S=^4%Mn=Rg6n{pLI7-0}${2A?&zJMN+F3K?%So8Iv? z&Dl7*9&KVtp4mFc8w~zP^X2yRAhn;i%LaP*vNdxJO=5oo@Z3%9m$R!LkyTw?`E+Kb zz1Ld?-v=&>QrPGC+`~M#x1ESOxE1`oChv{+6vw0fkGfa+OB;0$4w)G-F!CJwKcgf4 z2cjQ;9uSMJMueNmM$_slK$<*zrlaC zoPXd!bQAi?fPO>%s%8HmFVorcL)m`A{m!y~kSnbJ#yK-1X8Ic;5ElC7LRU|TziJML F{s$_z?xO$z literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl new file mode 100644 index 000000000..038d91bcd --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/Greetings.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml new file mode 100644 index 000000000..f9b3498bc --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/META-INF/jbi.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/goodbye.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/hello.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/xsltmap.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/xsltmap.properties new file mode 100644 index 000000000..06e4b6631 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/build/testSUSE/xsltmap.properties @@ -0,0 +1,28 @@ +# properties will be used to find the xslt file that will be used for invoking a +# service operation. +# The "xsltmap.properties" file should contain two types of properties +# 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +# "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +# 2. a service description to xslt file properties with syntax like +# "{tns-prefix}service-name=xslt_file_name" and +# "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +# "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +# the service description property is a "." delimited tokens that represents +# a serive or interface qname and a operation name. To locate xslt file either with +# service qname or service qname and operaton or serivice qname and interface qname +# and operation, all the three properties specified above should be there for each xslt file. +# + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +# just service level default settings +{greet2}greetService=hello.xsl +# service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +# service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +# service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +# service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/Greetings.wsdl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/Greetings.wsdl new file mode 100644 index 000000000..8a160abd0 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..f9b3498bc --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/goodbye.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/hello.xsl b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/xsltmap.properties b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/xsltmap.properties new file mode 100644 index 000000000..06e4b6631 --- /dev/null +++ b/maven-archtype-v2/maven-archetype-service-engine-v2/target/test-classes/projects/basic/project/ServiceEngine-archetype/test/testSA/testSUSE/src/xsltmap.properties @@ -0,0 +1,28 @@ +# properties will be used to find the xslt file that will be used for invoking a +# service operation. +# The "xsltmap.properties" file should contain two types of properties +# 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +# "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +# 2. a service description to xslt file properties with syntax like +# "{tns-prefix}service-name=xslt_file_name" and +# "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +# "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +# the service description property is a "." delimited tokens that represents +# a serive or interface qname and a operation name. To locate xslt file either with +# service qname or service qname and operaton or serivice qname and interface qname +# and operation, all the three properties specified above should be there for each xslt file. +# + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +# just service level default settings +{greet2}greetService=hello.xsl +# service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +# service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +# service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +# service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/pom.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/pom.xml new file mode 100644 index 000000000..603bf268f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + open-jbi-components + BindingComponent-Plugin-archetype + 1.0-SNAPSHOT + maven-archetype + + BindingComponent-Plugin-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 000000000..417c58560 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,69 @@ + + + + + deploy-plugin/nbproject + + **/*.xml + **/*.properties + + + + deploy-plugin/src + + **/*.java + **/*.xml + **/*.properties + + + + nbproject + + **/*.xml + **/*.properties + + + + nbproject/private + + **/*.xml + **/*.properties + + + + deploy-plugin + + **/*.xml + + + + deploy-plugin/src + + **/*.ExtensibilityElementTemplateProvider + **/*.ElementFactory + **/*.png + **/*.ValidatorSchemaFactory + **/*.Validator + **/*.xsd + + + + deploy-plugin + + **/*.mf + + + + + + build.xml + install-params.properties + m2nbbuild-impl.xml + m2nbbuild.properties + m2nbbuild.xml + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/build.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/build.xml new file mode 100644 index 000000000..14afd1d29 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/build.xml @@ -0,0 +1,72 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Builds, tests, and runs the project ${artifactId}. + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/build.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/build.xml new file mode 100644 index 000000000..12e9743bf --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/build.xml @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Builds, tests, and runs the project ${artifactId}. + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/manifest.mf b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/manifest.mf new file mode 100644 index 000000000..7b9bf6601 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: ${artifactId} +OpenIDE-Module-Layer: ${artifactId}/layer.xml +OpenIDE-Module-Localizing-Bundle: ${artifactId}/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml new file mode 100644 index 000000000..37d0e9fcf --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml @@ -0,0 +1,30 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/genfiles.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/genfiles.properties new file mode 100644 index 000000000..c0843e42b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/genfiles.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.xml.data.CRC32=43b76edb +build.xml.script.CRC32=09d16688 +build.xml.stylesheet.CRC32=a56c6a5b@2.50.1 +${symbol_pound} This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +${symbol_pound} Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=43b76edb +nbproject/build-impl.xml.script.CRC32=899b03af +nbproject/build-impl.xml.stylesheet.CRC32=68e521fc@2.50.1 diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/platform.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/platform.properties new file mode 100644 index 000000000..7ac9923fb --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/platform.properties @@ -0,0 +1,4 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +nbplatform.active=default diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/private/platform-private.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/private/platform-private.properties new file mode 100644 index 000000000..3ac32342a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/private/platform-private.properties @@ -0,0 +1,4 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +user.properties.file=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working57${symbol_escape}${symbol_escape}.netbeans${symbol_escape}${symbol_escape}openesb${symbol_escape}${symbol_escape}build.properties diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.properties new file mode 100644 index 000000000..a5e2da3b1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.properties @@ -0,0 +1,7 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +javac.compilerargs=-Xlint -Xlint:-serial +javac.source=1.5 +nbm.homepage=http://www.netbeans.org +nbm.module.author=logicoyparam diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml new file mode 100644 index 000000000..671ff920b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml @@ -0,0 +1,59 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + org.netbeans.modules.apisupport.project + + + ${artifactId} + + + + org.netbeans.modules.xml.schema.model + + + + 1 + 1.2 + + + + org.netbeans.modules.xml.wsdl.bindingsupport.api + + + + 1.0 + + + + org.netbeans.modules.xml.wsdl.model + + + + 1 + 1.2 + + + + org.netbeans.modules.xml.xam + + + + 1 + 1.2 + + + + org.openide.util + + + + 7.9.0.1 + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider new file mode 100644 index 000000000..5d706f033 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider @@ -0,0 +1 @@ +cname.template.WSDLExtTemplateProvider diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.model.spi.ElementFactory b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.model.spi.ElementFactory new file mode 100644 index 000000000..90f3ddb3c --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.model.spi.ElementFactory @@ -0,0 +1,6 @@ +cname.model.ExtElementFactoryProvider$BindingExtFactory +cname.model.ExtElementFactoryProvider$OperationExtFactory +cname.model.ExtElementFactoryProvider$InputExtFactory +cname.model.ExtElementFactoryProvider$OutputExtFactory +cname.model.ExtElementFactoryProvider$FaultExtFactory +cname.model.ExtElementFactoryProvider$PortExtFactory diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.validator.spi.ValidatorSchemaFactory b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.validator.spi.ValidatorSchemaFactory new file mode 100644 index 000000000..5caf7af1f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.wsdl.validator.spi.ValidatorSchemaFactory @@ -0,0 +1 @@ +cname.validator.WSDLExtValidatorSchemaFactory diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.xam.spi.Validator b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.xam.spi.Validator new file mode 100644 index 000000000..695264745 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/META-INF/services/org.netbeans.modules.xml.xam.spi.Validator @@ -0,0 +1,2 @@ +cname.validator.WSDLExtValidator + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/BindingComponentWsdlExt.xsd b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/BindingComponentWsdlExt.xsd new file mode 100644 index 000000000..82c1c9ba8 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/BindingComponentWsdlExt.xsd @@ -0,0 +1,115 @@ + + + + + + + + + "binding" defines a protocol based binding details. + + + + + + + + + + + + + + "operation" defines the protocol based binding operation details. + + + + + + + + + + + + + + + + "input" defines the protocol based binding input details. + + + + + + + + + + + + + + + "output" defines the protocol based binding output details. + + + + + + + + + + + + + + + "fault" defines the protocol based binding fault details. + + + + + + + + + + + + + + + "address" indicates protocol based binding port details. + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/Bundle.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/Bundle.properties new file mode 100644 index 000000000..446e39e02 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/Bundle.properties @@ -0,0 +1,21 @@ +# binding component deployment plugin resource bundle +# binding deploy plugin +OpenIDE-Module-Name=JBI Deployment Plugin[${artifactId}] +# deployment plugin +OpenIDE-Module-Short-Description=Binding component deployment plugin for ${artifactId} +# deployment plugin for adding wsdl extensions related to the binding component to the wsdl editor +OpenIDE-Module-Long-Description=Deployment plugin for adding wsdl extensions related to this binding component to the wsdl editor +# category +OpenIDE-Module-Display-Category=CAPS + +# WSDLEditor mapping names for the Binding +WSDLEditor/Binding/${artifactId}BindingExt=${artifactId} Binding +WSDLEditor/BindingOperation/${artifactId}OperationExt=${artifactId} Binding Operation extension +WSDLEditor/BindingOperationInput/${artifactId}InputExt=${artifactId} Binding Input extension +WSDLEditor/BindingOperationOutput/${artifactId}OutputExt=${artifactId} Binding Output extension +WSDLEditor/BindingOperationFault/${artifactId}FaultExt=${artifactId} Binding Fault extension +WSDLEditor/ServicePort/${artifactId}PortExt=${artifactId} Service Port extension + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/layer.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/layer.xml new file mode 100644 index 000000000..54dd3a897 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/layer.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/BindingExt.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/BindingExt.java new file mode 100644 index 000000000..3d50c6f9e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/BindingExt.java @@ -0,0 +1,47 @@ +/* + * BindingExt.java + */ +package net.openesb.component.${artifactId}.model; + +import org.netbeans.modules.xml.wsdl.model.Binding; +import org.netbeans.modules.xml.wsdl.model.WSDLModel; +import org.netbeans.modules.xml.xam.Component; +import org.w3c.dom.Element; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * extension element. + * + * @author chikkala + */ +public interface BindingExt extends ExtComponent { + +//TODO: define get/set methods for properties for BindingExt if the extension element has attributes. + /** + * This class is an implementation of BindingExt interface that provides + * java model for binding extensibility element. + */ + public static class BindingExtImpl extends ExtModelImpl implements BindingExt { + + public BindingExtImpl(WSDLModel model, Element e) { + super(model, e); + } + + public BindingExtImpl(WSDLModel model) { + this(model, createPrefixedElement(QN_BINDING_EXT, model)); + } + + public void accept(ExtVisitor visitor) { + visitor.visit(this); + } + + @Override + public boolean canBeAddedTo(Component target) { + if (target instanceof Binding) { + return true; + } + return false; + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtAttribute.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtAttribute.java new file mode 100644 index 000000000..58abbf15c --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtAttribute.java @@ -0,0 +1,53 @@ +/* + * ExtAttribute.java + */ +package net.openesb.component.${artifactId}.model; + +import org.netbeans.modules.xml.xam.dom.Attribute; + +/** + * @author chikkala + */ +public enum ExtAttribute implements Attribute, ExtConstants { + + //TODO: define any additional extension elements attributes here + ACTION(ATTR_ACTION), + SERVICE_URL(ATTR_SERVICE_URL), + USERNAME(ATTR_USERNAME), + PASSWORD(ATTR_PASSWORD), + MBEAN(ATTR_MBEAN); + private String name; + private Class type; + private Class subtype; + + ExtAttribute(String name) { + this(name, String.class); + } + + ExtAttribute(String name, Class type) { + this(name, type, null); + } + + ExtAttribute(String name, Class type, Class subtype) { + this.name = name; + this.type = type; + this.subtype = subtype; + } + + @Override + public String toString() { + return name; + } + + public Class getType() { + return type; + } + + public String getName() { + return name; + } + + public Class getMemberType() { + return subtype; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtComponent.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtComponent.java new file mode 100644 index 000000000..cf3f28f42 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtComponent.java @@ -0,0 +1,35 @@ +/* + * ExtComponent.java + */ +package net.openesb.component.${artifactId}.model; + +import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement; +import org.netbeans.modules.xml.wsdl.model.WSDLModel; +import org.netbeans.modules.xml.wsdl.model.spi.GenericExtensibilityElement; +import org.w3c.dom.Element; + +/** + * This is the base class for the extension model + * + * @author chikkala + */ +public interface ExtComponent extends ExtConstants, ExtensibilityElement { + + void accept(ExtVisitor visitor); + + /** + * this class is the base class for the extension model objects + */ + public static abstract class ExtModelImpl + extends GenericExtensibilityElement implements ExtComponent { + + public ExtModelImpl(WSDLModel model, Element e) { + super(model, e); + } + + @Override + protected String getNamespaceURI() { + return NS_URI; + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtConstants.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtConstants.java new file mode 100644 index 000000000..3e00176d2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtConstants.java @@ -0,0 +1,47 @@ +/* + * ExtConstants.java + * + */ +package net.openesb.component.${artifactId}.model; + +import javax.xml.namespace.QName; + +/** + * This interface defines the constants for the namespace, elements, attributes + * and qnames corresponding to the wsdl extensions that this component + * processes. These constants will be used in the wsdl extension model used to + * process a particular wsdl extensions. + * + * @author chikkala + */ +public interface ExtConstants { + + public static final String NS_URI_WSDL = "http://schemas.xmlsoap.org/wsdl/"; + public static final String NS_URI_XMLNS = "http://www.w3.org/2000/xmlns/"; + /** + * wsdl extension namespace processed by this wsdl extension model + */ + public static final String NS_URI = "http://java.sun.com/jbi/wsdl-extensions/sample/jmx-bc/"; + public static final String NS_DEF_PREFIX = "jmxbc"; + // wsdl extension element names. + public static final String EL_BINDING_EXT = "binding"; + public static final String EL_OPERATION_EXT = "operation"; + public static final String EL_INPUT_EXT = "input"; + public static final String EL_OUTPUT_EXT = "output"; + public static final String EL_FAULT_EXT = "fault"; + public static final String EL_PORT_EXT = "address"; + // Qualified wsdl extension element names. + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + public static final QName QN_OPERATION_EXT = new QName(NS_URI, EL_OPERATION_EXT); + public static final QName QN_INPUT_EXT = new QName(NS_URI, EL_INPUT_EXT); + public static final QName QN_OUTPUT_EXT = new QName(NS_URI, EL_OUTPUT_EXT); + public static final QName QN_FAULT_EXT = new QName(NS_URI, EL_FAULT_EXT); + public static final QName QN_PORT_EXT = new QName(NS_URI, EL_PORT_EXT); + //TODO: define any additional extension element attribute names here. + // wsdl extension elements attribute names. + public static final String ATTR_ACTION = "action"; + public static final String ATTR_SERVICE_URL = "serviceURL"; + public static final String ATTR_USERNAME = "username"; + public static final String ATTR_PASSWORD = "password"; + public static final String ATTR_MBEAN = "mbean"; +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtElementFactoryProvider.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtElementFactoryProvider.java new file mode 100644 index 000000000..0d3711cc4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtElementFactoryProvider.java @@ -0,0 +1,85 @@ +/* + * ExtElementFactoryProvider + */ +package net.openesb.component.${artifactId}.model; + +import java.util.Collections; +import java.util.Set; +import javax.xml.namespace.QName; +import org.netbeans.modules.xml.wsdl.model.WSDLComponent; +import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory; +import org.w3c.dom.Element; + +/** + * Factory class that has wsdl extension elements model factories + * + * @author chikkala + */ +public class ExtElementFactoryProvider { + + public static class BindingExtFactory extends ElementFactory { + + public Set getElementQNames() { + return Collections.singleton(ExtConstants.QN_BINDING_EXT); + } + + public WSDLComponent create(WSDLComponent context, Element element) { + return new BindingExt.BindingExtImpl(context.getModel(), element); + } + } + + public static class OperationExtFactory extends ElementFactory { + + public Set getElementQNames() { + return Collections.singleton(ExtConstants.QN_OPERATION_EXT); + } + + public WSDLComponent create(WSDLComponent context, Element element) { + return new OperationExt.OperationExtImpl(context.getModel(), element); + } + } + + public static class InputExtFactory extends ElementFactory { + + public Set getElementQNames() { + return Collections.singleton(ExtConstants.QN_INPUT_EXT); + } + + public WSDLComponent create(WSDLComponent context, Element element) { + return new InputExt.InputExtImpl(context.getModel(), element); + } + } + + public static class OutputExtFactory extends ElementFactory { + + public Set getElementQNames() { + return Collections.singleton(ExtConstants.QN_OUTPUT_EXT); + } + + public WSDLComponent create(WSDLComponent context, Element element) { + return new OutputExt.OutputExtImpl(context.getModel(), element); + } + } + + public static class FaultExtFactory extends ElementFactory { + + public Set getElementQNames() { + return Collections.singleton(ExtConstants.QN_FAULT_EXT); + } + + public WSDLComponent create(WSDLComponent context, Element element) { + return new FaultExt.FaultExtImpl(context.getModel(), element); + } + } + + public static class PortExtFactory extends ElementFactory { + + public Set getElementQNames() { + return Collections.singleton(ExtConstants.QN_PORT_EXT); + } + + public WSDLComponent create(WSDLComponent context, Element element) { + return new PortExt.PortExtImpl(context.getModel(), element); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtVisitor.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtVisitor.java new file mode 100644 index 000000000..606b4da96 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/ExtVisitor.java @@ -0,0 +1,25 @@ +/* + * ExtVisitor.java + */ +package net.openesb.component.${artifactId}.model; + +/** + * This interface provides the visitor pattern to validate the extension model + * objects. + * + * @author chikkala + */ +public interface ExtVisitor { + + void visit(BindingExt bindingExt); + + void visit(OperationExt operationExt); + + void visit(InputExt inputExt); + + void visit(OutputExt outputExt); + + void visit(FaultExt faultExt); + + void visit(PortExt portExt); +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/FaultExt.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/FaultExt.java new file mode 100644 index 000000000..7816822ac --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/FaultExt.java @@ -0,0 +1,47 @@ +/* + * FaultExt.java + */ +package net.openesb.component.${artifactId}.model; + +import org.netbeans.modules.xml.wsdl.model.BindingFault; +import org.netbeans.modules.xml.wsdl.model.WSDLModel; +import org.netbeans.modules.xml.xam.Component; +import org.w3c.dom.Element; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation fault extension element. + * + * @author chikkala + */ +public interface FaultExt extends ExtComponent { + +//TODO: define get/set methods for properties for FaultExt if the extension element has attributes. + /** + * This class is an implementation of FaultExt interface that provides java + * model for binding operation fault extensibility element. + */ + public static class FaultExtImpl extends ExtModelImpl implements FaultExt { + + public FaultExtImpl(WSDLModel model, Element e) { + super(model, e); + } + + public FaultExtImpl(WSDLModel model) { + this(model, createPrefixedElement(QN_FAULT_EXT, model)); + } + + public void accept(ExtVisitor visitor) { + visitor.visit(this); + } + + @Override + public boolean canBeAddedTo(Component target) { + if (target instanceof BindingFault) { + return true; + } + return false; + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/InputExt.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/InputExt.java new file mode 100644 index 000000000..4aeb4fcd7 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/InputExt.java @@ -0,0 +1,47 @@ +/* + * InputExt.java + */ +package net.openesb.component.${artifactId}.model; + +import org.netbeans.modules.xml.wsdl.model.BindingInput; +import org.netbeans.modules.xml.wsdl.model.WSDLModel; +import org.netbeans.modules.xml.xam.Component; +import org.w3c.dom.Element; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation input extension element. + * + * @author chikkala + */ +public interface InputExt extends ExtComponent { + +//TODO: define get/set methods for properties for InputExt if the extension element has attributes. + /** + * This class is an implementation of InputExt interface that provides java + * model for binding operation input extensibility element. + */ + public static class InputExtImpl extends ExtModelImpl implements InputExt { + + public InputExtImpl(WSDLModel model, Element e) { + super(model, e); + } + + public InputExtImpl(WSDLModel model) { + this(model, createPrefixedElement(QN_INPUT_EXT, model)); + } + + public void accept(ExtVisitor visitor) { + visitor.visit(this); + } + + @Override + public boolean canBeAddedTo(Component target) { + if (target instanceof BindingInput) { + return true; + } + return false; + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/OperationExt.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/OperationExt.java new file mode 100644 index 000000000..408774e38 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/OperationExt.java @@ -0,0 +1,68 @@ +/* + * OperationExt.java + */ +package net.openesb.component.${artifactId}.model; + +import org.netbeans.modules.xml.wsdl.model.BindingOperation; +import org.netbeans.modules.xml.wsdl.model.WSDLModel; +import org.netbeans.modules.xml.xam.Component; +import org.w3c.dom.Element; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation extension element. + * + * @author chikkala + */ +public interface OperationExt extends ExtComponent { + + /** + * Getter for property action. + * + * @return Value of property action. + */ + public String getAction(); + + /** + * Setter for property action. + * + * @param action New value of property action. + */ + public void setAction(String action); + + /** + * This class is an implementation of OperationExt interface that provides + * java model for binding operation extensibility element. + */ + public static class OperationExtImpl extends ExtModelImpl implements OperationExt { + + public OperationExtImpl(WSDLModel model, Element e) { + super(model, e); + } + + public OperationExtImpl(WSDLModel model) { + this(model, createPrefixedElement(QN_OPERATION_EXT, model)); + } + + public void accept(ExtVisitor visitor) { + visitor.visit(this); + } + + @Override + public boolean canBeAddedTo(Component target) { + if (target instanceof BindingOperation) { + return true; + } + return false; + } + + public String getAction() { + return getAttribute(ExtAttribute.ACTION); + } + + public void setAction(String action) { + setAttribute(ATTR_ACTION, ExtAttribute.ACTION, action); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/OutputExt.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/OutputExt.java new file mode 100644 index 000000000..70c9ff12b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/OutputExt.java @@ -0,0 +1,47 @@ +/* + * OutputExt.java + */ +package net.openesb.component.${artifactId}.model; + +import org.netbeans.modules.xml.wsdl.model.BindingOutput; +import org.netbeans.modules.xml.wsdl.model.WSDLModel; +import org.netbeans.modules.xml.xam.Component; +import org.w3c.dom.Element; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation output extension element. + * + * @author chikkala + */ +public interface OutputExt extends ExtComponent { + +//TODO: define get/set methods for properties for OutputExt if the extension element has attributes. + /** + * This class is an implementation of OutputExt interface that provides java + * model for binding operation output extension element. + */ + public static class OutputExtImpl extends ExtModelImpl implements OutputExt { + + public OutputExtImpl(WSDLModel model, Element e) { + super(model, e); + } + + public OutputExtImpl(WSDLModel model) { + this(model, createPrefixedElement(QN_OUTPUT_EXT, model)); + } + + public void accept(ExtVisitor visitor) { + visitor.visit(this); + } + + @Override + public boolean canBeAddedTo(Component target) { + if (target instanceof BindingOutput) { + return true; + } + return false; + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/PortExt.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/PortExt.java new file mode 100644 index 000000000..b2e817bac --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/model/PortExt.java @@ -0,0 +1,134 @@ +/* + * PortExt.java + */ +package net.openesb.component.${artifactId}.model; + +import org.netbeans.modules.xml.wsdl.model.Port; +import org.netbeans.modules.xml.wsdl.model.WSDLModel; +import org.netbeans.modules.xml.xam.Component; +import org.w3c.dom.Element; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for service + * port extension element. + * + * @author chikkala + */ +public interface PortExt extends ExtComponent { + + /** + * Getter for property serviceURL. + * + * @return Value of property serviceURL. + */ + public String getServiceURL(); + + /** + * Setter for property serviceURL. + * + * @param serviceURL New value of property serviceURL. + */ + public void setServiceURL(String serviceURL); + + /** + * Getter for property username. + * + * @return Value of property username. + */ + public String getUsername(); + + /** + * Setter for property username. + * + * @param username New value of property username. + */ + public void setUsername(String username); + + /** + * Getter for property password. + * + * @return Value of property password. + */ + public String getPassword(); + + /** + * Setter for property password. + * + * @param password New value of property password. + */ + public void setPassword(String password); + + /** + * Getter for property name. + * + * @return Value of property name. + */ + public String getMBean(); + + /** + * Setter for property mbean. + * + * @param name New value of property mbean. + */ + public void setMBean(String mbean); + + /** + * This class is an implementation of PortExt interface that provides java + * model for service port extensibility element. + */ + public static class PortExtImpl extends ExtModelImpl implements PortExt { + + public PortExtImpl(WSDLModel model, Element e) { + super(model, e); + } + + public PortExtImpl(WSDLModel model) { + this(model, createPrefixedElement(QN_PORT_EXT, model)); + } + + public void accept(ExtVisitor visitor) { + visitor.visit(this); + } + + @Override + public boolean canBeAddedTo(Component target) { + if (target instanceof Port) { + return true; + } + return false; + } + + public String getServiceURL() { + return getAttribute(ExtAttribute.SERVICE_URL); + } + + public void setServiceURL(String serviceURL) { + setAttribute(ATTR_SERVICE_URL, ExtAttribute.SERVICE_URL, serviceURL); + } + + public String getUsername() { + return getAttribute(ExtAttribute.USERNAME); + } + + public void setUsername(String username) { + setAttribute(ATTR_USERNAME, ExtAttribute.USERNAME, username); + } + + public String getPassword() { + return getAttribute(ExtAttribute.PASSWORD); + } + + public void setPassword(String password) { + setAttribute(ATTR_PASSWORD, ExtAttribute.PASSWORD, password); + } + + public String getMBean() { + return getAttribute(ExtAttribute.MBEAN); + } + + public void setMBean(String mbean) { + setAttribute(ATTR_MBEAN, ExtAttribute.MBEAN, mbean); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/binding-ext.png b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/binding-ext.png new file mode 100644 index 0000000000000000000000000000000000000000..c378d12761cf66beb7e4e0c54d52104165b498f4 GIT binary patch literal 449 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+AuIM279_VhE&{2`t$$4J+o27Eg256 zif?}`onLMd?%`o!a9}WO;AwcM>dW}QzHS%uvGwbHe(*n1KAn7+f$>Po*$e*t+YAoG zIC3zs2q>QrD{=g;z~1&Vc>3awvwwnnt}-+*BrysuWVMyh^ElJj^7;PV8Rra&)tL`3 zyce+J#;)S`5^6ekPcsNOBrvN@b8lvyXxi9t)J4-^?^#*Jvgfj^xEYu_SS`2g-mLTQ zFb`v9+s%yd9%~-3;Ho7ms(~tr+s>}$JDOz;vR_!|USfm)Irek=zC4hXP~W|Fu#UDVqk^Rf5{8d)e92?PCwYXS#mWa17nL2x4~Hh1|t?BZVvH<%s|J!Ic0L( zgMC2*i|gHEdzn}+GdeIVRPmmWxIl&Hkool$|Jgrss-^bP0l+XkK2ePFK literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/fault-ext.png b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/fault-ext.png new file mode 100644 index 0000000000000000000000000000000000000000..49343303188380f51d3ea85d8ba613caaf370bee GIT binary patch literal 1035 zcmeAS@N?(olHy`uVBq!ia0vp^+(697!OXzGxO0b^A&|pa;1O926c+|!Ax6o@wUG=A z%nSiOA+A}Bj3q2Awe0LooSa?U+*5dYXY%teXJgyW!m@>nYd=5#P78}8?Ce)~crIva zUNbVfYis*JNa%}!!EbBp8{XbeJUrg{_K1kF)nrp+S$G8Zs86opVS-v_kMr67atK@r0phrwj)mK>flFzskoK&=l_3uW>p4-h8YqX zEDVe;8yTTQOJYOW=5zG|$CgRVmT_P(Y+w>>+d6B@|NRVyc3yw>kA36Crw)%4DpM>Q z7?iw>?VK5yIP?l19rfHZ>mo1XO7@M6OdN7-pY_isTYP;Y()In%pFjVUFB>ofu?O)p zF)$wC@b*}6VB^*ejGOuATO2Cb`i)C@n}bU@vw%Z^c!Pz4qX2`Z6Mt@u7z2xda#c`U z=8>mNB|xi^mYC=Rg^p?pDl}-A0i6vZ4lvxUKQ-~zf~Sjs9%Jxy^>bP0l+XkK>~LyM literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/operation-ext.png b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/operation-ext.png new file mode 100644 index 0000000000000000000000000000000000000000..5c63b31f7cf698cac54ff76cebaee78c21183251 GIT binary patch literal 465 zcmV;?0WSWDP)O? zBux0i$bbd_0tlzAzkj^>|LOTbFn)b&(f^0X3$eNcAb>Dju%LhkMZhO}I>WcO=Na~` zn1$5^00D$I3_v#GvKfW}0tmwe*j$6vW+(s%Ah-d^txLg-w=bW7`5PvcqiDh<4-i0L zXC$>O`G4~2ga2Q@|NQ^-^@sl(4_*52pW6XZP0Ad75c4qrC{QmQoA+u=)*wD)K zaE5oEzA?;PzL`N-T!sOkJU{@kfCOH={lri+aWULk0ePMOGopOq&c`PY5I{^I;>qg| z4EO*(d4K={yWrRFzYO{DfnbwCd=UHdx1VrD_~Zcs2pkL1wR8UKs>(4KsL6l@FWh>< zaN^8)xRde80|XFCG_td?Fg$zw0B1B}lLrVOya|aI01#jR@{g4o@lFzskoK&=l_3uW>p4-h8YqX zEDVe;8yTTQOJYOW=5zG|$CgRVmT_P(Y+w>>+d6B@|NRVyc3yw>kA36Crw)%4DpM>Q z7?iw>?VK5yIP?l19rfHZ>mo1XO7@M6OdN7-pY_isTYP;Y()In%pFjVUFB>ofu?O)p zF)$wC@b*}6VB^*ejGOuATO2Cb`i)C@n}bU@vw%Z^c!Pz4qX2`Z6Mt@u7z2xda#c`U z=8>mNB|xi^mYC=Rg^p?pDl}-A0i6vZ4lvxUKQ-~zf~Sjs9%Jxy^>bP0l+XkK>~LyM literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/port-ext.png b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/resources/port-ext.png new file mode 100644 index 0000000000000000000000000000000000000000..a6b7f8415baf7f5237c1de5ca3867decaf700c1b GIT binary patch literal 393 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+AuIMN_)CEhE&{2`t$$4{o$Y6dj9jM zGzl+1XOxm>ah5~CLC1hmH`&?X@B6#PYoz|!?d{8An8L=Pu!GS@=oC-!EA7rrw%6PQ z&jE#67?ZdXq@L*1%v#PqV^M{;Lc@%Ne>0~_b}ssG$!O<)ZmtTBHeLsYjSn`PCLR)J zo1o|*wR|-LQwQr!w~~|g_VUoU!w{i40SeM&)>$Kgz% zR3i@q=Rf=MSF(q92HR*%vb%X%a^GIt^BeMy>afM=F>okMVEn)EpKBn)ril~M1b}?8 zFDo4R0-R + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/validator/WSDLExtValidator.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/validator/WSDLExtValidator.java new file mode 100644 index 000000000..3f2119f66 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/validator/WSDLExtValidator.java @@ -0,0 +1,229 @@ +/* + * WSDLExtValidator.java + */ +package net.openesb.component.${artifactId}.validator; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import net.openesb.component.${artifactId}.model.BindingExt; +import net.openesb.component.${artifactId}.model.ExtVisitor; +import net.openesb.component.${artifactId}.model.FaultExt; +import net.openesb.component.${artifactId}.model.InputExt; +import net.openesb.component.${artifactId}.model.OperationExt; +import net.openesb.component.${artifactId}.model.OutputExt; +import net.openesb.component.${artifactId}.model.PortExt; +import org.netbeans.modules.xml.wsdl.model.Binding; +import org.netbeans.modules.xml.wsdl.model.BindingFault; +import org.netbeans.modules.xml.wsdl.model.BindingInput; +import org.netbeans.modules.xml.wsdl.model.BindingOperation; +import org.netbeans.modules.xml.wsdl.model.BindingOutput; +import org.netbeans.modules.xml.wsdl.model.Definitions; +import org.netbeans.modules.xml.wsdl.model.Port; +import org.netbeans.modules.xml.wsdl.model.Service; +import org.netbeans.modules.xml.wsdl.model.WSDLModel; +import org.netbeans.modules.xml.xam.Model; +import org.netbeans.modules.xml.xam.Model.State; +import org.netbeans.modules.xml.xam.spi.Validation; +import org.netbeans.modules.xml.xam.spi.Validation.ValidationType; +import org.netbeans.modules.xml.xam.spi.ValidationResult; +import org.netbeans.modules.xml.xam.spi.Validator; +import org.netbeans.modules.xml.xam.spi.Validator.ResultItem; +import org.openide.util.NbBundle; + +/** + * This class implements the wsdl model validation with respect to the wsdl + * extension elements supported by the specific wsdl extension namespace. + * + * @author ${user} + */ +public class WSDLExtValidator implements Validator, ExtVisitor { + + public static final Set EMPTY_RESULT_ITEM = Collections.emptySet(); + public static final Set EMPTY_MODEL = Collections.emptySet(); + public static final ValidationResult EMPTY_RESULT = new ValidationResult(EMPTY_RESULT_ITEM, EMPTY_MODEL); + private Validation mValidation; + private ValidationType mValidationType; + private ValidationResult mValidationResult; + + public WSDLExtValidator() { + } + + /** + * @return name of the validation service. + */ + public String getName() { + return getClass().getName(); + } + + /** + * Validates given model. + * + * @param model model to validate. + * @param validation reference to the validation context. + * @param validationType the type of validation to perform + * @return ValidationResult. + */ + public ValidationResult validate(Model model, Validation validation, ValidationType validationType) { + + mValidation = validation; + mValidationType = validationType; + + HashSet results = new HashSet(); + HashSet models = new HashSet(); + models.add(model); + + mValidationResult = new ValidationResult(results, models); + + if (model instanceof WSDLModel) { + WSDLModel wsdlModel = (WSDLModel) model; + + if (model.getState() == State.NOT_WELL_FORMED) { + return EMPTY_RESULT; + } + + validateWSDLModel(wsdlModel, results); // validate WSDL Model + } + // Clear out our state + mValidation = null; + mValidationType = null; + + return mValidationResult; + } + + /** + * this method validates the WSDLModel and updates the result set with the + * possible ERRORs, ADVICEs or WARNINGS It calls each wsdl extension element + * models visitor method to validate each extension element. Modify this + * method to add more validations such as scope and limit of the extension + * elements etc. + */ + public void validateWSDLModel(WSDLModel wsdlModel, HashSet results) { + //TODO: add any specific validations such as extension element size etc in addition + // to the element validation itself. + Definitions defs = wsdlModel.getDefinitions(); + // for each binding + for (Binding binding : defs.getBindings()) { + // validate binding extensions + for (BindingExt bindingExt : binding.getExtensibilityElements(BindingExt.class)) { + bindingExt.accept(this); + } + // for each binding operation + for (BindingOperation bindingOp : binding.getBindingOperations()) { + // validate binding operation extensions + for (OperationExt operationExt : bindingOp.getExtensibilityElements(OperationExt.class)) { + operationExt.accept(this); + } + // validate binidng operation input extensions + BindingInput bindingInput = bindingOp.getBindingInput(); + if (bindingInput != null) { + for (InputExt inputExt : bindingInput.getExtensibilityElements(InputExt.class)) { + inputExt.accept(this); + } + } + // validate binding operation output extensions + BindingOutput bindingOutput = bindingOp.getBindingOutput(); + if (bindingOutput != null) { + for (OutputExt outputExt : bindingOutput.getExtensibilityElements(OutputExt.class)) { + outputExt.accept(this); + } + } + // validate binding operation fault extensions + for (BindingFault bindingFault : bindingOp.getBindingFaults()) { + for (FaultExt faultExt : bindingFault.getExtensibilityElements(FaultExt.class)) { + faultExt.accept(this); + } + } + } + } + // for each service + for (Service service : defs.getServices()) { + // for each port + for (Port port : service.getPorts()) { + // validate port extension + for (PortExt portExt : port.getExtensibilityElements(PortExt.class)) { + portExt.accept(this); + } + } + } + } + + public void visit(BindingExt bindingExt) { + Collection results = mValidationResult.getValidationResult(); + //TODO: validate attributes and other required things and add appropriate results. + // + //results.add( + // new Validator.ResultItem(this, // validator + // Validator.ResultType.ERROR, // .ADVICE | .ERROR | .WARNING + // bindingExt, // Validated object + // NbBundle.getMessage(this.getClass(), "I18NKEY") // I18Ned message + // )); + // + } + + public void visit(OperationExt operationExt) { + Collection results = mValidationResult.getValidationResult(); + //TODO: validate attributes and other required things and add appropriate results. + // + //results.add( + // new Validator.ResultItem(this, // validator + // Validator.ResultType.ERROR, // .ADVICE | .ERROR | .WARNING + // operationExt, // Validated object + // NbBundle.getMessage(this.getClass(), "I18NKEY") // I18Ned message + // )); + // + } + + public void visit(InputExt inputExt) { + Collection results = mValidationResult.getValidationResult(); + //TODO: validate attributes and other required things and add appropriate results. + // + //results.add( + // new Validator.ResultItem(this, // validator + // Validator.ResultType.ERROR, // .ADVICE | .ERROR | .WARNING + // inputExt, // Validated object + // NbBundle.getMessage(this.getClass(), "I18NKEY") // I18Ned message + // )); + // + } + + public void visit(OutputExt outputExt) { + Collection results = mValidationResult.getValidationResult(); + //TODO: validate attributes and other required things and add appropriate results. + // + //results.add( + // new Validator.ResultItem(this, // validator + // Validator.ResultType.ERROR, // .ADVICE | .ERROR | .WARNING + // outputExt, // Validated object + // NbBundle.getMessage(this.getClass(), "I18NKEY") // I18Ned message + // )); + // + } + + public void visit(FaultExt faultExt) { + Collection results = mValidationResult.getValidationResult(); + //TODO: validate attributes and other required things and add appropriate results. + // + //results.add( + // new Validator.ResultItem(this, // validator + // Validator.ResultType.ERROR, // .ADVICE | .ERROR | .WARNING + // faultExt, // Validated object + // NbBundle.getMessage(this.getClass(), "I18NKEY") // I18Ned message + // )); + // + } + + public void visit(PortExt portExt) { + Collection results = mValidationResult.getValidationResult(); + //TODO: validate attributes and other required things and add appropriate results. + // + //results.add( + // new Validator.ResultItem(this, // validator + // Validator.ResultType.ERROR, // .ADVICE | .ERROR | .WARNING + // portExt, // Validated object + // NbBundle.getMessage(this.getClass(), "I18NKEY") // I18Ned message + // )); + // + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/validator/WSDLExtValidatorSchemaFactory.java b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/validator/WSDLExtValidatorSchemaFactory.java new file mode 100644 index 000000000..c9fa35498 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/deploy-plugin/src/net/openesb/component/cname/validator/WSDLExtValidatorSchemaFactory.java @@ -0,0 +1,43 @@ +/* + * WSDLExtValidatorSchemaFactory.java + */ +package net.openesb.component.${artifactId}.validator; + +import java.io.InputStream; +import java.io.InputStream; +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; +import org.netbeans.modules.xml.wsdl.validator.spi.ValidatorSchemaFactory; + +/** + * This class implements ValidatorSchemaFactory interface. + * + * @author chikkala + */ +public class WSDLExtValidatorSchemaFactory extends ValidatorSchemaFactory { + + private final String NS_URL = + "http://java.sun.com/jbi/wsdl-extensions/sample/jmx-bc/"; + private final String wsdlExtXSDResourcePath = + "/${artifactId}/mybcWsdlExt.xsd"; + + ; + + public String getNamespaceURI() { + return NS_URL; + } + + public InputStream getSchemaInputStream() { + return this.getClass().getResourceAsStream(wsdlExtXSDResourcePath); + } + + /** + * Returns the Inputstream related to this schema + */ + public Source getSchemaSource() { + InputStream in = this.getClass().getResourceAsStream(wsdlExtXSDResourcePath); + Source s = new StreamSource(in); + s.setSystemId(this.getClass().getResource(wsdlExtXSDResourcePath).toString()); + return s; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/install-params.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/install-params.properties new file mode 100644 index 000000000..712a6a3ac --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/install-params.properties @@ -0,0 +1,3 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml new file mode 100644 index 000000000..9793203c4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml @@ -0,0 +1,130 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.properties new file mode 100644 index 000000000..663de1bb9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.properties @@ -0,0 +1,48 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} build properties file to set/override the properties of the netbeans project +${symbol_pound} build properties when the netbeans build is called from the maven build lifecycle. +${symbol_pound} Netbeans project when build from the IDE, uses a build.properties from the user.dir +${symbol_pound} of the Netbeans IDE to resolve some of the properties used in the project such as +${symbol_pound} the libraries classpath. +${symbol_pound} When invoking the Netbeans project build from maven, this build.properties file +${symbol_pound} is not available. So, you can add the properties defined in ide build properties +${symbol_pound} that this project uses here. +${symbol_pound} + +${symbol_pound} default local repository settings. If the repository location is different +${symbol_pound} -D command line option should override this (e.g. mvn -Dmaven.repo.local=/my/m2/repository +maven.repo.local=${symbol_dollar}{user.home}/.m2/repository +${symbol_pound} begin jbi admin settings +${symbol_pound} set the below properties if you want to override the properties from nbproject/project.properties +${symbol_pound} that sets the application server admin settings. +${symbol_pound} +${symbol_pound} jbi.as.home=C:/Sun/glassfish-v2-b58g +${symbol_pound} jbi.host=localhost +${symbol_pound} jbi.port=4848 +${symbol_pound} jbi.username=admin +${symbol_pound} jbi.password=adminadmin +${symbol_pound} end jbi admin settings +${symbol_pound} + +${symbol_pound} classpath settings +junit.ant.task.classpath=${symbol_dollar}{maven.repo.local}/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar +junit.runtime.classpath=${symbol_dollar}{maven.repo.local}/junit/junit/3.8.2/junit-3.8.2.jar +libs.junit.classpath=${symbol_dollar}{junit.runtime.classpath}:${symbol_dollar}{junit.ant.task.classpath} +libs.jbi-cdk-ant-tasks.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi-cdk/jbi-cdk-ant-tasks/${version}/jbi-cdk-ant-tasks-${version}.jar + +libs.jbi.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi/1.0/jbi-1.0.jar +libs.wsdl4j.162.classpath=${symbol_dollar}{maven.repo.local}/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar +${symbol_pound} libs.jaxws21.classpath=${symbol_dollar}{jbi.as.home}/lib/javaee.jar:${symbol_dollar}{jbi.as.home}/lib/webservices-rt.jar +libs.jaxws21.classpath=${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/activation/activation/1.1/activation-1.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/ws/jaxws-rt/2.1.2/jaxws-rt-2.1.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.xml new file mode 100644 index 000000000..31217d15d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/m2nbbuild.xml @@ -0,0 +1,37 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml new file mode 100644 index 000000000..e71fb3578 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml @@ -0,0 +1,558 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task is getting executed! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task executed successfully! + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties new file mode 100644 index 000000000..6d932c0a5 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.xml.data.CRC32=818aaa7f +build.xml.script.CRC32=d992673d +build.xml.stylesheet.CRC32=8add101f@1.0 +${symbol_pound} This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +${symbol_pound} Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=818aaa7f +nbproject/build-impl.xml.script.CRC32=52f42474 +nbproject/build-impl.xml.stylesheet.CRC32=4ed53ee0@1.0 diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml new file mode 100644 index 000000000..7c2588b9e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml @@ -0,0 +1,504 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + +This ant script contains the jbi ant tasks and the targets and properties using +which the jbi admin commands can be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Usage : ant -f <fullpath>/jbi_admin.xml [options] [target] + options: -D<property>=<value> + Specify a property/value pairs as options that are valid for the target. + target : ant target name in jbi_admin.xml + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml new file mode 100644 index 000000000..7e7dca2ae --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml @@ -0,0 +1,339 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + Install, uninstall, reinstall, start, stop, shutdown jbi components. + + + + + + + + + + + + + + Must set jbi.host + Must set jbi.port + Must set jbi.username + Must set jbi.password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/private/private.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/private/private.properties new file mode 100644 index 000000000..e540325d5 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/private/private.properties @@ -0,0 +1,6 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +javac.debug=true +javadoc.preview=true +user.properties.file=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working57${symbol_escape}${symbol_escape}.netbeans${symbol_escape}${symbol_escape}openesb${symbol_escape}${symbol_escape}build.properties diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml new file mode 100644 index 000000000..712a6a3ac --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/private/retriever/catalog.xml @@ -0,0 +1,3 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/project.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/project.properties new file mode 100644 index 000000000..d9b87e775 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/project.properties @@ -0,0 +1,91 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.classes.dir=${symbol_dollar}{build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${symbol_dollar}{build.dir}/generated +build.predist.dir=${symbol_dollar}{build.dir}/predist +build.predist.jar=${symbol_dollar}{build.predist.dir}/component.jar +build.predist.lib.dir=${symbol_dollar}{build.predist.dir}/lib +${symbol_pound} Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${symbol_dollar}{build.dir}/test/classes +build.test.dir=${symbol_dollar}{build.dir}/test +build.test.results.dir=${symbol_dollar}{build.dir}/test/results +conf.dir=src/conf +debug.classpath=${symbol_escape} + ${symbol_dollar}{run.classpath} +debug.test.classpath=${symbol_escape} + ${symbol_dollar}{run.test.classpath} +${symbol_pound} This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${symbol_dollar}{dist.dir}/${artifactId}.zip +dist.javadoc.dir=${symbol_dollar}{dist.dir}/javadoc +jar.compress=false +javac.classpath=${symbol_escape} + ${symbol_dollar}{libs.jbi.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.sharedlibs.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.lib.classpath} +${symbol_pound} Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir}:${symbol_escape} + ${symbol_dollar}{libs.junit.classpath}:${symbol_escape} + ${symbol_dollar}{libs.jaxws21.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jbi.ant.tasks.classpath=${symbol_escape} + ${symbol_dollar}{jbi.as.home}/lib/sun-appserv-ant.jar:${symbol_escape} + ${symbol_dollar}{jbi.as.home}/jbi/lib/jbi-ant-tasks.jar +jbi.as.home=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish +jbi.as.instance.id=[D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.component.bootstrap.class=cname.JMXBindingInstaller +jbi.component.class=cname.JMXBindingRuntime +jbi.component.description=Description of binding component : ${artifactId} +jbi.component.lib.classpath=${symbol_escape} + ${symbol_dollar}{libs.wsdl4j.162.classpath} +jbi.component.name=${artifactId} +jbi.component.sharedlibs.classpath= +jbi.component.type=binding-component +jbi.host=localhost +jbi.install.params.file=install-params.properties +jbi.install.with.params=false +jbi.password=this really long string is used to identify a password that has been stored in the Keyring +jbi.port=4848 +jbi.soap.binding.name=sun-http-binding +jbi.username=admin +meta.inf.dir=${symbol_dollar}{conf.dir}/META-INF +platform.active=default_platform +project.jbi.deploy.plugin=./deploy-plugin +project.testSA=test/testSA +run.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir} +${symbol_pound} Space-separated list of JVM arguments used when running the project +${symbol_pound} (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +${symbol_pound} or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.test.classpath}:${symbol_escape} + ${symbol_dollar}{build.test.classes.dir} +src.dir=src/java +test-sys-prop.test.results.dir=${symbol_dollar}{build.test.results.dir} +test-sys-prop.test.src.dir=test-sys-prop.test.src.dir +test.src.dir=test/java +testSA.enabled=true +testSA.name=${artifactId}_TestSA diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/project.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/project.xml new file mode 100644 index 000000000..12b71aa1c --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/nbproject/project.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + org.netbeans.modules.jbi.apisupport.project.jbicomponent + + + ${artifactId} + binding-component + 1.6.5 + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/pom.xml b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 000000000..04d8bb61d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,171 @@ + + + + 4.0.0 + ${groupId} + ${artifactId} + jar + ${version} + JBI Component[BindingComponent] + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + http://open-esb.org + + build + src/java + test/java + build/classes + build/test/classes + package + + + + maven-antrun-plugin + 1.2 + + + default-cli + + run + + + + !!!!!!!!!!!!!!!!!!!!!! Moving Files and organizing package !!!!!!!!!!!!!!!!!!!!!!!! + + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + + + + + + + maven2-repo1 + Maven2 Central Repository + http://repo1.maven.org/maven2 + + + download-java-net-maven2-repository + download.java.net Maven 2.x repository + http://download.java.net/maven/2/ + + + maven-repository.dev.java.net-repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + + + ws-zones + ws.zones maven repository + http://ws.zones.apache.org/repository2/ + + + apache.org + Maven Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + + apache.org + Maven Plugin Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + org.apache.maven + maven-ant-tasks + 2.0.7 + + + open-esb.jbi-cdk + jbi-cdk-ant-tasks + 1.0-SNAPSHOT + + + open-esb + jbi + 1.0 + + + wsdl4j + wsdl4j + 1.6.2 + + + com.sun.xml.ws + jaxws-rt + 2.1.2 + test + + + + + ${maven.repo.local} + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/test/resources/projects/basic/archetype.properties b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/test/resources/projects/basic/archetype.properties new file mode 100644 index 000000000..112db0dc2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/test/resources/projects/basic/archetype.properties @@ -0,0 +1,5 @@ +#Wed Jul 24 14:12:01 IST 2013 +package=it.pkg +version=0.1-SNAPSHOT +groupId=archetype.it +artifactId=basic diff --git a/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/test/resources/projects/basic/goal.txt b/maven-archtype-v2/maven-archtype-binding-component-plugin-v2/src/test/resources/projects/basic/goal.txt new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/pom.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/pom.xml new file mode 100644 index 000000000..11eb1f5e9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + open-jbi-components + BindingComponent-archetype + 1.0-SNAPSHOT + maven-archetype + + BindingComponent-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 000000000..e3cafbf91 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,76 @@ + + + + + C:\\GlassFishESBv22\\glassfish + + + + + test/java + + **/*.xml + **/*.java + **/*.properties + + + + src/java + + **/*.java + + + + src/java + + **/*.xsd + + + + test/testSA + + **/*.xml + **/*.properties + + + + nbproject + + **/*.xml + **/*.properties + + + + src/conf + + **/*.xml + + + + nbproject/private + + **/*.xml + **/*.properties + + + + test/testSA + + **/*.xsl + **/*.wsdl + + + + + + build.xml + install-params.properties + m2nbbuild-impl.xml + m2nbbuild.properties + m2nbbuild.xml + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build.xml new file mode 100644 index 000000000..14afd1d29 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build.xml @@ -0,0 +1,72 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Builds, tests, and runs the project ${artifactId}. + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml new file mode 100644 index 000000000..1e58b6067 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/pom.xml @@ -0,0 +1,38 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + 4.0.0 + + ${package} + ${artifactId}-archetype + ${version} + maven-archetype + + ${artifactId}-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml new file mode 100644 index 000000000..c493031be --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml @@ -0,0 +1,33 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml new file mode 100644 index 000000000..99e45731e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml @@ -0,0 +1,62 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + org.netbeans.modules.apisupport.project + + + ${symbol_dollar}{artifactId} + + + + org.netbeans.modules.xml.schema.model + + + + 1 + 1.2 + + + + org.netbeans.modules.xml.wsdl.bindingsupport.api + + + + 1.0 + + + + org.netbeans.modules.xml.wsdl.model + + + + 1 + 1.2 + + + + org.netbeans.modules.xml.xam + + + + 1 + 1.2 + + + + org.openide.util + + + + 7.9.0.1 + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml new file mode 100644 index 000000000..a54d4d390 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml new file mode 100644 index 000000000..6233ab78e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..5456aa8f2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml @@ -0,0 +1,143 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..63b89125f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + ${symbol_dollar}{artifactId}_TestSA + This is a test Service Assembly to test Binding + + + + + ${symbol_dollar}{artifactId}_TestSUBC + This service unit enables inbound endpoint in the JMXBinding for a service in service engine + + + testSUBC.zip + ${symbol_dollar}{artifactId} + + + + + ${symbol_dollar}{artifactId}_TestSUSE + This service unit enables greetings service provider in the service engine + + + testSUSE.zip + ServiceEngine + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..96e95745f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..539a5efbf --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..75340ea7d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..324002052 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml new file mode 100644 index 000000000..d7dabc84f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild-impl.xml @@ -0,0 +1,130 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild.properties new file mode 100644 index 000000000..663de1bb9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild.properties @@ -0,0 +1,48 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} build properties file to set/override the properties of the netbeans project +${symbol_pound} build properties when the netbeans build is called from the maven build lifecycle. +${symbol_pound} Netbeans project when build from the IDE, uses a build.properties from the user.dir +${symbol_pound} of the Netbeans IDE to resolve some of the properties used in the project such as +${symbol_pound} the libraries classpath. +${symbol_pound} When invoking the Netbeans project build from maven, this build.properties file +${symbol_pound} is not available. So, you can add the properties defined in ide build properties +${symbol_pound} that this project uses here. +${symbol_pound} + +${symbol_pound} default local repository settings. If the repository location is different +${symbol_pound} -D command line option should override this (e.g. mvn -Dmaven.repo.local=/my/m2/repository +maven.repo.local=${symbol_dollar}{user.home}/.m2/repository +${symbol_pound} begin jbi admin settings +${symbol_pound} set the below properties if you want to override the properties from nbproject/project.properties +${symbol_pound} that sets the application server admin settings. +${symbol_pound} +${symbol_pound} jbi.as.home=C:/Sun/glassfish-v2-b58g +${symbol_pound} jbi.host=localhost +${symbol_pound} jbi.port=4848 +${symbol_pound} jbi.username=admin +${symbol_pound} jbi.password=adminadmin +${symbol_pound} end jbi admin settings +${symbol_pound} + +${symbol_pound} classpath settings +junit.ant.task.classpath=${symbol_dollar}{maven.repo.local}/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar +junit.runtime.classpath=${symbol_dollar}{maven.repo.local}/junit/junit/3.8.2/junit-3.8.2.jar +libs.junit.classpath=${symbol_dollar}{junit.runtime.classpath}:${symbol_dollar}{junit.ant.task.classpath} +libs.jbi-cdk-ant-tasks.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi-cdk/jbi-cdk-ant-tasks/${version}/jbi-cdk-ant-tasks-${version}.jar + +libs.jbi.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi/1.0/jbi-1.0.jar +libs.wsdl4j.162.classpath=${symbol_dollar}{maven.repo.local}/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar +${symbol_pound} libs.jaxws21.classpath=${symbol_dollar}{jbi.as.home}/lib/javaee.jar:${symbol_dollar}{jbi.as.home}/lib/webservices-rt.jar +libs.jaxws21.classpath=${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/activation/activation/1.1/activation-1.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/ws/jaxws-rt/2.1.2/jaxws-rt-2.1.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild.xml new file mode 100644 index 000000000..31217d15d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/m2nbbuild.xml @@ -0,0 +1,37 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml new file mode 100644 index 000000000..096c6dd04 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/build-impl.xml @@ -0,0 +1,557 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task is getting executed! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task executed successfully! + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties new file mode 100644 index 000000000..ac5cc7404 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/genfiles.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.xml.data.CRC32=f37ab647 +build.xml.script.CRC32=9068f2c7 +build.xml.stylesheet.CRC32=8add101f@1.0 +${symbol_pound} This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +${symbol_pound} Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=f37ab647 +nbproject/build-impl.xml.script.CRC32=d15987fd +nbproject/build-impl.xml.stylesheet.CRC32=4ed53ee0@1.0 diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml new file mode 100644 index 000000000..8a7d2a523 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/jbi_admin.xml @@ -0,0 +1,504 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + +This ant script contains the jbi ant tasks and the targets and properties using +which the jbi admin commands can be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Usage : ant -f <fullpath>/jbi_admin.xml [options] [target] + options: -D<property>=<value> + Specify a property/value pairs as options that are valid for the target. + target : ant target name in jbi_admin.xml + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml new file mode 100644 index 000000000..7e7dca2ae --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/jbiadmin-impl.xml @@ -0,0 +1,339 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + Install, uninstall, reinstall, start, stop, shutdown jbi components. + + + + + + + + + + + + + + Must set jbi.host + Must set jbi.port + Must set jbi.username + Must set jbi.password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/private/private.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/private/private.properties new file mode 100644 index 000000000..e540325d5 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/private/private.properties @@ -0,0 +1,6 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +javac.debug=true +javadoc.preview=true +user.properties.file=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working57${symbol_escape}${symbol_escape}.netbeans${symbol_escape}${symbol_escape}openesb${symbol_escape}${symbol_escape}build.properties diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/project.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/project.properties new file mode 100644 index 000000000..7237a56d7 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/project.properties @@ -0,0 +1,93 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.classes.dir=${symbol_dollar}{build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${symbol_dollar}{build.dir}/generated +build.predist.dir=${symbol_dollar}{build.dir}/predist +build.predist.jar=${symbol_dollar}{build.predist.dir}/component.jar +build.predist.lib.dir=${symbol_dollar}{build.predist.dir}/lib +${symbol_pound} Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${symbol_dollar}{build.dir}/test/classes +build.test.dir=${symbol_dollar}{build.dir}/test +build.test.results.dir=${symbol_dollar}{build.dir}/test/results +conf.dir=src/conf +debug.classpath=${symbol_escape} + ${symbol_dollar}{run.classpath} +debug.test.classpath=${symbol_escape} + ${symbol_dollar}{run.test.classpath} +${symbol_pound} This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${symbol_dollar}{dist.dir}/${artifactId}.zip +dist.javadoc.dir=${symbol_dollar}{dist.dir}/javadoc +jar.compress=false +javac.classpath=${symbol_escape} + ${symbol_dollar}{libs.jbi.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.sharedlibs.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.lib.classpath} +${symbol_pound} Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir}:${symbol_escape} + ${symbol_dollar}{libs.junit.classpath}:${symbol_escape} + ${symbol_dollar}{libs.jaxws21.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jbi.ant.tasks.classpath=${symbol_escape} + ${symbol_dollar}{jbi.as.home}/lib/sun-appserv-ant.jar:${symbol_escape} + ${symbol_dollar}{jbi.as.home}/jbi/lib/jbi-ant-tasks.jar +#jbi.as.home=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish +jbi.as.home=${glassfishLocation} +#jbi.as.instance.id=[D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.as.instance.id=[${glassfishLocation}]deployer:Sun:AppServer::localhost:4848 +jbi.component.bootstrap.class=${artifactId}.JMXBindingInstaller +jbi.component.class=${artifactId}.JMXBindingRuntime +jbi.component.description=Description of binding component : ${artifactId} +jbi.component.lib.classpath=${symbol_escape} + ${symbol_dollar}{libs.wsdl4j.162.classpath} +jbi.component.name=${artifactId} +jbi.component.sharedlibs.classpath= +jbi.component.type=binding-component +jbi.host=localhost +jbi.install.params.file=install-params.properties +jbi.install.with.params=false +jbi.password=this really long string is used to identify a password that has been stored in the Keyring +jbi.port=4848 +jbi.soap.binding.name=sun-http-binding +jbi.username=admin +meta.inf.dir=${symbol_dollar}{conf.dir}/META-INF +platform.active=default_platform +project.jbi.deploy.plugin=./deploy-plugin +project.testSA=test/testSA +run.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir} +${symbol_pound} Space-separated list of JVM arguments used when running the project +${symbol_pound} (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +${symbol_pound} or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.test.classpath}:${symbol_escape} + ${symbol_dollar}{build.test.classes.dir} +src.dir=src/java +test-sys-prop.test.results.dir=${symbol_dollar}{build.test.results.dir} +test-sys-prop.test.src.dir=test-sys-prop.test.src.dir +test.src.dir=test/java +testSA.enabled=true +testSA.name=${artifactId}_TestSA diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/project.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/project.xml new file mode 100644 index 000000000..12b71aa1c --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/nbproject/project.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + org.netbeans.modules.jbi.apisupport.project.jbicomponent + + + ${artifactId} + binding-component + 1.6.5 + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/pom.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 000000000..7ae109163 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,268 @@ + + + + 4.0.0 + ${groupId} + ${artifactId} + jar + ${version} + JBI Component[${artifactId}] + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + http://open-esb.org + + build + src/java + test/java + build/classes + build/test/classes + package + + + org.apache.maven.plugins + maven-compiler-plugin + + true + 1.5 + 1.5 + + + **/*.java + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + **/*.* + + + + + maven-surefire-plugin + 2.1.3 + true + + + true + + **/bindingtest/*.java + **/enginetest/*.java + + + + + + maven-antrun-plugin + 1.2 + + + m2nbbuild-compile + compile + run + + + + + + + + m2nbbuild-compile-test + test-compile + run + + + + + + + + m2nbbuild-package + package + run + + + + + + + + m2nbbuild-utest + test + run + + + + + + + + m2nbbuild-itest + integration-test + run + + + + + + + + m2nbbuild-clean + clean + run + + + + + + + default-cli + + run + + + + !!!!!!!!!!!!!!!!!!!!!! Moving Files and organizing package !!!!!!!!!!!!!!!!!!!!!!!! + + + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + + + + + + + maven2-repo1 + Maven2 Central Repository + http://repo1.maven.org/maven2 + + + download-java-net-maven2-repository + download.java.net Maven 2.x repository + http://download.java.net/maven/2/ + + + maven-repository.dev.java.net-repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + + + ws-zones + ws.zones maven repository + http://ws.zones.apache.org/repository2/ + + + apache.org + Maven Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + + apache.org + Maven Plugin Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + org.apache.maven + maven-ant-tasks + 2.0.7 + + + open-esb.jbi-cdk + jbi-cdk-ant-tasks + 1.0-SNAPSHOT + + + open-esb + jbi + 1.0 + + + wsdl4j + wsdl4j + 1.6.2 + + + com.sun.xml.ws + jaxws-rt + 2.1.2 + test + + + + + ${maven.repo.local} + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/conf/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/conf/META-INF/jbi.xml new file mode 100644 index 000000000..6c38687ee --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/conf/META-INF/jbi.xml @@ -0,0 +1,45 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + ${artifactId} + Description of binding component : ${artifactId} + + + net.openesb.component.${artifactId}.JMXBindingRuntime + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + net.openesb.component.${artifactId}.JMXBindingInstaller + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java new file mode 100644 index 000000000..d4e017183 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java @@ -0,0 +1,52 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMX${artifactId}LifeCycle.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.BasicComponentLifeCycle; +import net.openesb.component.${artifactId}.common.DefaultMessageExchangeReceiver; +import net.openesb.component.${artifactId}.common.MessageExchangeReceiver; +import net.openesb.component.${artifactId}.common.RuntimeContext; +import javax.jbi.JBIException; +import javax.jbi.component.Component; + +/** + * This class extends the basic ComponentLifeCycle implementation to provide + * component specific implementation of the ComponentLifeCycle. + * + * @see javax.jbi.ComponentLifeCycle + * @see com.sun.jbi.sample.component.common.BasicComponentLifeCycle + * @author chikkala + */ +public class JMXBindingComponentLifeCycle extends BasicComponentLifeCycle { + + /** + * constructor for the ComponentLifecycle implementation. + */ + public JMXBindingComponentLifeCycle(Component compRuntime) { + super(compRuntime); + } + + /** + * creates DefaultMessageExchangeReceiver to handles receiving and + * processing the message exchanges from the delivery channel. + */ + @Override + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return new DefaultMessageExchangeReceiver(); + } + + /** + * chance to extended classes to do the component specific init + * + * @throws javax.jbi.JBIException + */ + @Override + protected void doInit() throws JBIException { + // NOOP + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java new file mode 100644 index 000000000..3a0711150 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java @@ -0,0 +1,153 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingConsumerEndpoint.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.wsdlext.PortExt; +import net.openesb.component.${artifactId}.wsdlext.WSDLExtHelper; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.ConsumerEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import javax.jbi.JBIException; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanRegistrationException; +import javax.management.ObjectName; +import javax.management.StandardMBean; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends ConsumerEndpoint to implement the component specific + * consumer endpoint configuration. It uses JMXBindingConsumerProxy to receive + * messages from external service consumers and initiate the InOut message + * exchange. This implementation shows how a synchronous send/receive from the + * delivery channel will be used in InOut message exchange in a service + * invocation by the external consumers. + * + * @author chikkala + */ +public class JMXBindingConsumerEndpoint extends ConsumerEndpoint { + + private ObjectName mJMXEndpointMBeanName; + private JMXEndpointMBean mJMXEndpointMBean; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public JMXBindingConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(consumes, wsdlDef, su); + } + + @Override + protected void doInit() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): init called"); + this.initJMXEndpoint(); + } + + @Override + protected void doActivate() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): activate called"); + this.activateJMXEndpoint(); + } + + @Override + protected void doDeactivate() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): deactivate called"); + this.deactivateJMXEndpoint(); + } + + @Override + protected void doClean() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): clean called"); + this.cleanJMXEndpoint(); + } + + /** + * creates the JMXEndpointMBean implementation. + */ + protected JMXEndpointMBean createJMXEndpointMBean() { + // JMX EndpointMBean implementation that initiates in-out message exchange. + return new JMXBindingConsumerProxy(this); + } + + /** + * get the mbean object name from the endpoint address of the jmx wsdl + * extension element + */ + protected ObjectName createJMXEndpointMBeanName() throws JBIException { + ObjectName mbeanObjectName = null; + try { + mbeanObjectName = new ObjectName(findMBeanNameFromWSDL()); + } catch (Exception ex) { + throw new JBIException(ex); + } + return mbeanObjectName; + } + + public final ObjectName getJMXEndpointMBeanName() { + return this.mJMXEndpointMBeanName; + } + + public final JMXEndpointMBean getJMXEndpointMBean() { + return this.mJMXEndpointMBean; + } + + protected final void initJMXEndpoint() throws JBIException { + // create jmx mbean resources + this.mJMXEndpointMBeanName = createJMXEndpointMBeanName(); + this.mJMXEndpointMBean = createJMXEndpointMBean(); + } + + protected final void activateJMXEndpoint() throws JBIException { + // open jmx connectivity to external consumers by registering the + // external endpoint mbean implementation. + try { + StandardMBean mbean = new StandardMBean(this.mJMXEndpointMBean, JMXEndpointMBean.class); + this.getComponentContext().getMBeanServer().registerMBean(mbean, this.mJMXEndpointMBeanName); + } catch (Exception ex) { + throw new JBIException(ex); + } + } + + protected final void deactivateJMXEndpoint() throws JBIException { + // close the jmx connectivity to external consumers by unregistering + // the external endpoint mbean. + try { + this.getComponentContext().getMBeanServer().unregisterMBean(this.mJMXEndpointMBeanName); + } catch (InstanceNotFoundException ex) { + ex.printStackTrace(); + } catch (MBeanRegistrationException ex) { + ex.printStackTrace(); + } + } + + protected final void cleanJMXEndpoint() throws JBIException { + // release jmx mbean resources + this.mJMXEndpointMBean = null; + this.mJMXEndpointMBeanName = null; + } + + /** + * get the mbean object name from the endpoint address of the jmx wsdl + * extension element + */ + protected String findMBeanNameFromWSDL() { + String mbeanName = null; + try { + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + Definition def = this.getWSDL(); + PortExt address = WSDLExtHelper.getPortExt(def, serviceName, endpointName); + if (address != null) { + mbeanName = address.getMBean(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + return mbeanName; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java new file mode 100644 index 000000000..180f4d45d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java @@ -0,0 +1,237 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingConsumerProxy.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.ConsumerEndpoint; +import java.io.StringReader; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Operation; +import javax.wsdl.OperationType; +import javax.xml.namespace.QName; +import javax.xml.transform.Source; + +/** + * This class acts as a proxy to the external service consumer that can receive + * messages from the external consumer using JMX interface and then initiate the + * InOut message exchange to invoke a service provided by the component in the + * jbi environment. + * + * this code shows how a synchronous send/receive messages from the delivery + * channel can be used in InOut message exchange to complete a service + * invocation. + * + * @author chikkala + */ +public class JMXBindingConsumerProxy implements JMXEndpointMBean { + + /** + * Synchronous send timeout + */ + private static final long SEND_SYNC_TIMEOUT = 60000; + private ConsumerEndpoint mEndpoint; + private JMXBindingNormalizer mNormalizer; + + /** + * Creates a new instance of JMXEndpointMBeanImpl + */ + public JMXBindingConsumerProxy(ConsumerEndpoint endpoint) { + this.mEndpoint = endpoint; + this.mNormalizer = new JMXBindingNormalizer(endpoint.getWSDL(), endpoint.getWSDLBinding()); + } + + public StringBuffer sendMessage(String operation, StringBuffer inputDoc) throws Exception { + // when receive input from external service consumer, + // 1. normalized the message, 2. send in-out message exchange. 3. denormalize out message. + Source inMsgSource = RuntimeHelper.createDOMSource(new StringReader(inputDoc.toString())); + QName operationQName = this.mEndpoint.getOperationQName(operation); + Source out = initiateMessageExchange(operationQName, inMsgSource); + StringBuffer outBuff = null; + if (out != null) { + // read the denormalized out message to string buffer. + outBuff = RuntimeHelper.readFromSource(out); + } + // return the out message content to the external service consumer. + return outBuff; + } + + public Source initiateMessageExchange(QName operation, Source inSource) throws JBIException { + // 1. Decide what type of message exchange needed for this operation. + Source outSource = null; + try { + Operation wsdlOp = this.mEndpoint.getWSDLOperation(operation); + if (OperationType.REQUEST_RESPONSE.equals(wsdlOp.getStyle())) { + outSource = doInOutMessageExchange(operation, inSource); + } else if (OperationType.ONE_WAY.equals(wsdlOp.getStyle())) { + doInOnlyMessageExchange(operation, inSource); + } else { + throw new JBIException("Unsupported MEP " + wsdlOp.getStyle() + + "for operation " + operation); + } + return outSource; + } catch (Exception ex) { + throw new JBIException(ex); + } + } + + /** + * invokes the service provider with in-only message exchange sent to + * delivery channel by the consumer + * + * @param operation operation name on a service + * @param inSource input xml document for the InOut operation + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + * @return output xml document as a Source object received from InOut + * operation of the service invoked. + */ + private void doInOnlyMessageExchange(QName operation, Source inSource) + throws Exception { + // 2. normalized the message. + // 3. locate service endpoint + // 4. create message exchange according to the Opeations MEP + + // get the component context and the delivery channel for preparing to send message + ComponentContext compContext = this.mEndpoint.getComponentContext(); + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + // create INOUT Message Exchange + InOnly inOnlyME = this.mEndpoint.createInOnlyMessageExchange(operation); + // set the content of the IN normalized message ( Normalize the message ) + NormalizedMessage inMsg = inOnlyME.getInMessage(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(inOnlyME.getOperation()); + this.mNormalizer.normalizeInput(wsdlOperation, inMsg, RuntimeHelper.sourceToDOMSource(inSource)); + // send the message exchange and wait for response + boolean isSent = channel.sendSync(inOnlyME, SEND_SYNC_TIMEOUT); + if (!isSent) { + throw new Exception("JMXBinding:Timeout occured in sending the message to provider"); + } + // check if you got a done message or error ( done or error are only allowed in in-only) + // process the Message Exchange to check for done or error message and + // complete InOut message exchange with provider + //TODO: put this below code in processInOnlyMessageExchangeOnConsumer() + ExchangeStatus status = inOnlyME.getStatus(); + this.mEndpoint.getLogger().fine("Consumer:InOnly:Processing Message Exchange with status " + status); + if (ExchangeStatus.DONE.equals(status)) { + this.mEndpoint.getLogger().fine("Consumer: Completed the INONLY MessageExchange"); + return; + } else if (ExchangeStatus.ERROR.equals(status)) { + // error can occur any time. so just return the error back to client. + Exception serverSideEx = inOnlyME.getError(); + StringBuffer exMsgBuff = RuntimeHelper.getExceptionStackTrace(serverSideEx); + throw new Exception("Consumer:INONLY Message Exchange status ERROR.${symbol_escape}n" + exMsgBuff); + } else { + // any other status is error. + throw new Exception("Consumer:INONLY Message Exchange error. status: " + status); + } + } + + /** + * invokes service provider with in-out message exchange sent to delivery + * channel by the consumer + * + * @param operation operation name on a service + * @param inSource input xml document for the InOut operation + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + * @return output xml document as a Source object received from InOut + * operation of the service invoked. + */ + private Source doInOutMessageExchange(QName operation, Source inSource) + throws Exception { + // 2. normalized the message. + // 3. locate service endpoint + // 4. create message exchange according to the Opeations MEP + + // get the component context and the delivery channel for preparing to send message + ComponentContext compContext = this.mEndpoint.getComponentContext(); + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + // create INOUT Message Exchange + InOut inOutME = this.mEndpoint.createInOutMessageExchange(operation); + // set the content of the IN normalized message ( Normalize the message ) + NormalizedMessage inMsg = inOutME.getInMessage(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(inOutME.getOperation()); + this.mNormalizer.normalizeInput(wsdlOperation, inMsg, RuntimeHelper.sourceToDOMSource(inSource)); + // send the message exchange and wait for response + boolean isSent = channel.sendSync(inOutME, SEND_SYNC_TIMEOUT); + if (!isSent) { + throw new Exception("JMXBinding:Timeout occured in sending the message to provider"); + } + // check if you got a out message or fault or error + // process the Message Exchange to get the output message and + // complete InOut message exchange with provider + NormalizedMessage outMsg = processInOutMessageExchangeOnConsumer(inOutME); + Source outSource = this.mNormalizer.denormalizeOutput(wsdlOperation, outMsg); + return outSource; + } + + /** + * takes the InOut message exchange received from sendSync call and + * processes it further to complete InOut message exchange with provider and + * returns the out message or throws exception in case of error or faults. + */ + private NormalizedMessage processInOutMessageExchangeOnConsumer(InOut inoutExchange) + throws Exception { + // InOut MessageExchange processing on consumer side + // 1. ACTIVE status receives a fault or out message, + // send the done status to complete message exchange + // return the fault/out message to external consumer + // 2. can not receive DONE status + // 3. when received ERROR status, return the error to consumer. + + // process the message exchange based on its state. + ExchangeStatus status = inoutExchange.getStatus(); + this.mEndpoint.getLogger().fine("Consumer:Processing Message Exchange with status " + status); + + if (ExchangeStatus.ACTIVE.equals(status)) { + + Fault fault = inoutExchange.getFault(); + NormalizedMessage outMsg = inoutExchange.getOutMessage(); + + // send done to complete message exchange. + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + inoutExchange.setStatus(ExchangeStatus.DONE); + channel.send(inoutExchange); + this.mEndpoint.getLogger().fine("Consumer: Completed the INOUT MessageExchange"); + + // process fault or out message + if (fault != null) { + // throw an exception if there is a fault message. + Source faultContent = fault.getContent(); + StringBuffer faultContentBuff = null; + if (faultContent != null) { + faultContentBuff = RuntimeHelper.readFromSource(faultContent); + } + throw new Exception("Consumer:INOUT message exchange Fault ${symbol_escape}n" + + faultContentBuff); + } + + // return the outMessage for processing + if (outMsg != null) { + return outMsg; + } else { + throw new Exception("Consumer: Null Out message in INOUT message exchange. "); + } + } else if (ExchangeStatus.DONE.equals(status)) { + // can not get DONE on Consumer side in INOUT message exchange. + throw new Exception("Consumer: Illegal status DONE on INOUT message exchange"); + } else if (ExchangeStatus.ERROR.equals(status)) { + // error can occur any time. so just return the error back to client. + Exception serverSideEx = inoutExchange.getError(); + StringBuffer exMsgBuff = RuntimeHelper.getExceptionStackTrace(serverSideEx); + throw new Exception("Consumer:INOUT Message Exchange status ERROR.${symbol_escape}n" + exMsgBuff); + } else { + throw new Exception("Consumer:INOUT Message Exchange error. status: " + status); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingInstaller.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingInstaller.java new file mode 100644 index 000000000..e1b6f21e9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingInstaller.java @@ -0,0 +1,34 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + /* + * JMXBindingInstaller.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.ComponentInstaller; + +/** + * This class extends the ComponentInstaller that implements the + * javax.jbi.component.Bootstrap for a component installation contract. + * + * If the default implemenation of the javax.jbi.component.Bootstrap in + * com.sun.jbi.sample.component.common.ComponentInstaller is not sufficient for + * this components install, uninstall and upgrade requirements, override the + * default implementation here to add component specific installation and + * upgrade tasks such as initializing configuration mbean and creating resources + * specific to component or upgrade workspace and service units during upgrading + * the component. + * + * @see javax.jbi.Bootstrap + * @see com.sun.jbi.sample.component.common.ComponentInstaller + * @author chikkala + */ +public class JMXBindingInstaller extends ComponentInstaller { + + /** + * Constructor to create the ComponentInstaller. + */ + public JMXBindingInstaller() { + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingNormalizer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingNormalizer.java new file mode 100644 index 000000000..7452d3dca --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingNormalizer.java @@ -0,0 +1,242 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingNormalizer.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractNormalizer; +import net.openesb.component.${artifactId}.common.wsdl.WSDL11JBIWrapper; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * This class is a concrete implementation of the AbstractNormalizer to + * implement normalize jmx binding specific concrete messages to jbi wrapper + * messages and denormalize the jbi wrapper messages to jmx binding specific + * messages. The jmx binding concrete message has "message" as the root element + * that contains the part elements as its children. for example + * + * + * + * + * This is the sample code that demonstrate how to normalize and denormalize + * messages to/from jbi wrapper from/to concrete messages specific to a binding + * protocol + * + * @author chikkala + */ +public class JMXBindingNormalizer extends AbstractNormalizer { + + public static final String JMXBC_MSG_NS = "http://java.sun.com/jbi/sample/jmx-bc/envelope/"; + public static final String DEF_NS_PREFIX = "jmxbc"; + public static final String MESSAGE_EL = "message"; + + /** + * Creates a new instance of JMXBCNormalizer + */ + public JMXBindingNormalizer(Definition wsdl, Binding binding) { + super(wsdl, binding); + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeInput(Operation operation, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Input input = operation.getInput(); + Message wsdlMsg = input.getMessage(); + //TODO: get the binding input extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeOutput(Operation operation, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Output output = operation.getOutput(); + Message wsdlMsg = output.getMessage(); + //TODO: get the binding output extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Fault wsdlFault = operation.getFault(faultName); + Message wsdlMsg = wsdlFault.getMessage(); + //TODO: get the binding fault extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException { + try { + + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Input input = operation.getInput(); + Message wsdlMsg = input.getMessage(); + //TODO: get the binding input extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + jmxMsgDoc.appendChild(jmxMessage); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException { + try { + + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Output output = operation.getOutput(); + Message wsdlMsg = output.getMessage(); + //TODO: get the binding output extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + jmxMsgDoc.appendChild(jmxMessage); + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Fault wsdlFault = operation.getFault(faultName); + Message wsdlMsg = wsdlFault.getMessage(); + //TODO: get the binding fault extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + jmxMsgDoc.appendChild(jmxMessage); + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java new file mode 100644 index 000000000..e6ab7f172 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java @@ -0,0 +1,87 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingProviderEndpoint.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.wsdlext.PortExt; +import net.openesb.component.${artifactId}.wsdlext.WSDLExtHelper; +import net.openesb.component.${artifactId}.common.MessageExchangeHandler; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.MessageExchangeListener; +import net.openesb.component.${artifactId}.common.deployment.ProviderEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import java.util.logging.Level; +import javax.jbi.JBIException; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends the ProviderEndpoint to implement component specific + * endpoint configuration. It implements the MessageExchangeListener to receive + * message exchange notifications from the MessageExchangeSupport fired by + * MessageExchangeReceiver and process it using a message exchange handler to + * show how an asynchronous processing of message exchange can be done. + * + * This endpoint uses the JMXBindingProviderProxy as a message exchange handler + * that can invoke the external provider to send a message and receive the + * response in a InOut message exchange. + * + * @author chikkala + */ +public class JMXBindingProviderEndpoint extends ProviderEndpoint implements MessageExchangeListener { + + JMXBindingProviderProxy mProviderProxy; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public JMXBindingProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(provides, wsdlDef, su); + } + + @Override + public void doInit() throws JBIException { + RuntimeHelper.getLogger().info("JMXBindingProviderEndpoint:doInit called"); + this.mProviderProxy = new JMXBindingProviderProxy(this); + } + + @Override + public MessageExchangeHandler createMessageExchangeHandler() { + return this.mProviderProxy; + } + + @Override + protected MessageExchangeListener createMessageExchangeListener() { + return this; + } + + public void messageExchangeReceived(ExchangeStatus status, MessageExchange me) { + try { + RuntimeHelper.getLogger().fine("MXListener.MessageExchangeReceived: with Status: " + status); + processMessageExchangeWithHandler(status, me); + // processMessageExchange(me); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public PortExt getJMXProviderInfo() { + PortExt portExt = null; + try { + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + Definition def = this.getWSDL(); + portExt = WSDLExtHelper.getPortExt(def, serviceName, endpointName); + } catch (Exception ex) { + getLogger().log(Level.FINE, ex.getMessage(), ex); + } + return portExt; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java new file mode 100644 index 000000000..1d263da33 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java @@ -0,0 +1,235 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingProviderProxy.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.wsdlext.PortExt; +import net.openesb.component.${artifactId}.common.AbstractMessageExchangeHandler; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.IOException; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.management.MBeanServerConnection; +import javax.management.ObjectName; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; + +/** + * This is a provider side implementation of the message exchange handler on a + * binding component which acts as a service provider proxy for the external + * provider. During the message exchange processing of the InOut message + * exchange, this handler acting as a proxy to the external provider invokes the + * service operation on the external provider and does required normalization + * and denormalization in processing out and in messages received from or send + * to the external service provider. + * + * @author chikkala + */ +public class JMXBindingProviderProxy extends AbstractMessageExchangeHandler { + + private JMXBindingProviderEndpoint mEndpoint; + private String mServiceURL; + private String mUsername; + private String mPassword; + private String mMBeanName; + private JMXBindingNormalizer mNormalizer; + + /** + * Creates a new instance of ProviderSEMXHandler + */ + public JMXBindingProviderProxy(JMXBindingProviderEndpoint endpoint) { + + this.mEndpoint = endpoint; + + PortExt jmxInfo = this.mEndpoint.getJMXProviderInfo(); + this.mServiceURL = jmxInfo.getServiceURL(); + this.mUsername = jmxInfo.getUsername(); + this.mPassword = jmxInfo.getPassword(); + this.mMBeanName = jmxInfo.getMBean(); + + this.mNormalizer = new JMXBindingNormalizer(endpoint.getWSDL(), endpoint.getWSDLBinding()); + } + + protected Logger getLogger() { + return this.mEndpoint.getLogger(); + } + + protected DeliveryChannel getDeliveryChannel() { + return this.mEndpoint.getDeliveryChannel(); + } + + protected void validateMessageExchange() throws MessagingException { + MessageExchange msgExchange = this.getMessageExchange(); + + if (this.getMessageExchange() == null) { + throw new MessagingException("MessageExchange Object is null in MessageExchageHandler"); + } + + if (MessageExchange.Role.CONSUMER.equals(msgExchange.getRole())) { + throw new MessagingException("Provider Message Exchange Handler can not have MessageExchange with CONSUMER Role"); + } + + if (!(msgExchange instanceof InOut)) { + throw new MessagingException("InOut Message Exchange Handler MessageExchange object should be instanceof javax.jbi.messaging.InOut "); + } + } + + protected void processError(Exception ex) { + MessageExchange msgExchange = this.getMessageExchange(); + Exception errEx = msgExchange.getError(); // get the error and print + RuntimeHelper.getLogger().info( + "InOut Message Exchange Provider received Error: " + errEx.getMessage()); + msgExchange.getError().printStackTrace(); + } + + protected void processDone() { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.getLogger().info("InOut Message Exchange Provider received DONE :" + + " END of service invocation"); + } + + protected void processFault(Fault fault) { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.logError("InOut Message Exchange Provider Handler can not receive Fault on Provider side"); + } + + protected void processMessage() { + try { + processInMessageOnProvider((InOut) this.getMessageExchange()); + } catch (JBIException ex) { + ex.printStackTrace(); + } + } + + protected void processInMessageOnProvider(InOut inOutExchange) throws JBIException { + RuntimeHelper.getLogger().fine("Processing In Message on Provider side " + inOutExchange); + // receive IN message. + NormalizedMessage inMsg = inOutExchange.getInMessage(); + NormalizedMessage outMsg = null; + Fault fault = null; + DOMSource inContent = null; + DOMSource outContent = null; + Source faultContent = null; + String faultAsText = null; + + QName opName = inOutExchange.getOperation(); + QName svcName = inOutExchange.getEndpoint().getServiceName(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(opName); + + // process in message + // invoke the service operation + try { + inContent = this.mNormalizer.denormalizeInput(wsdlOperation, inMsg); + StringBuffer outputDoc = invokeOperation(opName.getLocalPart(), + RuntimeHelper.readFromDOMSource(inContent)); + outContent = RuntimeHelper.createDOMSource(new StringReader(outputDoc.toString())); + } catch (Exception ex) { + // exception invoking the operation. so, set exception text as fault content. + ex.printStackTrace(); + faultAsText = RuntimeHelper.getExceptionAsText(ex); + String faultText = RuntimeHelper.getExceptionAsXmlText(ex); + faultContent = RuntimeHelper.createDOMSource(new StringReader(faultText)); + } + // set out or fault message + if (outContent != null) { + // set the out message content. + outMsg = inOutExchange.createMessage(); + inOutExchange.setOutMessage(outMsg); + this.mNormalizer.normalizeOutput(wsdlOperation, outMsg, outContent); + // outMsg.setContent(outContent); + } else if (faultContent != null) { + fault = inOutExchange.createFault(); + inOutExchange.setFault(fault); + fault.setContent(faultContent); // may need to normalize the content. + } + // send out or fault message. + this.send(); + } + + protected StringBuffer invokeOperation(String operation, StringBuffer inputDoc) throws MessagingException { + try { + StringBuffer outputDoc = invokeSendMessage(this.mServiceURL, this.mUsername, this.mPassword, + this.mMBeanName, operation, inputDoc); + return outputDoc; + } catch (Exception ex) { + ex.printStackTrace(); + throw new MessagingException(ex); + } + } + + /** + * invokes a jmx mbean to send message. + */ + protected StringBuffer invokeSendMessage(String serviceURL, String username, String password, + String mbeanName, String operation, StringBuffer inputDoc) + throws MessagingException { + + JMXConnector jmxConnector = null; + MBeanServerConnection jmxConn = null; + JMXServiceURL jmxURL = null; + ObjectName epAddressName = null; + + Map env = new HashMap(); + if (username != null) { + String[] credentials = new String[]{username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, this.getClass().getClassLoader()); + } + + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + try { + jmxURL = new JMXServiceURL(serviceURL); + epAddressName = new ObjectName(mbeanName); + + jmxConnector = JMXConnectorFactory.connect(jmxURL, env); + jmxConn = jmxConnector.getMBeanServerConnection(); + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if (result != null) { + outDoc = (StringBuffer) result; + } + } catch (Exception ex) { + throw new MessagingException(ex); + } finally { + if (jmxConnector != null) { + try { + jmxConnector.close(); + } catch (IOException ex) { + RuntimeHelper.logDebug(ex); + // ingore + } + } + } + return outDoc; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingRuntime.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingRuntime.java new file mode 100644 index 000000000..a3252887e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingRuntime.java @@ -0,0 +1,57 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingRuntime.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.ComponentRuntime; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; + +/** + * This class extends the ComponentRuntime that implements + * javax.jbi.component.Component interface required for the component contract + * at runtime. + * + * This class provides the component specific ComponentLifeCycle implementation + * as well as the component specific ServiceUnitManager implementation. + * + * Add any additional component runtime specific functionality here. + * + * @see javax.jbi.component.Component + * @see com.sun.jbi.sample.component.common.ComponentRuntime + * @see com.sun.jbi.sample.component.common.BasicComponentLifecycle + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @author chikkala + */ +public class JMXBindingRuntime extends ComponentRuntime { + + /** + * Creates a new instance of MyBindingRuntime + */ + public JMXBindingRuntime() { + super(); + } + + /** + * overriding the parent's createComponentLifeCycle to create MyBinding + * specific component lifecycle implementation. + */ + @Override + protected ComponentLifeCycle createComponentLifeCycle() { + return new JMXBindingComponentLifeCycle(this); + } + + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. Extended classes can override + * this method and do their own ServiceUnitManager specific creation. + */ + @Override + protected ServiceUnitManager createServiceUnitManager() { + return new JMXBindingSUManager(this); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingSUManager.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingSUManager.java new file mode 100644 index 000000000..75968c59a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingSUManager.java @@ -0,0 +1,51 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingSUManager.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.AbstractServiceUnitManager; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; + +/** + * This class extends the AbstractServiceUnitManager to implement component + * specific service unit manager by creating the component specific ServiceUnit + * implementation. + * + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit + * + * @author chikkala + */ +public class JMXBindingSUManager extends AbstractServiceUnitManager { + + private JMXBindingRuntime mRuntime; + + /** + * Creates a new instance of JMXBindingSUManager + */ + public JMXBindingSUManager(JMXBindingRuntime compRuntime) { + super(); + this.mRuntime = compRuntime; + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + protected String getComponentName() { + return RuntimeHelper.getComponentName(); + } + + //TODO implement ProviderSEServiceUnit + protected ServiceUnit createServiceUnit(String suName, String suRootPath) throws DeploymentException { + return new JMXBindingServiceUnit(suName, suRootPath); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java new file mode 100644 index 000000000..9175742ba --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java @@ -0,0 +1,55 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingServiceUnit.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.deployment.ConsumerEndpoint; +import net.openesb.component.${artifactId}.common.deployment.ProviderEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Provides; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; + +/** + * This class extends the ServiceUnit to implement the component specific + * service unit processing. It creates the component specific ProviderEndpoint + * and ConsumerEndpoint implementation to configure the service provider and + * consumer endpoints on this component deployed in the service unit. + * + * @author chikkala + */ +public class JMXBindingServiceUnit extends ServiceUnit { + + /** + * Creates a new instance of ProviderSEServiceUnit + */ + public JMXBindingServiceUnit(String suName, String suRootPath) { + super(suName, suRootPath); + } + + @Override + protected WSDLProcessor createWSDLProcessor() { + return new JMXBindingWSDLProcessor(this.getSURootPath()); + } + + @Override + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return new JMXBindingConsumerEndpoint(consumes, wsdlDef, this); + } + + @Override + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return new JMXBindingProviderEndpoint(provides, wsdlDef, this); + } + + @Override + protected void loadOtherArtifacts() throws DeploymentException { + //TODO: load any component specific service unit artifacts + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java new file mode 100644 index 000000000..67b92ee50 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java @@ -0,0 +1,43 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingWSDLProcessor.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.wsdlext.WSDLExtensionRegistry; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This class extends form the WSDLProcessor to configure the wsdl processor use + * the wsdl extension registry configured to process the binding specific + * extension elements in the wsdl documents. + * + * WSDLExtensionRegistry that is created here has the wsdl extension model + * required to process the extension elements specific to the binding used by + * this binding component. + * + * @author chikkala + */ +public class JMXBindingWSDLProcessor extends WSDLProcessor { + + private WSDLExtensionRegistry mExtRegistry; + + /** + * Creates a new instance of JMXBindingWSDLProcessor + */ + public JMXBindingWSDLProcessor(String wsdlDir) { + super(wsdlDir); + } + + @Override + protected ExtensionRegistry getExtensionRegistry() { + if (this.mExtRegistry == null) { + this.mExtRegistry = new WSDLExtensionRegistry(); + } + return this.mExtRegistry; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXEndpointMBean.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXEndpointMBean.java new file mode 100644 index 000000000..3c14041e8 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/JMXEndpointMBean.java @@ -0,0 +1,41 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXEndpointMBean.java + */ +package net.openesb.component.${artifactId}; + +/** + * The sample BC implemented as a jmx binding component exposes this interface + * as a external connectivity (endpoint address) to the external service + * consumers that can exchange messages over jmx protocol to invoke services + * provided inside jbi environment. + * + * A jmx client can send a message by invoking this method using jmx management + * interface. When this mbean method is executed in the BC as a result of mbean + * call from the jmx client, the BC acts as a proxy service consumer inside the + * jbi environment and starts a message exchange with the service provider. + * + * If the operation being executed is a InOut operation, the BC should return + * the Out or Fault message from the InOut message exchange as a return value to + * complete invocation of the service by the external consumer. + * + * @author chikkala + */ +public interface JMXEndpointMBean { + + /** + * This method will be called by a jmx client as a service consumer to send + * message to the echo service provider to invoke the service for a InOut + * message exchange. + * + * @param operation operation name on a service + * @param inputDoc input xml document for the InOut operation + * @return output xml document in a StringBuffer received from InOut + * operation of the service invoked. or null if the operation is InOnly. + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + */ + StringBuffer sendMessage(String operation, StringBuffer inputDoc) throws Exception; +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java new file mode 100644 index 000000000..4987029b3 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java @@ -0,0 +1,141 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractMessageExchangeHandler.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.io.StringReader; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.xml.namespace.QName; + +/** + * This class is an abstract implementation of the MessageExchangeHandler which + * provides the base implementation of the ME processing and provides hooks to + * extended classes to implement component specific processing. + * + * @author chikkala + */ +public abstract class AbstractMessageExchangeHandler implements MessageExchangeHandler { + + public static String IN_MESSAGE = "in"; + public static String OUT_MESSAGE = "out"; + + private MessageExchange mMessageExchange; + private ExchangeStatus mStatus; + /** Creates a new instance of AbstractMessageExchangeHandler */ + protected AbstractMessageExchangeHandler() { + this.mMessageExchange = null; + } + + protected abstract Logger getLogger(); + protected abstract DeliveryChannel getDeliveryChannel(); + protected abstract void validateMessageExchange() throws MessagingException; + protected abstract void processError(Exception ex); + protected abstract void processDone(); + protected abstract void processMessage(); + protected abstract void processFault(Fault fault); + + public final MessageExchange getMessageExchange() { + return this.mMessageExchange; + } + + public final void setMessageExchange(MessageExchange msgExchange) { + this.mMessageExchange = msgExchange; + } + + public final ExchangeStatus getMessageExchangeStatus() { + if ( this.mStatus != null ) { + return this.mStatus; + } else if ( this.mMessageExchange != null ) { + return this.mMessageExchange.getStatus(); + } else { + return null; + } + } + + public final void setMessageExchangeStatus(ExchangeStatus status) { + this.mStatus = status; + } + + protected void send() throws MessagingException { + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected boolean sendSync(long timeout) throws MessagingException { + return this.getDeliveryChannel().sendSync(this.mMessageExchange, timeout); + } + + protected void sendDone() throws MessagingException { + this.mMessageExchange.setStatus(ExchangeStatus.DONE); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendError(Exception ex) throws MessagingException { + this.mMessageExchange.setError(ex); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendFault(Exception ex, QName type, String name) throws MessagingException { + Fault fault = this.mMessageExchange.createFault(); + if ( ex != null ) { + String xmlText = RuntimeHelper.getExceptionAsXmlText(ex); + fault.setContent(RuntimeHelper.createDOMSource(new StringReader(xmlText))); + } + this.mMessageExchange.setFault(fault); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void processActive() { + Fault fault = this.getMessageExchange().getFault(); + if ( fault != null ) { + processFault(fault); + } else { + processMessage(); + } + } + /** + * implementation of the MessageExchangeHandler${symbol_pound}processMessageExchange method. + */ + public void processMessageExchange(ExchangeStatus status, MessageExchange msgEx) { + + getLogger().fine("MessageExchangeHandler.processMessageExchange:status: " + status ); + + this.setMessageExchangeStatus(status); + this.setMessageExchange(msgEx); + + try { + validateMessageExchange(); + } catch (MessagingException ex) { + getLogger().log(Level.FINE, "Invalid message exchange for processing ", ex); + if ( this.getMessageExchange() != null ) { + try { + sendError(ex); + } catch (MessagingException errEx) { + getLogger().log(Level.FINE, "Can not send invalid message exchange error", errEx); + } + } + return; + } + + MessageExchange msgExchange = this.getMessageExchange(); + + if (ExchangeStatus.ACTIVE.equals(status) ) { + processActive(); + } else if (ExchangeStatus.DONE.equals(status) ) { + processDone(); + } else if (ExchangeStatus.ERROR.equals(status) ) { + processError(msgExchange.getError()); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java new file mode 100644 index 000000000..d76fbe0f9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java @@ -0,0 +1,398 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractComponentLifeCycle.java + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.MessagingException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.ComponentLifeCycle. This is an + * abstract class that keeps the reference to the component context and the lifecycle + * extension mbeans. It implements the lifecycle method and provide the extended methods + * for each lifecycle methods to implement component specific functionality. + *

+ * It makes sure that the mininum initialization required for the component + * lifecycle is implemented by this class or the classes extending this class. + *

+ * Another important functionality implemented in this class is that it initializes the global + * RuntimeContext for the component with the ComponentContext passed by the JBI runtime and the + * opened delivery channel to make them available globally to any class in the component implementation + * that may need it during component lifecycle + *

+ * Service engine or a binding component lifecycle implementation can directly extend + * this class for their required functionality and override some of the methods to provide + * their own implementation. + * + * @see javax.jbi.ComponentLifeCycle + * @author chikkala + */ +public class BasicComponentLifeCycle implements ComponentLifeCycle { + /** reference to the component runtime */ + private Component mCompRuntime; + /** component context */ + private ComponentContext mComponentContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + /** a message receiver that accepts messages from delivery channel */ + private MessageExchangeReceiver mMsgExchReceiver; + + /** + * constructor for the ComponentLifecycle implementation. + * @param compRuntime + */ + protected BasicComponentLifeCycle(Component compRuntime) { + this.mCompRuntime = compRuntime; + } + /** + * @return Component + */ + public final Component getComponentRuntime() { + return this.mCompRuntime; + } + /** + * @return ComponentContext component context. + */ + public final ComponentContext getComponentContext() { + return mComponentContext; + } + /** + * @return component name + */ + protected String getComponentName() { + return (this.mComponentContext != null) ? + this.mComponentContext.getComponentName() : null; + } + /////////////////////////////////////////////////////////////////////////// + // ComponentLifeCycle interface implemenation + /////////////////////////////////////////////////////////////////////////// + + /** + * Initializes the component lifecycle. This method makes sure that the + * component context passed by the jbi runtime is saved in the lifecycle + * object before calling the other component initialization methods to + * completely initialize the component. + * @param context Component context + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}init(javax.jbi.component.ComponentContext) + * @throws javax.jbi.JBIException on error + */ + public final void init(ComponentContext context) throws JBIException { + + if ( context == null ) { + throw new JBIException("Null Component Context received in " + + "Component Lifecycle init "); + } + this.mComponentContext = context; // 0. save the component context passed by jbi framework. + // initialize the content + initGlobalContext(); // 1. Initialize component runtime context. + registerExtensionMBean(); // 2. Create and register extension mbean. + openDeliveryChannel(); // 3. Open delivery channel. + initMessageExchangeReceiver(); // 4. Create message exchange receiver. + doInit(); // 5. Do any component specific initialization such + // as static service providers and consumers initialization. + + this.getLogger().fine("Component " + this.getComponentName() + " initialized"); + } + + /** + * Starts the component. Extended classes can override/implement the methods called + * in this method to provide component specify start functionality. + * + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}start() + * @throws javax.jbi.JBIException on error + */ + public final void start() throws JBIException { + + doStart(); // 1. do any other component specific start tasks such as + // activating any static service providers and consumers. + startMessageExchangeProcessing(); // 2. begin accepting and processing message exchanges. + + this.getLogger().fine("Component " + this.getComponentName() + " started"); + } + + /** + * Stop the component.Extended classes can override/implement the methods called + * in this method to provide component specify stop functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}stop() + */ + public final void stop() throws JBIException { + + stopMessageExchangeProcessing(); // 1. stop accepting and processing message exchanges. + doStop(); // 2. do any other component specific stop tasks such as + // deactivating any static service providers and consumers. + this.getLogger().fine("Component " + this.getComponentName() + " stopped."); + } + + /** + * Shut down the component. Extended classes can override/implement the methods called + * in this method to provide component specify shut down functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}shutDown() + */ + public final void shutDown() throws JBIException { + // clean up all resources. + shutdownMessageExchangeReceiver(); // 1. remove the message receiver. + closeDeliveryChannel(); // 2. close delivery channel + unregisterExtensionMBean(); // 3. unregister and remove extension mbean if exists. + doShutDown(); // 4. do any other component specific clean up tasks such + // as clean any static service providers and consumer resource. + this.getLogger().fine("Component " + this.getComponentName() + " shut down"); + } + /** + * create jmx object name for the extension mbean. default implementation does + * not required to have the extension mbean. + * @return ObjectName of the extension mbean + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * gets the reference to the extension mbean name. + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}getExtensionMBeanName() + * @return ObjectName of the extension mbean objectname or null if component + * does not support extension mbean + */ + public final ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = this.createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. default + * implementation does not require the extension mbean + * @return the ExtensionMBean implementation as StandardMBean + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * gets the reference to the extension mbean. + * @return extension mbean implementation or null if component does not support. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + * @throws JBIException on error registering mbean + */ + protected final void registerExtensionMBean() throws JBIException { + // creatre the extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server if any. + */ + protected final void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Extension MBean from MBeanServer for " + this.getComponentName(), e); + } + } + /** + * creates MessageExchangeReceiver implementation that handles receiving and processing + * the message exchanges from the delivery channel. Component should implement + * this method to provide the MessageReceiver. + * + * Component may return null indicating that they don't need the message receiver + * that can receive and process message exchanges from delivery channel. For example, + * components that have only service consumers which send a synchronous messages to + * providers don't need this. + * + * @throws java.lang.Exception + * @return MessageExchangeReceiver implementation. null if the component does not support it. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}createMessageExchangeReceiver + */ + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return null; + } + /** + * returns the message exchange receiver implementation reference + * @return MessageExchangeReceiver interface + */ + protected final MessageExchangeReceiver getMessageExchangeReceiver() { + if ( this.mMsgExchReceiver == null ) { + this.mMsgExchReceiver = createMessageExchangeReceiver(); + } + return this.mMsgExchReceiver; + } + /** + * creates a message receiver object as part of the component initialization. + * @throws javax.jbi.JBIException + */ + protected void initMessageExchangeReceiver() throws JBIException { + // create and initialize the MessageExchangeReceiver + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.initReceiver(); + } + } + /** + * allows the component to accept the message exchange objects from the + * delivery channel and process it as part of the component startup process. + * @throws javax.jbi.JBIException + */ + protected void startMessageExchangeProcessing() throws JBIException { + // start message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.startProcessing(); + } + } + /** + * stops the component from accepting the message exchange objects from the + * delivery channel as part of the component stop process + * @throws javax.jbi.JBIException + */ + protected void stopMessageExchangeProcessing() throws JBIException { + // stop message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.stopProcessing(); + } + } + /** + * removes the message receiver as part of the component shutdown process + * @throws javax.jbi.JBIException + */ + protected void shutdownMessageExchangeReceiver() throws JBIException { + // clean up message processing. + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.shutdownReceiver(); + } + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * initializes the RuntimeContext during component init lifecycle phase. This + * includes setting the ComponentContext and loggers etc. extended classes must + * save the component context in the RuntimeContext in this methods implementation. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}initGlobalContext + */ + protected void initGlobalContext() { + RuntimeContext.getInstance().setComponentContext(this.getComponentContext()); + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } + /** opens the delivery channel to accept or send message exchange objects + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}openDeliveryChannel + */ + protected void openDeliveryChannel() { + try { + DeliveryChannel channel = this.getComponentContext().getDeliveryChannel(); + RuntimeContext.getInstance().setDeliveryChannel(channel); + } catch (MessagingException ex) { + ex.printStackTrace(); + } + } + /** closes the delivery channel as part of the component shutdown process. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}closeDeliveryChannel + */ + protected void closeDeliveryChannel() { + // closes delivery channel and remove the reference. + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel != null ) { + channel.close(); + } + } catch (MessagingException ex) { + ex.printStackTrace(); + } finally { + RuntimeContext.getInstance().setDeliveryChannel(null); + } + } + /** + * chance to extended classes to do any extra component specific init tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * initialized here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}init method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}init + */ + protected void doInit() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific start tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * activated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}start method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}start + */ + protected void doStart() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific stop tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * deactivated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}stop method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}stop + */ + protected void doStop() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific shutdown tasks.If the component + * supports static service providers or consumers without deployment support, they can be + * cleaned up here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}shutdown method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}shutdown + */ + protected void doShutDown() throws JBIException { + //NOOP + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java new file mode 100644 index 000000000..7e44dc053 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java @@ -0,0 +1,275 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + /* + * ComponentInstaller.java + */ +package net.openesb.component.${artifactId}.common; + +import java.util.List; +import java.util.logging.Level; +import javax.jbi.component.Bootstrap; +import javax.jbi.component.InstallationContext; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.Bootstrap. This class implements + * the minimum required functionality for component installation contract + * of the jbi component in the jbi environment. It also takes care of maintaining + * the installation context reference and installation specific logger creation and + * installation extension mbean registration and unregistration during initialization + * and cleanup. Extended classes only need to supply the mbean name and its implementation + * object for the installation extensions. + * + * It makes sure that the installation context and the loggers are available to + * the classes extended from this class to add more installation specific functionality. + * + * Service engine or a binding component installation implementation can directly use + * this class or extend this class to add more functionality to their installation + * process. + * + * @see javax.jbi.Bootstrap + * @author chikkala + */ +public class ComponentInstaller implements Bootstrap { + /** default logger*/ + private Logger mDefLogger; + /** bootstrap logger */ + private Logger mBTLogger ; + /** Installation Context . */ + private InstallationContext mInstallationContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + + /** Constructor to create the ComponentInstaller. */ + public ComponentInstaller() { + } + /** + * @return InstallationContext of the component. + */ + public final InstallationContext getInstallationContext() { + return this.mInstallationContext; + } + protected String getComponentName() { + return (this.mInstallationContext != null) ? + this.mInstallationContext.getComponentName() : null; + } + /** + * @return logger initialized from the installation context or a default + * logger. + */ + protected Logger getLogger() { + // try init bootstrap logger + if (this.mBTLogger == null && this.mInstallationContext != null ) { + try { + this.mBTLogger = + this.mInstallationContext.getContext().getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mBTLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mBTLogger != null) ? this.mBTLogger : this.mDefLogger; + } + /** + * Initializes the installation environment for a component. + * @see javax.jbi.component.Bootstrap${symbol_pound}init(javax.jbi.component.InstallationContext) + */ + public final void init(InstallationContext installContext) throws javax.jbi.JBIException { + + if ( installContext == null ) { + throw new JBIException("Null Installation Context received in " + + "Component Bootstrap initialization"); + } + // save the installation context reference passed by the jbi framework. + this.mInstallationContext = installContext; + registerExtensionMBean(); // create and register extension mbean + doInit(); // do any other extra initialization required specific to the component installation. + // initialize logger + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component Installer initialized"); + } + /** + * default implementation just logs the method call. extended classes should override this. + * @see javax.jbi.component.Bootstrap${symbol_pound}onInstall() + */ + public void onInstall() throws javax.jbi.JBIException { + //TODO: do required initializaton and resource creation + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component installed."); + } + /** + * default implementation just logs the method call. + * @see javax.jbi.component.Bootstrap${symbol_pound}onUninstall() + */ + public void onUninstall() throws javax.jbi.JBIException { + //TODO: do clean up the resource and other stuff. + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component uninstalled"); + } + /** + * default noop implementation of the cleanup. + * @see javax.jbi.component.Bootstrap${symbol_pound}cleanUp() + */ + public final void cleanUp() throws javax.jbi.JBIException { + + unregisterExtensionMBean(); // unregister extension mbean and remove it + doCleanUp(); // do any other extra cleanup specific to the component installation. + this.getLogger().fine( this.mInstallationContext.getComponentName() + + " Component Installer Cleaned up"); + } + + /** + * create jmx object name for the extension mbean. Extended classes should + * return the component specific installer extension mbean name here. + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * default implementation that does not have extension mbean return null. + * @see javax.jbi.component.Bootstrap${symbol_pound}getExtensionMBeanName() + */ + public final javax.management.ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. Extended + * classes should return the installer extension mbean implementation as the + * standard mbean. + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * returns the installation extension mbean implementation. + * @return StandardMBean for the extension mbean implementation. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * Chance to extended classes to do the component installation specific init. + * Installation context will be initialized before calling this method. So, + * initialize other things if required in this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller${symbol_pound}init( + * javax.jbi.component.InstallationContext) + */ + protected void doInit() throws JBIException { + this.getLogger().info(this.getInstallationContext().getComponentName() + + " : Component Installer initialized"); + } + /** + * Chance to extended classes to do the component installation specific cleanup. + * ExtensionMbean will be unregistered before calling this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller${symbol_pound}cleanUp( + * javax.jbi.component.InstallationContext) + */ + protected void doCleanUp() throws JBIException { + this.getLogger().fine(this.getInstallationContext().getComponentName() + + " : Component Installer doCleanUp"); + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + */ + protected void registerExtensionMBean() throws JBIException { + // creatre the installation extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation if the object name is created. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Installation Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Installation Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server. + */ + protected void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Installation extension MBean for " + this.getComponentName(), e); + } + } + /** + * This method is called by the JBI runtime to allow a component to upgrade + * it's workspace and any existing Service Units to match the new version of + * the component. The JBI runtime copies the existing workspace root to the + * new workspace root prior to calling this method, so that the component + * can examine the contents of the workspace root to determine the version + * of the component from which the upgrade is being made. All updates to the + * workspace root are done in-place; in the event of a failure, the JBI + * runtime reverts back to the original workspace root, the original install + * root, and the original Service Unit roots for the component. + * + * Note1: The component must ensure that it never holds open references + * to any files in the workspace root or any of the Service Unit roots upon + * returning from this method. Failure to do so will cause problems when + * the runtime attempts to complete the upgrade processing. + * + * Note2: The installation context that is normally initialized + * by the runtime by calling ${symbol_pound}init method of the javax.jbi.Bootstrap interface + * before install and uninstall will not be called before calling this + * upgrade method. So, installation context can not be used in this method's + * implementation. + * + * Note3: Since there won't be any installation context available, the logger + * that returned from the ${symbol_pound}getLogger method is a default logger created using + * the package name of this class or extended class if the method is overridden + * in the extended class. + * + * @param workspaceRoot the workspace root for the new version of the + * component that will replace the currently installed version. This is + * populated with the contents of the original workspace root and the + * component must update it to match the new version of the component. + * @param serviceUnitRoots a list of directory paths to all of the Service + * Units currently deployed to the component. The component must update all + * of these to match the new version of the component. + * @exception JBIException when there is an error requiring that the upgrade + * be terminated. + */ + public void upgrade(String workspaceRoot, List serviceUnitRoots) + throws javax.jbi.JBIException + { + //TODO: override this method in the extended class to handle the + // workspace root and service unit roots upgrade according to the + // component's requirement. + this.getLogger().fine("Default upgrade implementation. " + + "TODO: Implement workspace root and service unit roots upgrade."); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java new file mode 100644 index 000000000..5c32ce274 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java @@ -0,0 +1,174 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ComponentRuntime.java + */ +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Logger; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.servicedesc.ServiceEndpoint; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; + +/** + * This class implements javax.jbi.component.Component interface which is + * responsible for creating the Component Lifecycle implementation and the + * ServiceUnitManager implementation for the jbi component. + * + * This class makes sure that non null component lifecycle implementation is + * returns by this class or any classes extended from this class which is + * required as a component contract. It also provides default implementation of + * all methods of the Component interface which the extended classes can + * override to add more functionality. + * + * @see javax.jbi.component.Component + * @author chikkala + */ +public class ComponentRuntime implements Component { + /** Component LifeCycle implementation */ + private ComponentLifeCycle mLifeCycle; + /** ServiceUnitManager implementation */ + private ServiceUnitManager mSUManager; + /** default logger*/ + private Logger mDefLogger; + + /** Creates a new instance of ComponentImpl */ + public ComponentRuntime() { + this.mLifeCycle = null; + this.mSUManager = null; + } + /** + * returns the ComponentContext. Any component runtime class extended from + * this class can override this method to return their own reference to the + * ComponentContext. + * @return ComponentContext component context. + */ + public ComponentContext getComponentContext() { + ComponentContext ctx = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + ctx = ((BasicComponentLifeCycle) this.mLifeCycle).getComponentContext(); + } + return ctx; + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + public Logger getLogger() { + Logger logger = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + logger = ((BasicComponentLifeCycle) this.mLifeCycle).getLogger(); + } + // init default logger if required + if ( logger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (logger != null) ? logger : this.mDefLogger; + } + /** + * return the ComponentLifeCycle implementation. if returned null, the + * ComponentLifeCycleImpl will be used as the component lifecycle + * Extended classes can override this method and do their own ComponentLifecyle + * specific creation. + */ + protected ComponentLifeCycle createComponentLifeCycle() { + return new BasicComponentLifeCycle(this); + } + /** + * Get the life cycle control interface for this component. + * + * @return the life cycle control interface for this component + * @see javax.jbi.Component${symbol_pound}getLifeCycle() + */ + public final ComponentLifeCycle getLifeCycle() { + if ( this.mLifeCycle == null ) { + this.mLifeCycle = createComponentLifeCycle(); + if ( this.mLifeCycle == null ) { + this.getLogger().fine("Creating basic component lifecycle implemenation"); + // use the default ComponentLifeCycle Impl if a component + // specific implementation return null in createComponentLifeCycle. + this.mLifeCycle = new BasicComponentLifeCycle(this); + } + } + return this.mLifeCycle; + } + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. + * Extended classes can override this method and do their own ServiceUnitManager + * specific creation. + */ + protected ServiceUnitManager createServiceUnitManager() { + return null; + } + /** + * Get the Service Unit manager for this component. + * + * @return the ServiceUnitManager for this component, or + * null if there is none. + * @see javax.jbi.Component${symbol_pound}getServiceUnitManager() + */ + public final ServiceUnitManager getServiceUnitManager() { + if ( this.mSUManager == null ) { + this.mSUManager = createServiceUnitManager(); + } + return this.mSUManager; + } + /** + * Retrieves a DOM representation containing metadata which describes the + * service provided by this component, through the given endpoint. + * + * Default implementation does not support service description. + * + * @see javax.jbi.Component${symbol_pound}getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint) + */ + public Document getServiceDescription(ServiceEndpoint serviceEndpoint) { + return null; + } + /** + * This method is called by JBI to check if this component, in the role of + * provider of the service indicated by the given exchange, can actually + * perform the operation desired. + * + * Default implementation has no policy and allows all exchanges with consumer. + * + * @see javax.jbi.Component${symbol_pound}isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithConsumerOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * This method is called by JBI to check if this component, in the role of + * consumer of the service indicated by the given exchange, can actually + * interact with the provider properly. The provider is described by the + * given endpoint and the service description supplied by that endpoint. + * + * Default implementation has no policy and allows all exchanges with provider. + * + * @see javax.jbi.Component${symbol_pound}isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithProviderOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * Resolve the given endpoint reference. + * + * Default implementation does not have any XML dialect. So can not resolve the + * endpoint from the document fragment. + * + * @see javax.jbi.Component${symbol_pound}resolveEndpointReference(org.w3c.dom.DocumentFragment) + */ + public ServiceEndpoint resolveEndpointReference(DocumentFragment documentFragment) { + return null; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java new file mode 100644 index 000000000..51c85bc6e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java @@ -0,0 +1,180 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * DefaultMessageExchangeReceiver.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; + +/** + * This class implements MessageExchangeReceiver interface. This is a default implementation that + * demonstrates the multi-threaded environment to receive and process message exchanges from the + * delivery channel. It uses a main thread to receive message exchanges from the delivery channel + * and then processes the received message exchanges in a individual threads from the thread pool. + * The controller methods of MessageExchangeReceiver controls the main thread and the thread pool + * execution. + * + * @author chikkala + */ +public class DefaultMessageExchangeReceiver implements MessageExchangeReceiver { + + /** delivery channel accept time out */ + private final static long DC_ACCEPT_TIME_OUT = 3000; // milliseconds + /** receiver thread wait time before polling for messages after woke up **/ + private final static long RECEIVER_WAIT_TIME = 2000; // milliseconds + /** receiver thread wait time before force shutdown */ + private final static long RECEIVER_SHUTDOWN_WAIT_TIME = 10; // seconds + /** handler threads wait time before forced shutdown */ + private final static long HANDLERS_SHUTDOWN_WAIT_TIME = 30; // seconds + /** handler thread pool size */ + private final static int HANDLER_THREAD_POOL_SIZE = 5; + /** receiver thread accept message exchange condition */ + private Boolean mCanAccept = false; + /** receiver thread termination condition */ + private Boolean mContinue = true; + /** receiver thread executor service */ + private ExecutorService mReceiverThreadMgr; + /** handler thread executor service */ + private ExecutorService mHandlerThreadPool; + + /** no default constructor for extended classes */ + public DefaultMessageExchangeReceiver() { + } + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + public final void initReceiver() throws JBIException { + + this.mHandlerThreadPool = Executors.newFixedThreadPool(HANDLER_THREAD_POOL_SIZE); + this.mReceiverThreadMgr = Executors.newSingleThreadExecutor(); + + this.mReceiverThreadMgr.execute(new Runnable() { + public void run() { + Thread t = Thread.currentThread(); + while ( mContinue ) { + if (mCanAccept) { + receiveAndProcessMessageExchange(); + } else { + try { + t.sleep(RECEIVER_WAIT_TIME); + } catch (InterruptedException interruptException) { + // someone must have interrupted this thread + // do nothing + RuntimeHelper.logDebug("Interrupted the MessageReceiverThread in Sleep"); + } + } + } + } + }); + } + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + public final void shutdownReceiver() throws JBIException { + + synchronized ( mContinue ) { + mContinue = false; + } + boolean terminated = false; + try { + this.mReceiverThreadMgr.shutdown(); + terminated = this.mReceiverThreadMgr.awaitTermination( + RECEIVER_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Message Receiver not shutdown. Forcing shutdown"); + this.mReceiverThreadMgr.shutdownNow(); + } + } + shutdownHandlers(); + } + /** + * shutdown all the working threads from the thread pool. + */ + private final void shutdownHandlers() throws JBIException { + + boolean terminated = false; + try { + this.mHandlerThreadPool.shutdown(); + terminated = this.mHandlerThreadPool.awaitTermination( + HANDLERS_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Handler threads not shutdown. Forcing shutdown"); + this.mHandlerThreadPool.shutdownNow(); + } + } + } + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + public final void startProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = true; + } + } + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + public final void stopProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = false; + } + } + + protected MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + private void receiveAndProcessMessageExchange() { + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel == null ) { + RuntimeHelper.logDebug("DeliveryChannel Not Opened for receiving messages"); + return; + } + final MessageExchange msgExchange = channel.accept(DC_ACCEPT_TIME_OUT); + if ( msgExchange == null ) { + // delivery channel timeout occurred. do nothing. + // RuntimeHelper.logDebug("DeliveryChannel returned null message exchange from accept"); + return; + } + final ExchangeStatus status = msgExchange.getStatus(); + // process message exchange in a separate thread + this.mHandlerThreadPool.execute(new Runnable() { + public void run() { + getMessageExchangeSupport().fireMessageExchangeReceived(status, msgExchange); + } + }); + + } catch (MessagingException ex) { + RuntimeHelper.logWarning(ex); + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java new file mode 100644 index 000000000..fed6c987d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeHandler.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface is a Handler to perform message exchanges when the component + * receives the MessageExchange object from the delivery channel. + * Implementation of this interface should implement the processing of + * the active, error, done status of the MessageExchange object according to + * the MEP for which the MessageExchange object is created. + * + * @author chikkala + */ +public interface MessageExchangeHandler { + /** + * this method will be invoked to process the MessageExchange + * object. + * @param msgExchange MessageExchange object to process. + */ + void processMessageExchange(ExchangeStatus status, MessageExchange msgExchange); + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java new file mode 100644 index 000000000..c27c1f221 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java @@ -0,0 +1,36 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeListener.java + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface defines the notification mechanism with which the message exchange object received + * from the delivery channel is processed by the interesting parties. A particular service endpoint + * implementation would first register the implementation of this interface with MessageExchangeSupport + * to get the notification of a received message exchange on a particular service endpoint and the + * implementation of the interface would process the message exchange when notified. + * + * When the com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver receives the message exchange + * object, it asks the MessageExchangeSupport to notify the MessageExchangeLister that is registered for the + * received message exchange object to process the message exchange object. + * @see com.sun.jbi.sample.component.common.MessageExchangeSupport + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public interface MessageExchangeListener { + /** + * MessageExchangeSupport will call this method to notify the lister implementation that a + * message exchange is received from the delivery channel. + * @param me MessageExchange Object + */ + void messageExchangeReceived(ExchangeStatus status, MessageExchange me); +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java new file mode 100644 index 000000000..607146abd --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeReceiver.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.JBIException; + +/** + * This interface provides the methods can controls the receiving and processing of the message + * exchange objects from the delivery channel during the component lifecycle operations. + * The implementation of this interface can use multi-threaded environment to receive and process + * message exchanges from the delivery channel during the component lifecycle. + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @author chikkala + */ +public interface MessageExchangeReceiver { + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + void initReceiver() throws JBIException; + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + void startProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + void stopProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + void shutdownReceiver() throws JBIException; + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java new file mode 100644 index 000000000..bddf9a8b1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java @@ -0,0 +1,170 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeSupport.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.xml.namespace.QName; + +/** + * This class supports the registering and unregistering MessageExchangeListeners and the + * MessageExchangeHandlers that can be used to process the received message exchange from a + * delivery channel. A global reference to this class will be created in RuntimeContext object to + * provide access to this class from any where in the component runtime. + * + * A ProviderEndpoint or ConsumerEndpoint interested in a MessageExchange received from a delivery + * channel for a particular service endpoint will register the MessageExchangeListener with this + * class. The DefaultMessageExchangeReceiver when received a message exchange object from the delivery + * channel uses MessageExchangeSupport.processMessageExchange method to notify the registered listener. + * + * The MessageExchangeListener implementation ( ProviderEndpoint or ConsumerEndpoint ) while processing + * received message ( messageExchangeReceived()) will create and register the message exchange handlers + * to process the message exchange. + * + * @see RuntimeContext${symbol_pound}getMessageExchangeSupport + * @see RuntimeHelper${symbol_pound}getMessageExchangeSupport + * @see DefaultMessageExchangeReceiver${symbol_pound}receiveAndProcessMessageExchange + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public class MessageExchangeSupport { + /** listener map to notify a message exchange received event */ + private Map mListeners; + /** handlers that can process the message exchange */ + private Map mHandlers; + /** Creates a new instance of MessageExchangeSupport */ + public MessageExchangeSupport() { + this.mListeners = Collections.synchronizedMap(new HashMap()); + this.mHandlers = Collections.synchronizedMap(new HashMap()); + } + /** + * generates key that will be used to store the MessageExchangeListener objects. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public String createListenerKey(Role role, QName interfaceName, QName serviceName, String endpointName) { + + StringBuffer strBuff = new StringBuffer(); + strBuff.append(interfaceName).append("+"); + strBuff.append(serviceName).append("+"); + strBuff.append(endpointName).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(role) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(role) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + /** + * adds message exchange listener who are interested in receiving the notification when the + * message exchange is received from delivery channel. The listener can be registered with the + * following combination of the parameters: (role,interfaceName,serviceName, endpointName), + * (role,interfaceName,null, null), (role, null,serviceName, endpointName), (role, null,serviceName, null) + * + * @param role role of the message exchange listener PROVIDER or CONSUMER - can not be null. + * @param interfaceName QName of the interface ( protType ) - can be null if the serviceName is not null + * @param serviceName QName of the service - can be null if interfaceName is not null. + * @param endpointName endpoint name of the service. - can be null if the serviceName is not null. + * @param listener MessageExchangeListener object + */ + public synchronized void addMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName, MessageExchangeListener listener) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + this.mListeners.put(key, listener); + } + /** + * removes any message exchange listener registered for the service endpoint specified by the serviceName and + * endpoint name. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public synchronized void removeMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + MessageExchangeListener listener = this.mListeners.remove(key); + if ( listener == null ) { + RuntimeHelper.getLogger().fine("No message exchange listener removed with key " + key); + } + } + /** + * finds the MessageExchangeListner registers for the endpoint for which the message exchange is + * received and call the method on the listener + */ + public boolean fireMessageExchangeReceived(ExchangeStatus status, MessageExchange me) { + boolean notified = false; + Role role = me.getRole(); + QName interfaceName = me.getInterfaceName(); + QName serviceName = me.getEndpoint().getServiceName(); + String endpointName = me.getEndpoint().getEndpointName(); + // lookup with complete service description ( role + interface + service + endpoint ) + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + MessageExchangeListener listener = this.mListeners.get(key); + + if ( listener == null ) { // lookup with role+interface name + key = createListenerKey(role, interfaceName, null, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with role + serviceName + endpointName + key = createListenerKey(role, null, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with with role + serviceName + key = createListenerKey(role, null, serviceName, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { + RuntimeHelper.getLogger().fine("Could not find listener for message exchange" + me); + notified = false; + } else { + listener.messageExchangeReceived(status,me); + notified = true; + } + return notified; + } + /** + * registers the MessageExchangeHandler implementation against the message exchange id. + * @param me MessageExchange for which the handler need to be assigned + * @param handler MessageExchangeHandler implementation that will be registers. + */ + public synchronized void addMessageExchangeHandler(MessageExchange me, MessageExchangeHandler handler) { + this.mHandlers.put(me.getExchangeId(), handler); + } + /** + * removes the MessageExchangeHandler for the particular message exchange object + */ + public synchronized void removeMessageExchangeHandler(MessageExchange me) { + MessageExchangeHandler handler = this.mHandlers.remove(me.getExchangeId()); + if ( handler == null ) { + RuntimeHelper.getLogger().fine("No MessageExchangeHandler found for removing " + me.getExchangeId()); + } + } + /** + * looks up the registered message exchange handler for the message exchange object + * @param me MessageExchangeHandler. + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(MessageExchange me) { + return this.mHandlers.get(me.getExchangeId()); + } + /** + * looks up the registered message exchange handler for the message exchange object with Id + * @param exchangeId message exchange object's id + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(String exchangeId) { + return this.mHandlers.get(exchangeId); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java new file mode 100644 index 000000000..be75c7b7d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java @@ -0,0 +1,176 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * RuntimeContext.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; + +/** + * This class is global context for all the component runtime to store and + * retrieve the information that should be available anywhere in the component runtime. + * + * Each instance variable of this class will be initialized at various points of the + * component runtime using setter methods on this class. + * + * The two important objects that will be initialized and available from this context are + * ComponentContext and the opened DeliveryChannel objects both of which will be set from the + * implementation {@link BasicComponentLifeCycle}. + * + * Note that the ComponentContext from this global context will not be available until + * the jbi framework calls the init method of the ComponentLifeCycle of the component and + * then intern the implementation of the init method sets the context. + * + * @see BasicComponentLifeCycle${symbol_pound}initGlobalContext + * @see BasicComponentLifeCycle${symbol_pound}openDeliveryChannel + * @see BasicComponentLifeCycle${symbol_pound}closeDeliveryChannel + * @author chikkala + */ +public final class RuntimeContext { + /** RuntimeContext singleton instance */ + private static RuntimeContext sRuntimeContext; + /** default logger*/ + private Logger mDefLogger; + /** Logger object. */ + private Logger mLogger; + /** Holds value of property ComponentContext. */ + private ComponentContext mComponentContext; + /** Holds value of property DeliveryChannel. */ + private DeliveryChannel mDeliveryChannel; + /** MessageExchange processing support **/ + private MessageExchangeSupport mMESupport; + + /** outside code can not instantiate RuntimeContext */ + private RuntimeContext() { + } + /** + * @return RuntimeContext instance. + */ + public static RuntimeContext getInstance() { + if ( sRuntimeContext == null ) { + synchronized (RuntimeContext.class) { + if ( sRuntimeContext == null ) { + sRuntimeContext = new RuntimeContext(); + } + } + } + return sRuntimeContext; + } + /** + * Getter for to obtaining ComponentContext from any where in the component runtime. + * @return ComponentContext. + */ + public ComponentContext getComponentContext() { + return this.mComponentContext; + } + /** + * Sets the Component context reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle${symbol_pound}initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle${symbol_pound}initContext + * for details. + * @param componentContext New value of property ComponentContext. + * @see BasicComponentLifeCycle${symbol_pound}initGlobalContext + */ + public void setComponentContext(ComponentContext componentContext) { + if ( this.mComponentContext != null ) { + (new IllegalStateException("Component Context already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mComponentContext = componentContext; + } + /** + * Getter for obtaining opened delivery channel from any where in the component runtime. + * @return DeliveryChannel. + */ + public DeliveryChannel getDeliveryChannel() { + return this.mDeliveryChannel; + } + /** + * Sets the opened delivery channel reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle${symbol_pound}initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle${symbol_pound}initContext + * for details. + * + * @param componentContext New value of property ComponentContext. + */ + public void setDeliveryChannel(DeliveryChannel deliveryChannel) { + if ( deliveryChannel != null && this.mDeliveryChannel != null ) { + (new IllegalStateException("Delivery Channel already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mDeliveryChannel = deliveryChannel; + } + /** + * Sets the logger. + * + * @param name name for the Logger. + * @param resourceBundle resource bundle for the logger. can be null. + */ + public void setLogger(String name, String resourceBundle) { + + if (this.mComponentContext != null) { + // get the logger from component context if the component context is not null + try { + this.mLogger = this.mComponentContext.getLogger(name, resourceBundle); + } catch (Exception ex) { + ex.printStackTrace(); + } + } else { + this.mDefLogger = Logger.getLogger(name, resourceBundle); + } + } + /** + * Returns the logger. + * + * @return Logger + */ + public Logger getLogger() { + + // try init logger + if (this.mLogger == null && this.mComponentContext != null ) { + try { + this.mLogger = + this.mComponentContext.getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mLogger != null) ? this.mLogger : this.mDefLogger; + } + /** + * Returns the Component Name if the ComponentContext is set. else null + * @return component name + */ + public String getComponentName() { + String componentName = null; + if (this.mComponentContext != null) { + componentName = this.mComponentContext.getComponentName(); + } + return componentName; + } + /** + * Global MessageExchangeSupport reference. Various classes in the common + * component runtime would use this method to obtain the MessageExchangeSupport + * for processing message exchange objects received from delivery channel. + */ + public MessageExchangeSupport getMessageExchangeSupport() { + if ( this.mMESupport == null ) { + this.mMESupport = new MessageExchangeSupport(); + } + return this.mMESupport; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java new file mode 100644 index 000000000..f12c2b2f4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java @@ -0,0 +1,360 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * RuntimeHelper.java + */ + +package net.openesb.component.${artifactId}.common; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * This is a helper class that have bunch of methods for xml processing. + * @author chikkala + */ +public class RuntimeHelper { + + public static Logger getLogger() { + return RuntimeContext.getInstance().getLogger(); + } + + public static void logWarning(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.WARNING, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().warning(logObj.toString()); + } + } + + public static void logError(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.SEVERE, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().severe(logObj.toString()); + } + } + + public static void logDebug(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.FINER, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().finer(logObj.toString()); + } + } + + public static String getComponentName() { + return RuntimeContext.getInstance().getComponentName(); + } + public static ComponentContext getComponentContext() { + return RuntimeContext.getInstance().getComponentContext(); + } + public static DeliveryChannel getDeliveryChannel() { + return RuntimeContext.getInstance().getDeliveryChannel(); + } + + public static MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeContext.getInstance().getMessageExchangeSupport(); + } + + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(Reader xmlReader) throws Exception { + InputSource xmlSource = new InputSource(xmlReader); + return buildDOMDocument(xmlSource); + } + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(InputSource xmlSource) throws Exception { + Document xmlDoc = null; + DocumentBuilderFactory docBuilderFactory = + DocumentBuilderFactory.newInstance(); + docBuilderFactory.setValidating(false); + docBuilderFactory.setNamespaceAware(true); + DocumentBuilder docBuilder = + docBuilderFactory.newDocumentBuilder(); + docBuilder.setErrorHandler( new DefaultHandler() { + public void fatalError(SAXParseException e) + throws SAXException { + throw new SAXException(e.getMessage()); + } + }); + + docBuilder.setEntityResolver(new EntityResolver() { + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + StringReader reader = + new StringReader(""); // NOI18N + InputSource source = new InputSource(reader); + source.setPublicId(publicId); + source.setSystemId(systemId); + return source; + } + }); + + xmlDoc = docBuilder.parse(xmlSource); + + return xmlDoc; + } + /** + * reads xml text from DOMSource to StringBuffer + */ + public static StringBuffer readFromDOMSource(DOMSource domSource) { + + StringWriter writer = new StringWriter(); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer trans = null; + try { + trans = tFactory.newTransformer(); + trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, + "yes"); + trans.setOutputProperty(OutputKeys.INDENT, "yes"); + StreamResult result = new StreamResult(writer); + trans.transform(domSource, result); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads the xml text from InputSource into a StringBuffer + */ + public static StringBuffer readFromInputSource(InputSource inSource) { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + InputStream inStream = inSource.getByteStream(); + Reader reader = inSource.getCharacterStream(); + if ( reader == null ) { + reader = new InputStreamReader(inStream); + } + BufferedReader buff = new BufferedReader(reader); + try { + + for ( String line = null; (line = buff.readLine()) != null ; ) { + out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads xml from from DOM, SAX or Stream Source into a string buffer + */ + public static StringBuffer readFromSource(Source source) { + if ( source instanceof DOMSource ) { + return readFromDOMSource((DOMSource)source); + } else { + InputSource inSource = SAXSource.sourceToInputSource(source); + if ( inSource != null ) { + return readFromInputSource(inSource); + } else { + return null; + } + } + } + /** + * creates a DOMSource from the xml text read from the reader. + */ + public static DOMSource createDOMSource(Reader xmlReader) { + Document doc = null; + try { + doc = buildDOMDocument(xmlReader); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * creates a DOMSource from any source. If the source itself is DOMSource, + * the source is returned as it is as DOMSource. + */ + public static DOMSource sourceToDOMSource(Source source) { + if ( source instanceof DOMSource) { + return (DOMSource) source; + } + InputSource xmlSource = SAXSource.sourceToInputSource(source); + Document doc = null; + try { + doc = buildDOMDocument(xmlSource); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * converts the ex stracktrace to string. + */ + public static StringBuffer getExceptionStackTrace(Exception ex) { + StringWriter strWriter = new StringWriter(); + if ( ex != null ) { + PrintWriter out = new PrintWriter(strWriter); + ex.printStackTrace(out); + } + return strWriter.getBuffer(); + } + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsXmlText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + String exXmlText = + "" + + "" + message + "" + + "" + stackTrace + "" + + "" ; + return exXmlText; + } + + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + StringBuffer buff = new StringBuffer(); + buff.append(message); + buff.append(System.getProperty("line.separator", "${symbol_escape}n")); + buff.append(stackTrace); + return buff.toString(); + } + + + /** + * For attribute values which denote a QName, i.e. include a namespace prefix, + * resolve the value into a QName. + * If a namespace can not be resolved, it is set to empty - it does not + * result in an exception + * @param attrValue the string value of the attribute + * @param element the element the attribute belongs to + */ + public static QName resolveAttrQName(String attrValue, Element element) { + int aColonLoc = attrValue.indexOf(":"); + String aLocalName = attrValue; + String aPrefix = null; + String aNS = null; + if (aColonLoc > -1) { + aPrefix = attrValue.substring(0, aColonLoc); + aLocalName = attrValue.substring(aColonLoc + 1); + + // Traverse up the hierarchy until a namespace definition is found + // or the top of the document is reached. + Node currNode = element; + while ((aNS == null || aNS.equals("")) && currNode != null) { + if (currNode.getNodeType() == Node.ELEMENT_NODE) { + aNS = ((Element) currNode).getAttribute("xmlns:" + aPrefix); + } + currNode = currNode.getParentNode(); + } + } + + QName qName = new QName(aNS, aLocalName, aPrefix); + + return qName; + } + + /** + * replaces the xml entity references with the xml escape chars + * @param xmlString Text with the xml escape chars + * @param Text with the xml entity references + */ + public static String replaceXmlEscapeCharsToEntityRefereces(String xmlString) { + if ( xmlString == null ) { + return xmlString; + } + + // just convert < , > and & only + StringBuffer sbuff = new StringBuffer(2 * xmlString.length()); + for ( int i = 0; i < xmlString.length(); ++i ) { + switch ( xmlString.charAt(i) ) { + case '&': sbuff.append("&"); + break; + case '<': sbuff.append("<"); + break; + case '>': sbuff.append(">"); + break; + default: sbuff.append( xmlString.charAt(i) ); + } + } + return sbuff.toString(); + } + + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + + public static Element getElement(DOMSource domSource) { + return getElement(domSource.getNode()); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java new file mode 100644 index 000000000..fd0fc4f79 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java @@ -0,0 +1,312 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractServiceUnitManager.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.management.DeploymentException; + +/** + * This is an abstract class that implements {@link javax.jbi.component.ServiceUnitManager} to provide a + * service unit deployment support for the component. The implementation supported by this service + * unit manager and related classes in this package provides WSDL1.1 based service unit deployment + * in the component. + * + * @see javax.jbi.component.ServiceUnitManager + * @see ServiceUnit + * + * @author chikkala + */ +public abstract class AbstractServiceUnitManager implements ServiceUnitManager { + + /** Map of ServiceUnit Name to the ServiceUnit Object for all the service units + * deployed in the component */ + private Map mSUMap; + + /** Creates a new instance of AbstractSUManager */ + protected AbstractServiceUnitManager() { + this.mSUMap = Collections.synchronizedMap(new HashMap()); + } + /** returns the component name + * @return component name. + */ + protected abstract String getComponentName(); + /** + * @return Logger + */ + protected abstract Logger getLogger(); + /** + * returns the creation of the ServiceUnit implementation specific to the service unit deployment + * for the component. + * @param suName service unit name + * @param suRootPath service unit root path + * @param concrete implementation of the ServiceUnit class. + */ + protected abstract ServiceUnit createServiceUnit(String suName, String suRootPath) + throws DeploymentException; + /** + * returns the service unit object deployed by the specified name. or null if not deployed. + * @param suName service unit name to look for + * @param ServiceUnit object for the suName. or null if not present. + */ + private ServiceUnit getServiceUnit(String suName) { + return this.mSUMap.get(suName); + } + /** + * lookup for the deployed service unit. If not there, throws a deployment exception. + * @param suName service unit name + * @return ServiceUnit object + * @throws DeploymentException if the service unit is not present. + */ + private ServiceUnit findServiceUnit(String suName) throws DeploymentException { + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return serviceUnit; + } + /** + * add the service unit object to the list of deployed service units. if there is already a + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is added. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit addServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + this.mSUMap.put(suName, su); + return su; + } + /** + * removes service unit object from the list of deployed service units. if there is no + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is being removed. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit removeServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return this.mSUMap.remove(suName); + } + /** + * creates the concrete service unit implementation and calls the load method on it to initialize + * the created service unit. + * @param suName service unit name to create + * @param suRootPath service unit root path. + * @return ServiceUnit that is created and loaded. + */ + private ServiceUnit loadServiceUnit(String suName, String suRootPath) throws DeploymentException { + ServiceUnit serviceUnit = createServiceUnit(suName, suRootPath); + serviceUnit.doLoad(); + return serviceUnit; + } + /** + * deploys a service unit. it creates and loads the service unit object for the suName and then call + * doDeploy on the service unit and adds it to the deployed service unit list + * @return result as jbi management xml + * @throws DeploymentException if there is an error deploying. + */ + private synchronized String deployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + ServiceUnit serviceUnit = loadServiceUnit(suName, suRootPath); + serviceUnit.doDeploy(); + addServiceUnit(serviceUnit); + return result; + } + /** + * Deploy a Service Unit to the component. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}deploy(String, String); + */ + public final String deploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Deploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully deployed service unit " + suName; + Exception errEx = null; + try { + deployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to deploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, ex); + } + return createComponentTaskResultXML(compName, "deployTask", isSuccess, mainMsg, errEx); + } + + /** + * undeploys the service unit. it looks up the existing deployed service unit and call doUndeploy + * on it and then removes from the deployed service unit list. + */ + private synchronized String undeployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit serviceUnit = findServiceUnit(suName); + serviceUnit.doUndeploy(); + removeServiceUnit(serviceUnit); + return result; + } + /** + * Undeploy a service unit from the component. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}undeploy(String, String); + */ + public final String undeploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Undeploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully undeployed service unit " + suName; + Exception errEx = null; + try { + undeployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to undeploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, errEx); + } + return createComponentTaskResultXML(compName, "undeployTask", isSuccess, mainMsg, errEx); + } + /** + * Initialize the given deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}init(String, String); */ + public final void init(String suName, String suRootPath) + throws DeploymentException { + this.getLogger().fine("Initializing service unit " + suName + " with suRootPath " + suRootPath); + String result = suName; + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { // if the service unit not exists, create and add + serviceUnit = loadServiceUnit(suName, suRootPath); // create and load service unit + addServiceUnit(serviceUnit); // add service unit to existing service units + } + serviceUnit.doInit(); // Do Service unit initialization tasks + this.getLogger().fine("Service unit initialized:" + suName); + } + /** + * Shut down the deployment. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}shutdown(String); + */ + public final void shutDown(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doShutdown(); // Do Service unit shutdown tasks + this.getLogger().fine("Service unit shut down:" + suName); + } + /** + * Start the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}start(String); + */ + public final void start(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStart(); // Do service unit start tasks. + this.getLogger().fine("Service unit started:" + suName ); + } + /** + * Stop the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}stop(String); + */ + public final void stop(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStop(); // do service unit stop tasks + this.getLogger().fine("Service unit stopped: " + suName + " stopped."); + } + + /** + * helper method to create result message as jbi management message xml. + * @param componentName name of the component for this xml. + * @param taskId task id + * @param isSuccess true to format a success result, false to format a failed result. + * @param mainMsg main result message + * @param errEx Exception, null if there is no exception in failure message. + * @return XML string. + */ + protected static String createComponentTaskResultXML( + String componentName, String taskId, boolean isSuccess, String mainMsg, Exception errEx ) { + + String exMsgXml = getComponentTaskResultExceptionXML(errEx); + String mainMsgXmlEsc = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces(mainMsg); + String taskResult = isSuccess ? "SUCCESS" : "FAILED"; + String msgType = isSuccess ? "INFO" : "ERROR"; + + String xmlResult = + "" + + " " + componentName + "" + + " " + + " " + + " " + taskId + "" + + " " + taskResult + "" + + " " + msgType + "" + + " " + + " " + + " SU_MGR_MSG_ID" + + " " + mainMsgXmlEsc + "" + + " " + + " " + + exMsgXml + + " " + + " " + + ""; + + return xmlResult; + } + /** + * converts the exception to the jbi management message xml chunk. + */ + private static String getComponentTaskResultExceptionXML(Exception errEx) { + StringBuffer exMsgBuff = new StringBuffer(); + if ( errEx == null ) { + return exMsgBuff.toString(); // empty string. + } + + List exList = new ArrayList(); + int exLevel = 0; + for ( Throwable cause = errEx ; cause != null ; cause = cause.getCause() ) { + String causeMsg = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + cause.getMessage()); + StringWriter stBuff = new StringWriter(); + PrintWriter stOut = new PrintWriter(stBuff); + StackTraceElement[] stList = cause.getStackTrace(); + for (StackTraceElement stEl : stList) { + stOut.println(stEl.toString()); + } + stOut.close(); + String causeStackTrace = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + stBuff.getBuffer().toString()); + + exMsgBuff.append(""); + exMsgBuff.append(" " + exLevel + ""); + exMsgBuff.append(" " + "SU_MGR_EXP_ID"); + exMsgBuff.append(" " + causeMsg + ""); + exMsgBuff.append(" "); + exMsgBuff.append(" " + causeStackTrace + ""); + exMsgBuff.append(""); + ++exLevel; + } + + return exMsgBuff.toString(); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java new file mode 100644 index 000000000..e9537ca9e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java @@ -0,0 +1,208 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ConsumerEndpoint.java + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.messaging.MessageExchangeFactory; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service consumer. {@link ServiceUnit${symbol_pound}createConsumerEndpoint} creates the object of this + * type to implement the service consumer functionality. + * + * @see ServiceUnit${symbol_pound}createConsumerEndpoint + * @author chikkala + */ + +public class ConsumerEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with CONSUMER role and makes sure that the service + * description passed to it is of consumer description. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(Role.CONSUMER, consumes, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef) { + this(consumes, wsdlDef, null); + } + public final void init() throws JBIException { + getLogger().fine("ConsumerEndpoint: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + public final void activate() throws JBIException { + getLogger().fine("ConsumerEndpoint: activate called"); + //1. do common ativation tasks. + doActivate(); //2. do any other activation related tasks. + } + + public final void deactivate() throws JBIException { + getLogger().fine("ConsumerEndpoint: deactivate called"); + //1. do common deactivation tasks. + doDeactivate(); //2. do any other deactivation related tasks. + } + + public final void clean() throws JBIException { + getLogger().fine("ConsumerEndpoint: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + + /** + * helper method to find the active ServiceEndpiont for the service described with the + * serviceDescriptor. This method looks for the Active ServiceEndpoint using interface or + * service name or service name and the endpoint name. + */ + public ServiceEndpoint findServiceEndpoint() { + + QName serviceType = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + + ServiceEndpoint [] refs = null; + ServiceEndpoint serviceEndpoint = null; + ComponentContext compContext = this.getComponentContext(); + + if ( compContext == null ) { + this.getLogger().info("Null Component context. Can not find ServiceEndpoint"); + return null; + } + // lookup ServiceEndpiont with concrete service(serice qname + endpoint name). + if ( serviceName != null && endpointName != null ) { + this.getLogger().info("Looking for ServiceEndpoint with:" + + " ServiceName: " + serviceName + " EndpointName: " + endpointName); + serviceEndpoint = compContext.getEndpoint(serviceName, endpointName); + } + // else lookup ServiceEndpiont with Service Name + if ( serviceEndpoint == null && serviceName != null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service name: " + serviceName); + refs = compContext.getEndpointsForService(serviceName); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + // else lookup ServiceEndpont with serviceType + if ( serviceEndpoint == null && serviceType != null && + serviceName == null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service type: " + serviceType); + refs = compContext.getEndpoints(serviceType); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + + return serviceEndpoint; + } + + /** + * this method creates a InOutMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOut createInOutMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for ${symbol_escape}n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOut inOutME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOutME = factory.createInOutExchange(); + // set operation + inOutME.setOperation(operation); + // set interface if that is not set + if ( inOutME.getInterfaceName() == null ) { + inOutME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOutME.createMessage(); + // set IN Normalized message on message exchange + inOutME.setInMessage(inMsg); + + return inOutME; + } + + /** + * this method creates a InOnlyMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOnly createInOnlyMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for ${symbol_escape}n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOnly inOnlyME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOnlyME = factory.createInOnlyExchange(); + // set operation + inOnlyME.setOperation(operation); + // set interface if that is not set + if ( inOnlyME.getInterfaceName() == null ) { + inOnlyME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOnlyME.createMessage(); + // set IN Normalized message on message exchange + inOnlyME.setInMessage(inMsg); + + return inOnlyME; + } + + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java new file mode 100644 index 000000000..3aac0f8e2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java @@ -0,0 +1,289 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * Endpoint.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.MessageExchangeHandler; +import net.openesb.component.${artifactId}.common.MessageExchangeListener; +import net.openesb.component.${artifactId}.common.MessageExchangeSupport; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; + +/** + * This is an abstract class that represents the Endpoint defined for service provisioning or + * consumption in a jbi component. It stores the required service description ( wsdl definition, + * role, service unit to which it belongs etc) and defines the lifecycle operations {@link ${symbol_pound}init}, + * {@link ${symbol_pound}activate}, {@link ${symbol_pound}deactivate}, {@link ${symbol_pound}clean} to control a service endpoint that + * provides or consumes the service. + *

+ * Extended classes implement the abstract methods defined in this class to implement the endpoint + * functionality by providing the functionality to process the deployment artifacts specific to this + * endpoint, configure the endpoint to send/receive messages to/from delivery channel and process them + * according to the specific service implementation. + * + * @author chikkala + */ +public abstract class Endpoint { + /** Role of this endpoint. CONSUMER or PROVIDER */ + private Role mRole; + /** Service description from the SU descriptor for which this endpoint is configured */ + private SUDescriptor.Service mService; + /** WSDL definition corresponding to this endpoint */ + private Definition mWsdlDef; + /** service endpoint corresponding to this endpoint */ + private ServiceEndpoint mServiceEndpoint; + /** service unit from which this endpoint is created */ + private ServiceUnit mSU; // can be null + /** private constructor to force extended classes to use the parameterized constructor */ + private Endpoint() { + } + /** Creates a new instance of Endpoint + * @param role CONSUMER or PRVODER role. + * @param service service description from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + * @param su service unit object which created this endpoint. + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl, ServiceUnit su) { + this.mService = service; + this.mRole = role; + this.mWsdlDef = wsdl; + this.mSU = su; + } + /** Creates a new instance of Endpoint without service unit. may be useful for static endpoints that + * are not part of the deployment + * @param role CONSUMER or PRVODER role. + * @param service service info from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl) { + this(role, service, wsdl, null); + } + /** + * should be called to initialize any resources related to this endpoint object + * throws JBIException + */ + public abstract void init() throws JBIException; + /** + * activates the endpoint to send/receive messages + * throws JBIException + */ + public abstract void activate() throws JBIException; + /** + * deactivates the endpoint + * throws JBIException + */ + public abstract void deactivate() throws JBIException; + /** + * clean endpoint + * throws JBIException + */ + public abstract void clean() throws JBIException; + + public final Role getRole() { + return this.mRole; + } + public final boolean isProvider() { + return (Role.PROVIDER.equals(this.getRole())); + } + public final boolean isConsumer() { + return (Role.CONSUMER.equals(this.getRole())); + } + public final Definition getWSDL() { + return this.mWsdlDef; + } + public final SUDescriptor.Service getService() { + return this.mService; + } + public final ServiceEndpoint getServiceEndpoint() { + return this.mServiceEndpoint; + } + protected final void setServiceEndpoint(ServiceEndpoint svcEP) { + this.mServiceEndpoint = svcEP; + } + public final ServiceUnit getServiceUnit() { + return this.mSU; + } + /** + * generates an ID that would uniquely identify this endpoint implementation. Use as a key to map + * any information to store that is related to this endpoint. + */ + public final String getID() { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(this.mService.getInterface()).append("+"); + strBuff.append(this.mService.getServiceName()).append("+"); + strBuff.append(this.mService.getEndpointName()).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(this.mRole) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(this.mRole) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + + @Override + public String toString() { + return "Endpoint : " + "${symbol_escape}n" + this.mService; + } + /** + * checks if this endpoint is configured for the binding component or service engine. + */ + public boolean isFor${artifactId}() { + boolean isFor${artifactId} = false; + if ( this.mSU != null ) { + try { + isFor${artifactId} = this.mSU.getSUDescriptor().isFor${artifactId}(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + return isFor${artifactId}; + } + + public QName getOperationQName(String opName) { + return new QName(this.getService().getInterface().getNamespaceURI(), opName); + } + + public Operation getWSDLOperation(QName opQName) { + String opName = null; + if ( opQName != null ) { + opName = opQName.getLocalPart(); + } + Operation operation = WSDLProcessor.findOperation(this.getWSDL(), + this.getService().getInterface(), opName); + return operation; + } + + public Binding getWSDLBinding() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + if ( serviceName != null ) { + return WSDLProcessor.findServiceBinding(this.getWSDL(), serviceName, endpointName); + } else { + return WSDLProcessor.findInterfaceBinding(this.getWSDL(), interfaceName, null); + } + } + /** @return logger */ + public Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** @return ComponentContext */ + public ComponentContext getComponentContext() { + return RuntimeHelper.getComponentContext(); + } + /** @return DeliveryChannel */ + public DeliveryChannel getDeliveryChannel() { + return RuntimeHelper.getDeliveryChannel(); + } + /** + * helper function to get the MessageExchangeSupport object + */ + public MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + public MessageExchangeHandler createMessageExchangeHandler() { + return null; + } + /** + * creates the message exchange listener. Extended classes should return + * MessageExchangeListener implementation. + * @return MessageExchangeListener or null. + * + */ + protected MessageExchangeListener createMessageExchangeListener() { + return null; + } + /** + * Creates and adds message exchange listener to receive message exchange received notification. + */ + protected void addMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeListener meListener = createMessageExchangeListener(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null && meListener != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName, meListener); + if ( serviceName != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), null, serviceName, endpointName, meListener); + } + } + } + /** + * Removes message exchange listener from the MessageExchangeSupport. + */ + protected void removeMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName); + if ( serviceName != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), null, serviceName, endpointName); + } + } + } + + public final boolean processMessageExchangeWithHandler(ExchangeStatus status, MessageExchange me) { + + //1. lookup handler + //2. if not there create one and register + //3. call process message exchange on it + //4. check status. if that is the end, remove the handler + + MessageExchangeSupport support = this.getMessageExchangeSupport(); + if ( support == null ) { + getLogger().fine("No MessageExchangeSupport present"); + return false; + } + MessageExchangeHandler handler = support.findMessageExchangeHandler(me); + if ( handler == null ) { + handler = this.createMessageExchangeHandler(); + if ( handler == null ) { + getLogger().fine("MessageExchangeHandler not supported"); + return false; + } + support.addMessageExchangeHandler(me, handler); + } + + handler.processMessageExchange(status, me); + + getLogger().fine("XXX MX Handler processed ME with STATUS: " + status); + + if (!ExchangeStatus.ACTIVE.equals(status) ) { + // DONE or ERROR means done with the me. + getLogger().fine("End of ME processing. STATUS: " + status + + ". Removing the MX Handler ..."); + support.removeMessageExchangeHandler(me); + } + + return true; + } + +} + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java new file mode 100644 index 000000000..4bd932fc1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java @@ -0,0 +1,107 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderEndpoint.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Service; +import javax.jbi.JBIException; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service provider. {@link ServiceUnit${symbol_pound}createProviderEndpoint} creates the object of this + * type to implement the service provider functionality. It makes sure that this class or the extended + * classes will activate or deactivate the ServiceEndpoint corresponding to the service + * provided by the endpoint is performed during the activate and deactivate method calls as part of the + * endpoint lifecycle. + * + * @see ServiceUnit${symbol_pound}createProviderEndpoint + * @author chikkala + */ + +public class ProviderEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with PROVIDER role and makes sure that the service + * description passed to it is of provider description. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(Role.PROVIDER, provides, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef) { + this(provides, wsdlDef, null); + } + /** + * initializes the endpoint and creates and registers the MessageExchangeListener with + * MessageExchangeSupport. + */ + public final void init() throws JBIException { + getLogger().fine("ProviderEndpiont: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + /** + * calls activatesServiceEndpoint for the Provider. + */ + public final void activate() throws JBIException { + getLogger().fine("ProviderEndpiont: activate called"); + activateServiceEndpoint(); //1. activate service endpoint in NMR + doActivate(); //2. do any other activation related tasks. + } + /** + * calls deactivateServiceEndpoint for the Provider. + */ + public final void deactivate() throws JBIException { + getLogger().fine("ProviderEndpiont: deactivate called"); + deactivateServiceEndpoint(); //1. deactivates the service endpoint in NMR + doDeactivate(); //2. do any other deactivation related tasks. + } + /** + * removes the message exchange listener. cleans up other resources + */ + public final void clean() throws JBIException { + getLogger().fine("ProviderEndpiont: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + /** + * Activates the ServiceEndpoint with NMR + */ + private void activateServiceEndpoint() throws JBIException { + Service service = this.getService(); + ServiceEndpoint svcEP = this.getComponentContext().activateEndpoint( + service.getServiceName(), service.getEndpointName()); + this.setServiceEndpoint(svcEP); + } + /** + * Deactivates ServiceEndpoint in NMR + */ + private void deactivateServiceEndpoint() throws JBIException { + this.getComponentContext().deactivateEndpoint(this.getServiceEndpoint()); + this.setServiceEndpoint(null); + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java new file mode 100644 index 000000000..3710afa62 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java @@ -0,0 +1,364 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SUDescriptor.java + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import javax.jbi.management.DeploymentException; +import javax.xml.namespace.QName; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * This interface represent the service unit descriptor (jbi.xml) model. This will be used in + * ServiceUnit implementation to find the services provided and consumed by this service unit. + * {@link SUDescriptorFactory${symbol_pound}getSUDescriptor} method reads the jbi.xml in the service unit to + * to the implementation of this interface. + * + * @see SUDescriptorFactory + * @see Consumes + * @see Provides + * @see ServiceUnit + * + * @author chikkala + */ +public interface SUDescriptor { + + Collection getProvidedServices(); + + Collection getConsumedServices(); + + boolean isFor${artifactId}(); + + /** + * base interface that models the service information described in the service unit descriptor for + * consumed services and provided services. + */ + public interface Service { + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + QName getInterface(); + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + QName getServiceName(); + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + String getEndpointName(); + } + /** + * marker interface that represents the provided services in the service unit + */ + public interface Provides extends Service { + } + /** + * this interface represents the consumed service information in the su descriptor. + */ + public interface Consumes extends Service { + + public final static String STANDARD_LINK = "standard"; + public final static String SOFT_LINK = "soft"; + public final static String HARD_LINK = "hard"; + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + String getLinkType(); + } + /** + * This is a factory class that can build the Service Unit Descriptor model from the jbi.xml + */ + public static class SUDescriptorFactory { + + protected final static String JBI_TAG_NAME = "services"; + protected final static String SERVICES_TAG_NAME = "services"; + protected final static String BC_TAG_NAME = "binding-component"; + protected final static String PROVIDES_TAG_NAME = "provides"; + protected final static String CONSUMES_TAG_NAME = "consumes"; + protected final static String INTERFACE_TAG_NAME = "interface-name"; + protected final static String SERVICE_TAG_NAME = "service-name"; + protected final static String ENDPOINT_TAG_NAME = "endpoint-name"; + protected final static String LINK_TYPE_TAG_NAME = "link-type"; + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(String jbiXmlPath) throws Exception { + FileReader reader = null; + try { + reader = new FileReader(jbiXmlPath); + SUDescriptor suDesc = getSUDescriptor(reader); + return suDesc; + } finally { + if ( reader != null ) { + try { + reader.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(Reader reader) throws Exception { + SUDescriptor suDescriptor = null; + Document suDescDoc = RuntimeHelper.buildDOMDocument(reader); + Element jbiEl = suDescDoc.getDocumentElement(); + if (JBI_TAG_NAME.equals(jbiEl.getTagName())) { + throw new DeploymentException("Invalid service unit descriptor : no jbi root element"); + } + + NodeList servicesNL = jbiEl.getElementsByTagName(SERVICES_TAG_NAME); + if (servicesNL != null && servicesNL.getLength() == 1) { + Element servicesEl = (Element) servicesNL.item(0); + suDescriptor = SUDescriptorImpl.createSUDescriptor(servicesEl); + } else { + throw new DeploymentException("Invalid service unit descriptor : invalid services element"); + } + + return suDescriptor; + } + + } + /** + * This class implements SUDescriptor + */ + public static class SUDescriptorImpl implements SUDescriptor { + + private List mConsumedList; + private List mProvidedList; + private boolean mIsFor${artifactId}; + + protected SUDescriptorImpl(boolean isFor${artifactId}) { + this.mIsFor${artifactId} = isFor${artifactId}; + this.mConsumedList = new ArrayList(); + this.mProvidedList = new ArrayList(); + } + + protected void addProvidedService(Provides provides) { + this.mProvidedList.add(provides); + } + + protected void addConsumedService(Consumes consumes) { + this.mConsumedList.add(consumes); + } + + public Collection getProvidedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mProvidedList); + } + + public Collection getConsumedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mConsumedList); + } + + public boolean isFor${artifactId}() { + return this.mIsFor${artifactId}; + } + + protected static SUDescriptor createSUDescriptor(Element servicesEl) throws Exception { + boolean isForBC = false; + String bcTagString = servicesEl.getAttribute(SUDescriptorFactory.BC_TAG_NAME); + isForBC = Boolean.valueOf(bcTagString).booleanValue(); + SUDescriptorImpl suDesc = new SUDescriptorImpl(isForBC); + // add consumes + NodeList consumesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.CONSUMES_TAG_NAME); + for ( int i=0; i < consumesNL.getLength(); ++i) { + Element consumesEl = (Element) consumesNL.item(i); + Consumes consumes = ConsumedService.createConsumedService(consumesEl); + suDesc.addConsumedService(consumes); + } + // add provides + NodeList providesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.PROVIDES_TAG_NAME); + for ( int i=0; i < providesNL.getLength(); ++i) { + Element providesEl = (Element) providesNL.item(i); + Provides provides = ProvidedService.createProvidedService(providesEl); + suDesc.addProvidedService(provides); + } + + return suDesc; + } + } + /** + * Base class that implements the Service interface + */ + public static abstract class AbstractService implements Service { + + private QName mInterface; + private QName mServiceName; + private String mEndpointName; + + private AbstractService() { + } + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + public QName getInterface() { + return this.mInterface; + } + + /** + * Setter for property interfaceQName. + * @param interfaceQName New value of property interfaceQName. + */ + protected void setInterface(QName interfaceQName) { + this.mInterface = interfaceQName; + } + + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + public QName getServiceName() { + return this.mServiceName; + } + + /** + * Setter for property serviceName. + * @param serviceName New value of property serviceName. + */ + protected void setServiceName(QName serviceName) { + this.mServiceName = serviceName; + } + + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + public String getEndpointName() { + return this.mEndpointName; + } + + /** + * Setter for property endpointName. + * @param endpointName New value of property endpointName. + */ + protected void setEndpointName(String endpointName) { + this.mEndpointName = endpointName; + } + + } + /** + * This class implements the Provides interface + */ + public static class ProvidedService + extends AbstractService + implements Provides { + protected ProvidedService(QName interfaceQName, QName serviceName, String endpointName) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + } + + @Override + public String toString() { + return "Provides :" + + "${symbol_escape}n${symbol_escape}t interface-name= " + getInterface() + + "${symbol_escape}n${symbol_escape}t service-name= " + getServiceName() + + "${symbol_escape}n${symbol_escape}t endpont-name= " + getEndpointName(); + } + + protected static Provides createProvidedService(Element providesEl) throws Exception { + + String ifName = providesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = providesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = providesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + if ( ifName == null || serviceName == null || endpointName == null ) { + throw new Exception("Invalid provides element: missing " + SUDescriptorFactory.INTERFACE_TAG_NAME + + " or " + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, providesEl); + QName serviceQName = RuntimeHelper.resolveAttrQName(serviceName, providesEl); + + return new ProvidedService(ifQName, serviceQName, endpointName); + } + } + /** + * This class implements the Consumes interface. + */ + public static class ConsumedService + extends AbstractService + implements Consumes { + private String mLinkType; + protected ConsumedService(QName interfaceQName, + QName serviceName, String endpointName, String linkType) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + this.mLinkType = linkType; + } + + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + public String getLinkType() { + return this.mLinkType; + } + + @Override + public String toString() { + return "Cosumes :" + + "${symbol_escape}n${symbol_escape}t interface-name= " + getInterface() + + "${symbol_escape}n${symbol_escape}t service-name= " + getServiceName() + + "${symbol_escape}n${symbol_escape}t endpont-name= " + getEndpointName() + + "${symbol_escape}n${symbol_escape}t link-type= " + getLinkType(); + } + + protected static Consumes createConsumedService(Element consumesEl) throws Exception { + + String ifName = consumesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = consumesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = consumesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + String linkType = consumesEl.getAttribute(SUDescriptorFactory.LINK_TYPE_TAG_NAME); + if ( linkType == null || linkType.trim().length() == 0 ) { + linkType = STANDARD_LINK; + } + + if ( ifName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.INTERFACE_TAG_NAME ); + } + if ( serviceName == null || endpointName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, consumesEl); + QName serviceQName = null; + if ( serviceName != null ) { + serviceQName = RuntimeHelper.resolveAttrQName(serviceName, consumesEl); + } + if ( serviceQName != null && endpointName != null && linkType != null ) { + if (!(STANDARD_LINK.equals(linkType) || + SOFT_LINK.equals(linkType) || HARD_LINK.equals(linkType)) ) { + throw new Exception("Invalid consumes attribute value" + + SUDescriptorFactory.LINK_TYPE_TAG_NAME + "=" + linkType); + } + } + return new ConsumedService(ifQName, serviceQName, endpointName, linkType); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java new file mode 100644 index 000000000..1794d9333 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java @@ -0,0 +1,464 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ServiceUnit.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Provides; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Service; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; + +/** + * This is an abstract class that implements the service unit functionality in the component which + * processes the service unit artifacts and implement the actual service unit lifecycle functionality. + * The AbstractServiceUnitManager and its extended classes that implement the ServiceUnitManager + * functionality creates and maintains the reference to the concrete implementation of this class to + * invoke the functionality implemented by this class and its concrete implementation during the + * execution of the ServiceUnitMangers lifecycle methods by the jbi runtime. + *

+ * The main lifecycle methods of this class that will be called by the ServiceUnitManger implementation + * during the service unit deployment lifecycle are {@link ${symbol_pound}doload}, {@link ${symbol_pound}doDeploy}, {@link ${symbol_pound}doUndeploy}, + * {@link ${symbol_pound}doInit}, {@link ${symbol_pound}doStart}, {@link ${symbol_pound}doStop} and {@link ${symbol_pound}doShutdown} + *

+ * Service unit processing supported by this implementation is based on wsdl 1.1 deployments where the + * services provided and consumed in this service unit are described using wsdl 1.1 definitions. + *

+ * The main service unit artifacts that will be processed during deployment lifecycle of the service + * unit are 1.Service unit descriptor(jbi.xml) that describes the services provided and consumed by + * this service unit. 2.WSDL 1.1 document that describes the service definition 3.Component specific + * configurations related to services provided and consumed by this service unit. + *

+ * When the service unit is for Binding Component, the component specific configurations are read + * from the WSDL1.1 extensions defined in the WSDL document corresponding to the service provider + * or consumer deployed with this service unit. + *

+ * When the service unit is for Service Engine, the component specific configurations are read + * from the deployment artifacts such as xslt files and mapping files in the service unit zip file + * along with the WSDL document corresponding to the service provider or consumer deployed with this + * service unit. + * + * @see SUDescriptor + * @see Endpoint + * @see ProviderEndpoint + * @see ConsumerEndpoint + * @see WSDLProcessor + * @author chikkala + */ +public abstract class ServiceUnit { + /** Service Unit Name */ + private String mSUName; + /** Service Unit Root path passed by jbi runtime */ + private String mSURootPath; + /** service unit descriptor model unmarshalled from service unit jbi.xml */ + private SUDescriptor mSUDescriptor; + /** Map of Endpoint Key to ProviderEndpoint configurations in this service unit */ + private Map mProviderEndpointMap; + /** Map of Endpoint Key to ConsumerEndpoint configurations in this service unit */ + private Map mConsumerEndpointMap; + /** Map of Service Key to the WSDL Definition in this service unit */ + private Map mWSDLMap; + /** WSDLProcessor configured for this service unit to process wsdls in the service unit */ + private WSDLProcessor mWSDLProcessor; + /** + * + * @param suName + * @param suRootPath + */ + protected ServiceUnit(String suName, String suRootPath) { + this.mSUName = suName; + this.mSURootPath = suRootPath; + this.mSUDescriptor = null; + this.mWSDLMap = new HashMap(); + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + } + /** returns service unit name + * @return service unit name + */ + public String getName() { + return this.mSUName; + } + /** returns service unit root path where the su artifacts are unzipped by the jbi runtime + * @return path to the service unit root directory. + */ + public String getSURootPath() { + return this.mSURootPath; + } + protected SUDescriptor createSUDescriptor() throws Exception { + File jbiXmlFile = new File(this.getSURootPath(), "META-INF/jbi.xml"); + String jbiXmlPath = jbiXmlFile.getAbsolutePath(); + return SUDescriptor.SUDescriptorFactory.getSUDescriptor(jbiXmlPath); + } + /** return the Service unit descriptor model that was read from the jbi.xml + * @return SUDescriptor + */ + public SUDescriptor getSUDescriptor() throws Exception { + if ( this.mSUDescriptor == null ) { + this.mSUDescriptor = createSUDescriptor(); + } + return this.mSUDescriptor; + } + public ProviderEndpoint getProviderEndpoint(String providerID) { + return this.mProviderEndpointMap.get(providerID); + } + public Collection getProviderEndpoints() { + return Collections.unmodifiableCollection(this.mProviderEndpointMap.values()); + } + public ConsumerEndpoint getConsumerEndpoint(String cosumerID) { + return this.mConsumerEndpointMap.get(cosumerID); + } + + public Collection getConsumerEndpoints() { + return Collections.unmodifiableCollection(this.mConsumerEndpointMap.values()); + } + /** + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * extended classes implement this method to create the su specific WSDLProcessor. for examples, + * a su supporting binding component may have wsdl extensions that it want to registry for reading + * the configurations from the wsdl file. + * @return WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + */ + protected WSDLProcessor createWSDLProcessor() { + return new WSDLProcessor(this.getSURootPath()); + } + /** + * return the WSDLProcessor reference by creates if it is not yet created. + * @return WSDLProcessor. + */ + public final WSDLProcessor getWSDLProcessor() { + if ( this.mWSDLProcessor == null ) { + this.mWSDLProcessor = createWSDLProcessor(); + } + return this.mWSDLProcessor; + } + /** + * loads the service unit artifacts into the SU model. AbstractServiceUnitManager implementation + * calls this method during the during deploy and init lifecycle methods when the service unit + * object is newly created. + */ + public void doLoad() throws DeploymentException { + try { + SUDescriptor suDesc = getSUDescriptor(); // load jbi.xml + loadServiceDefinitions(); // check if the wsdls are valid for corresponding services. + loadOtherArtifacts(); // additional validations specific to component deployment features. + loadEndpoints(); // create endpoints + } catch ( DeploymentException jbiEx) { + throw jbiEx; + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + /** extended classes implement this method to perform the su specific deployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doDeploy() throws DeploymentException { + // NOOP. doLoad has done it all. + this.getLogger().fine("ServiceUnit.doDeploy"); + } + /** extended classes implement this method to perform the su specific undeployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doUndeploy() throws DeploymentException { + //NOOP + this.getLogger().fine("ServiceUnit.doUndeploy"); + } + /** extended classes implement this method to perform the su specific initialization tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doInit() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doInit"); + this.doInitEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on start in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStart() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStart"); + this.doActivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on stop in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStop() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStop"); + this.doDeactivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on shutdown in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doShutdown() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doShutdown"); + this.doCleanEndpoints(); + } + /** + * create the ProviderEndpoint that implement the service provider implementation specific to this su. + * @return ProviderEndpoint or null if the SU does not support the service provider access + */ + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return null; + } + /** + * create the ProviderEndpoint that implement the service consumer implementation specific to this su. + * @return ConsumerEndpoint or null if the SU does not support the service consumer access + */ + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return null; + } + /** + * generates the key based on the service to store the wsdl definitions . + */ + protected String getServiceKey(Service service) { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(service.getInterface()).append("+"); + strBuff.append(service.getServiceName()).append("+"); + strBuff.append(service.getEndpointName()); + return strBuff.toString(); + } + /** + * looks up the wsdl definition loaded for this service. + */ + protected Definition findWSDLFor(Service service) throws WSDLException { + Definition wsdlDef = null; + String key = this.getServiceKey(service); + wsdlDef = this.mWSDLMap.get(key); + return wsdlDef; + } + + protected Definition findWSDL(List wsdlList, Service service, boolean ignoreEndpointLookup) { + Definition foundDef = null; + for ( Definition def : wsdlList ) { + if ( WSDLProcessor.isWSDLFor(def, service.getInterface(), service.getServiceName(), + ((ignoreEndpointLookup) ? null : service.getEndpointName()) ) ) { + foundDef = def; + break; + } + } + return foundDef; + } + /** + * loads the WSDL definitions corresponds to the service providers and consumers defined in the + * service unit descriptor. + */ + protected void loadServiceDefinitions() throws Exception { + + this.mWSDLMap = new HashMap(); + + WSDLProcessor wsdlProcessor = getWSDLProcessor(); + List wsdlList = wsdlProcessor.readWSDLs(this.getSURootPath()); + this.getLogger().fine("Number of wsdl definitions in service unit " + wsdlList.size()); + + List services = new ArrayList(); + services.addAll(this.getSUDescriptor().getProvidedServices()); + services.addAll(this.getSUDescriptor().getConsumedServices()); + + boolean isForBinding = this.getSUDescriptor().isFor${artifactId}(); + this.getLogger().fine("Is this service unit for Binding? " + isForBinding); + + for ( Service service : services ) { + this.getLogger().fine("Looking up WSDL for service " + service); + boolean ignoreEndpointLookup = false; + boolean providerAtEngine = false; + if ( !isForBinding && service instanceof Provides ) { + ignoreEndpointLookup = true; + providerAtEngine = true; + } + Definition def = findWSDL(wsdlList, service, ignoreEndpointLookup); + if ( def == null ) { + throw new Exception("WSDL Definition not found for " + service); + } + this.mWSDLMap.put(getServiceKey(service), def); + if ( providerAtEngine ) { + // provider at engine. so add engine binding and endpoint to the wsdl + wsdlProcessor.createServiceEngineBinding(def, + service.getInterface(), service.getServiceName(), service.getEndpointName()); + } + } + } + /** extended classes implement this method to perform the su specific artifacts validation in + * this method implementation. + * @throws DeploymentException on error. + */ + protected void loadOtherArtifacts() throws DeploymentException { + // nothing to validate further. + this.getLogger().fine("ServiceUnit.loadOtherArtifacts"); + } + /** + * creates ProviderEndpoint and ConsumerEndpoint objects corresponding to the service providers + * and consumers described in the su descriptor ( jbi.xml ) + */ + protected void loadEndpoints() throws Exception { + + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + + Collection providesList = this.getSUDescriptor().getProvidedServices(); + for ( Provides provides : providesList ) { + Definition wsdlDef = findWSDLFor(provides); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + provides); + } + ProviderEndpoint provider = createProviderEndpoint(provides, wsdlDef); + this.mProviderEndpointMap.put(provider.getID(), provider); + } + + Collection consumesList = this.getSUDescriptor().getConsumedServices(); + for ( Consumes consumes : consumesList ) { + Definition wsdlDef = findWSDLFor(consumes); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + consumes); + } + ConsumerEndpoint consumer = createConsumerEndpoint(consumes, wsdlDef); + this.mConsumerEndpointMap.put(consumer.getID(), consumer); + } + } + /** + * initializes the Endpoint objects created corresponding to the consumer and providers defined + * in the su descriptor + */ + protected void doInitEndpoints() throws DeploymentException { + // init endpoints. if any initialization fails, rollback the already inited endpoints + List initedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.init(); + initedEndpoints.add(endpoint); + } catch ( Exception initEx) { + doCleanEndpoints(initedEndpoints); + throw new DeploymentException(initEx); + } + } + + } + /** + * invokes activates method of all provider and consumer endpoint object in this su. if there is + * and error activating any one the endpoints, it deactivates the already activated ones and throws + * the error + */ + protected void doActivateEndpoints() throws DeploymentException { + // activate providers first and then consumers + List activatedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.activate(); + activatedEndpoints.add(endpoint); + } catch ( Exception actEx) { + doDeactivateEndpoints(activatedEndpoints); + throw new DeploymentException(actEx); + } + } + } + /** + * invokes deactivate method on the list of Endpoint objects passed to this method + */ + protected void doDeactivateEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.deactivate(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes deactivate method on the all consumer and provider endpoint objects + */ + protected void doDeactivateEndpoints() { + // deactivate consumers first and then the providers + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doDeactivateEndpoints(allEndpoints); + } + /** + * invokes clean method on the list of endpoint objects + */ + protected void doCleanEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.clean(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes clean method on the all consumer and provider endpoint objects in this su. + */ + protected void doCleanEndpoints() { + + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doCleanEndpoints(allEndpoints); + } + /** + * prints the service unit description + */ + protected final String printDetails() { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + + out.println("ServiceUnit Name : " + this.getName()); + out.println("ServiceUnit Root : " + this.getSURootPath()); + + SUDescriptor suDesc = null; + try { + suDesc = this.getSUDescriptor(); + for ( SUDescriptor.Consumes consumer : suDesc.getConsumedServices()) { + out.println(consumer); + } + for ( SUDescriptor.Provides provides : suDesc.getProvidedServices()) { + out.println(provides); + } + } catch (Exception ex) { + ex.printStackTrace(out); + } + return writer.getBuffer().toString(); + } + + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java new file mode 100644 index 000000000..67bbf5a45 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java @@ -0,0 +1,44 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensibilityElement.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This is an abstract class which can be extended to create jwsdl (wsdl4j's) extension elements model to + * read/write the wsdl extension elements in wsdl 1.1 xml. + * + * @author chikkala + */ +public abstract class AbstractExtensibilityElement implements ExtensibilityElement, java.io.Serializable { + public static final long serialVersionUID = 1; + private QName mElementType; + private Boolean mRequired; + + /** Creates a new instance of AbstractExtensibilityElement */ + protected AbstractExtensibilityElement() { + } + + public void setElementType(QName elementType) { + this.mElementType = elementType; + } + + public QName getElementType() { + return this.mElementType; + } + + public void setRequired(Boolean required) { + this.mRequired = required; + } + + public Boolean getRequired() { + return this.mRequired; + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java new file mode 100644 index 000000000..0882bd65f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java @@ -0,0 +1,45 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensionRegistry.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.List; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This is the abstract class used to add the wsdl extension serializers and deserializers to the + * wsdl extension registry configured to read/write wsdl extensions into a know java model. + * @see AbstractExtensionSerializer + * @see WSDLProcessor + * @author chikkala + */ +public abstract class AbstractExtensionRegistry extends ExtensionRegistry { + + /** Creates a new instance of AbstractSerializer + * it calls the createSerializers method to get the list of + * serializers and then call registerSerializer on each AbstractExtensionSerializer + * to register them with this registry. + * @see AbstractExtensionSerializer${symbol_pound}registerSerializer + */ + protected AbstractExtensionRegistry() { + super(); + List list = createSerializers(); + for (AbstractExtensionSerializer ser : list ) { + ser.registerSerializer(this); + } + // register ServiceEngine Binding serializers + AbstractExtensionSerializer seBindingSer = new SEBindingExt.SEBindingExtSerializer(); + seBindingSer.registerSerializer(this); + } + /** + * create wsdl extension serializers for each extension element to register with the extension + * registry. + * @return List of AbstractExtensionSerializer objects for serializing/deserializing the wsdl extensions. + * @see AbstractExtensionSerializer + */ + protected abstract List createSerializers(); +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java new file mode 100644 index 000000000..4ac1b37d6 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java @@ -0,0 +1,123 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensionSerializer.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.PrintWriter; +import java.io.Serializable; +import java.util.Set; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionDeserializer; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.extensions.ExtensionSerializer; +import javax.xml.namespace.QName; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +/** + * This class is an abstract class that should be extended to implements extension serializer and + * deserializer. This class implements the code required for registering the serializer and deserializer + * implemented by this class. THe AbstractExtensionRegistry class calls the ${symbol_pound}registerSerializer method + * to register the concrete implementation of this class with extension registry. + * @see AbstractExtensionRegistry + * @author chikkala + */ +public abstract class AbstractExtensionSerializer + implements ExtensionSerializer, ExtensionDeserializer, Serializable { + + public static final long serialVersionUID = 1; + + private Class mParentType; + private Class mExtensionType; + private QName mElementType; + + /** Creates a new instance of AbstractSerializer */ + public AbstractExtensionSerializer(Class parentType, QName elementType, Class extensionType) { + this.mParentType = parentType; + this.mElementType = elementType; + this.mExtensionType = extensionType; + } + + public Class getParentType() { + return this.mParentType; + } + public QName getElementType() { + return this.mElementType; + } + public Class getExtensionType() { + return this.mExtensionType; + } + + public void registerSerializer(ExtensionRegistry extReg) { + extReg.registerSerializer(this.mParentType, this.mElementType, this); + extReg.registerDeserializer(this.mParentType, this.mElementType, this); + extReg.mapExtensionTypes(this.mParentType, this.mElementType, this.mExtensionType); + } + + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + // DO NOTHING. Binding component runtime does not need to serialize the wsdl extensions. + } + + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + return null; + } + + public static String getAttribute(Element el, String attrName) { + String attrValue = null; + Attr attr = el.getAttributeNode(attrName); + if ( attr != null ) { + attrValue = attr.getValue(); + } + return attrValue; + } + + protected String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + /** + * @return the name with the prefix defined for the namespaceURI in the wsdl definition. + * @throws WSDLException if the prefix not found in the wsdl definition. note that the + * default prefix is an empty string. + */ + protected String getQualifiedName(Definition def, + String namespaceURI, String localName) throws WSDLException { + String prefix = null; + if (namespaceURI != null && !namespaceURI.equals("")) { + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + throw new WSDLException(WSDLException.OTHER_ERROR, + "Can not find prefix in WSDL Definition for " + namespaceURI); + } + } + if ( prefix != null && !prefix.equals("")) { + return prefix + ":" + localName; + } else { + return localName; + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java new file mode 100644 index 000000000..b10800550 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java @@ -0,0 +1,229 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractNormalizer.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.ArrayList; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Part; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * This is an abstract class that implements most of the functionality to normalize the binding protocol + * specific concrete message to jbi wrapper and and denormalize jbi wrapper to the concrete binding + * protocol specific message. + *

+ * The extended classes specific to particular binding protocol will be used when a jbi binding + * component is sending and receiving messages from the external service providers and consumers using + * a particular binding protocol known to this class. Extended implementation of this class should make + * use of the helper methods in this class in normalizing and denormalizing the messages. + * @see JMXBindingNormalizer + * @author chikkala + */ +public abstract class AbstractNormalizer { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + /** wsdl definition to use when normalizing and denormalizing */ + private Definition mWSDL; + /** Binding definition to use when normalizing and denormalizing */ + private Binding mBinding; + + private AbstractNormalizer() {} + /** Creates a new instance of JMXBCNormalizer */ + public AbstractNormalizer(Definition wsdl, Binding binding) { + this.mWSDL = wsdl; + this.mBinding = binding; + } + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete mssage of a particular binding protocol. + */ + public abstract void normalizeInput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeOutput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be de-normalized. + * @param normMsg NormalizedMessage which should be used to create de-normalized message. + */ + public abstract DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + + /** + * denormalized the normalized fault message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException; + /** + * @return the wsdl definition to use in normalizing and denormalizing the message + */ + protected Definition getWSDL() { + return this.mWSDL; + } + /** + * @return the wsdl binding definition to use in normalizing and denormalizing the message + */ + protected Binding getBinding() { + return this.mBinding; + } + /** + * create and add message parts to the jbiWrapper according to the abstract message model. This + * method assumes that the each element in the msgParts list passed to it is mapped to the part + * of the abstract wsdl message and uses the type or element attribute of the abstract message to + * determine whether the element is actual part element or a wrapped part type. + * Use this method in normalizing the concrete protocol specific message to jbi wrapper message. + * @param jbiWrapper object that holds the jbi wrapper information. + * @param wsdlMsg abstract message from the wsdl definition + * @param msgParts actual message parts from the concrete message + */ + protected void addMessagePartsToJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg, List msgParts) throws MessagingException { + List wsdlParts = wsdlMsg.getOrderedParts(null); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= msgParts.size() ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + Element msgPart = msgParts.get(i); + if ( wsdlPart.getElementName() != null ) { + jbiWrapper.appendPart(msgPart); + } else { + // it is type. + // check the element name is same as part + if ( !wsdlPart.getName().equals(msgPart.getLocalName()) ) { + throw new MessagingException("mismatched message content for part " + wsdlPart.getName()); + } + if ( !wsdlMsg.getQName().getNamespaceURI().equals(msgPart.getNamespaceURI()) ) { + throw new MessagingException("mismatched message content namespace for part " + wsdlPart.getName()); + } + // check the content is text or element. + List partContent = getChildElements(msgPart); + if ( partContent.size() > 0 ) { + // add content as part elements + jbiWrapper.appendPart(partContent); + } else { + // add the content as text + jbiWrapper.appendPart(msgPart.getTextContent()); + } + } + } + } + /** + * extracts the message parts from the jbiWrapper according to the abstract wsdl message + * definition passed to it. Use this method in denormalizing the jbi wrapper message into the + * binding protocol specific concrete message. + * @param jbiWrapper jbi wrapper object that contains message parts and the message type information. + * @param wsdlMsg abstract wsdl message definition to use in constructing the part elements. + */ + protected List getMessagePartsFromJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg) + throws MessagingException, ParserConfigurationException { + + List msgParts = new ArrayList(); + int jbiPartCount = jbiWrapper.getPartCount(); + List wsdlParts = wsdlMsg.getOrderedParts(null); + QName msgType = jbiWrapper.getType(); + if (!wsdlMsg.getQName().getNamespaceURI().equals(msgType.getNamespaceURI())) { + throw new MessagingException("Namespace mismatch between jbi wrapper message type and wsdl message"); + } + Document newDoc = jbiWrapper.getDocumentBuilder().newDocument(); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= jbiPartCount ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + if ( wsdlPart.getElementName() != null ) { + msgParts.add(jbiWrapper.getPartAsElement(i)); + } else { + // it is type. create a new element for a typed part + // check the element name is same as part + String prefix = msgType.getPrefix(); + String nsURI = msgType.getNamespaceURI(); + String localName = wsdlPart.getName(); + Element partEl = newDoc.createElementNS(nsURI, prefix + ":" + localName); + partEl.setAttributeNS(XMLNS_NS, "xmlns:"+prefix, nsURI); + NodeList partContent = jbiWrapper.getPart(i); + appendChildren(partEl, partContent, newDoc, true); + msgParts.add(partEl); + } + } + return msgParts; + } + /** + * utility method that can append the nodeList passed to it to the element children. + * @param el element node to which the nodeList should be appended + * @param doc the document object that should be used to import the nodeList + * @param importNode true if the nodeList should be imported while appending the nodeList to the + * element children. false if no import is necessary. + */ + protected void appendChildren(Element el, NodeList nodeList, Document doc, boolean importNode) { + + for ( int pIdx = 0; pIdx < nodeList.getLength(); ++pIdx) { + Node node = nodeList.item(pIdx); + if ( importNode ) { + node = doc.importNode(node, true); + } + el.appendChild(node); + } + } + /** + * @param el element from which to extract the child elements + * @return List list of child Element nodes. + */ + protected List getChildElements(Element el) { + List list = new ArrayList(); + NodeList nodeList = el.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if (!(node instanceof Element) ){ + continue; + } + list.add((Element)node); + } + return list; + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java new file mode 100644 index 000000000..de59e0360 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java @@ -0,0 +1,99 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SEBindingExt.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation classes implement wsdl 1.1 extension model for the + * jbi service engine binding that is defined in jsr 208(sec. 5.5.6.1). to read/write concrete binding + * element in the wsdl definition for the service endpoint binding provided by the service engine. + * The wsdl definition with this binding information can be used in providing the service provider + * metadata returned by the service engine in Component.getServiceDescription. + *

+ * AbstractExtensionRegistry by default include this extension serializers in the + * registry to read/write this service engine binding type in the wsdl definition. + *

+ * During a service unit deployment/initialization in the service engine, the deployed wsdl definition + * is loaded and modified to provide this binding for the service provided by the engine. + * + * @see WSDLProcessor${symbol_pound}createServiceEngineBinding + * @see AbstractExtensionRegistry + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit${symbol_pound}loadServiceDefinitions + * @author chikkala + */ +public interface SEBindingExt extends ExtensibilityElement, java.io.Serializable { + + public static final String NS_URI = "http://java.sun.com/xml/ns/jbi/binding/service+engine"; + public static final String NS_DEF_PREFIX = "jbise"; + /** Element names. */ + public static final String EL_BINDING_EXT = "binding"; + /**Qualified element names.*/ + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + + public static class SEBindingExtImpl extends AbstractExtensibilityElement implements SEBindingExt { + + public SEBindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + @Override + public String toString() { + StringBuffer buff = new StringBuffer(); + buff.append("<"+NS_DEF_PREFIX+":"+EL_BINDING_EXT); + buff.append("/>"); + return buff.toString(); + } + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static SEBindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + SEBindingExtImpl bindingExt = new SEBindingExt.SEBindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, SEBindingExt.NS_DEF_PREFIX); + return bindingExt; + } + } + /** + * serializer and descrializer implementation for the binding extension element. + */ + public static class SEBindingExtSerializer extends AbstractExtensionSerializer { + + public SEBindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, SEBindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + SEBindingExt extObj = (SEBindingExt)extReg.createExtension(parentType, elementType); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + + SEBindingExt extObj = (SEBindingExt)extension; + + StringBuffer buff = new StringBuffer(); + buff.append("<" + elName ); + buff.append("/>"); + pw.println(buff.toString()); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java new file mode 100644 index 000000000..92606104d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java @@ -0,0 +1,471 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDL11JBIWrapper.java + * + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +/** + * This class wraps the wsdl11 messages to the jbi wrapper message suitable for + * processing in the wsdl2.0 model of the normalized message in jbi as defined in jsr208 like + * + * + * + * + * + * + * + * + * + * + * @author chikkala + */ +public class WSDL11JBIWrapper { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + public static final String WRAPPER_NAMESPACE = "http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; + public static final String DEF_NS_PREFIX = "jbiwrp"; + public static final String DEF_MESSAGE_NS_PREFIX = "msgns"; + public static final String JBI_MESSAGE_EL = "message"; + public static final String JBI_PART_EL = "part"; + public static final String VERSION_ATTR = "version"; + public static final String VERSION_ATTR_VALUE = "1.0"; + public static final String TYPE_ATTR = "type"; + public static final String NAME_ATTR = "name"; + + private static DocumentBuilder sDocBuilder = null; + /** qname of message attribute from wsdl:input, wsdl:output or wsdl:fault */ + private QName mType; + /** optional name attribute from wsdl:input, wsdl:output or wsdl:fault */ + private String mName; + /** each parts contents as node list */ + List mPartConentList = new ArrayList(); + + /** Creates a new instance of WSDL11JBIWrapper */ + public WSDL11JBIWrapper() { + } + /** creates the namespace aware document builder. extended classes can override this method + * to return the doc builder created else where. + */ + protected DocumentBuilder createDocumentBuilder() throws ParserConfigurationException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + return factory.newDocumentBuilder(); + } + /** return the document builder + * @return DocumentBuilder + */ + public final DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { + if ( WSDL11JBIWrapper.sDocBuilder == null ) { + WSDL11JBIWrapper.sDocBuilder = createDocumentBuilder(); + } + return WSDL11JBIWrapper.sDocBuilder; + } + /** + * @return type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public QName getType() { + return this.mType; + } + /** + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public void setType(QName type) { + this.mType = type; + } + /** @return name attribute from wsdl:input, wsdl:output or wsdl:fault. or null if not set. */ + public String getName() { + return this.mName; + } + /** + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault. can be null. + */ + public void setName(String name) { + this.mName = name; + } + /** + * appends part content as node list + */ + public void appendPart(NodeList partContent) { + this.mPartConentList.add(partContent); + } + /** + * append part content from the List of nodes + */ + public void appendPart(List partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content as element + */ + public void appendPart(Element partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content from DOMSource + */ + public void appendPart(DOMSource partContent) { + Element partConentEl = getElement(partContent.getNode()); + this.mPartConentList.add(new NodeListImpl(partConentEl)); + } + /** + * append part content as text node. + */ + public void appendPart(String partContent) { + Text textContent = null; + try { + textContent = this.getDocumentBuilder().newDocument().createTextNode(partContent); + } catch (ParserConfigurationException ex) { + ex.printStackTrace(); + } + if ( textContent != null ) { + this.mPartConentList.add(new NodeListImpl(textContent)); + } + } + /** + * append list of part contents each is a NodeList to the parts + */ + public void appendParts(List partContentList) { + this.mPartConentList.addAll(partContentList); + } + /** + * returned the ordered list of part contents. + */ + public List getParts() { + return Collections.unmodifiableList(this.mPartConentList); + } + /** + * return the number of parts + */ + public int getPartCount() { + return this.mPartConentList.size(); + } + /** + * return the part content at a particular index as NodeList. + */ + public NodeList getPart(int idx) { + return this.mPartConentList.get(idx); + } + /** + * return part context at a particular index as text + */ + public String getPartAsText(int idx) { + NodeList partNodes = getPart(idx); + Document doc; + try { + doc = this.getDocumentBuilder().newDocument(); + Element el = doc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + for ( int i=0; i < partNodes.getLength(); ++i) { + el.appendChild(partNodes.item(i)); + } + return el.getTextContent(); + } catch (ParserConfigurationException ex) { + return null; + } + } + /** + * return part context at a particular index as Element + */ + public Element getPartAsElement(int idx) { + Element contentEl = null; + NodeList partNodes = getPart(idx); + for ( int i=0; i < partNodes.getLength(); ++i) { + Node node = partNodes.item(i); + if ( node instanceof Element) { + contentEl = (Element)node; + break; + } + } + return contentEl; + } + /** + * creates Document from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return Document containing the wsdl 11 wrapper xml + */ + public Document toDocument() throws ParserConfigurationException { + + Document wrapperDoc = getDocumentBuilder().newDocument(); + Element jbiMessage = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_MESSAGE_EL); + jbiMessage.setAttribute(VERSION_ATTR, VERSION_ATTR_VALUE); + wrapperDoc.appendChild(jbiMessage); + + QName type = this.getType(); + if ( type == null ) { + type = new QName("", "", DEF_MESSAGE_NS_PREFIX); + } + // set the jbiMessage attributes + String prefix = type.getPrefix(); + if (prefix == null || prefix.length() == 0) { + prefix = DEF_MESSAGE_NS_PREFIX; + } + jbiMessage.setAttribute(TYPE_ATTR, prefix + ":" + type.getLocalPart()); + jbiMessage.setAttributeNS( XMLNS_NS, "xmlns:" + prefix, type.getNamespaceURI()); + + String name = this.getName(); + if (name != null && name.trim().length() > 0 ) { + jbiMessage.setAttribute(NAME_ATTR, name); + } + + List partContentList = this.getParts(); + for ( NodeList nodeList : partContentList ) { + // set jbi part message + Element jbiPart = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + jbiMessage.appendChild(jbiPart); + for ( int i =0; i < nodeList.getLength(); ++i ) { + Node importedMsgNode = wrapperDoc.importNode(nodeList.item(i), true); + jbiPart.appendChild(importedMsgNode); + } + } + + return wrapperDoc; + + } + /** + * creates DOMSource from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return DOMSource containing the wsdl 11 wrapper xml + */ + public DOMSource toDOMSource() throws ParserConfigurationException { + DOMSource wrappedSource = new DOMSource(); + wrappedSource.setNode(toDocument()); + return wrappedSource; + } + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + /** + * creates wrapper object from the DOMSource that has wsdl 11 wrapper xml. + * @param wrappedMsg wsdl 11 wrapper xml as DOMSource + * @return WSDL11JBIWrapper representing the wrapper xml. + */ + public static WSDL11JBIWrapper sourceToWrapper(DOMSource wrappedMsg) { + Element jbiMessage = getElement(wrappedMsg.getNode()); + if ( jbiMessage == null ) { + return null; + } + String nsURI = jbiMessage.getNamespaceURI(); + String tagName = jbiMessage.getLocalName(); + if (!WRAPPER_NAMESPACE.equals(nsURI) || !JBI_MESSAGE_EL.equals(tagName)) { + return null; + } + String name = jbiMessage.getAttribute(NAME_ATTR); + String typeQN = jbiMessage.getAttribute(TYPE_ATTR); + String typePrefix = ""; + String typeName = ""; + if ( typeQN != null && typeQN.trim().length() > 0 ) { + int idx = typeQN.indexOf(':'); + if ( idx >= 0 ) { + typePrefix = typeQN.substring(0, idx); + if ( typeQN.length() > idx ) { + typeName = typeQN.substring(idx+1); + } + } else { + typePrefix = ""; + typeName = typeQN; + } + } + String typeURI = jbiMessage.getAttribute("xmlns:" + typePrefix); + QName typeQName = new QName(typeURI, typeName, typePrefix); + + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(typeQName); + NodeList jbiPartList = jbiMessage.getElementsByTagNameNS(WRAPPER_NAMESPACE, JBI_PART_EL); + for ( int i=0; i < jbiPartList.getLength(); ++i) { + Node jbiPart = jbiPartList.item(i); + wrapper.appendPart(jbiPart.getChildNodes()); + } + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object and sets the type and name of the object + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name ) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(type); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content has multiple child element. + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, NodeList partContent) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + wrapper.appendPart(partContent); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content is a single element + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, Element msgEl) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name, new WSDL11JBIWrapper.NodeListImpl(msgEl)); + return wrapper; + } + + public static WSDL11JBIWrapper createWrapper(QName type, String name, DOMSource inputSource) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + Node msgNode = getElement(inputSource.getNode()); + NodeList nodeList = new WSDL11JBIWrapper.NodeListImpl(msgNode); + wrapper.appendPart(nodeList); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations input element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createInputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Input input = operation.getInput(); + if ( input == null ) { + return null; + } + name = input.getName(); + Message wsdlMsg = input.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createOutputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Output output = operation.getOutput(); + if ( output == null) { + return null; + } + name = output.getName(); + Message wsdlMsg = output.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @param faultName fault name, can be null to look for the fault with no name. + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createFaultWrapper(Operation operation, String faultName) throws ParserConfigurationException { + QName type = null; + String name = null; + @SuppressWarnings("unchecked") + Map faultMap = operation.getFaults(); + Fault fault = faultMap.get(faultName); + + if ( fault == null ) { + return null; + } + name = fault.getName(); + Message wsdlMsg = fault.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * NodeList implementation. + */ + public static class NodeListImpl extends ArrayList implements NodeList { + + public NodeListImpl() { + super(); + } + + public NodeListImpl(Node aNode) { + super(); + if (aNode != null) { + this.add(aNode); + } + } + + public NodeListImpl(List nodes) { + if (nodes != null) { + this.addAll(nodes); + } + } + + public int getLength() { + return this.size(); + } + + public Node item(int idx) { + return this.get(idx); + } + + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java new file mode 100644 index 000000000..b5a1bb331 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java @@ -0,0 +1,419 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDLProcessor.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.wsdl.Port; +import javax.wsdl.PortType; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ElementExtensible; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.wsdl.xml.WSDLWriter; +import javax.xml.namespace.QName; + +/** + * This class is used to configure jwsdl(wsdl4j) to read and process wsdl documents with wsdl extensions. + * It provides set of helper methods to read and process the wsdl definitions from files with .wsdl + * extension from a specified directory. + *

+ * A Binding Component that is processing the wsdl extensions for its deployment configuration would + * extend this class and provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + *

+ * A Service Engine that is processing the wsdl during deployment can directly use this class + * to process the wsdl as the default implementation returned by this class configures the wsdl extension + * registry to read/write the service engine binding extensions. + * + * @see AbstractExtensionRegistry + * @see SEBindingExt + * @author chikkala + */ +public class WSDLProcessor { + + private String mXmlCatalogPath = "xml-catalog.xml"; + private String mWsdlDirPath = ""; + private WSDLReader mReader; + + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir) { + this(wsdlDir, null); + } + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir, String xmlCatPath) { + if ( wsdlDir != null ) { + this.mWsdlDirPath = wsdlDir; + } + if ( xmlCatPath != null ) { + this.mXmlCatalogPath = xmlCatPath; + } + } + /** @return directory path from which this class reads the wsdl files with .wsdl as file extension. */ + public String getWSDLDirectory() { + return this.mWsdlDirPath; + } + /** path to the xml catalog file in the service unit which can be used for Catalog-based entity + * and URI resolution. + */ + public String getXmlCatelogPath() { + return this.mXmlCatalogPath; + } + /** wsdl extension registry required for processing the wsdl extensions in the wsdl definition to + * java model. Binding component that is processing the wsdl extensions for its deployment + * configuration would provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + * @return ExtensionSerializer + * @see AbstractExtensionSerializer + */ + protected ExtensionRegistry getExtensionRegistry() { + return new AbstractExtensionRegistry() { + protected List createSerializers() { + return new ArrayList(); + } + }; + } + /** + * @return the WSDLReader configured with extension registry to process the wsdl extensions. + */ + public final WSDLReader getWSDLReader() throws WSDLException { + if ( this.mReader == null ) { + WSDLFactory factory = WSDLFactory.newInstance(); + this.mReader = factory.newWSDLReader(); + // reader.setFeature("javax.wsdl.verbose", true); + // reader.setFeature("javax.wsdl.importDocuments", true); + this.mReader.setExtensionRegistry(getExtensionRegistry()); + } + return this.mReader; + } + /** + * reads the wsdl file and returns the wsdl definition jwsdl model. + * @param wsldFilePath relative path to wsdl file from the the root wsdl directory returns from + * ${symbol_pound}getWSDLDirectory in the service unit or or absolute path . + * @return Definition + */ + public Definition readWSDL(String wsdlFilePath) throws WSDLException { + File wsdlFile = new File(wsdlFilePath); + if ( !wsdlFile.isAbsolute() ) { + wsdlFile = new File(this.mWsdlDirPath, wsdlFilePath); + } + return getWSDLReader().readWSDL(wsdlFile.getAbsolutePath()); + } + /** + * reads the files with .wsdl file extension in a directory. If the directory should + * be searched recursively, it searches this directory, all child directories of this + * directory and then to their child directories recursively. + * @param dir directory file to search for .wsdl files + * @param rec if set to true, it recursively searches the directory. if set to false, only + * this directory is searched. + * @return List of Files with .wsdl extension. + */ + public List listWSDLFiles(File dir, final boolean rec) throws IOException { + if ( dir == null || !dir.isDirectory()) { + throw new IOException(dir + " is not a directory for looking up wsdl files"); + } + List wsdlList = new ArrayList(); + File[] files = dir.listFiles(new FileFilter() { + public boolean accept(File pathname) { + if ( rec && pathname.isDirectory()) { + return true; + } else { + String name = pathname.getName(); + int idx = name.lastIndexOf('.'); + if ( idx < 0 ) { + return false; + } + String ext = name.substring(idx); + return ".wsdl".equalsIgnoreCase(ext); + } + } + }); + for ( File file : files ) { + if ( rec && file.isDirectory()) { + List wsdlFiles = listWSDLFiles(file, rec); + wsdlList.addAll(wsdlFiles); + } else { + wsdlList.add(file); + } + } + return wsdlList; + } + /** + * reads the files with .wsdl file extension in a directory fromDir and return the list of + * wsdl definitions corresponding to them. + * @param fromDir path to the directory relative to the root wsdl directory returns from + * ${symbol_pound}getWSDLDirectory or the absolute path to the directory. + */ + public List readWSDLs(String fromDir) throws WSDLException { + if ( fromDir == null ) { fromDir = ""; } + File wsdlDir = new File(fromDir); + if (!wsdlDir.isAbsolute()) { + wsdlDir = new File(this.mWsdlDirPath, fromDir); + } + + List wsdlFiles = new ArrayList(); + try { + wsdlFiles = listWSDLFiles(wsdlDir, true); + } catch (IOException ioEx) { + throw new WSDLException("WSDLFileReadError", ioEx.getMessage(),ioEx); + } + + List wsdlPaths = new ArrayList(); + for ( File wsdlFile : wsdlFiles) { + wsdlPaths.add(wsdlFile.getAbsolutePath()); + } + Collections.sort(wsdlPaths); + + List wsdlList = new ArrayList(); + for ( String wsdlPath : wsdlPaths ) { + Definition wsdlDef = readWSDL(wsdlPath); + wsdlList.add(wsdlDef); + } + return wsdlList; + } + /** + * finds PortType using port type ( interface ) qname. + */ + public static PortType findInterface(Definition wsdlDef, QName interfaceName) { + return wsdlDef.getPortType(interfaceName); + } + /** finds the Service using service qname */ + public static Service findService(Definition wsdlDef, QName serviceName) { + return wsdlDef.getService(serviceName); + } + /** finds the wsdl port using service qname and endpoint name */ + public static Port findServiceEndpoint(Definition wsdlDef, QName serviceName, String endpointName) { + Service service = null; + Port port = null; + service = findService(wsdlDef, serviceName); + if ( service != null ) { + port = service.getPort(endpointName); + } + return port; + } + /** + * finds the binding definition to which the service with serviceName and endpointName was bound. + */ + public static Binding findServiceBinding(Definition wsdlDef, QName serviceName, String endpointName) { + Binding binding = null; + Port port = findServiceEndpoint(wsdlDef, serviceName, endpointName); + if ( port != null ) { + binding = port.getBinding(); + } + return binding; + } + /** + * finds the binding definition using the interface(portType) qname with a + */ + public static Binding findInterfaceBinding(Definition wsdlDef, + QName interfaceQName, QName extQName) { + Map bindingMap = wsdlDef.getBindings(); + @SuppressWarnings("unchecked") + Collection bindings = bindingMap.values(); + for ( Binding binding : bindings ) { + if ( binding.getPortType().getQName().equals(interfaceQName)) { + return binding; + } + } + return null; + } + + /** + * find the wsdl4j operation corresponds to the interface+operation. + * @param wsdlDef wsdl definition + * @param portTypeQName portType QName + * @param opName operation name. if null, first operation in the portType + * is returned. + * @return Operation corresponding to the portType+opName + */ + public static Operation findOperation(Definition wsdlDef, + QName portTypeQName, String opName) { + Operation operation = null; + PortType portType = wsdlDef.getPortType(portTypeQName); + if ( portType != null ) { + if ( opName != null ) { + operation = portType.getOperation(opName, null, null); + } else { + @SuppressWarnings("unchecked") + List list = portType.getOperations(); + if ( list != null && list.size() > 0 ) { + operation = list.get(0); + } + } + } + return operation; + } + /** + * verifies whether the wsdl definition contains the specified service descriptions or not. Used + * to locate the wsdl definition for the services describes in service unit deployment + * descriptor(jbi.xm). + * @param interfaceName portType qname to find in the definition. can be null if you are trying to + * find only service endpoint description. + * @param serviceName qname for the service to find in this wsdl. can be null if + * you are trying to find only portType (abstract service) description. + * @param endpointName port name to find in the service definition. null if only + * service with any port should be looked up. + * + * @return true if the wsdl definition contains the specified service description. + */ + public static boolean isWSDLFor(Definition wsdlDef, + QName interfaceName, QName serviceName, String endpointName) { + PortType portType = null; + Service service = null; + Port port = null; + if ( interfaceName != null ) { + portType = findInterface(wsdlDef, interfaceName); + } + + if ( serviceName != null ) { + service = findService(wsdlDef, serviceName); + } + + if ( endpointName != null && service != null ) { + port = service.getPort(endpointName); + } + + boolean isWSDL = true; + + if ( (interfaceName != null && portType == null) || + ( serviceName != null && service == null ) || + ( endpointName != null && (service == null || port == null)) ) { + isWSDL = false; + } + + return isWSDL; + } + /** + * creates a binding definition that contains a service engine binding elements in the specified + * wsdl definition for a portType. It will try to find/create the binding element with interface + * local name with a "_JBISEBinding" suffix and add service engine binding element to it if it + * is not present. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding createServiceEngineBinding(Definition wsdl, QName interfaceName) { + QName bindingQName = new QName(wsdl.getQName().getNamespaceURI(), + interfaceName.getLocalPart() + "_JBISEBinding"); + Binding binding = wsdl.getBinding(bindingQName); + if ( binding == null ) { + binding = wsdl.createBinding(); + binding.setQName(bindingQName); + binding.setPortType(wsdl.getPortType(interfaceName)); + binding.setUndefined(false); + + ExtensibilityElement bindingExt = + SEBindingExt.SEBindingExtImpl.addExtensibilityElement(wsdl, binding); + + wsdl.addBinding(binding); + } + return binding; + } + /** + * creates port and binding elements that provide the the service engine binding for a service. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @param serviceName service under which the port definition bound to the service engine binding + * should be created. + * @param endpointName port name. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding createServiceEngineBinding(Definition wsdl, QName interfaceName, QName serviceName, String endpointName ) { + Binding binding = null; + Service service = findService(wsdl, serviceName); + if ( service == null ) { + return null; + } + Port port = service.getPort(endpointName); + if ( port != null ) { + binding = port.getBinding(); + } else { + // create port + port = wsdl.createPort(); + port.setName(endpointName); + binding = createServiceEngineBinding(wsdl, interfaceName); + port.setBinding(binding); + service.addPort(port); + } + return binding; + } + /** prints the wsdl to text from the wsdl definition */ + public static void printWSDL(PrintWriter out, Definition def) { + try { + WSDLFactory factory = WSDLFactory.newInstance(); + WSDLWriter wsdlWriter = factory.newWSDLWriter(); + wsdlWriter.writeWSDL(def, out); + } catch (WSDLException ex) { + ex.printStackTrace(out); + } + } + /** prints the wsdl to text from the wsdl definition */ + public static String printWSDLToString(Definition def) { + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + printWSDL(out, def); + out.close(); + return writer.getBuffer().toString(); + } + /** returns an existing namespace prefix or create one if not exists for the corresponding namespaceURI */ + public static String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static void addExtensibilityElement(Definition wsdlDef, + ElementExtensible extensibleEl, ExtensibilityElement extEl, String defPrefix) { + QName elementType = extEl.getElementType(); + String namespaceURI = elementType.getNamespaceURI(); + String prefix = wsdlDef.getPrefix(namespaceURI); + if ( prefix == null ) { + // no namespace prefix defined. create one. + prefix = WSDLProcessor.getNamespacePrefix(wsdlDef, namespaceURI, defPrefix); + wsdlDef.addNamespace(prefix, namespaceURI); + } + extensibleEl.addExtensibilityElement(extEl); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/BindingExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/BindingExt.java new file mode 100644 index 000000000..f61d31f64 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/BindingExt.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * BindingExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * extension element. The inner classes BindingExtImpl implements the interface + * and the BindingExtSerializer provides the serializer and deserializer + * implementation. The implementation and serializer classes will be registered + * with the ExtensionRegistry to process the binding extension element in the + * wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface BindingExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + //TODO: define get/set methods for properties for BindingExt if the extension element has attributes. + + /** + * This class is an implementation of BindingExt interface that provides + * java model for binding extensibility element. + */ + public static class BindingExtImpl extends AbstractExtensibilityElement implements BindingExt { + + public BindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + + /** + * creates and adds the binding extensibility element to the wsdl + * definition + */ + public static BindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + BindingExtImpl bindingExt = new BindingExt.BindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, NS_DEF_PREFIX); + return bindingExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding extensibility element. + */ + public static class BindingExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public BindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, BindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + BindingExt extObj = (BindingExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + BindingExt extObj = (BindingExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=${symbol_escape}"" + myAttr + "${symbol_escape}""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java new file mode 100644 index 000000000..2a7b8d153 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java @@ -0,0 +1,52 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ExtConstants.java + * + */ +package net.openesb.component.${artifactId}.wsdlext; + +import javax.xml.namespace.QName; + +/** + * This interface defines the constants for the namespace, elements, attributes + * and qnames corresponding to the wsdl extensions that this component + * processes. These constants will be used in the wsdl extension model used to + * process a particular wsdl extensions. + * + * @see WSDLExtensionRegistry + * @see PortExt + * @see BindingExt + * @author chikkala + */ +public interface ExtConstants { + + public static final String NS_URI_WSDL = "http://schemas.xmlsoap.org/wsdl/"; + public static final String NS_URI_XMLNS = "http://www.w3.org/2000/xmlns/"; + /** + * wsdl extension namespace processed by this wsdl extension model + */ + public static final String NS_URI = "http://java.sun.com/jbi/wsdl-extensions/sample/jmx-bc/"; + public static final String NS_DEF_PREFIX = "jmxbc"; + // wsdl extension element names. + public static final String EL_BINDING_EXT = "binding"; + public static final String EL_OPERATION_EXT = "operation"; + public static final String EL_INPUT_EXT = "input"; + public static final String EL_OUTPUT_EXT = "output"; + public static final String EL_FAULT_EXT = "fault"; + public static final String EL_PORT_EXT = "address"; + // Qualified wsdl extension element names. + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + public static final QName QN_OPERATION_EXT = new QName(NS_URI, EL_OPERATION_EXT); + public static final QName QN_INPUT_EXT = new QName(NS_URI, EL_INPUT_EXT); + public static final QName QN_OUTPUT_EXT = new QName(NS_URI, EL_OUTPUT_EXT); + public static final QName QN_FAULT_EXT = new QName(NS_URI, EL_FAULT_EXT); + public static final QName QN_PORT_EXT = new QName(NS_URI, EL_PORT_EXT); + // wsdl extension elements attribute names. + public static final String ATTR_ACTION = "action"; + public static final String ATTR_SERVICE_URL = "serviceURL"; + public static final String ATTR_USERNAME = "username"; + public static final String ATTR_PASSWORD = "password"; + public static final String ATTR_MBEAN = "mbean"; +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/FaultExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/FaultExt.java new file mode 100644 index 000000000..051573122 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/FaultExt.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * FaultExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingFault; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation fault extension element. The inner classes FaultExtImpl implements + * the interface and the FaultExtSerializer provides the serializer and + * deserializer implementation. The implemenation and serializer classes will be + * registered with the ExtensionRegistry to process the binding operation fault + * extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface FaultExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define getter methods for properties for FaultExt if the extension element has attributes. + /** + * This class is an implementation of FaultExt interface that provides java + * model for binding operation fault extensibility element. + */ + public static class FaultExtImpl extends AbstractExtensibilityElement implements FaultExt { + + public FaultExtImpl() { + setElementType(QN_FAULT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static FaultExtImpl addExtensibilityElement(Definition wsdlDef, BindingFault fault) { + FaultExtImpl faultExt = new FaultExt.FaultExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, fault, faultExt, NS_DEF_PREFIX); + return faultExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation fault extensibility element. + */ + public static class FaultExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public FaultExtSerializer() { + super(BindingFault.class, QN_FAULT_EXT, FaultExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + FaultExt extObj = (FaultExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + FaultExt extObj = (FaultExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_FAULT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=${symbol_escape}"" + myAttr + "${symbol_escape}""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/InputExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/InputExt.java new file mode 100644 index 000000000..bb4f45078 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/InputExt.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * InputExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingInput; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation input extension element. The inner classes InputExtImpl implements + * the interface and the InputExtSerializer provides the serislizer and + * deserializer implementation. The implementation and serializer classes will + * be registered with the ExtensionRegistry to process the binding operation + * input extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface InputExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define get/set methods for properties for InputExt if the extension element has attributes. + /** + * This class is an implementation of InputExt interface that provides java + * model for binding operation input extensibility element. + */ + public static class InputExtImpl extends AbstractExtensibilityElement implements InputExt { + + public InputExtImpl() { + setElementType(QN_INPUT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static InputExtImpl addExtensibilityElement(Definition wsdlDef, BindingInput input) { + InputExtImpl inputExt = new InputExt.InputExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, input, inputExt, NS_DEF_PREFIX); + return inputExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation input extensibility element. + */ + public static class InputExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public InputExtSerializer() { + super(BindingInput.class, QN_INPUT_EXT, InputExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + InputExt extObj = (InputExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + InputExt extObj = (InputExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_INPUT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=${symbol_escape}"" + myAttr + "${symbol_escape}""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OperationExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OperationExt.java new file mode 100644 index 000000000..c7fd384a4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OperationExt.java @@ -0,0 +1,121 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * OperationExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingOperation; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation extension element. The inner classes OperationImpl implements the + * interface and the OperationExtSerializer provides the serilizer and + * deserializer implementation. The implementation and serializer classes will + * be registered with the ExtensionRegistry to process the binding operation + * extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface OperationExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + /** + * Getter for property action. + * + * @return Value of property action. + */ + public String getAction(); + + /** + * Setter for property action. + * + * @param action New value of property action. + */ + public void setAction(String action); + + /** + * This class is an implementation of OperationExt interface that provides + * java model for binding operation extensibility element. + */ + public static class OperationExtImpl extends AbstractExtensibilityElement implements OperationExt { + + private String mAction; + + public OperationExtImpl() { + setElementType(QN_OPERATION_EXT); + } + + public String getAction() { + return this.mAction; + } + + public void setAction(String action) { + this.mAction = action; + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static OperationExtImpl addExtensibilityElement(Definition wsdlDef, BindingOperation operation) { + OperationExtImpl operationExt = new OperationExt.OperationExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, operation, operationExt, NS_DEF_PREFIX); + return operationExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation extensibility element. + */ + public static class OperationExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public OperationExtSerializer() { + super(BindingOperation.class, QN_OPERATION_EXT, OperationExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + OperationExt extObj = (OperationExt) extReg.createExtension(parentType, elementType); + String action = el.getAttribute(ATTR_ACTION); + extObj.setAction(action); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + OperationExt extObj = (OperationExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_OPERATION_EXT); + buff.append("<" + elName); + + String action = extObj.getAction(); + if (action != null && action.trim().length() > 0) { + buff.append(" " + ATTR_ACTION + "=${symbol_escape}"" + action + "${symbol_escape}""); + } + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OutputExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OutputExt.java new file mode 100644 index 000000000..7c88fc9de --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OutputExt.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * OutputExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingOutput; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation output extension element. The inner classes OutputExtImpl + * implements the interface and the OutputExtSerializer provides the serilizer + * and deserializer implementation. The implementation and serializer classes + * will be registered with the ExtensionRegistry to process the binding + * operation output extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface OutputExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define get/set methods for properties for OutputExt if the extension element has attributes. + /** + * This class is an implementation of OutputExt interface that provides java + * model for binding operation output extensibility element. + */ + public static class OutputExtImpl extends AbstractExtensibilityElement implements OutputExt { + + public OutputExtImpl() { + setElementType(QN_OUTPUT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static OutputExtImpl addExtensibilityElement(Definition wsdlDef, BindingOutput output) { + OutputExtImpl OutputExt = new OutputExt.OutputExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, output, OutputExt, NS_DEF_PREFIX); + return OutputExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation output extensibility element. + */ + public static class OutputExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public OutputExtSerializer() { + super(BindingOutput.class, QN_OUTPUT_EXT, OutputExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + OutputExt extObj = (OutputExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + OutputExt extObj = (OutputExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_OUTPUT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=${symbol_escape}"" + myAttr + "${symbol_escape}""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/PortExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/PortExt.java new file mode 100644 index 000000000..ca5ce4b09 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/PortExt.java @@ -0,0 +1,217 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * PortExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for port + * extension element. The inner classes PortExtImpl implements the interface and + * the PortExtSerializer provides the serializer and deserializer implemenation. + * The implementation and serializer classes will be registered with the + * ExtensionRegistry to process the port extension element in the wsdl + * definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface PortExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + /** + * Getter for property serviceURL. + * + * @return Value of property serviceURL. + */ + public String getServiceURL(); + + /** + * Setter for property serviceURL. + * + * @param serviceURL New value of property serviceURL. + */ + public void setServiceURL(String serviceURL); + + /** + * Getter for property username. + * + * @return Value of property username. + */ + public String getUsername(); + + /** + * Setter for property username. + * + * @param username New value of property username. + */ + public void setUsername(String username); + + /** + * Getter for property password. + * + * @return Value of property password. + */ + public String getPassword(); + + /** + * Setter for property password. + * + * @param password New value of property password. + */ + public void setPassword(String password); + + /** + * Getter for property name. + * + * @return Value of property name. + */ + public String getMBean(); + + /** + * Setter for property mbean. + * + * @param name New value of property mbean. + */ + public void setMBean(String mbean); + + /** + * This class is an implementation of PortExt interface that provides java + * model for port extensibility element. + */ + public static class PortExtImpl + extends AbstractExtensibilityElement implements PortExt { + + private String mServiceURL; + private String mUsername; + private String mPassword; + private String mMBean; + + public PortExtImpl() { + setElementType(QN_PORT_EXT); + } + + public String getServiceURL() { + return this.mServiceURL; + } + + public void setServiceURL(String serviceURL) { + this.mServiceURL = serviceURL; + } + + public String getUsername() { + return this.mUsername; + } + + public void setUsername(String username) { + this.mUsername = username; + } + + public String getPassword() { + return this.mPassword; + } + + public void setPassword(String password) { + this.mPassword = password; + } + + public String getMBean() { + return this.mMBean; + } + + public void setMBean(String mbean) { + this.mMBean = mbean; + } + + /** + * creates and adds the port extensibility element to the wsdl + * definition + */ + public static PortExtImpl addExtensibilityElement(Definition wsdlDef, Port port) { + PortExtImpl portExt = new PortExt.PortExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, port, portExt, NS_DEF_PREFIX); + return portExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * port extensibility element. + */ + public static class PortExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public PortExtSerializer() { + super(Port.class, QN_PORT_EXT, PortExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + PortExt extObj = (PortExt) extReg.createExtension(parentType, elementType); + + String serviceURL = el.getAttribute(ATTR_SERVICE_URL); + extObj.setServiceURL(serviceURL); + + String mbean = el.getAttribute(ATTR_MBEAN); + extObj.setMBean(mbean); + + String username = el.getAttribute(ATTR_USERNAME); + extObj.setUsername(username); + + String password = el.getAttribute(ATTR_PASSWORD); + extObj.setPassword(password); + + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + PortExt extObj = (PortExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_PORT_EXT); + buff.append("<" + elName); + + String serviceURL = extObj.getServiceURL(); + if (serviceURL != null && serviceURL.trim().length() > 0) { + buff.append(" " + ATTR_SERVICE_URL + "=${symbol_escape}"" + serviceURL + "${symbol_escape}""); + } + + String mbean = extObj.getMBean(); + if (mbean != null && mbean.trim().length() > 0) { + buff.append(" " + ATTR_MBEAN + "=${symbol_escape}"" + mbean + "${symbol_escape}""); + } + + String username = extObj.getUsername(); + if (username != null && username.trim().length() > 0) { + buff.append(" " + ATTR_USERNAME + "=${symbol_escape}"" + username + "${symbol_escape}""); + } + + String password = extObj.getUsername(); + if (password != null && password.trim().length() > 0) { + buff.append(" " + ATTR_PASSWORD + "=${symbol_escape}"" + password + "${symbol_escape}""); + } + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java new file mode 100644 index 000000000..c73d4e3f6 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java @@ -0,0 +1,223 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDLExtHelper.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import java.util.List; +import javax.wsdl.Binding; +import javax.wsdl.BindingFault; +import javax.wsdl.BindingInput; +import javax.wsdl.BindingOperation; +import javax.wsdl.BindingOutput; +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This class is a helper class for processing the wsdl extensions. It has + * methods that help locate the extension elements and return the java models + * corresponds to the extension elements. + * + * @author chikkala + */ +public final class WSDLExtHelper { + + /** + * creates the java object for the port extension element. + * + * @param def wsdl definition + * @param serviceName QName of the service + * @param endpointName name of the port under which to lookup for the port + * extension. + * @return java object for the port extension element + */ + public static PortExt getPortExt(Definition def, QName serviceName, String endpointName) { + PortExt portExt = null; + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + @SuppressWarnings("unchecked") + List extElList = port.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof PortExt) { + portExt = (PortExt) extEl; + break; + } + } + return portExt; + } + + /** + * creates the java object for the binding extension element. + * + * @param def wsdl definition + * @param binding binding under which to lookup for the binding extension. + * @return java object for the port extension element + */ + public static BindingExt getBindingExt(Definition def, Binding binding) { + BindingExt bindingExt = null; + @SuppressWarnings("unchecked") + List extElList = binding.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof BindingExt) { + bindingExt = (BindingExt) extEl; + break; + } + } + return bindingExt; + } + + /** + * creates the java object for the binding extension element. + * + * @param def wsdl definition + * @param serviceName QName of the service + * @param endpointName name of the port that references the binding. + * @return java object for the port extension element + */ + public static BindingExt getBindingExt(Definition def, QName serviceName, String endpointName) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getBindingExt(def, binding); + } + + /** + * @return OperationExt java object corresponding to the operation extension + * element under binding + */ + public static OperationExt getOperationExt(Definition def, Binding binding, String operation) { + OperationExt operationExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, null); + if (bindingOp != null) { + @SuppressWarnings("unchecked") + List extElList = bindingOp.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof OperationExt) { + operationExt = (OperationExt) extEl; + break; + } + } + } + return operationExt; + } + + /** + * @return OperationExt java object corresponding to the operation extension + * element under binding + */ + public static OperationExt getOperationExt(Definition def, QName serviceName, String endpointName, String operation) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getOperationExt(def, binding, operation); + } + + /** + * @return InputExt java object corresponding to input extension element of + * the the binding operation under binding + */ + public static InputExt getInputExt(Definition def, Binding binding, + String operation, String input) { + InputExt inputExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, input, null); + if (bindingOp != null) { + BindingInput bindingInput = bindingOp.getBindingInput(); + @SuppressWarnings("unchecked") + List extElList = bindingInput.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof InputExt) { + inputExt = (InputExt) extEl; + break; + } + } + } + return inputExt; + } + + /** + * @return InputExt java object corresponding to input extension element of + * the the binding operation under binding + */ + public static InputExt getInputExt(Definition def, + QName serviceName, String endpointName, String operation, String input) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getInputExt(def, binding, operation, input); + } + + /** + * @return OutputExt java object corresponding to output extension element + * of the the binding operation under binding + */ + public static OutputExt getOutputExt(Definition def, Binding binding, + String operation, String output) { + OutputExt outputExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, output); + if (bindingOp != null) { + BindingOutput bindingOutput = bindingOp.getBindingOutput(); + @SuppressWarnings("unchecked") + List extElList = bindingOutput.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof OutputExt) { + outputExt = (OutputExt) extEl; + break; + } + } + } + return outputExt; + } + + /** + * @return OutputExt java object corresponding to output extension element + * of the the binding operation under binding + */ + public static OutputExt getOutputExt(Definition def, + QName serviceName, String endpointName, String operation, String output) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getOutputExt(def, binding, operation, output); + } + + /** + * @return FaultExt java object corresponding to fault extension element of + * the the binding operation under binding + */ + public static FaultExt getFaultExt(Definition def, Binding binding, + String operation, String faultName) { + FaultExt faultExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, null); + if (bindingOp != null) { + BindingFault bindingFault = bindingOp.getBindingFault(faultName); + if (bindingFault != null) { + @SuppressWarnings("unchecked") + List extElList = bindingFault.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof FaultExt) { + faultExt = (FaultExt) extEl; + break; + } + } + } + } + return faultExt; + } + + /** + * @return FaultExt java object corresponding to fault extension element of + * the the binding operation under binding + */ + public static FaultExt getFaultExt(Definition def, + QName serviceName, String endpointName, String operation, String faultName) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getFaultExt(def, binding, operation, faultName); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd new file mode 100644 index 000000000..1311a03c9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd @@ -0,0 +1,98 @@ + + + + + + + + + "binding" defines a protocol based binding details. + + + + + + + + + + + + + + "operation" defines the protocol based binding operation details. + + + + + + + + + + + + + + + "input" defines the protocol based binding input details. + + + + + + + + + + + + + + "output" defines the protocol based binding output details. + + + + + + + + + + + + + + "fault" defines the protocol based binding fault details. + + + + + + + + + + + + + + "address" indicates protocol based binding port details. + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java new file mode 100644 index 000000000..36154acfb --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java @@ -0,0 +1,46 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDLExtensionRegistry.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionRegistry; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import java.util.ArrayList; +import java.util.List; + +/** + * This class extends + * AbstractExtensionRegistry to create the serializers and deserializers + * for processing wsdl extensions. + * + * @see AbstractExtensionRegistry + * @author chikkala + */ +public class WSDLExtensionRegistry extends AbstractExtensionRegistry { + + /** + * Creates a new instance of JMXBindingExtensionRegistry + */ + public WSDLExtensionRegistry() { + super(); + } + + /** + * creates serializers and deserializers for all the extension elements + */ + protected List createSerializers() { + List list = new ArrayList(); + + list.add(new BindingExt.BindingExtSerializer()); + list.add(new OperationExt.OperationExtSerializer()); + list.add(new InputExt.InputExtSerializer()); + list.add(new OutputExt.OutputExtSerializer()); + list.add(new FaultExt.FaultExtSerializer()); + list.add(new PortExt.PortExtSerializer()); + + return list; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/BindingComponentTest.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/BindingComponentTest.java new file mode 100644 index 000000000..defb6afd4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/BindingComponentTest.java @@ -0,0 +1,55 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ${artifactId}Test.java + */ +package bindingtest; +import net.openesb.component.${artifactId}.test.JBIComponentTestClient; +import net.openesb.component.${artifactId}.test.JMXBindingTestClient; +import java.util.Properties; + import junit.framework.TestCase; + +/** + * The test method in this testcase uses the JMXBindingTestClient to send the + * input document to the echo service provided by service engine via the binding + * component by sending the input to the binding using jmx interface. The output + * received from the service invocation will be placed in test results directory + * under the same package as this test case. + * @see com.sun.jbi.sample.component.test.JMXBindingTestClinet + * + * @author chikkala + */ +public class BindingComponentTest + extends TestCase +{ + + public BindingComponentTest(String testName) { + super(testName); + } + + public void test1() throws Exception { + String testPropertiesPath = "test1.properties"; + JBIComponentTestClient testClient = new JMXBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public void test2() throws Exception { + String testPropertiesPath = "test2.properties"; + JBIComponentTestClient testClient = new JMXBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public static void main(String[] args) { + try { + BindingComponentTest compTest = new BindingComponentTest("BindingComponentTest"); + compTest.test1(); + compTest.test2(); + } catch(Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test1.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test1.properties new file mode 100644 index 000000000..02707a88a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test1.properties @@ -0,0 +1,16 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Sample ResourceBundle properties file + +${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} test properties for testing the binding component +input.file=test1Input.xml +${symbol_pound}exptected.file=Expected.xml +output.file=test1Output.xml + +consumer.jmx.bc.ep.operation=sayHello +consumer.jmx.bc.ep.address.mbean=com.sun.jbi.sample.jmxbc:jmxbc-ep-address=BindingComponent/greetings +consumer.jmx.bc.ep.address.serviceURL=service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi +consumer.jmx.bc.ep.address.username=admin +consumer.jmx.bc.ep.address.password=this really long string is used to identify a password that has been stored in the Keyring + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml new file mode 100644 index 000000000..ac1004c3e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml @@ -0,0 +1,12 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test2.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test2.properties new file mode 100644 index 000000000..4921dee72 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test2.properties @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Sample ResourceBundle properties file + +${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} test properties for testing the binding component +input.file=test2Input.xml +${symbol_pound}exptected.file=Expected.xml +output.file=test2Output.xml + +consumer.jmx.bc.ep.operation=sayGoodbye +consumer.jmx.bc.ep.address.mbean=com.sun.jbi.sample.jmxbc:jmxbc-ep-address=BindingComponent/greetings +consumer.jmx.bc.ep.address.serviceURL=service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi +consumer.jmx.bc.ep.address.username=admin +consumer.jmx.bc.ep.address.password=this really long string is used to identify a password that has been stored in the Keyring diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml new file mode 100644 index 000000000..31058414d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml @@ -0,0 +1,12 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java new file mode 100644 index 000000000..919ad6829 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java @@ -0,0 +1,298 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JBIComponentTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; + +/** + * This class implements the base framework for the testing the JBI components. + * Testing the JBI component involves may require deploying a service to the + * component(s) to enable the service provided by the test component and then + * invoking the service provided by the test component. If the test component is + * a binding component, then a service provider component such as sample service + * engine is required to test the component end to end. If the test component is a + * service engine, then the service on the test component can be invoked via + * soap/http binding component. + * + * This class provides the utilites to read the test properties, read the input + * message from the file and save the output to the file. The testService + * method implemented here can be executed as the test for the component. The + * testService method calls the invokeService method with the input document and + * expects a output document or error that will be saved to the output file. + * The method invokeService should be implemented by the extended test classes to + * inplement a suitable service consumer implemenation for the test compoent. + * See JMXBindingTestClient.java or SOAPBidningTestClient.java for more details + * on how to implement a partucular test service consumer. + * + * @author chikkala + */ +public abstract class JBIComponentTestClient { + + public static final String TEST_PROPS_FILE_PROP = "test.properties.file"; + public static final String TEST_RESULTS_DIR_PROP = "test.results.dir"; + public static final String TEST_SRC_DIR_PROP = "test.src.dir"; + + public static final String TEST_PACKAGE_PROP = "test.package.name"; + + public static final String INPUT_FILE_PROP = "input.file"; + public static final String EXPECTED_FILE_PROP = "expected.file"; + public static final String OUTPUT_FILE_PROP = "output.file"; + + public static final String DEF_TEST_PROP_FILE = "test.properties"; + public static final String DEF_INPUT_FILE = "Input.xml"; + public static final String DEF_OUTPUT_FILE = "Output.xml"; + public static final String DEF_TEST_RESULTS_DIR = "test-results"; + + public JBIComponentTestClient() { + } + /** + * returns the absolute resource path w.r.t. the packagePath if the resource name + * is relative else return the resourceName as it is. + * @param package name ( dot separated ) + * @param resourcName dot separated name or a absolute resource path + * @return abosolute resource path with path separator + */ + public static String resolveResourcePath(String packageName, String resourceName) { + String resourcePath = resourceName; + if ( !resourceName.startsWith("/")) { + // it is relative resource file. resolve it w.r.t. testPackage + String pkgDir = packageName.trim().replace('.', '/'); + if ( pkgDir.length() != 0 ) { + pkgDir += "/"; + } + resourcePath = "/" + pkgDir + resourceName; + } + return resourcePath; + } + /** + * loads the resource file as properties. + * @param testPackage package name where this test belongs + * @param testPropPath resource path relative to testPackage or absolute resource path + */ + public Properties loadTestProperties(String testPackage, String testPropPath) throws IOException { + String propsResourcePath = resolveResourcePath(testPackage, testPropPath); + + InputStream testPropIS = null; + try { + testPropIS = this.getClass().getResourceAsStream(propsResourcePath); + Properties testProps = new Properties(); + testProps.load(testPropIS); + testProps.setProperty(TEST_PACKAGE_PROP, testPackage); + return testProps; + } finally { + if ( testPropIS != null ) { + try { + testPropIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @param testPropPath resource path relative to testPackage or absolute resource path + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass, String testPropPath) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), testPropPath ); + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), DEF_TEST_PROP_FILE ); + } + /** + * loads the resource file to string bugger + * @param inputFile resource file path + */ + public StringBuffer loadResourceFile(String resourcePath) throws FileNotFoundException, IOException { + + InputStream inputIS = null; + InputStreamReader inputReader = null; + BufferedReader reader = null; + StringWriter strWriter = null; + PrintWriter writer = null; + try { + inputIS = this.getClass().getResourceAsStream(resourcePath); + inputReader = new InputStreamReader(inputIS); + reader = new BufferedReader(inputReader); + strWriter = new StringWriter(); + writer = new PrintWriter(strWriter); + for ( String line = null; (line = reader.readLine()) != null ; ) { + writer.println(line); + } + writer.close(); + strWriter.close(); + return strWriter.getBuffer(); + } finally { + if ( inputIS != null ) { + try { + inputIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + + /** + * reads data from the reader and saves to file + * @param reader reader from which to read the data and save to file + * @param outputFilePath absolute file path + */ + public void saveOutputToFile(Reader reader, String outputFilePath) throws IOException { + + BufferedReader buff = null; + FileWriter fileWriter = null; + PrintWriter writer = null; + try { + buff = new BufferedReader(reader); + fileWriter = new FileWriter(outputFilePath); + writer = new PrintWriter(fileWriter); + for ( String line = null; (line = buff.readLine()) != null ; ) { + writer.println(line); + } + } finally { + if ( writer != null ) { + writer.close(); + } + if ( fileWriter != null ) { + fileWriter.close(); + } + } + } + + /** + * resource path. + */ + public String getInputFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String inputFile = testProps.getProperty(INPUT_FILE_PROP, DEF_INPUT_FILE); + String resourcePath = resolveResourcePath(testPkg, inputFile); + return resourcePath; + } + /** + * return resource path + */ + public String getExpectedFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String resourcePath = null; + String expFile = testProps.getProperty(EXPECTED_FILE_PROP, null); + if ( expFile != null ) { + resourcePath = resolveResourcePath(testPkg, expFile); + } + return resourcePath; + } + /** + * return the absolute path to the output file + */ + public String getOutputFilePath(Properties testProps) { + + String defPackage = this.getClass().getPackage().getName(); + String testPackage = testProps.getProperty(TEST_PACKAGE_PROP, defPackage); + String testPackageDir = testPackage.replace('.','/'); + String outputFile = testProps.getProperty(OUTPUT_FILE_PROP, DEF_OUTPUT_FILE); + + String userHomeDir = System.getProperty("user.home", ""); + String userDir = System.getProperty("user.dir", userHomeDir); + String defResultsDir = userDir + "/" + DEF_TEST_RESULTS_DIR; + String sysResultDir = System.getProperty(TEST_RESULTS_DIR_PROP, defResultsDir); + String resultDir = testProps.getProperty(TEST_RESULTS_DIR_PROP, sysResultDir); + + File outputDir = new File(resultDir, testPackageDir); + // System.out.println("Creating the test results output dir " + outputDir); + outputDir.mkdirs(); + return (new File(outputDir, outputFile)).getAbsolutePath(); + } + + /** + * This is the method where the actual service invocation code based on the + * type of client will be implemented. testService method calls this method + * after preparing the test input and then processes the output returned by + * this method to complte the test. + * @param inputDoc + * @param testProps + * @throws java.lang.Exception + * @return + */ + public abstract StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception; + + /** + * abstract method implemented by the extended classes to compare the output + * document with the expected output to determine the test is a failure or + * success. + * @param outputDoc + * @param expectedDoc + * @param testProps + * @throws java.lang.Exception + */ + public abstract void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, Properties testProps) throws Exception; + + /** + * This is the main test method that a test case will call to test the + * service. The standard steps that required to invoke the service and + * process the output will be done in this method. Each test case creates + * the test Properties required for that test and executes this method for + * testing the service by passing the test properties to it. This method + * prepares the input and executes the invokeService method to invoke a + * service with the prepared input. It then processes the return value from + * the invokeService to complete the test. + * + * @param testProps + * @throws java.lang.Exception + */ + public void testService(Properties testProps) throws Exception { + + String inFilePath = getInputFileResourcePath(testProps); + String outFilePath = getOutputFilePath(testProps); + String expFilePath = getExpectedFileResourcePath(testProps); + File outDir = (new File(outFilePath)).getParentFile(); + outDir.mkdirs(); + + StringBuffer outputDoc = new StringBuffer(); + + try { + StringBuffer inputDoc = loadResourceFile(inFilePath); + outputDoc = invokeService(inputDoc, testProps); + if ( expFilePath != null ) { + StringBuffer expOutputDoc = loadResourceFile(expFilePath); + compareWithExpectedOutput(inputDoc, expOutputDoc, testProps); + } + } catch (Exception ex) { + StringWriter out = new StringWriter(); + ex.printStackTrace(new PrintWriter(out)); + outputDoc.append(out.getBuffer()); + throw ex; + } finally { + if ( outputDoc != null ) { + System.out.println(outputDoc); + this.saveOutputToFile(new StringReader(outputDoc.toString()), outFilePath); + } + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java new file mode 100644 index 000000000..7cc8c103e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java @@ -0,0 +1,136 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the proxy service consumer implementation by a binding component + * that can communicate with the external service consumers using JMX interface. + * @author chikkala + */ +public class JMXBindingTestClient extends JBIComponentTestClient { + + public static final String CONSUMER_EP_INBOUND_OPERATION_PROP = "consumer.jmx.bc.ep.operation"; + public static final String CONSUMER_EP_ADDRESS_MBEAN_PROP = "consumer.jmx.bc.ep.address.mbean"; + public static final String CONSUMER_EP_ADDRESS_URL_PROP = "consumer.jmx.bc.ep.address.serviceURL"; + public static final String CONSUMER_EP_ADDRESS_USERNAME_PROP = "consumer.jmx.bc.ep.address.username"; + public static final String CONSUMER_EP_ADDRESS_PASSWORD_PROP = "consumer.jmx.bc.ep.address.password"; + + public static final String PROVIDER_EP_INBOUND_OPERATION_PROP = "provider.jmx.bc.ep.operation"; + public static final String PROVIDER_EP_ADDRESS_MBEAN_PROP = "provider.jmx.bc.ep.address.mbean"; + public static final String PROVIDER_EP_ADDRESS_URL_PROP = "provider.jmx.bc.ep.address.serviceURL"; + public static final String PROVIDER_EP_ADDRESS_USERNAME_PROP = "provider.jmx.bc.ep.address.username"; + public static final String PROVIDER_EP_ADDRESS_PASSWORD_PROP = "provider.jmx.bc.ep.address.password"; + + + /** + * Creates a new instance of JMXBindingTestClient + */ + public JMXBindingTestClient() { + super(); + } + /** + * creates jmx connection to send the input message to the binding component. + */ + public static MBeanServerConnection getJMXConnection(Properties testProps) + throws MalformedURLException, IOException { + + String jmxUrl = testProps.getProperty(CONSUMER_EP_ADDRESS_URL_PROP); + String username = testProps.getProperty(CONSUMER_EP_ADDRESS_USERNAME_PROP); + String password = testProps.getProperty(CONSUMER_EP_ADDRESS_PASSWORD_PROP); + + Map env = new HashMap(); + if ( username != null ) { + String [] credentials = new String [] {username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, JMXBindingTestClient.class.getClassLoader()); + } + JMXServiceURL serviceURL = new JMXServiceURL(jmxUrl); + JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, env); + MBeanServerConnection mbeanServerConnection = jmxConnector.getMBeanServerConnection(); + return mbeanServerConnection; + } + /** + * constructs the jmx mbean objectname + */ + public static ObjectName createJMXEndpointMBeanObjectName(String endpointAddressMBean) throws MalformedObjectNameException { + // String objectName = JMX_DOMAIN + ":" + JMX_ENDPOINT_ADDRESS_KEY + "=" + endpointAddressMBean; + return new ObjectName(endpointAddressMBean); + } + /** + * invokes a jmx mbean to send message. + */ + public static StringBuffer invokeSendMessage(MBeanServerConnection jmxConn, ObjectName epAddressName, + String operation, StringBuffer inputDoc) + throws MalformedObjectNameException, InstanceNotFoundException, + MBeanException, ReflectionException, IOException { + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if ( result != null ) { + outDoc = (StringBuffer)result; + } + + return outDoc; + } + /** + * invokes the service via jmx interface. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + ObjectName epAddressName = new ObjectName(testProps.getProperty(CONSUMER_EP_ADDRESS_MBEAN_PROP)); + String operation = testProps.getProperty(CONSUMER_EP_INBOUND_OPERATION_PROP); + + MBeanServerConnection jmxConn = getJMXConnection(testProps); + StringBuffer outputDoc = null; + try { + outputDoc = invokeSendMessage(jmxConn, epAddressName, operation, inputDoc); + } catch (MBeanException ex) { + Exception targetEx = ex.getTargetException(); + if ( targetEx != null ) { + throw targetEx; + } else { + throw ex; + } + } + return outputDoc; + } + /** no expected output comparison implemented */ + public void compareWithExpectedOutput(StringBuffer inputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java new file mode 100644 index 000000000..28f534612 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java @@ -0,0 +1,159 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SOAPBindingTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.util.Properties; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPConnection; +import javax.xml.soap.SOAPConnectionFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPFault; +import javax.xml.soap.SOAPMessage; +import javax.xml.soap.SOAPPart; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the Service Engine via SOAP Binding by invoking the service using + * SOAP Client that sends the message to the service provider via soaphttp binding. + * + * @author chikkala + */ +public class SOAPBindingTestClient extends JBIComponentTestClient { + + private static final String ADDRESS_PROP = "soap.binding.inbound.endpoint.address.location"; + private static final String SOAP_ACTION_PROP = "soap.binding.soapaction"; + private static final String FAIL_ON_SOAP_FAULT_PROP = "fail.on.soap.fault"; + + private static MessageFactory messageFactory; + private static SOAPConnectionFactory soapConnFactory; + private static SOAPConnection connection; + + public SOAPBindingTestClient() throws SOAPException { + init(); + } + /** initializes SOAP client */ + private synchronized void init() throws SOAPException { + if ( messageFactory == null ) { + messageFactory = MessageFactory.newInstance(); + } + if ( soapConnFactory == null ) { + soapConnFactory = SOAPConnectionFactory.newInstance(); + } + if ( connection == null ) { + connection = soapConnFactory.createConnection(); + } + } + + /** + * read in a soap message from the given input file + */ + private static SOAPMessage loadMessage(Reader inReader) throws SOAPException, IOException { + //Create and populate the message from a file + SOAPMessage message = messageFactory.createMessage(); + SOAPPart soapPart = message.getSOAPPart(); + StreamSource preppedMsgSrc = new StreamSource(inReader); + soapPart.setContent(preppedMsgSrc); + message.saveChanges(); + return message; + } + /** saves the SOAP message as xml text to a writer */ + private static void saveMessage(SOAPMessage response, Writer outWriter) + throws TransformerConfigurationException, SOAPException, TransformerException { + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute("indent-number", new Integer(2)); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + SOAPPart replySOAPPart = response.getSOAPPart(); + Source sourceContent = replySOAPPart.getContent(); + StreamResult result = new StreamResult(outWriter); + try { + transformer.transform(sourceContent, result); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + } + /** + * Send a soap message + * @param destination URL to send to + * @param message message to send + * @param expectedHttpStatus expected http status code or null if success is expected + * @return reply soap message + */ + private static SOAPMessage sendMessage(String destination, SOAPMessage message, String soapAction) throws SOAPException { + + // Add soapAction if not null + if (soapAction != null) { + MimeHeaders hd = message.getMimeHeaders(); + hd.setHeader("SOAPAction", soapAction); + } + // Send the message and get a reply + SOAPMessage reply = null; + reply = connection.call(message, destination); + return reply; + } + /** check the xml text in the StringBuffer passed contains SOAP Fault. */ + public boolean isSOAPFault(StringBuffer msgBuff) { + SOAPFault soapFault = null; + try { + SOAPMessage inMsg = loadMessage(new StringReader(msgBuff.toString())); + soapFault = inMsg.getSOAPBody().getFault(); + } catch (Exception ex) { + // any exception, means either no fault elem or invalid xml + } + return (soapFault != null); + } + /** + * invokes the service ny sending the input message and return the output + * message returned by the service. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + String soapAction = testProps.getProperty(SOAP_ACTION_PROP); + String destination = testProps.getProperty(ADDRESS_PROP); + SOAPMessage inMsg = loadMessage(new StringReader(inputDoc.toString())); + SOAPMessage outMsg = sendMessage(destination, inMsg, soapAction); + StringWriter out = new StringWriter(); + saveMessage(outMsg, out); + StringBuffer outDoc = out.getBuffer(); + Boolean failOnSoapFault = Boolean.valueOf(testProps.getProperty(FAIL_ON_SOAP_FAULT_PROP, "false")); + if ( failOnSoapFault ) { + if (isSOAPFault(outDoc)) { + StringBuffer errBuff = new StringBuffer("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} SOAP FAULT ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} ${symbol_escape}n"); + errBuff.append(outDoc); + throw new Exception(errBuff.toString()); + } + } + return outDoc; + } + /** comparing the received output document with the expected document. throw + * exception if the docs are not same. throwing the exception in this method + * fails the test. + */ + public void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/build.properties new file mode 100644 index 000000000..945269943 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/build.properties @@ -0,0 +1,22 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service assembly builds +${symbol_pound} user.properties.file=../../user.properties +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +service.assembly.name=testSA + +${symbol_pound}no.deps=true set the no.deps property if there are no SUs to build +${symbol_pound} for each testSU define the properties here. +${symbol_pound} dependent BC SU projects dependency +${symbol_pound} service unit name +service.unit.name.testSUBC=testSUBC +${symbol_pound} service unit project directory +project.testSUBC=testSUBC + +${symbol_pound} service unit name +service.unit.name.testSUSE=testSUSE +${symbol_pound} service unit project directory +project.testSUSE=testSUSE diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..02f75e641 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/build.xml @@ -0,0 +1,140 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..3ced1c59e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,44 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + ${artifactId}_TestSA + This is a test Service Assembly to test Binding + + + + + ${artifactId}_TestSUBC + This service unit enables inbound endpoint in the JMXBinding for a service in service engine + + + testSUBC.zip + ${artifactId} + + + + + ${artifactId}_TestSUSE + This service unit enables greetings service provider in the service engine + + + testSUSE.zip + ServiceEngine + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.properties new file mode 100644 index 000000000..caaefb87b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.properties @@ -0,0 +1,10 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service unit builds +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +${symbol_pound}build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUBC + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..777fb3cf9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,74 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl new file mode 100644 index 000000000..cf1d4ccc3 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..112a9decb --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.properties new file mode 100644 index 000000000..1bfd81c69 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.properties @@ -0,0 +1,10 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service unit builds +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +${symbol_pound}build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..846415d3a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,74 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl new file mode 100644 index 000000000..9c6322558 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..e1edc9a96 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/hello.xsl b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties new file mode 100644 index 000000000..44baf5452 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/main/resources/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} properties will be used to find the xslt file that will be used for invoking a +${symbol_pound} service operation. +${symbol_pound} The "xsltmap.properties" file should contain two types of properties +${symbol_pound} 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +${symbol_pound} "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +${symbol_pound} 2. a service description to xslt file properties with syntax like +${symbol_pound} "{tns-prefix}service-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +${symbol_pound} the service description property is a "." delimited tokens that represents +${symbol_pound} a serive or interface qname and a operation name. To locate xslt file either with +${symbol_pound} service qname or service qname and operaton or serivice qname and interface qname +${symbol_pound} and operation, all the three properties specified above should be there for each xslt file. +${symbol_pound} + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +${symbol_pound} just service level default settings +{greet2}greetService=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/test/resources/projects/basic/archetype.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/src/test/resources/projects/basic/archetype.properties new file mode 100644 index 000000000..cdd05f905 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/src/test/resources/projects/basic/archetype.properties @@ -0,0 +1,6 @@ +#Tue Jul 30 12:43:25 IST 2013 +package=it.pkg +version=0.1-SNAPSHOT +groupId=archetype.it +artifactId=BindingComponent-archetype +glassfishLocation=C:\\GlassFishESBv22\\glassfish \ No newline at end of file diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/src/test/resources/projects/basic/goal.txt b/maven-archtype-v2/maven-archtype-binding-component-v2/src/test/resources/projects/basic/goal.txt new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/BindingComponent-archetype-1.0-SNAPSHOT.jar b/maven-archtype-v2/maven-archtype-binding-component-v2/target/BindingComponent-archetype-1.0-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..5914d262bcd15dfa100c0443c5ebd7e34a690cfb GIT binary patch literal 137721 zcmd43V~}NQm+zalRcWh|D{b3$Wmej@ZQHhuN~6-YZQH!Hci;P-{&3#i5jWy=pEV;^ zte7z)=7;fn#(!|hOM!x+0YUw_hT=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MA?bhiaWh>nKu|hlv7B#}azm|qtKj|l?ek)J~jb^F|bSv3|i(anc$ez(bPHk5oq3#?owwt0(C@^pwM}D)NN+D zZnE9EGJ)m~p`XO6TXm&w4js~AORd6`51I;LqM8SMdVWf8HY|cdA7)R(=&w7Y2Yp&% z_)92eN6^Q`4j3azwVsT0-NQoP=i);%@M3pasc!hlR3#mmJwl%v;zPr`q&FLup+O(4 z;Wqc&6+P(FLxVhDWcC7m!GkNn!>f97(XIgKqZ0Z-kh;0u(36qsc@VQR=sO5p$%ft1 zlZP%PL+`HB4=dE|GwhEbZSlPx-Mbv`JF^!oYvFM}{EULVw$gf7 HY!m+j=>nM* literal 0 HcmV?d00001 diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/META-INF/maven/archetype-metadata.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/META-INF/maven/archetype-metadata.xml new file mode 100644 index 000000000..e3cafbf91 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,76 @@ + + + + + C:\\GlassFishESBv22\\glassfish + + + + + test/java + + **/*.xml + **/*.java + **/*.properties + + + + src/java + + **/*.java + + + + src/java + + **/*.xsd + + + + test/testSA + + **/*.xml + **/*.properties + + + + nbproject + + **/*.xml + **/*.properties + + + + src/conf + + **/*.xml + + + + nbproject/private + + **/*.xml + **/*.properties + + + + test/testSA + + **/*.xsl + **/*.wsdl + + + + + + build.xml + install-params.properties + m2nbbuild-impl.xml + m2nbbuild.properties + m2nbbuild.xml + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build.xml new file mode 100644 index 000000000..14afd1d29 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build.xml @@ -0,0 +1,72 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + Builds, tests, and runs the project ${artifactId}. + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/pom.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/pom.xml new file mode 100644 index 000000000..1e58b6067 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/pom.xml @@ -0,0 +1,38 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + 4.0.0 + + ${package} + ${artifactId}-archetype + ${version} + maven-archetype + + ${artifactId}-archetype + + + + + org.apache.maven.archetype + archetype-packaging + 2.2 + + + + + + + maven-archetype-plugin + 2.2 + + + + + + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + + http://open-esb.org + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml new file mode 100644 index 000000000..c493031be --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/build-impl.xml @@ -0,0 +1,33 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml new file mode 100644 index 000000000..99e45731e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/deploy-plugin/nbproject/project.xml @@ -0,0 +1,62 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + org.netbeans.modules.apisupport.project + + + ${symbol_dollar}{artifactId} + + + + org.netbeans.modules.xml.schema.model + + + + 1 + 1.2 + + + + org.netbeans.modules.xml.wsdl.bindingsupport.api + + + + 1.0 + + + + org.netbeans.modules.xml.wsdl.model + + + + 1 + 1.2 + + + + org.netbeans.modules.xml.xam + + + + 1 + 1.2 + + + + org.openide.util + + + + 7.9.0.1 + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml new file mode 100644 index 000000000..a54d4d390 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test1Input.xml @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml new file mode 100644 index 000000000..6233ab78e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/java/bindingtest/test2Input.xml @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..5456aa8f2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/build.xml @@ -0,0 +1,143 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..63b89125f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + ${symbol_dollar}{artifactId}_TestSA + This is a test Service Assembly to test Binding + + + + + ${symbol_dollar}{artifactId}_TestSUBC + This service unit enables inbound endpoint in the JMXBinding for a service in service engine + + + testSUBC.zip + ${symbol_dollar}{artifactId} + + + + + ${symbol_dollar}{artifactId}_TestSUSE + This service unit enables greetings service provider in the service engine + + + testSUSE.zip + ServiceEngine + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..96e95745f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..539a5efbf --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..75340ea7d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,77 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..324002052 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/build/generated-sources/archetype/src/main/resources/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound}set( ${symbol_dollar}symbol_pound = '${symbol_pound}' ) +${symbol_pound}set( ${symbol_dollar}symbol_dollar = '${symbol_dollar}' ) +${symbol_pound}set( ${symbol_dollar}symbol_escape = '${symbol_escape}' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild-impl.xml new file mode 100644 index 000000000..d7dabc84f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild-impl.xml @@ -0,0 +1,130 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild.properties new file mode 100644 index 000000000..663de1bb9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild.properties @@ -0,0 +1,48 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} build properties file to set/override the properties of the netbeans project +${symbol_pound} build properties when the netbeans build is called from the maven build lifecycle. +${symbol_pound} Netbeans project when build from the IDE, uses a build.properties from the user.dir +${symbol_pound} of the Netbeans IDE to resolve some of the properties used in the project such as +${symbol_pound} the libraries classpath. +${symbol_pound} When invoking the Netbeans project build from maven, this build.properties file +${symbol_pound} is not available. So, you can add the properties defined in ide build properties +${symbol_pound} that this project uses here. +${symbol_pound} + +${symbol_pound} default local repository settings. If the repository location is different +${symbol_pound} -D command line option should override this (e.g. mvn -Dmaven.repo.local=/my/m2/repository +maven.repo.local=${symbol_dollar}{user.home}/.m2/repository +${symbol_pound} begin jbi admin settings +${symbol_pound} set the below properties if you want to override the properties from nbproject/project.properties +${symbol_pound} that sets the application server admin settings. +${symbol_pound} +${symbol_pound} jbi.as.home=C:/Sun/glassfish-v2-b58g +${symbol_pound} jbi.host=localhost +${symbol_pound} jbi.port=4848 +${symbol_pound} jbi.username=admin +${symbol_pound} jbi.password=adminadmin +${symbol_pound} end jbi admin settings +${symbol_pound} + +${symbol_pound} classpath settings +junit.ant.task.classpath=${symbol_dollar}{maven.repo.local}/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar +junit.runtime.classpath=${symbol_dollar}{maven.repo.local}/junit/junit/3.8.2/junit-3.8.2.jar +libs.junit.classpath=${symbol_dollar}{junit.runtime.classpath}:${symbol_dollar}{junit.ant.task.classpath} +libs.jbi-cdk-ant-tasks.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi-cdk/jbi-cdk-ant-tasks/${version}/jbi-cdk-ant-tasks-${version}.jar + +libs.jbi.classpath=${symbol_dollar}{maven.repo.local}/open-esb/jbi/1.0/jbi-1.0.jar +libs.wsdl4j.162.classpath=${symbol_dollar}{maven.repo.local}/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar +${symbol_pound} libs.jaxws21.classpath=${symbol_dollar}{jbi.as.home}/lib/javaee.jar:${symbol_dollar}{jbi.as.home}/lib/webservices-rt.jar +libs.jaxws21.classpath=${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/activation/activation/1.1/activation-1.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:${symbol_escape} +${symbol_dollar}{maven.repo.local}/com/sun/xml/ws/jaxws-rt/2.1.2/jaxws-rt-2.1.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild.xml new file mode 100644 index 000000000..31217d15d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/m2nbbuild.xml @@ -0,0 +1,37 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/build-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/build-impl.xml new file mode 100644 index 000000000..096c6dd04 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/build-impl.xml @@ -0,0 +1,557 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task is getting executed! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task executed successfully! + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/genfiles.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/genfiles.properties new file mode 100644 index 000000000..ac5cc7404 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/genfiles.properties @@ -0,0 +1,11 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.xml.data.CRC32=f37ab647 +build.xml.script.CRC32=9068f2c7 +build.xml.stylesheet.CRC32=8add101f@1.0 +${symbol_pound} This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +${symbol_pound} Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=f37ab647 +nbproject/build-impl.xml.script.CRC32=d15987fd +nbproject/build-impl.xml.stylesheet.CRC32=4ed53ee0@1.0 diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/jbi_admin.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/jbi_admin.xml new file mode 100644 index 000000000..8a7d2a523 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/jbi_admin.xml @@ -0,0 +1,504 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + +This ant script contains the jbi ant tasks and the targets and properties using +which the jbi admin commands can be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Usage : ant -f <fullpath>/jbi_admin.xml [options] [target] + options: -D<property>=<value> + Specify a property/value pairs as options that are valid for the target. + target : ant target name in jbi_admin.xml + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/jbiadmin-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/jbiadmin-impl.xml new file mode 100644 index 000000000..7e7dca2ae --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/jbiadmin-impl.xml @@ -0,0 +1,339 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + Install, uninstall, reinstall, start, stop, shutdown jbi components. + + + + + + + + + + + + + + Must set jbi.host + Must set jbi.port + Must set jbi.username + Must set jbi.password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/private/private.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/private/private.properties new file mode 100644 index 000000000..e540325d5 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/private/private.properties @@ -0,0 +1,6 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +javac.debug=true +javadoc.preview=true +user.properties.file=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working57${symbol_escape}${symbol_escape}.netbeans${symbol_escape}${symbol_escape}openesb${symbol_escape}${symbol_escape}build.properties diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/project.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/project.properties new file mode 100644 index 000000000..7237a56d7 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/project.properties @@ -0,0 +1,93 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +build.classes.dir=${symbol_dollar}{build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${symbol_dollar}{build.dir}/generated +build.predist.dir=${symbol_dollar}{build.dir}/predist +build.predist.jar=${symbol_dollar}{build.predist.dir}/component.jar +build.predist.lib.dir=${symbol_dollar}{build.predist.dir}/lib +${symbol_pound} Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${symbol_dollar}{build.dir}/test/classes +build.test.dir=${symbol_dollar}{build.dir}/test +build.test.results.dir=${symbol_dollar}{build.dir}/test/results +conf.dir=src/conf +debug.classpath=${symbol_escape} + ${symbol_dollar}{run.classpath} +debug.test.classpath=${symbol_escape} + ${symbol_dollar}{run.test.classpath} +${symbol_pound} This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${symbol_dollar}{dist.dir}/${artifactId}.zip +dist.javadoc.dir=${symbol_dollar}{dist.dir}/javadoc +jar.compress=false +javac.classpath=${symbol_escape} + ${symbol_dollar}{libs.jbi.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.sharedlibs.classpath}:${symbol_escape} + ${symbol_dollar}{jbi.component.lib.classpath} +${symbol_pound} Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir}:${symbol_escape} + ${symbol_dollar}{libs.junit.classpath}:${symbol_escape} + ${symbol_dollar}{libs.jaxws21.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jbi.ant.tasks.classpath=${symbol_escape} + ${symbol_dollar}{jbi.as.home}/lib/sun-appserv-ant.jar:${symbol_escape} + ${symbol_dollar}{jbi.as.home}/jbi/lib/jbi-ant-tasks.jar +#jbi.as.home=D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish +jbi.as.home=${glassfishLocation} +#jbi.as.instance.id=[D:${symbol_escape}${symbol_escape}softwares${symbol_escape}${symbol_escape}openesb_logicoy_last_working53${symbol_escape}${symbol_escape}glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.as.instance.id=[${glassfishLocation}]deployer:Sun:AppServer::localhost:4848 +jbi.component.bootstrap.class=${artifactId}.JMXBindingInstaller +jbi.component.class=${artifactId}.JMXBindingRuntime +jbi.component.description=Description of binding component : ${artifactId} +jbi.component.lib.classpath=${symbol_escape} + ${symbol_dollar}{libs.wsdl4j.162.classpath} +jbi.component.name=${artifactId} +jbi.component.sharedlibs.classpath= +jbi.component.type=binding-component +jbi.host=localhost +jbi.install.params.file=install-params.properties +jbi.install.with.params=false +jbi.password=this really long string is used to identify a password that has been stored in the Keyring +jbi.port=4848 +jbi.soap.binding.name=sun-http-binding +jbi.username=admin +meta.inf.dir=${symbol_dollar}{conf.dir}/META-INF +platform.active=default_platform +project.jbi.deploy.plugin=./deploy-plugin +project.testSA=test/testSA +run.classpath=${symbol_escape} + ${symbol_dollar}{javac.classpath}:${symbol_escape} + ${symbol_dollar}{build.classes.dir} +${symbol_pound} Space-separated list of JVM arguments used when running the project +${symbol_pound} (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +${symbol_pound} or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=${symbol_escape} + ${symbol_dollar}{javac.test.classpath}:${symbol_escape} + ${symbol_dollar}{build.test.classes.dir} +src.dir=src/java +test-sys-prop.test.results.dir=${symbol_dollar}{build.test.results.dir} +test-sys-prop.test.src.dir=test-sys-prop.test.src.dir +test.src.dir=test/java +testSA.enabled=true +testSA.name=${artifactId}_TestSA diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/project.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/project.xml new file mode 100644 index 000000000..12b71aa1c --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/nbproject/project.xml @@ -0,0 +1,20 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + org.netbeans.modules.jbi.apisupport.project.jbicomponent + + + ${artifactId} + binding-component + 1.6.5 + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/pom.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/pom.xml new file mode 100644 index 000000000..7ae109163 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/pom.xml @@ -0,0 +1,268 @@ + + + + 4.0.0 + ${groupId} + ${artifactId} + jar + ${version} + JBI Component[${artifactId}] + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + http://open-esb.org + + build + src/java + test/java + build/classes + build/test/classes + package + + + org.apache.maven.plugins + maven-compiler-plugin + + true + 1.5 + 1.5 + + + **/*.java + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + **/*.* + + + + + maven-surefire-plugin + 2.1.3 + true + + + true + + **/bindingtest/*.java + **/enginetest/*.java + + + + + + maven-antrun-plugin + 1.2 + + + m2nbbuild-compile + compile + run + + + + + + + + m2nbbuild-compile-test + test-compile + run + + + + + + + + m2nbbuild-package + package + run + + + + + + + + m2nbbuild-utest + test + run + + + + + + + + m2nbbuild-itest + integration-test + run + + + + + + + + m2nbbuild-clean + clean + run + + + + + + + default-cli + + run + + + + !!!!!!!!!!!!!!!!!!!!!! Moving Files and organizing package !!!!!!!!!!!!!!!!!!!!!!!! + + + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + + + + + + + maven2-repo1 + Maven2 Central Repository + http://repo1.maven.org/maven2 + + + download-java-net-maven2-repository + download.java.net Maven 2.x repository + http://download.java.net/maven/2/ + + + maven-repository.dev.java.net-repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + + + ws-zones + ws.zones maven repository + http://ws.zones.apache.org/repository2/ + + + apache.org + Maven Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + + apache.org + Maven Plugin Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + org.apache.maven + maven-ant-tasks + 2.0.7 + + + open-esb.jbi-cdk + jbi-cdk-ant-tasks + 1.0-SNAPSHOT + + + open-esb + jbi + 1.0 + + + wsdl4j + wsdl4j + 1.6.2 + + + com.sun.xml.ws + jaxws-rt + 2.1.2 + test + + + + + ${maven.repo.local} + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/conf/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/conf/META-INF/jbi.xml new file mode 100644 index 000000000..6c38687ee --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/conf/META-INF/jbi.xml @@ -0,0 +1,45 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + ${artifactId} + Description of binding component : ${artifactId} + + + net.openesb.component.${artifactId}.JMXBindingRuntime + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + net.openesb.component.${artifactId}.JMXBindingInstaller + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java new file mode 100644 index 000000000..d4e017183 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java @@ -0,0 +1,52 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMX${artifactId}LifeCycle.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.BasicComponentLifeCycle; +import net.openesb.component.${artifactId}.common.DefaultMessageExchangeReceiver; +import net.openesb.component.${artifactId}.common.MessageExchangeReceiver; +import net.openesb.component.${artifactId}.common.RuntimeContext; +import javax.jbi.JBIException; +import javax.jbi.component.Component; + +/** + * This class extends the basic ComponentLifeCycle implementation to provide + * component specific implementation of the ComponentLifeCycle. + * + * @see javax.jbi.ComponentLifeCycle + * @see com.sun.jbi.sample.component.common.BasicComponentLifeCycle + * @author chikkala + */ +public class JMXBindingComponentLifeCycle extends BasicComponentLifeCycle { + + /** + * constructor for the ComponentLifecycle implementation. + */ + public JMXBindingComponentLifeCycle(Component compRuntime) { + super(compRuntime); + } + + /** + * creates DefaultMessageExchangeReceiver to handles receiving and + * processing the message exchanges from the delivery channel. + */ + @Override + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return new DefaultMessageExchangeReceiver(); + } + + /** + * chance to extended classes to do the component specific init + * + * @throws javax.jbi.JBIException + */ + @Override + protected void doInit() throws JBIException { + // NOOP + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java new file mode 100644 index 000000000..3a0711150 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java @@ -0,0 +1,153 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingConsumerEndpoint.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.wsdlext.PortExt; +import net.openesb.component.${artifactId}.wsdlext.WSDLExtHelper; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.ConsumerEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import javax.jbi.JBIException; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanRegistrationException; +import javax.management.ObjectName; +import javax.management.StandardMBean; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends ConsumerEndpoint to implement the component specific + * consumer endpoint configuration. It uses JMXBindingConsumerProxy to receive + * messages from external service consumers and initiate the InOut message + * exchange. This implementation shows how a synchronous send/receive from the + * delivery channel will be used in InOut message exchange in a service + * invocation by the external consumers. + * + * @author chikkala + */ +public class JMXBindingConsumerEndpoint extends ConsumerEndpoint { + + private ObjectName mJMXEndpointMBeanName; + private JMXEndpointMBean mJMXEndpointMBean; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public JMXBindingConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(consumes, wsdlDef, su); + } + + @Override + protected void doInit() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): init called"); + this.initJMXEndpoint(); + } + + @Override + protected void doActivate() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): activate called"); + this.activateJMXEndpoint(); + } + + @Override + protected void doDeactivate() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): deactivate called"); + this.deactivateJMXEndpoint(); + } + + @Override + protected void doClean() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): clean called"); + this.cleanJMXEndpoint(); + } + + /** + * creates the JMXEndpointMBean implementation. + */ + protected JMXEndpointMBean createJMXEndpointMBean() { + // JMX EndpointMBean implementation that initiates in-out message exchange. + return new JMXBindingConsumerProxy(this); + } + + /** + * get the mbean object name from the endpoint address of the jmx wsdl + * extension element + */ + protected ObjectName createJMXEndpointMBeanName() throws JBIException { + ObjectName mbeanObjectName = null; + try { + mbeanObjectName = new ObjectName(findMBeanNameFromWSDL()); + } catch (Exception ex) { + throw new JBIException(ex); + } + return mbeanObjectName; + } + + public final ObjectName getJMXEndpointMBeanName() { + return this.mJMXEndpointMBeanName; + } + + public final JMXEndpointMBean getJMXEndpointMBean() { + return this.mJMXEndpointMBean; + } + + protected final void initJMXEndpoint() throws JBIException { + // create jmx mbean resources + this.mJMXEndpointMBeanName = createJMXEndpointMBeanName(); + this.mJMXEndpointMBean = createJMXEndpointMBean(); + } + + protected final void activateJMXEndpoint() throws JBIException { + // open jmx connectivity to external consumers by registering the + // external endpoint mbean implementation. + try { + StandardMBean mbean = new StandardMBean(this.mJMXEndpointMBean, JMXEndpointMBean.class); + this.getComponentContext().getMBeanServer().registerMBean(mbean, this.mJMXEndpointMBeanName); + } catch (Exception ex) { + throw new JBIException(ex); + } + } + + protected final void deactivateJMXEndpoint() throws JBIException { + // close the jmx connectivity to external consumers by unregistering + // the external endpoint mbean. + try { + this.getComponentContext().getMBeanServer().unregisterMBean(this.mJMXEndpointMBeanName); + } catch (InstanceNotFoundException ex) { + ex.printStackTrace(); + } catch (MBeanRegistrationException ex) { + ex.printStackTrace(); + } + } + + protected final void cleanJMXEndpoint() throws JBIException { + // release jmx mbean resources + this.mJMXEndpointMBean = null; + this.mJMXEndpointMBeanName = null; + } + + /** + * get the mbean object name from the endpoint address of the jmx wsdl + * extension element + */ + protected String findMBeanNameFromWSDL() { + String mbeanName = null; + try { + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + Definition def = this.getWSDL(); + PortExt address = WSDLExtHelper.getPortExt(def, serviceName, endpointName); + if (address != null) { + mbeanName = address.getMBean(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + return mbeanName; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java new file mode 100644 index 000000000..180f4d45d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java @@ -0,0 +1,237 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingConsumerProxy.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.ConsumerEndpoint; +import java.io.StringReader; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Operation; +import javax.wsdl.OperationType; +import javax.xml.namespace.QName; +import javax.xml.transform.Source; + +/** + * This class acts as a proxy to the external service consumer that can receive + * messages from the external consumer using JMX interface and then initiate the + * InOut message exchange to invoke a service provided by the component in the + * jbi environment. + * + * this code shows how a synchronous send/receive messages from the delivery + * channel can be used in InOut message exchange to complete a service + * invocation. + * + * @author chikkala + */ +public class JMXBindingConsumerProxy implements JMXEndpointMBean { + + /** + * Synchronous send timeout + */ + private static final long SEND_SYNC_TIMEOUT = 60000; + private ConsumerEndpoint mEndpoint; + private JMXBindingNormalizer mNormalizer; + + /** + * Creates a new instance of JMXEndpointMBeanImpl + */ + public JMXBindingConsumerProxy(ConsumerEndpoint endpoint) { + this.mEndpoint = endpoint; + this.mNormalizer = new JMXBindingNormalizer(endpoint.getWSDL(), endpoint.getWSDLBinding()); + } + + public StringBuffer sendMessage(String operation, StringBuffer inputDoc) throws Exception { + // when receive input from external service consumer, + // 1. normalized the message, 2. send in-out message exchange. 3. denormalize out message. + Source inMsgSource = RuntimeHelper.createDOMSource(new StringReader(inputDoc.toString())); + QName operationQName = this.mEndpoint.getOperationQName(operation); + Source out = initiateMessageExchange(operationQName, inMsgSource); + StringBuffer outBuff = null; + if (out != null) { + // read the denormalized out message to string buffer. + outBuff = RuntimeHelper.readFromSource(out); + } + // return the out message content to the external service consumer. + return outBuff; + } + + public Source initiateMessageExchange(QName operation, Source inSource) throws JBIException { + // 1. Decide what type of message exchange needed for this operation. + Source outSource = null; + try { + Operation wsdlOp = this.mEndpoint.getWSDLOperation(operation); + if (OperationType.REQUEST_RESPONSE.equals(wsdlOp.getStyle())) { + outSource = doInOutMessageExchange(operation, inSource); + } else if (OperationType.ONE_WAY.equals(wsdlOp.getStyle())) { + doInOnlyMessageExchange(operation, inSource); + } else { + throw new JBIException("Unsupported MEP " + wsdlOp.getStyle() + + "for operation " + operation); + } + return outSource; + } catch (Exception ex) { + throw new JBIException(ex); + } + } + + /** + * invokes the service provider with in-only message exchange sent to + * delivery channel by the consumer + * + * @param operation operation name on a service + * @param inSource input xml document for the InOut operation + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + * @return output xml document as a Source object received from InOut + * operation of the service invoked. + */ + private void doInOnlyMessageExchange(QName operation, Source inSource) + throws Exception { + // 2. normalized the message. + // 3. locate service endpoint + // 4. create message exchange according to the Opeations MEP + + // get the component context and the delivery channel for preparing to send message + ComponentContext compContext = this.mEndpoint.getComponentContext(); + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + // create INOUT Message Exchange + InOnly inOnlyME = this.mEndpoint.createInOnlyMessageExchange(operation); + // set the content of the IN normalized message ( Normalize the message ) + NormalizedMessage inMsg = inOnlyME.getInMessage(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(inOnlyME.getOperation()); + this.mNormalizer.normalizeInput(wsdlOperation, inMsg, RuntimeHelper.sourceToDOMSource(inSource)); + // send the message exchange and wait for response + boolean isSent = channel.sendSync(inOnlyME, SEND_SYNC_TIMEOUT); + if (!isSent) { + throw new Exception("JMXBinding:Timeout occured in sending the message to provider"); + } + // check if you got a done message or error ( done or error are only allowed in in-only) + // process the Message Exchange to check for done or error message and + // complete InOut message exchange with provider + //TODO: put this below code in processInOnlyMessageExchangeOnConsumer() + ExchangeStatus status = inOnlyME.getStatus(); + this.mEndpoint.getLogger().fine("Consumer:InOnly:Processing Message Exchange with status " + status); + if (ExchangeStatus.DONE.equals(status)) { + this.mEndpoint.getLogger().fine("Consumer: Completed the INONLY MessageExchange"); + return; + } else if (ExchangeStatus.ERROR.equals(status)) { + // error can occur any time. so just return the error back to client. + Exception serverSideEx = inOnlyME.getError(); + StringBuffer exMsgBuff = RuntimeHelper.getExceptionStackTrace(serverSideEx); + throw new Exception("Consumer:INONLY Message Exchange status ERROR.${symbol_escape}n" + exMsgBuff); + } else { + // any other status is error. + throw new Exception("Consumer:INONLY Message Exchange error. status: " + status); + } + } + + /** + * invokes service provider with in-out message exchange sent to delivery + * channel by the consumer + * + * @param operation operation name on a service + * @param inSource input xml document for the InOut operation + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + * @return output xml document as a Source object received from InOut + * operation of the service invoked. + */ + private Source doInOutMessageExchange(QName operation, Source inSource) + throws Exception { + // 2. normalized the message. + // 3. locate service endpoint + // 4. create message exchange according to the Opeations MEP + + // get the component context and the delivery channel for preparing to send message + ComponentContext compContext = this.mEndpoint.getComponentContext(); + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + // create INOUT Message Exchange + InOut inOutME = this.mEndpoint.createInOutMessageExchange(operation); + // set the content of the IN normalized message ( Normalize the message ) + NormalizedMessage inMsg = inOutME.getInMessage(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(inOutME.getOperation()); + this.mNormalizer.normalizeInput(wsdlOperation, inMsg, RuntimeHelper.sourceToDOMSource(inSource)); + // send the message exchange and wait for response + boolean isSent = channel.sendSync(inOutME, SEND_SYNC_TIMEOUT); + if (!isSent) { + throw new Exception("JMXBinding:Timeout occured in sending the message to provider"); + } + // check if you got a out message or fault or error + // process the Message Exchange to get the output message and + // complete InOut message exchange with provider + NormalizedMessage outMsg = processInOutMessageExchangeOnConsumer(inOutME); + Source outSource = this.mNormalizer.denormalizeOutput(wsdlOperation, outMsg); + return outSource; + } + + /** + * takes the InOut message exchange received from sendSync call and + * processes it further to complete InOut message exchange with provider and + * returns the out message or throws exception in case of error or faults. + */ + private NormalizedMessage processInOutMessageExchangeOnConsumer(InOut inoutExchange) + throws Exception { + // InOut MessageExchange processing on consumer side + // 1. ACTIVE status receives a fault or out message, + // send the done status to complete message exchange + // return the fault/out message to external consumer + // 2. can not receive DONE status + // 3. when received ERROR status, return the error to consumer. + + // process the message exchange based on its state. + ExchangeStatus status = inoutExchange.getStatus(); + this.mEndpoint.getLogger().fine("Consumer:Processing Message Exchange with status " + status); + + if (ExchangeStatus.ACTIVE.equals(status)) { + + Fault fault = inoutExchange.getFault(); + NormalizedMessage outMsg = inoutExchange.getOutMessage(); + + // send done to complete message exchange. + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + inoutExchange.setStatus(ExchangeStatus.DONE); + channel.send(inoutExchange); + this.mEndpoint.getLogger().fine("Consumer: Completed the INOUT MessageExchange"); + + // process fault or out message + if (fault != null) { + // throw an exception if there is a fault message. + Source faultContent = fault.getContent(); + StringBuffer faultContentBuff = null; + if (faultContent != null) { + faultContentBuff = RuntimeHelper.readFromSource(faultContent); + } + throw new Exception("Consumer:INOUT message exchange Fault ${symbol_escape}n" + + faultContentBuff); + } + + // return the outMessage for processing + if (outMsg != null) { + return outMsg; + } else { + throw new Exception("Consumer: Null Out message in INOUT message exchange. "); + } + } else if (ExchangeStatus.DONE.equals(status)) { + // can not get DONE on Consumer side in INOUT message exchange. + throw new Exception("Consumer: Illegal status DONE on INOUT message exchange"); + } else if (ExchangeStatus.ERROR.equals(status)) { + // error can occur any time. so just return the error back to client. + Exception serverSideEx = inoutExchange.getError(); + StringBuffer exMsgBuff = RuntimeHelper.getExceptionStackTrace(serverSideEx); + throw new Exception("Consumer:INOUT Message Exchange status ERROR.${symbol_escape}n" + exMsgBuff); + } else { + throw new Exception("Consumer:INOUT Message Exchange error. status: " + status); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingInstaller.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingInstaller.java new file mode 100644 index 000000000..e1b6f21e9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingInstaller.java @@ -0,0 +1,34 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + /* + * JMXBindingInstaller.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.ComponentInstaller; + +/** + * This class extends the ComponentInstaller that implements the + * javax.jbi.component.Bootstrap for a component installation contract. + * + * If the default implemenation of the javax.jbi.component.Bootstrap in + * com.sun.jbi.sample.component.common.ComponentInstaller is not sufficient for + * this components install, uninstall and upgrade requirements, override the + * default implementation here to add component specific installation and + * upgrade tasks such as initializing configuration mbean and creating resources + * specific to component or upgrade workspace and service units during upgrading + * the component. + * + * @see javax.jbi.Bootstrap + * @see com.sun.jbi.sample.component.common.ComponentInstaller + * @author chikkala + */ +public class JMXBindingInstaller extends ComponentInstaller { + + /** + * Constructor to create the ComponentInstaller. + */ + public JMXBindingInstaller() { + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingNormalizer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingNormalizer.java new file mode 100644 index 000000000..7452d3dca --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingNormalizer.java @@ -0,0 +1,242 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingNormalizer.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractNormalizer; +import net.openesb.component.${artifactId}.common.wsdl.WSDL11JBIWrapper; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * This class is a concrete implementation of the AbstractNormalizer to + * implement normalize jmx binding specific concrete messages to jbi wrapper + * messages and denormalize the jbi wrapper messages to jmx binding specific + * messages. The jmx binding concrete message has "message" as the root element + * that contains the part elements as its children. for example + * + * + * + * + * This is the sample code that demonstrate how to normalize and denormalize + * messages to/from jbi wrapper from/to concrete messages specific to a binding + * protocol + * + * @author chikkala + */ +public class JMXBindingNormalizer extends AbstractNormalizer { + + public static final String JMXBC_MSG_NS = "http://java.sun.com/jbi/sample/jmx-bc/envelope/"; + public static final String DEF_NS_PREFIX = "jmxbc"; + public static final String MESSAGE_EL = "message"; + + /** + * Creates a new instance of JMXBCNormalizer + */ + public JMXBindingNormalizer(Definition wsdl, Binding binding) { + super(wsdl, binding); + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeInput(Operation operation, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Input input = operation.getInput(); + Message wsdlMsg = input.getMessage(); + //TODO: get the binding input extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeOutput(Operation operation, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Output output = operation.getOutput(); + Message wsdlMsg = output.getMessage(); + //TODO: get the binding output extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Fault wsdlFault = operation.getFault(faultName); + Message wsdlMsg = wsdlFault.getMessage(); + //TODO: get the binding fault extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException { + try { + + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Input input = operation.getInput(); + Message wsdlMsg = input.getMessage(); + //TODO: get the binding input extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + jmxMsgDoc.appendChild(jmxMessage); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException { + try { + + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Output output = operation.getOutput(); + Message wsdlMsg = output.getMessage(); + //TODO: get the binding output extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + jmxMsgDoc.appendChild(jmxMessage); + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Fault wsdlFault = operation.getFault(faultName); + Message wsdlMsg = wsdlFault.getMessage(); + //TODO: get the binding fault extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + jmxMsgDoc.appendChild(jmxMessage); + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java new file mode 100644 index 000000000..e6ab7f172 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java @@ -0,0 +1,87 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingProviderEndpoint.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.wsdlext.PortExt; +import net.openesb.component.${artifactId}.wsdlext.WSDLExtHelper; +import net.openesb.component.${artifactId}.common.MessageExchangeHandler; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.MessageExchangeListener; +import net.openesb.component.${artifactId}.common.deployment.ProviderEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import java.util.logging.Level; +import javax.jbi.JBIException; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends the ProviderEndpoint to implement component specific + * endpoint configuration. It implements the MessageExchangeListener to receive + * message exchange notifications from the MessageExchangeSupport fired by + * MessageExchangeReceiver and process it using a message exchange handler to + * show how an asynchronous processing of message exchange can be done. + * + * This endpoint uses the JMXBindingProviderProxy as a message exchange handler + * that can invoke the external provider to send a message and receive the + * response in a InOut message exchange. + * + * @author chikkala + */ +public class JMXBindingProviderEndpoint extends ProviderEndpoint implements MessageExchangeListener { + + JMXBindingProviderProxy mProviderProxy; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public JMXBindingProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(provides, wsdlDef, su); + } + + @Override + public void doInit() throws JBIException { + RuntimeHelper.getLogger().info("JMXBindingProviderEndpoint:doInit called"); + this.mProviderProxy = new JMXBindingProviderProxy(this); + } + + @Override + public MessageExchangeHandler createMessageExchangeHandler() { + return this.mProviderProxy; + } + + @Override + protected MessageExchangeListener createMessageExchangeListener() { + return this; + } + + public void messageExchangeReceived(ExchangeStatus status, MessageExchange me) { + try { + RuntimeHelper.getLogger().fine("MXListener.MessageExchangeReceived: with Status: " + status); + processMessageExchangeWithHandler(status, me); + // processMessageExchange(me); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public PortExt getJMXProviderInfo() { + PortExt portExt = null; + try { + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + Definition def = this.getWSDL(); + portExt = WSDLExtHelper.getPortExt(def, serviceName, endpointName); + } catch (Exception ex) { + getLogger().log(Level.FINE, ex.getMessage(), ex); + } + return portExt; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java new file mode 100644 index 000000000..1d263da33 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java @@ -0,0 +1,235 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingProviderProxy.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.wsdlext.PortExt; +import net.openesb.component.${artifactId}.common.AbstractMessageExchangeHandler; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.IOException; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.management.MBeanServerConnection; +import javax.management.ObjectName; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; + +/** + * This is a provider side implementation of the message exchange handler on a + * binding component which acts as a service provider proxy for the external + * provider. During the message exchange processing of the InOut message + * exchange, this handler acting as a proxy to the external provider invokes the + * service operation on the external provider and does required normalization + * and denormalization in processing out and in messages received from or send + * to the external service provider. + * + * @author chikkala + */ +public class JMXBindingProviderProxy extends AbstractMessageExchangeHandler { + + private JMXBindingProviderEndpoint mEndpoint; + private String mServiceURL; + private String mUsername; + private String mPassword; + private String mMBeanName; + private JMXBindingNormalizer mNormalizer; + + /** + * Creates a new instance of ProviderSEMXHandler + */ + public JMXBindingProviderProxy(JMXBindingProviderEndpoint endpoint) { + + this.mEndpoint = endpoint; + + PortExt jmxInfo = this.mEndpoint.getJMXProviderInfo(); + this.mServiceURL = jmxInfo.getServiceURL(); + this.mUsername = jmxInfo.getUsername(); + this.mPassword = jmxInfo.getPassword(); + this.mMBeanName = jmxInfo.getMBean(); + + this.mNormalizer = new JMXBindingNormalizer(endpoint.getWSDL(), endpoint.getWSDLBinding()); + } + + protected Logger getLogger() { + return this.mEndpoint.getLogger(); + } + + protected DeliveryChannel getDeliveryChannel() { + return this.mEndpoint.getDeliveryChannel(); + } + + protected void validateMessageExchange() throws MessagingException { + MessageExchange msgExchange = this.getMessageExchange(); + + if (this.getMessageExchange() == null) { + throw new MessagingException("MessageExchange Object is null in MessageExchageHandler"); + } + + if (MessageExchange.Role.CONSUMER.equals(msgExchange.getRole())) { + throw new MessagingException("Provider Message Exchange Handler can not have MessageExchange with CONSUMER Role"); + } + + if (!(msgExchange instanceof InOut)) { + throw new MessagingException("InOut Message Exchange Handler MessageExchange object should be instanceof javax.jbi.messaging.InOut "); + } + } + + protected void processError(Exception ex) { + MessageExchange msgExchange = this.getMessageExchange(); + Exception errEx = msgExchange.getError(); // get the error and print + RuntimeHelper.getLogger().info( + "InOut Message Exchange Provider received Error: " + errEx.getMessage()); + msgExchange.getError().printStackTrace(); + } + + protected void processDone() { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.getLogger().info("InOut Message Exchange Provider received DONE :" + + " END of service invocation"); + } + + protected void processFault(Fault fault) { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.logError("InOut Message Exchange Provider Handler can not receive Fault on Provider side"); + } + + protected void processMessage() { + try { + processInMessageOnProvider((InOut) this.getMessageExchange()); + } catch (JBIException ex) { + ex.printStackTrace(); + } + } + + protected void processInMessageOnProvider(InOut inOutExchange) throws JBIException { + RuntimeHelper.getLogger().fine("Processing In Message on Provider side " + inOutExchange); + // receive IN message. + NormalizedMessage inMsg = inOutExchange.getInMessage(); + NormalizedMessage outMsg = null; + Fault fault = null; + DOMSource inContent = null; + DOMSource outContent = null; + Source faultContent = null; + String faultAsText = null; + + QName opName = inOutExchange.getOperation(); + QName svcName = inOutExchange.getEndpoint().getServiceName(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(opName); + + // process in message + // invoke the service operation + try { + inContent = this.mNormalizer.denormalizeInput(wsdlOperation, inMsg); + StringBuffer outputDoc = invokeOperation(opName.getLocalPart(), + RuntimeHelper.readFromDOMSource(inContent)); + outContent = RuntimeHelper.createDOMSource(new StringReader(outputDoc.toString())); + } catch (Exception ex) { + // exception invoking the operation. so, set exception text as fault content. + ex.printStackTrace(); + faultAsText = RuntimeHelper.getExceptionAsText(ex); + String faultText = RuntimeHelper.getExceptionAsXmlText(ex); + faultContent = RuntimeHelper.createDOMSource(new StringReader(faultText)); + } + // set out or fault message + if (outContent != null) { + // set the out message content. + outMsg = inOutExchange.createMessage(); + inOutExchange.setOutMessage(outMsg); + this.mNormalizer.normalizeOutput(wsdlOperation, outMsg, outContent); + // outMsg.setContent(outContent); + } else if (faultContent != null) { + fault = inOutExchange.createFault(); + inOutExchange.setFault(fault); + fault.setContent(faultContent); // may need to normalize the content. + } + // send out or fault message. + this.send(); + } + + protected StringBuffer invokeOperation(String operation, StringBuffer inputDoc) throws MessagingException { + try { + StringBuffer outputDoc = invokeSendMessage(this.mServiceURL, this.mUsername, this.mPassword, + this.mMBeanName, operation, inputDoc); + return outputDoc; + } catch (Exception ex) { + ex.printStackTrace(); + throw new MessagingException(ex); + } + } + + /** + * invokes a jmx mbean to send message. + */ + protected StringBuffer invokeSendMessage(String serviceURL, String username, String password, + String mbeanName, String operation, StringBuffer inputDoc) + throws MessagingException { + + JMXConnector jmxConnector = null; + MBeanServerConnection jmxConn = null; + JMXServiceURL jmxURL = null; + ObjectName epAddressName = null; + + Map env = new HashMap(); + if (username != null) { + String[] credentials = new String[]{username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, this.getClass().getClassLoader()); + } + + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + try { + jmxURL = new JMXServiceURL(serviceURL); + epAddressName = new ObjectName(mbeanName); + + jmxConnector = JMXConnectorFactory.connect(jmxURL, env); + jmxConn = jmxConnector.getMBeanServerConnection(); + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if (result != null) { + outDoc = (StringBuffer) result; + } + } catch (Exception ex) { + throw new MessagingException(ex); + } finally { + if (jmxConnector != null) { + try { + jmxConnector.close(); + } catch (IOException ex) { + RuntimeHelper.logDebug(ex); + // ingore + } + } + } + return outDoc; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingRuntime.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingRuntime.java new file mode 100644 index 000000000..a3252887e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingRuntime.java @@ -0,0 +1,57 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingRuntime.java + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.ComponentRuntime; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; + +/** + * This class extends the ComponentRuntime that implements + * javax.jbi.component.Component interface required for the component contract + * at runtime. + * + * This class provides the component specific ComponentLifeCycle implementation + * as well as the component specific ServiceUnitManager implementation. + * + * Add any additional component runtime specific functionality here. + * + * @see javax.jbi.component.Component + * @see com.sun.jbi.sample.component.common.ComponentRuntime + * @see com.sun.jbi.sample.component.common.BasicComponentLifecycle + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @author chikkala + */ +public class JMXBindingRuntime extends ComponentRuntime { + + /** + * Creates a new instance of MyBindingRuntime + */ + public JMXBindingRuntime() { + super(); + } + + /** + * overriding the parent's createComponentLifeCycle to create MyBinding + * specific component lifecycle implementation. + */ + @Override + protected ComponentLifeCycle createComponentLifeCycle() { + return new JMXBindingComponentLifeCycle(this); + } + + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. Extended classes can override + * this method and do their own ServiceUnitManager specific creation. + */ + @Override + protected ServiceUnitManager createServiceUnitManager() { + return new JMXBindingSUManager(this); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingSUManager.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingSUManager.java new file mode 100644 index 000000000..75968c59a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingSUManager.java @@ -0,0 +1,51 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingSUManager.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.AbstractServiceUnitManager; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; + +/** + * This class extends the AbstractServiceUnitManager to implement component + * specific service unit manager by creating the component specific ServiceUnit + * implementation. + * + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit + * + * @author chikkala + */ +public class JMXBindingSUManager extends AbstractServiceUnitManager { + + private JMXBindingRuntime mRuntime; + + /** + * Creates a new instance of JMXBindingSUManager + */ + public JMXBindingSUManager(JMXBindingRuntime compRuntime) { + super(); + this.mRuntime = compRuntime; + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + protected String getComponentName() { + return RuntimeHelper.getComponentName(); + } + + //TODO implement ProviderSEServiceUnit + protected ServiceUnit createServiceUnit(String suName, String suRootPath) throws DeploymentException { + return new JMXBindingServiceUnit(suName, suRootPath); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java new file mode 100644 index 000000000..9175742ba --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java @@ -0,0 +1,55 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingServiceUnit.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.common.deployment.ConsumerEndpoint; +import net.openesb.component.${artifactId}.common.deployment.ProviderEndpoint; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Provides; +import net.openesb.component.${artifactId}.common.deployment.ServiceUnit; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; + +/** + * This class extends the ServiceUnit to implement the component specific + * service unit processing. It creates the component specific ProviderEndpoint + * and ConsumerEndpoint implementation to configure the service provider and + * consumer endpoints on this component deployed in the service unit. + * + * @author chikkala + */ +public class JMXBindingServiceUnit extends ServiceUnit { + + /** + * Creates a new instance of ProviderSEServiceUnit + */ + public JMXBindingServiceUnit(String suName, String suRootPath) { + super(suName, suRootPath); + } + + @Override + protected WSDLProcessor createWSDLProcessor() { + return new JMXBindingWSDLProcessor(this.getSURootPath()); + } + + @Override + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return new JMXBindingConsumerEndpoint(consumes, wsdlDef, this); + } + + @Override + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return new JMXBindingProviderEndpoint(provides, wsdlDef, this); + } + + @Override + protected void loadOtherArtifacts() throws DeploymentException { + //TODO: load any component specific service unit artifacts + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java new file mode 100644 index 000000000..67b92ee50 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java @@ -0,0 +1,43 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingWSDLProcessor.java + * + */ +package net.openesb.component.${artifactId}; + +import net.openesb.component.${artifactId}.wsdlext.WSDLExtensionRegistry; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This class extends form the WSDLProcessor to configure the wsdl processor use + * the wsdl extension registry configured to process the binding specific + * extension elements in the wsdl documents. + * + * WSDLExtensionRegistry that is created here has the wsdl extension model + * required to process the extension elements specific to the binding used by + * this binding component. + * + * @author chikkala + */ +public class JMXBindingWSDLProcessor extends WSDLProcessor { + + private WSDLExtensionRegistry mExtRegistry; + + /** + * Creates a new instance of JMXBindingWSDLProcessor + */ + public JMXBindingWSDLProcessor(String wsdlDir) { + super(wsdlDir); + } + + @Override + protected ExtensionRegistry getExtensionRegistry() { + if (this.mExtRegistry == null) { + this.mExtRegistry = new WSDLExtensionRegistry(); + } + return this.mExtRegistry; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXEndpointMBean.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXEndpointMBean.java new file mode 100644 index 000000000..3c14041e8 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/JMXEndpointMBean.java @@ -0,0 +1,41 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXEndpointMBean.java + */ +package net.openesb.component.${artifactId}; + +/** + * The sample BC implemented as a jmx binding component exposes this interface + * as a external connectivity (endpoint address) to the external service + * consumers that can exchange messages over jmx protocol to invoke services + * provided inside jbi environment. + * + * A jmx client can send a message by invoking this method using jmx management + * interface. When this mbean method is executed in the BC as a result of mbean + * call from the jmx client, the BC acts as a proxy service consumer inside the + * jbi environment and starts a message exchange with the service provider. + * + * If the operation being executed is a InOut operation, the BC should return + * the Out or Fault message from the InOut message exchange as a return value to + * complete invocation of the service by the external consumer. + * + * @author chikkala + */ +public interface JMXEndpointMBean { + + /** + * This method will be called by a jmx client as a service consumer to send + * message to the echo service provider to invoke the service for a InOut + * message exchange. + * + * @param operation operation name on a service + * @param inputDoc input xml document for the InOut operation + * @return output xml document in a StringBuffer received from InOut + * operation of the service invoked. or null if the operation is InOnly. + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + */ + StringBuffer sendMessage(String operation, StringBuffer inputDoc) throws Exception; +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java new file mode 100644 index 000000000..4987029b3 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java @@ -0,0 +1,141 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractMessageExchangeHandler.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.io.StringReader; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.xml.namespace.QName; + +/** + * This class is an abstract implementation of the MessageExchangeHandler which + * provides the base implementation of the ME processing and provides hooks to + * extended classes to implement component specific processing. + * + * @author chikkala + */ +public abstract class AbstractMessageExchangeHandler implements MessageExchangeHandler { + + public static String IN_MESSAGE = "in"; + public static String OUT_MESSAGE = "out"; + + private MessageExchange mMessageExchange; + private ExchangeStatus mStatus; + /** Creates a new instance of AbstractMessageExchangeHandler */ + protected AbstractMessageExchangeHandler() { + this.mMessageExchange = null; + } + + protected abstract Logger getLogger(); + protected abstract DeliveryChannel getDeliveryChannel(); + protected abstract void validateMessageExchange() throws MessagingException; + protected abstract void processError(Exception ex); + protected abstract void processDone(); + protected abstract void processMessage(); + protected abstract void processFault(Fault fault); + + public final MessageExchange getMessageExchange() { + return this.mMessageExchange; + } + + public final void setMessageExchange(MessageExchange msgExchange) { + this.mMessageExchange = msgExchange; + } + + public final ExchangeStatus getMessageExchangeStatus() { + if ( this.mStatus != null ) { + return this.mStatus; + } else if ( this.mMessageExchange != null ) { + return this.mMessageExchange.getStatus(); + } else { + return null; + } + } + + public final void setMessageExchangeStatus(ExchangeStatus status) { + this.mStatus = status; + } + + protected void send() throws MessagingException { + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected boolean sendSync(long timeout) throws MessagingException { + return this.getDeliveryChannel().sendSync(this.mMessageExchange, timeout); + } + + protected void sendDone() throws MessagingException { + this.mMessageExchange.setStatus(ExchangeStatus.DONE); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendError(Exception ex) throws MessagingException { + this.mMessageExchange.setError(ex); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendFault(Exception ex, QName type, String name) throws MessagingException { + Fault fault = this.mMessageExchange.createFault(); + if ( ex != null ) { + String xmlText = RuntimeHelper.getExceptionAsXmlText(ex); + fault.setContent(RuntimeHelper.createDOMSource(new StringReader(xmlText))); + } + this.mMessageExchange.setFault(fault); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void processActive() { + Fault fault = this.getMessageExchange().getFault(); + if ( fault != null ) { + processFault(fault); + } else { + processMessage(); + } + } + /** + * implementation of the MessageExchangeHandler${symbol_pound}processMessageExchange method. + */ + public void processMessageExchange(ExchangeStatus status, MessageExchange msgEx) { + + getLogger().fine("MessageExchangeHandler.processMessageExchange:status: " + status ); + + this.setMessageExchangeStatus(status); + this.setMessageExchange(msgEx); + + try { + validateMessageExchange(); + } catch (MessagingException ex) { + getLogger().log(Level.FINE, "Invalid message exchange for processing ", ex); + if ( this.getMessageExchange() != null ) { + try { + sendError(ex); + } catch (MessagingException errEx) { + getLogger().log(Level.FINE, "Can not send invalid message exchange error", errEx); + } + } + return; + } + + MessageExchange msgExchange = this.getMessageExchange(); + + if (ExchangeStatus.ACTIVE.equals(status) ) { + processActive(); + } else if (ExchangeStatus.DONE.equals(status) ) { + processDone(); + } else if (ExchangeStatus.ERROR.equals(status) ) { + processError(msgExchange.getError()); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java new file mode 100644 index 000000000..d76fbe0f9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java @@ -0,0 +1,398 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractComponentLifeCycle.java + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.MessagingException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.ComponentLifeCycle. This is an + * abstract class that keeps the reference to the component context and the lifecycle + * extension mbeans. It implements the lifecycle method and provide the extended methods + * for each lifecycle methods to implement component specific functionality. + *

+ * It makes sure that the mininum initialization required for the component + * lifecycle is implemented by this class or the classes extending this class. + *

+ * Another important functionality implemented in this class is that it initializes the global + * RuntimeContext for the component with the ComponentContext passed by the JBI runtime and the + * opened delivery channel to make them available globally to any class in the component implementation + * that may need it during component lifecycle + *

+ * Service engine or a binding component lifecycle implementation can directly extend + * this class for their required functionality and override some of the methods to provide + * their own implementation. + * + * @see javax.jbi.ComponentLifeCycle + * @author chikkala + */ +public class BasicComponentLifeCycle implements ComponentLifeCycle { + /** reference to the component runtime */ + private Component mCompRuntime; + /** component context */ + private ComponentContext mComponentContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + /** a message receiver that accepts messages from delivery channel */ + private MessageExchangeReceiver mMsgExchReceiver; + + /** + * constructor for the ComponentLifecycle implementation. + * @param compRuntime + */ + protected BasicComponentLifeCycle(Component compRuntime) { + this.mCompRuntime = compRuntime; + } + /** + * @return Component + */ + public final Component getComponentRuntime() { + return this.mCompRuntime; + } + /** + * @return ComponentContext component context. + */ + public final ComponentContext getComponentContext() { + return mComponentContext; + } + /** + * @return component name + */ + protected String getComponentName() { + return (this.mComponentContext != null) ? + this.mComponentContext.getComponentName() : null; + } + /////////////////////////////////////////////////////////////////////////// + // ComponentLifeCycle interface implemenation + /////////////////////////////////////////////////////////////////////////// + + /** + * Initializes the component lifecycle. This method makes sure that the + * component context passed by the jbi runtime is saved in the lifecycle + * object before calling the other component initialization methods to + * completely initialize the component. + * @param context Component context + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}init(javax.jbi.component.ComponentContext) + * @throws javax.jbi.JBIException on error + */ + public final void init(ComponentContext context) throws JBIException { + + if ( context == null ) { + throw new JBIException("Null Component Context received in " + + "Component Lifecycle init "); + } + this.mComponentContext = context; // 0. save the component context passed by jbi framework. + // initialize the content + initGlobalContext(); // 1. Initialize component runtime context. + registerExtensionMBean(); // 2. Create and register extension mbean. + openDeliveryChannel(); // 3. Open delivery channel. + initMessageExchangeReceiver(); // 4. Create message exchange receiver. + doInit(); // 5. Do any component specific initialization such + // as static service providers and consumers initialization. + + this.getLogger().fine("Component " + this.getComponentName() + " initialized"); + } + + /** + * Starts the component. Extended classes can override/implement the methods called + * in this method to provide component specify start functionality. + * + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}start() + * @throws javax.jbi.JBIException on error + */ + public final void start() throws JBIException { + + doStart(); // 1. do any other component specific start tasks such as + // activating any static service providers and consumers. + startMessageExchangeProcessing(); // 2. begin accepting and processing message exchanges. + + this.getLogger().fine("Component " + this.getComponentName() + " started"); + } + + /** + * Stop the component.Extended classes can override/implement the methods called + * in this method to provide component specify stop functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}stop() + */ + public final void stop() throws JBIException { + + stopMessageExchangeProcessing(); // 1. stop accepting and processing message exchanges. + doStop(); // 2. do any other component specific stop tasks such as + // deactivating any static service providers and consumers. + this.getLogger().fine("Component " + this.getComponentName() + " stopped."); + } + + /** + * Shut down the component. Extended classes can override/implement the methods called + * in this method to provide component specify shut down functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}shutDown() + */ + public final void shutDown() throws JBIException { + // clean up all resources. + shutdownMessageExchangeReceiver(); // 1. remove the message receiver. + closeDeliveryChannel(); // 2. close delivery channel + unregisterExtensionMBean(); // 3. unregister and remove extension mbean if exists. + doShutDown(); // 4. do any other component specific clean up tasks such + // as clean any static service providers and consumer resource. + this.getLogger().fine("Component " + this.getComponentName() + " shut down"); + } + /** + * create jmx object name for the extension mbean. default implementation does + * not required to have the extension mbean. + * @return ObjectName of the extension mbean + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * gets the reference to the extension mbean name. + * @see javax.jbi.component.ComponentLifeCycle${symbol_pound}getExtensionMBeanName() + * @return ObjectName of the extension mbean objectname or null if component + * does not support extension mbean + */ + public final ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = this.createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. default + * implementation does not require the extension mbean + * @return the ExtensionMBean implementation as StandardMBean + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * gets the reference to the extension mbean. + * @return extension mbean implementation or null if component does not support. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + * @throws JBIException on error registering mbean + */ + protected final void registerExtensionMBean() throws JBIException { + // creatre the extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server if any. + */ + protected final void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Extension MBean from MBeanServer for " + this.getComponentName(), e); + } + } + /** + * creates MessageExchangeReceiver implementation that handles receiving and processing + * the message exchanges from the delivery channel. Component should implement + * this method to provide the MessageReceiver. + * + * Component may return null indicating that they don't need the message receiver + * that can receive and process message exchanges from delivery channel. For example, + * components that have only service consumers which send a synchronous messages to + * providers don't need this. + * + * @throws java.lang.Exception + * @return MessageExchangeReceiver implementation. null if the component does not support it. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}createMessageExchangeReceiver + */ + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return null; + } + /** + * returns the message exchange receiver implementation reference + * @return MessageExchangeReceiver interface + */ + protected final MessageExchangeReceiver getMessageExchangeReceiver() { + if ( this.mMsgExchReceiver == null ) { + this.mMsgExchReceiver = createMessageExchangeReceiver(); + } + return this.mMsgExchReceiver; + } + /** + * creates a message receiver object as part of the component initialization. + * @throws javax.jbi.JBIException + */ + protected void initMessageExchangeReceiver() throws JBIException { + // create and initialize the MessageExchangeReceiver + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.initReceiver(); + } + } + /** + * allows the component to accept the message exchange objects from the + * delivery channel and process it as part of the component startup process. + * @throws javax.jbi.JBIException + */ + protected void startMessageExchangeProcessing() throws JBIException { + // start message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.startProcessing(); + } + } + /** + * stops the component from accepting the message exchange objects from the + * delivery channel as part of the component stop process + * @throws javax.jbi.JBIException + */ + protected void stopMessageExchangeProcessing() throws JBIException { + // stop message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.stopProcessing(); + } + } + /** + * removes the message receiver as part of the component shutdown process + * @throws javax.jbi.JBIException + */ + protected void shutdownMessageExchangeReceiver() throws JBIException { + // clean up message processing. + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.shutdownReceiver(); + } + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * initializes the RuntimeContext during component init lifecycle phase. This + * includes setting the ComponentContext and loggers etc. extended classes must + * save the component context in the RuntimeContext in this methods implementation. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}initGlobalContext + */ + protected void initGlobalContext() { + RuntimeContext.getInstance().setComponentContext(this.getComponentContext()); + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } + /** opens the delivery channel to accept or send message exchange objects + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}openDeliveryChannel + */ + protected void openDeliveryChannel() { + try { + DeliveryChannel channel = this.getComponentContext().getDeliveryChannel(); + RuntimeContext.getInstance().setDeliveryChannel(channel); + } catch (MessagingException ex) { + ex.printStackTrace(); + } + } + /** closes the delivery channel as part of the component shutdown process. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle${symbol_pound}closeDeliveryChannel + */ + protected void closeDeliveryChannel() { + // closes delivery channel and remove the reference. + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel != null ) { + channel.close(); + } + } catch (MessagingException ex) { + ex.printStackTrace(); + } finally { + RuntimeContext.getInstance().setDeliveryChannel(null); + } + } + /** + * chance to extended classes to do any extra component specific init tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * initialized here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}init method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}init + */ + protected void doInit() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific start tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * activated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}start method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}start + */ + protected void doStart() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific stop tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * deactivated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}stop method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}stop + */ + protected void doStop() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific shutdown tasks.If the component + * supports static service providers or consumers without deployment support, they can be + * cleaned up here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle${symbol_pound}shutdown method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle${symbol_pound}shutdown + */ + protected void doShutDown() throws JBIException { + //NOOP + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java new file mode 100644 index 000000000..7e44dc053 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentInstaller.java @@ -0,0 +1,275 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + /* + * ComponentInstaller.java + */ +package net.openesb.component.${artifactId}.common; + +import java.util.List; +import java.util.logging.Level; +import javax.jbi.component.Bootstrap; +import javax.jbi.component.InstallationContext; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.Bootstrap. This class implements + * the minimum required functionality for component installation contract + * of the jbi component in the jbi environment. It also takes care of maintaining + * the installation context reference and installation specific logger creation and + * installation extension mbean registration and unregistration during initialization + * and cleanup. Extended classes only need to supply the mbean name and its implementation + * object for the installation extensions. + * + * It makes sure that the installation context and the loggers are available to + * the classes extended from this class to add more installation specific functionality. + * + * Service engine or a binding component installation implementation can directly use + * this class or extend this class to add more functionality to their installation + * process. + * + * @see javax.jbi.Bootstrap + * @author chikkala + */ +public class ComponentInstaller implements Bootstrap { + /** default logger*/ + private Logger mDefLogger; + /** bootstrap logger */ + private Logger mBTLogger ; + /** Installation Context . */ + private InstallationContext mInstallationContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + + /** Constructor to create the ComponentInstaller. */ + public ComponentInstaller() { + } + /** + * @return InstallationContext of the component. + */ + public final InstallationContext getInstallationContext() { + return this.mInstallationContext; + } + protected String getComponentName() { + return (this.mInstallationContext != null) ? + this.mInstallationContext.getComponentName() : null; + } + /** + * @return logger initialized from the installation context or a default + * logger. + */ + protected Logger getLogger() { + // try init bootstrap logger + if (this.mBTLogger == null && this.mInstallationContext != null ) { + try { + this.mBTLogger = + this.mInstallationContext.getContext().getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mBTLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mBTLogger != null) ? this.mBTLogger : this.mDefLogger; + } + /** + * Initializes the installation environment for a component. + * @see javax.jbi.component.Bootstrap${symbol_pound}init(javax.jbi.component.InstallationContext) + */ + public final void init(InstallationContext installContext) throws javax.jbi.JBIException { + + if ( installContext == null ) { + throw new JBIException("Null Installation Context received in " + + "Component Bootstrap initialization"); + } + // save the installation context reference passed by the jbi framework. + this.mInstallationContext = installContext; + registerExtensionMBean(); // create and register extension mbean + doInit(); // do any other extra initialization required specific to the component installation. + // initialize logger + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component Installer initialized"); + } + /** + * default implementation just logs the method call. extended classes should override this. + * @see javax.jbi.component.Bootstrap${symbol_pound}onInstall() + */ + public void onInstall() throws javax.jbi.JBIException { + //TODO: do required initializaton and resource creation + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component installed."); + } + /** + * default implementation just logs the method call. + * @see javax.jbi.component.Bootstrap${symbol_pound}onUninstall() + */ + public void onUninstall() throws javax.jbi.JBIException { + //TODO: do clean up the resource and other stuff. + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component uninstalled"); + } + /** + * default noop implementation of the cleanup. + * @see javax.jbi.component.Bootstrap${symbol_pound}cleanUp() + */ + public final void cleanUp() throws javax.jbi.JBIException { + + unregisterExtensionMBean(); // unregister extension mbean and remove it + doCleanUp(); // do any other extra cleanup specific to the component installation. + this.getLogger().fine( this.mInstallationContext.getComponentName() + + " Component Installer Cleaned up"); + } + + /** + * create jmx object name for the extension mbean. Extended classes should + * return the component specific installer extension mbean name here. + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * default implementation that does not have extension mbean return null. + * @see javax.jbi.component.Bootstrap${symbol_pound}getExtensionMBeanName() + */ + public final javax.management.ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. Extended + * classes should return the installer extension mbean implementation as the + * standard mbean. + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * returns the installation extension mbean implementation. + * @return StandardMBean for the extension mbean implementation. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * Chance to extended classes to do the component installation specific init. + * Installation context will be initialized before calling this method. So, + * initialize other things if required in this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller${symbol_pound}init( + * javax.jbi.component.InstallationContext) + */ + protected void doInit() throws JBIException { + this.getLogger().info(this.getInstallationContext().getComponentName() + + " : Component Installer initialized"); + } + /** + * Chance to extended classes to do the component installation specific cleanup. + * ExtensionMbean will be unregistered before calling this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller${symbol_pound}cleanUp( + * javax.jbi.component.InstallationContext) + */ + protected void doCleanUp() throws JBIException { + this.getLogger().fine(this.getInstallationContext().getComponentName() + + " : Component Installer doCleanUp"); + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + */ + protected void registerExtensionMBean() throws JBIException { + // creatre the installation extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation if the object name is created. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Installation Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Installation Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server. + */ + protected void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Installation extension MBean for " + this.getComponentName(), e); + } + } + /** + * This method is called by the JBI runtime to allow a component to upgrade + * it's workspace and any existing Service Units to match the new version of + * the component. The JBI runtime copies the existing workspace root to the + * new workspace root prior to calling this method, so that the component + * can examine the contents of the workspace root to determine the version + * of the component from which the upgrade is being made. All updates to the + * workspace root are done in-place; in the event of a failure, the JBI + * runtime reverts back to the original workspace root, the original install + * root, and the original Service Unit roots for the component. + * + * Note1: The component must ensure that it never holds open references + * to any files in the workspace root or any of the Service Unit roots upon + * returning from this method. Failure to do so will cause problems when + * the runtime attempts to complete the upgrade processing. + * + * Note2: The installation context that is normally initialized + * by the runtime by calling ${symbol_pound}init method of the javax.jbi.Bootstrap interface + * before install and uninstall will not be called before calling this + * upgrade method. So, installation context can not be used in this method's + * implementation. + * + * Note3: Since there won't be any installation context available, the logger + * that returned from the ${symbol_pound}getLogger method is a default logger created using + * the package name of this class or extended class if the method is overridden + * in the extended class. + * + * @param workspaceRoot the workspace root for the new version of the + * component that will replace the currently installed version. This is + * populated with the contents of the original workspace root and the + * component must update it to match the new version of the component. + * @param serviceUnitRoots a list of directory paths to all of the Service + * Units currently deployed to the component. The component must update all + * of these to match the new version of the component. + * @exception JBIException when there is an error requiring that the upgrade + * be terminated. + */ + public void upgrade(String workspaceRoot, List serviceUnitRoots) + throws javax.jbi.JBIException + { + //TODO: override this method in the extended class to handle the + // workspace root and service unit roots upgrade according to the + // component's requirement. + this.getLogger().fine("Default upgrade implementation. " + + "TODO: Implement workspace root and service unit roots upgrade."); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java new file mode 100644 index 000000000..5c32ce274 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/ComponentRuntime.java @@ -0,0 +1,174 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ComponentRuntime.java + */ +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Logger; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.servicedesc.ServiceEndpoint; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; + +/** + * This class implements javax.jbi.component.Component interface which is + * responsible for creating the Component Lifecycle implementation and the + * ServiceUnitManager implementation for the jbi component. + * + * This class makes sure that non null component lifecycle implementation is + * returns by this class or any classes extended from this class which is + * required as a component contract. It also provides default implementation of + * all methods of the Component interface which the extended classes can + * override to add more functionality. + * + * @see javax.jbi.component.Component + * @author chikkala + */ +public class ComponentRuntime implements Component { + /** Component LifeCycle implementation */ + private ComponentLifeCycle mLifeCycle; + /** ServiceUnitManager implementation */ + private ServiceUnitManager mSUManager; + /** default logger*/ + private Logger mDefLogger; + + /** Creates a new instance of ComponentImpl */ + public ComponentRuntime() { + this.mLifeCycle = null; + this.mSUManager = null; + } + /** + * returns the ComponentContext. Any component runtime class extended from + * this class can override this method to return their own reference to the + * ComponentContext. + * @return ComponentContext component context. + */ + public ComponentContext getComponentContext() { + ComponentContext ctx = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + ctx = ((BasicComponentLifeCycle) this.mLifeCycle).getComponentContext(); + } + return ctx; + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + public Logger getLogger() { + Logger logger = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + logger = ((BasicComponentLifeCycle) this.mLifeCycle).getLogger(); + } + // init default logger if required + if ( logger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (logger != null) ? logger : this.mDefLogger; + } + /** + * return the ComponentLifeCycle implementation. if returned null, the + * ComponentLifeCycleImpl will be used as the component lifecycle + * Extended classes can override this method and do their own ComponentLifecyle + * specific creation. + */ + protected ComponentLifeCycle createComponentLifeCycle() { + return new BasicComponentLifeCycle(this); + } + /** + * Get the life cycle control interface for this component. + * + * @return the life cycle control interface for this component + * @see javax.jbi.Component${symbol_pound}getLifeCycle() + */ + public final ComponentLifeCycle getLifeCycle() { + if ( this.mLifeCycle == null ) { + this.mLifeCycle = createComponentLifeCycle(); + if ( this.mLifeCycle == null ) { + this.getLogger().fine("Creating basic component lifecycle implemenation"); + // use the default ComponentLifeCycle Impl if a component + // specific implementation return null in createComponentLifeCycle. + this.mLifeCycle = new BasicComponentLifeCycle(this); + } + } + return this.mLifeCycle; + } + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. + * Extended classes can override this method and do their own ServiceUnitManager + * specific creation. + */ + protected ServiceUnitManager createServiceUnitManager() { + return null; + } + /** + * Get the Service Unit manager for this component. + * + * @return the ServiceUnitManager for this component, or + * null if there is none. + * @see javax.jbi.Component${symbol_pound}getServiceUnitManager() + */ + public final ServiceUnitManager getServiceUnitManager() { + if ( this.mSUManager == null ) { + this.mSUManager = createServiceUnitManager(); + } + return this.mSUManager; + } + /** + * Retrieves a DOM representation containing metadata which describes the + * service provided by this component, through the given endpoint. + * + * Default implementation does not support service description. + * + * @see javax.jbi.Component${symbol_pound}getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint) + */ + public Document getServiceDescription(ServiceEndpoint serviceEndpoint) { + return null; + } + /** + * This method is called by JBI to check if this component, in the role of + * provider of the service indicated by the given exchange, can actually + * perform the operation desired. + * + * Default implementation has no policy and allows all exchanges with consumer. + * + * @see javax.jbi.Component${symbol_pound}isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithConsumerOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * This method is called by JBI to check if this component, in the role of + * consumer of the service indicated by the given exchange, can actually + * interact with the provider properly. The provider is described by the + * given endpoint and the service description supplied by that endpoint. + * + * Default implementation has no policy and allows all exchanges with provider. + * + * @see javax.jbi.Component${symbol_pound}isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithProviderOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * Resolve the given endpoint reference. + * + * Default implementation does not have any XML dialect. So can not resolve the + * endpoint from the document fragment. + * + * @see javax.jbi.Component${symbol_pound}resolveEndpointReference(org.w3c.dom.DocumentFragment) + */ + public ServiceEndpoint resolveEndpointReference(DocumentFragment documentFragment) { + return null; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java new file mode 100644 index 000000000..51c85bc6e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java @@ -0,0 +1,180 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * DefaultMessageExchangeReceiver.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; + +/** + * This class implements MessageExchangeReceiver interface. This is a default implementation that + * demonstrates the multi-threaded environment to receive and process message exchanges from the + * delivery channel. It uses a main thread to receive message exchanges from the delivery channel + * and then processes the received message exchanges in a individual threads from the thread pool. + * The controller methods of MessageExchangeReceiver controls the main thread and the thread pool + * execution. + * + * @author chikkala + */ +public class DefaultMessageExchangeReceiver implements MessageExchangeReceiver { + + /** delivery channel accept time out */ + private final static long DC_ACCEPT_TIME_OUT = 3000; // milliseconds + /** receiver thread wait time before polling for messages after woke up **/ + private final static long RECEIVER_WAIT_TIME = 2000; // milliseconds + /** receiver thread wait time before force shutdown */ + private final static long RECEIVER_SHUTDOWN_WAIT_TIME = 10; // seconds + /** handler threads wait time before forced shutdown */ + private final static long HANDLERS_SHUTDOWN_WAIT_TIME = 30; // seconds + /** handler thread pool size */ + private final static int HANDLER_THREAD_POOL_SIZE = 5; + /** receiver thread accept message exchange condition */ + private Boolean mCanAccept = false; + /** receiver thread termination condition */ + private Boolean mContinue = true; + /** receiver thread executor service */ + private ExecutorService mReceiverThreadMgr; + /** handler thread executor service */ + private ExecutorService mHandlerThreadPool; + + /** no default constructor for extended classes */ + public DefaultMessageExchangeReceiver() { + } + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + public final void initReceiver() throws JBIException { + + this.mHandlerThreadPool = Executors.newFixedThreadPool(HANDLER_THREAD_POOL_SIZE); + this.mReceiverThreadMgr = Executors.newSingleThreadExecutor(); + + this.mReceiverThreadMgr.execute(new Runnable() { + public void run() { + Thread t = Thread.currentThread(); + while ( mContinue ) { + if (mCanAccept) { + receiveAndProcessMessageExchange(); + } else { + try { + t.sleep(RECEIVER_WAIT_TIME); + } catch (InterruptedException interruptException) { + // someone must have interrupted this thread + // do nothing + RuntimeHelper.logDebug("Interrupted the MessageReceiverThread in Sleep"); + } + } + } + } + }); + } + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + public final void shutdownReceiver() throws JBIException { + + synchronized ( mContinue ) { + mContinue = false; + } + boolean terminated = false; + try { + this.mReceiverThreadMgr.shutdown(); + terminated = this.mReceiverThreadMgr.awaitTermination( + RECEIVER_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Message Receiver not shutdown. Forcing shutdown"); + this.mReceiverThreadMgr.shutdownNow(); + } + } + shutdownHandlers(); + } + /** + * shutdown all the working threads from the thread pool. + */ + private final void shutdownHandlers() throws JBIException { + + boolean terminated = false; + try { + this.mHandlerThreadPool.shutdown(); + terminated = this.mHandlerThreadPool.awaitTermination( + HANDLERS_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Handler threads not shutdown. Forcing shutdown"); + this.mHandlerThreadPool.shutdownNow(); + } + } + } + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + public final void startProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = true; + } + } + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + public final void stopProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = false; + } + } + + protected MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + private void receiveAndProcessMessageExchange() { + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel == null ) { + RuntimeHelper.logDebug("DeliveryChannel Not Opened for receiving messages"); + return; + } + final MessageExchange msgExchange = channel.accept(DC_ACCEPT_TIME_OUT); + if ( msgExchange == null ) { + // delivery channel timeout occurred. do nothing. + // RuntimeHelper.logDebug("DeliveryChannel returned null message exchange from accept"); + return; + } + final ExchangeStatus status = msgExchange.getStatus(); + // process message exchange in a separate thread + this.mHandlerThreadPool.execute(new Runnable() { + public void run() { + getMessageExchangeSupport().fireMessageExchangeReceived(status, msgExchange); + } + }); + + } catch (MessagingException ex) { + RuntimeHelper.logWarning(ex); + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java new file mode 100644 index 000000000..fed6c987d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeHandler.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface is a Handler to perform message exchanges when the component + * receives the MessageExchange object from the delivery channel. + * Implementation of this interface should implement the processing of + * the active, error, done status of the MessageExchange object according to + * the MEP for which the MessageExchange object is created. + * + * @author chikkala + */ +public interface MessageExchangeHandler { + /** + * this method will be invoked to process the MessageExchange + * object. + * @param msgExchange MessageExchange object to process. + */ + void processMessageExchange(ExchangeStatus status, MessageExchange msgExchange); + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java new file mode 100644 index 000000000..c27c1f221 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeListener.java @@ -0,0 +1,36 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeListener.java + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface defines the notification mechanism with which the message exchange object received + * from the delivery channel is processed by the interesting parties. A particular service endpoint + * implementation would first register the implementation of this interface with MessageExchangeSupport + * to get the notification of a received message exchange on a particular service endpoint and the + * implementation of the interface would process the message exchange when notified. + * + * When the com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver receives the message exchange + * object, it asks the MessageExchangeSupport to notify the MessageExchangeLister that is registered for the + * received message exchange object to process the message exchange object. + * @see com.sun.jbi.sample.component.common.MessageExchangeSupport + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public interface MessageExchangeListener { + /** + * MessageExchangeSupport will call this method to notify the lister implementation that a + * message exchange is received from the delivery channel. + * @param me MessageExchange Object + */ + void messageExchangeReceived(ExchangeStatus status, MessageExchange me); +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java new file mode 100644 index 000000000..607146abd --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java @@ -0,0 +1,47 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeReceiver.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import javax.jbi.JBIException; + +/** + * This interface provides the methods can controls the receiving and processing of the message + * exchange objects from the delivery channel during the component lifecycle operations. + * The implementation of this interface can use multi-threaded environment to receive and process + * message exchanges from the delivery channel during the component lifecycle. + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @author chikkala + */ +public interface MessageExchangeReceiver { + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + void initReceiver() throws JBIException; + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + void startProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + void stopProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + void shutdownReceiver() throws JBIException; + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java new file mode 100644 index 000000000..bddf9a8b1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java @@ -0,0 +1,170 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * MessageExchangeSupport.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.xml.namespace.QName; + +/** + * This class supports the registering and unregistering MessageExchangeListeners and the + * MessageExchangeHandlers that can be used to process the received message exchange from a + * delivery channel. A global reference to this class will be created in RuntimeContext object to + * provide access to this class from any where in the component runtime. + * + * A ProviderEndpoint or ConsumerEndpoint interested in a MessageExchange received from a delivery + * channel for a particular service endpoint will register the MessageExchangeListener with this + * class. The DefaultMessageExchangeReceiver when received a message exchange object from the delivery + * channel uses MessageExchangeSupport.processMessageExchange method to notify the registered listener. + * + * The MessageExchangeListener implementation ( ProviderEndpoint or ConsumerEndpoint ) while processing + * received message ( messageExchangeReceived()) will create and register the message exchange handlers + * to process the message exchange. + * + * @see RuntimeContext${symbol_pound}getMessageExchangeSupport + * @see RuntimeHelper${symbol_pound}getMessageExchangeSupport + * @see DefaultMessageExchangeReceiver${symbol_pound}receiveAndProcessMessageExchange + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public class MessageExchangeSupport { + /** listener map to notify a message exchange received event */ + private Map mListeners; + /** handlers that can process the message exchange */ + private Map mHandlers; + /** Creates a new instance of MessageExchangeSupport */ + public MessageExchangeSupport() { + this.mListeners = Collections.synchronizedMap(new HashMap()); + this.mHandlers = Collections.synchronizedMap(new HashMap()); + } + /** + * generates key that will be used to store the MessageExchangeListener objects. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public String createListenerKey(Role role, QName interfaceName, QName serviceName, String endpointName) { + + StringBuffer strBuff = new StringBuffer(); + strBuff.append(interfaceName).append("+"); + strBuff.append(serviceName).append("+"); + strBuff.append(endpointName).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(role) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(role) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + /** + * adds message exchange listener who are interested in receiving the notification when the + * message exchange is received from delivery channel. The listener can be registered with the + * following combination of the parameters: (role,interfaceName,serviceName, endpointName), + * (role,interfaceName,null, null), (role, null,serviceName, endpointName), (role, null,serviceName, null) + * + * @param role role of the message exchange listener PROVIDER or CONSUMER - can not be null. + * @param interfaceName QName of the interface ( protType ) - can be null if the serviceName is not null + * @param serviceName QName of the service - can be null if interfaceName is not null. + * @param endpointName endpoint name of the service. - can be null if the serviceName is not null. + * @param listener MessageExchangeListener object + */ + public synchronized void addMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName, MessageExchangeListener listener) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + this.mListeners.put(key, listener); + } + /** + * removes any message exchange listener registered for the service endpoint specified by the serviceName and + * endpoint name. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public synchronized void removeMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + MessageExchangeListener listener = this.mListeners.remove(key); + if ( listener == null ) { + RuntimeHelper.getLogger().fine("No message exchange listener removed with key " + key); + } + } + /** + * finds the MessageExchangeListner registers for the endpoint for which the message exchange is + * received and call the method on the listener + */ + public boolean fireMessageExchangeReceived(ExchangeStatus status, MessageExchange me) { + boolean notified = false; + Role role = me.getRole(); + QName interfaceName = me.getInterfaceName(); + QName serviceName = me.getEndpoint().getServiceName(); + String endpointName = me.getEndpoint().getEndpointName(); + // lookup with complete service description ( role + interface + service + endpoint ) + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + MessageExchangeListener listener = this.mListeners.get(key); + + if ( listener == null ) { // lookup with role+interface name + key = createListenerKey(role, interfaceName, null, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with role + serviceName + endpointName + key = createListenerKey(role, null, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with with role + serviceName + key = createListenerKey(role, null, serviceName, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { + RuntimeHelper.getLogger().fine("Could not find listener for message exchange" + me); + notified = false; + } else { + listener.messageExchangeReceived(status,me); + notified = true; + } + return notified; + } + /** + * registers the MessageExchangeHandler implementation against the message exchange id. + * @param me MessageExchange for which the handler need to be assigned + * @param handler MessageExchangeHandler implementation that will be registers. + */ + public synchronized void addMessageExchangeHandler(MessageExchange me, MessageExchangeHandler handler) { + this.mHandlers.put(me.getExchangeId(), handler); + } + /** + * removes the MessageExchangeHandler for the particular message exchange object + */ + public synchronized void removeMessageExchangeHandler(MessageExchange me) { + MessageExchangeHandler handler = this.mHandlers.remove(me.getExchangeId()); + if ( handler == null ) { + RuntimeHelper.getLogger().fine("No MessageExchangeHandler found for removing " + me.getExchangeId()); + } + } + /** + * looks up the registered message exchange handler for the message exchange object + * @param me MessageExchangeHandler. + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(MessageExchange me) { + return this.mHandlers.get(me.getExchangeId()); + } + /** + * looks up the registered message exchange handler for the message exchange object with Id + * @param exchangeId message exchange object's id + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(String exchangeId) { + return this.mHandlers.get(exchangeId); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java new file mode 100644 index 000000000..be75c7b7d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeContext.java @@ -0,0 +1,176 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * RuntimeContext.java + * + */ + +package net.openesb.component.${artifactId}.common; + +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; + +/** + * This class is global context for all the component runtime to store and + * retrieve the information that should be available anywhere in the component runtime. + * + * Each instance variable of this class will be initialized at various points of the + * component runtime using setter methods on this class. + * + * The two important objects that will be initialized and available from this context are + * ComponentContext and the opened DeliveryChannel objects both of which will be set from the + * implementation {@link BasicComponentLifeCycle}. + * + * Note that the ComponentContext from this global context will not be available until + * the jbi framework calls the init method of the ComponentLifeCycle of the component and + * then intern the implementation of the init method sets the context. + * + * @see BasicComponentLifeCycle${symbol_pound}initGlobalContext + * @see BasicComponentLifeCycle${symbol_pound}openDeliveryChannel + * @see BasicComponentLifeCycle${symbol_pound}closeDeliveryChannel + * @author chikkala + */ +public final class RuntimeContext { + /** RuntimeContext singleton instance */ + private static RuntimeContext sRuntimeContext; + /** default logger*/ + private Logger mDefLogger; + /** Logger object. */ + private Logger mLogger; + /** Holds value of property ComponentContext. */ + private ComponentContext mComponentContext; + /** Holds value of property DeliveryChannel. */ + private DeliveryChannel mDeliveryChannel; + /** MessageExchange processing support **/ + private MessageExchangeSupport mMESupport; + + /** outside code can not instantiate RuntimeContext */ + private RuntimeContext() { + } + /** + * @return RuntimeContext instance. + */ + public static RuntimeContext getInstance() { + if ( sRuntimeContext == null ) { + synchronized (RuntimeContext.class) { + if ( sRuntimeContext == null ) { + sRuntimeContext = new RuntimeContext(); + } + } + } + return sRuntimeContext; + } + /** + * Getter for to obtaining ComponentContext from any where in the component runtime. + * @return ComponentContext. + */ + public ComponentContext getComponentContext() { + return this.mComponentContext; + } + /** + * Sets the Component context reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle${symbol_pound}initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle${symbol_pound}initContext + * for details. + * @param componentContext New value of property ComponentContext. + * @see BasicComponentLifeCycle${symbol_pound}initGlobalContext + */ + public void setComponentContext(ComponentContext componentContext) { + if ( this.mComponentContext != null ) { + (new IllegalStateException("Component Context already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mComponentContext = componentContext; + } + /** + * Getter for obtaining opened delivery channel from any where in the component runtime. + * @return DeliveryChannel. + */ + public DeliveryChannel getDeliveryChannel() { + return this.mDeliveryChannel; + } + /** + * Sets the opened delivery channel reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle${symbol_pound}initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle${symbol_pound}initContext + * for details. + * + * @param componentContext New value of property ComponentContext. + */ + public void setDeliveryChannel(DeliveryChannel deliveryChannel) { + if ( deliveryChannel != null && this.mDeliveryChannel != null ) { + (new IllegalStateException("Delivery Channel already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mDeliveryChannel = deliveryChannel; + } + /** + * Sets the logger. + * + * @param name name for the Logger. + * @param resourceBundle resource bundle for the logger. can be null. + */ + public void setLogger(String name, String resourceBundle) { + + if (this.mComponentContext != null) { + // get the logger from component context if the component context is not null + try { + this.mLogger = this.mComponentContext.getLogger(name, resourceBundle); + } catch (Exception ex) { + ex.printStackTrace(); + } + } else { + this.mDefLogger = Logger.getLogger(name, resourceBundle); + } + } + /** + * Returns the logger. + * + * @return Logger + */ + public Logger getLogger() { + + // try init logger + if (this.mLogger == null && this.mComponentContext != null ) { + try { + this.mLogger = + this.mComponentContext.getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mLogger != null) ? this.mLogger : this.mDefLogger; + } + /** + * Returns the Component Name if the ComponentContext is set. else null + * @return component name + */ + public String getComponentName() { + String componentName = null; + if (this.mComponentContext != null) { + componentName = this.mComponentContext.getComponentName(); + } + return componentName; + } + /** + * Global MessageExchangeSupport reference. Various classes in the common + * component runtime would use this method to obtain the MessageExchangeSupport + * for processing message exchange objects received from delivery channel. + */ + public MessageExchangeSupport getMessageExchangeSupport() { + if ( this.mMESupport == null ) { + this.mMESupport = new MessageExchangeSupport(); + } + return this.mMESupport; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java new file mode 100644 index 000000000..f12c2b2f4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/RuntimeHelper.java @@ -0,0 +1,360 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * RuntimeHelper.java + */ + +package net.openesb.component.${artifactId}.common; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * This is a helper class that have bunch of methods for xml processing. + * @author chikkala + */ +public class RuntimeHelper { + + public static Logger getLogger() { + return RuntimeContext.getInstance().getLogger(); + } + + public static void logWarning(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.WARNING, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().warning(logObj.toString()); + } + } + + public static void logError(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.SEVERE, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().severe(logObj.toString()); + } + } + + public static void logDebug(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.FINER, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().finer(logObj.toString()); + } + } + + public static String getComponentName() { + return RuntimeContext.getInstance().getComponentName(); + } + public static ComponentContext getComponentContext() { + return RuntimeContext.getInstance().getComponentContext(); + } + public static DeliveryChannel getDeliveryChannel() { + return RuntimeContext.getInstance().getDeliveryChannel(); + } + + public static MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeContext.getInstance().getMessageExchangeSupport(); + } + + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(Reader xmlReader) throws Exception { + InputSource xmlSource = new InputSource(xmlReader); + return buildDOMDocument(xmlSource); + } + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(InputSource xmlSource) throws Exception { + Document xmlDoc = null; + DocumentBuilderFactory docBuilderFactory = + DocumentBuilderFactory.newInstance(); + docBuilderFactory.setValidating(false); + docBuilderFactory.setNamespaceAware(true); + DocumentBuilder docBuilder = + docBuilderFactory.newDocumentBuilder(); + docBuilder.setErrorHandler( new DefaultHandler() { + public void fatalError(SAXParseException e) + throws SAXException { + throw new SAXException(e.getMessage()); + } + }); + + docBuilder.setEntityResolver(new EntityResolver() { + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + StringReader reader = + new StringReader(""); // NOI18N + InputSource source = new InputSource(reader); + source.setPublicId(publicId); + source.setSystemId(systemId); + return source; + } + }); + + xmlDoc = docBuilder.parse(xmlSource); + + return xmlDoc; + } + /** + * reads xml text from DOMSource to StringBuffer + */ + public static StringBuffer readFromDOMSource(DOMSource domSource) { + + StringWriter writer = new StringWriter(); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer trans = null; + try { + trans = tFactory.newTransformer(); + trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, + "yes"); + trans.setOutputProperty(OutputKeys.INDENT, "yes"); + StreamResult result = new StreamResult(writer); + trans.transform(domSource, result); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads the xml text from InputSource into a StringBuffer + */ + public static StringBuffer readFromInputSource(InputSource inSource) { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + InputStream inStream = inSource.getByteStream(); + Reader reader = inSource.getCharacterStream(); + if ( reader == null ) { + reader = new InputStreamReader(inStream); + } + BufferedReader buff = new BufferedReader(reader); + try { + + for ( String line = null; (line = buff.readLine()) != null ; ) { + out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads xml from from DOM, SAX or Stream Source into a string buffer + */ + public static StringBuffer readFromSource(Source source) { + if ( source instanceof DOMSource ) { + return readFromDOMSource((DOMSource)source); + } else { + InputSource inSource = SAXSource.sourceToInputSource(source); + if ( inSource != null ) { + return readFromInputSource(inSource); + } else { + return null; + } + } + } + /** + * creates a DOMSource from the xml text read from the reader. + */ + public static DOMSource createDOMSource(Reader xmlReader) { + Document doc = null; + try { + doc = buildDOMDocument(xmlReader); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * creates a DOMSource from any source. If the source itself is DOMSource, + * the source is returned as it is as DOMSource. + */ + public static DOMSource sourceToDOMSource(Source source) { + if ( source instanceof DOMSource) { + return (DOMSource) source; + } + InputSource xmlSource = SAXSource.sourceToInputSource(source); + Document doc = null; + try { + doc = buildDOMDocument(xmlSource); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * converts the ex stracktrace to string. + */ + public static StringBuffer getExceptionStackTrace(Exception ex) { + StringWriter strWriter = new StringWriter(); + if ( ex != null ) { + PrintWriter out = new PrintWriter(strWriter); + ex.printStackTrace(out); + } + return strWriter.getBuffer(); + } + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsXmlText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + String exXmlText = + "" + + "" + message + "" + + "" + stackTrace + "" + + "" ; + return exXmlText; + } + + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + StringBuffer buff = new StringBuffer(); + buff.append(message); + buff.append(System.getProperty("line.separator", "${symbol_escape}n")); + buff.append(stackTrace); + return buff.toString(); + } + + + /** + * For attribute values which denote a QName, i.e. include a namespace prefix, + * resolve the value into a QName. + * If a namespace can not be resolved, it is set to empty - it does not + * result in an exception + * @param attrValue the string value of the attribute + * @param element the element the attribute belongs to + */ + public static QName resolveAttrQName(String attrValue, Element element) { + int aColonLoc = attrValue.indexOf(":"); + String aLocalName = attrValue; + String aPrefix = null; + String aNS = null; + if (aColonLoc > -1) { + aPrefix = attrValue.substring(0, aColonLoc); + aLocalName = attrValue.substring(aColonLoc + 1); + + // Traverse up the hierarchy until a namespace definition is found + // or the top of the document is reached. + Node currNode = element; + while ((aNS == null || aNS.equals("")) && currNode != null) { + if (currNode.getNodeType() == Node.ELEMENT_NODE) { + aNS = ((Element) currNode).getAttribute("xmlns:" + aPrefix); + } + currNode = currNode.getParentNode(); + } + } + + QName qName = new QName(aNS, aLocalName, aPrefix); + + return qName; + } + + /** + * replaces the xml entity references with the xml escape chars + * @param xmlString Text with the xml escape chars + * @param Text with the xml entity references + */ + public static String replaceXmlEscapeCharsToEntityRefereces(String xmlString) { + if ( xmlString == null ) { + return xmlString; + } + + // just convert < , > and & only + StringBuffer sbuff = new StringBuffer(2 * xmlString.length()); + for ( int i = 0; i < xmlString.length(); ++i ) { + switch ( xmlString.charAt(i) ) { + case '&': sbuff.append("&"); + break; + case '<': sbuff.append("<"); + break; + case '>': sbuff.append(">"); + break; + default: sbuff.append( xmlString.charAt(i) ); + } + } + return sbuff.toString(); + } + + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + + public static Element getElement(DOMSource domSource) { + return getElement(domSource.getNode()); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java new file mode 100644 index 000000000..fd0fc4f79 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java @@ -0,0 +1,312 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractServiceUnitManager.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.management.DeploymentException; + +/** + * This is an abstract class that implements {@link javax.jbi.component.ServiceUnitManager} to provide a + * service unit deployment support for the component. The implementation supported by this service + * unit manager and related classes in this package provides WSDL1.1 based service unit deployment + * in the component. + * + * @see javax.jbi.component.ServiceUnitManager + * @see ServiceUnit + * + * @author chikkala + */ +public abstract class AbstractServiceUnitManager implements ServiceUnitManager { + + /** Map of ServiceUnit Name to the ServiceUnit Object for all the service units + * deployed in the component */ + private Map mSUMap; + + /** Creates a new instance of AbstractSUManager */ + protected AbstractServiceUnitManager() { + this.mSUMap = Collections.synchronizedMap(new HashMap()); + } + /** returns the component name + * @return component name. + */ + protected abstract String getComponentName(); + /** + * @return Logger + */ + protected abstract Logger getLogger(); + /** + * returns the creation of the ServiceUnit implementation specific to the service unit deployment + * for the component. + * @param suName service unit name + * @param suRootPath service unit root path + * @param concrete implementation of the ServiceUnit class. + */ + protected abstract ServiceUnit createServiceUnit(String suName, String suRootPath) + throws DeploymentException; + /** + * returns the service unit object deployed by the specified name. or null if not deployed. + * @param suName service unit name to look for + * @param ServiceUnit object for the suName. or null if not present. + */ + private ServiceUnit getServiceUnit(String suName) { + return this.mSUMap.get(suName); + } + /** + * lookup for the deployed service unit. If not there, throws a deployment exception. + * @param suName service unit name + * @return ServiceUnit object + * @throws DeploymentException if the service unit is not present. + */ + private ServiceUnit findServiceUnit(String suName) throws DeploymentException { + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return serviceUnit; + } + /** + * add the service unit object to the list of deployed service units. if there is already a + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is added. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit addServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + this.mSUMap.put(suName, su); + return su; + } + /** + * removes service unit object from the list of deployed service units. if there is no + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is being removed. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit removeServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return this.mSUMap.remove(suName); + } + /** + * creates the concrete service unit implementation and calls the load method on it to initialize + * the created service unit. + * @param suName service unit name to create + * @param suRootPath service unit root path. + * @return ServiceUnit that is created and loaded. + */ + private ServiceUnit loadServiceUnit(String suName, String suRootPath) throws DeploymentException { + ServiceUnit serviceUnit = createServiceUnit(suName, suRootPath); + serviceUnit.doLoad(); + return serviceUnit; + } + /** + * deploys a service unit. it creates and loads the service unit object for the suName and then call + * doDeploy on the service unit and adds it to the deployed service unit list + * @return result as jbi management xml + * @throws DeploymentException if there is an error deploying. + */ + private synchronized String deployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + ServiceUnit serviceUnit = loadServiceUnit(suName, suRootPath); + serviceUnit.doDeploy(); + addServiceUnit(serviceUnit); + return result; + } + /** + * Deploy a Service Unit to the component. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}deploy(String, String); + */ + public final String deploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Deploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully deployed service unit " + suName; + Exception errEx = null; + try { + deployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to deploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, ex); + } + return createComponentTaskResultXML(compName, "deployTask", isSuccess, mainMsg, errEx); + } + + /** + * undeploys the service unit. it looks up the existing deployed service unit and call doUndeploy + * on it and then removes from the deployed service unit list. + */ + private synchronized String undeployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit serviceUnit = findServiceUnit(suName); + serviceUnit.doUndeploy(); + removeServiceUnit(serviceUnit); + return result; + } + /** + * Undeploy a service unit from the component. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}undeploy(String, String); + */ + public final String undeploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Undeploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully undeployed service unit " + suName; + Exception errEx = null; + try { + undeployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to undeploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, errEx); + } + return createComponentTaskResultXML(compName, "undeployTask", isSuccess, mainMsg, errEx); + } + /** + * Initialize the given deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}init(String, String); */ + public final void init(String suName, String suRootPath) + throws DeploymentException { + this.getLogger().fine("Initializing service unit " + suName + " with suRootPath " + suRootPath); + String result = suName; + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { // if the service unit not exists, create and add + serviceUnit = loadServiceUnit(suName, suRootPath); // create and load service unit + addServiceUnit(serviceUnit); // add service unit to existing service units + } + serviceUnit.doInit(); // Do Service unit initialization tasks + this.getLogger().fine("Service unit initialized:" + suName); + } + /** + * Shut down the deployment. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}shutdown(String); + */ + public final void shutDown(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doShutdown(); // Do Service unit shutdown tasks + this.getLogger().fine("Service unit shut down:" + suName); + } + /** + * Start the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}start(String); + */ + public final void start(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStart(); // Do service unit start tasks. + this.getLogger().fine("Service unit started:" + suName ); + } + /** + * Stop the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager${symbol_pound}stop(String); + */ + public final void stop(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStop(); // do service unit stop tasks + this.getLogger().fine("Service unit stopped: " + suName + " stopped."); + } + + /** + * helper method to create result message as jbi management message xml. + * @param componentName name of the component for this xml. + * @param taskId task id + * @param isSuccess true to format a success result, false to format a failed result. + * @param mainMsg main result message + * @param errEx Exception, null if there is no exception in failure message. + * @return XML string. + */ + protected static String createComponentTaskResultXML( + String componentName, String taskId, boolean isSuccess, String mainMsg, Exception errEx ) { + + String exMsgXml = getComponentTaskResultExceptionXML(errEx); + String mainMsgXmlEsc = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces(mainMsg); + String taskResult = isSuccess ? "SUCCESS" : "FAILED"; + String msgType = isSuccess ? "INFO" : "ERROR"; + + String xmlResult = + "" + + " " + componentName + "" + + " " + + " " + + " " + taskId + "" + + " " + taskResult + "" + + " " + msgType + "" + + " " + + " " + + " SU_MGR_MSG_ID" + + " " + mainMsgXmlEsc + "" + + " " + + " " + + exMsgXml + + " " + + " " + + ""; + + return xmlResult; + } + /** + * converts the exception to the jbi management message xml chunk. + */ + private static String getComponentTaskResultExceptionXML(Exception errEx) { + StringBuffer exMsgBuff = new StringBuffer(); + if ( errEx == null ) { + return exMsgBuff.toString(); // empty string. + } + + List exList = new ArrayList(); + int exLevel = 0; + for ( Throwable cause = errEx ; cause != null ; cause = cause.getCause() ) { + String causeMsg = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + cause.getMessage()); + StringWriter stBuff = new StringWriter(); + PrintWriter stOut = new PrintWriter(stBuff); + StackTraceElement[] stList = cause.getStackTrace(); + for (StackTraceElement stEl : stList) { + stOut.println(stEl.toString()); + } + stOut.close(); + String causeStackTrace = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + stBuff.getBuffer().toString()); + + exMsgBuff.append(""); + exMsgBuff.append(" " + exLevel + ""); + exMsgBuff.append(" " + "SU_MGR_EXP_ID"); + exMsgBuff.append(" " + causeMsg + ""); + exMsgBuff.append(" "); + exMsgBuff.append(" " + causeStackTrace + ""); + exMsgBuff.append(""); + ++exLevel; + } + + return exMsgBuff.toString(); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java new file mode 100644 index 000000000..e9537ca9e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java @@ -0,0 +1,208 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ConsumerEndpoint.java + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.messaging.MessageExchangeFactory; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service consumer. {@link ServiceUnit${symbol_pound}createConsumerEndpoint} creates the object of this + * type to implement the service consumer functionality. + * + * @see ServiceUnit${symbol_pound}createConsumerEndpoint + * @author chikkala + */ + +public class ConsumerEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with CONSUMER role and makes sure that the service + * description passed to it is of consumer description. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(Role.CONSUMER, consumes, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef) { + this(consumes, wsdlDef, null); + } + public final void init() throws JBIException { + getLogger().fine("ConsumerEndpoint: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + public final void activate() throws JBIException { + getLogger().fine("ConsumerEndpoint: activate called"); + //1. do common ativation tasks. + doActivate(); //2. do any other activation related tasks. + } + + public final void deactivate() throws JBIException { + getLogger().fine("ConsumerEndpoint: deactivate called"); + //1. do common deactivation tasks. + doDeactivate(); //2. do any other deactivation related tasks. + } + + public final void clean() throws JBIException { + getLogger().fine("ConsumerEndpoint: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + + /** + * helper method to find the active ServiceEndpiont for the service described with the + * serviceDescriptor. This method looks for the Active ServiceEndpoint using interface or + * service name or service name and the endpoint name. + */ + public ServiceEndpoint findServiceEndpoint() { + + QName serviceType = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + + ServiceEndpoint [] refs = null; + ServiceEndpoint serviceEndpoint = null; + ComponentContext compContext = this.getComponentContext(); + + if ( compContext == null ) { + this.getLogger().info("Null Component context. Can not find ServiceEndpoint"); + return null; + } + // lookup ServiceEndpiont with concrete service(serice qname + endpoint name). + if ( serviceName != null && endpointName != null ) { + this.getLogger().info("Looking for ServiceEndpoint with:" + + " ServiceName: " + serviceName + " EndpointName: " + endpointName); + serviceEndpoint = compContext.getEndpoint(serviceName, endpointName); + } + // else lookup ServiceEndpiont with Service Name + if ( serviceEndpoint == null && serviceName != null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service name: " + serviceName); + refs = compContext.getEndpointsForService(serviceName); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + // else lookup ServiceEndpont with serviceType + if ( serviceEndpoint == null && serviceType != null && + serviceName == null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service type: " + serviceType); + refs = compContext.getEndpoints(serviceType); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + + return serviceEndpoint; + } + + /** + * this method creates a InOutMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOut createInOutMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for ${symbol_escape}n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOut inOutME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOutME = factory.createInOutExchange(); + // set operation + inOutME.setOperation(operation); + // set interface if that is not set + if ( inOutME.getInterfaceName() == null ) { + inOutME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOutME.createMessage(); + // set IN Normalized message on message exchange + inOutME.setInMessage(inMsg); + + return inOutME; + } + + /** + * this method creates a InOnlyMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOnly createInOnlyMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for ${symbol_escape}n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOnly inOnlyME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOnlyME = factory.createInOnlyExchange(); + // set operation + inOnlyME.setOperation(operation); + // set interface if that is not set + if ( inOnlyME.getInterfaceName() == null ) { + inOnlyME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOnlyME.createMessage(); + // set IN Normalized message on message exchange + inOnlyME.setInMessage(inMsg); + + return inOnlyME; + } + + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java new file mode 100644 index 000000000..3aac0f8e2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/Endpoint.java @@ -0,0 +1,289 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * Endpoint.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.MessageExchangeHandler; +import net.openesb.component.${artifactId}.common.MessageExchangeListener; +import net.openesb.component.${artifactId}.common.MessageExchangeSupport; +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; + +/** + * This is an abstract class that represents the Endpoint defined for service provisioning or + * consumption in a jbi component. It stores the required service description ( wsdl definition, + * role, service unit to which it belongs etc) and defines the lifecycle operations {@link ${symbol_pound}init}, + * {@link ${symbol_pound}activate}, {@link ${symbol_pound}deactivate}, {@link ${symbol_pound}clean} to control a service endpoint that + * provides or consumes the service. + *

+ * Extended classes implement the abstract methods defined in this class to implement the endpoint + * functionality by providing the functionality to process the deployment artifacts specific to this + * endpoint, configure the endpoint to send/receive messages to/from delivery channel and process them + * according to the specific service implementation. + * + * @author chikkala + */ +public abstract class Endpoint { + /** Role of this endpoint. CONSUMER or PROVIDER */ + private Role mRole; + /** Service description from the SU descriptor for which this endpoint is configured */ + private SUDescriptor.Service mService; + /** WSDL definition corresponding to this endpoint */ + private Definition mWsdlDef; + /** service endpoint corresponding to this endpoint */ + private ServiceEndpoint mServiceEndpoint; + /** service unit from which this endpoint is created */ + private ServiceUnit mSU; // can be null + /** private constructor to force extended classes to use the parameterized constructor */ + private Endpoint() { + } + /** Creates a new instance of Endpoint + * @param role CONSUMER or PRVODER role. + * @param service service description from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + * @param su service unit object which created this endpoint. + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl, ServiceUnit su) { + this.mService = service; + this.mRole = role; + this.mWsdlDef = wsdl; + this.mSU = su; + } + /** Creates a new instance of Endpoint without service unit. may be useful for static endpoints that + * are not part of the deployment + * @param role CONSUMER or PRVODER role. + * @param service service info from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl) { + this(role, service, wsdl, null); + } + /** + * should be called to initialize any resources related to this endpoint object + * throws JBIException + */ + public abstract void init() throws JBIException; + /** + * activates the endpoint to send/receive messages + * throws JBIException + */ + public abstract void activate() throws JBIException; + /** + * deactivates the endpoint + * throws JBIException + */ + public abstract void deactivate() throws JBIException; + /** + * clean endpoint + * throws JBIException + */ + public abstract void clean() throws JBIException; + + public final Role getRole() { + return this.mRole; + } + public final boolean isProvider() { + return (Role.PROVIDER.equals(this.getRole())); + } + public final boolean isConsumer() { + return (Role.CONSUMER.equals(this.getRole())); + } + public final Definition getWSDL() { + return this.mWsdlDef; + } + public final SUDescriptor.Service getService() { + return this.mService; + } + public final ServiceEndpoint getServiceEndpoint() { + return this.mServiceEndpoint; + } + protected final void setServiceEndpoint(ServiceEndpoint svcEP) { + this.mServiceEndpoint = svcEP; + } + public final ServiceUnit getServiceUnit() { + return this.mSU; + } + /** + * generates an ID that would uniquely identify this endpoint implementation. Use as a key to map + * any information to store that is related to this endpoint. + */ + public final String getID() { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(this.mService.getInterface()).append("+"); + strBuff.append(this.mService.getServiceName()).append("+"); + strBuff.append(this.mService.getEndpointName()).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(this.mRole) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(this.mRole) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + + @Override + public String toString() { + return "Endpoint : " + "${symbol_escape}n" + this.mService; + } + /** + * checks if this endpoint is configured for the binding component or service engine. + */ + public boolean isFor${artifactId}() { + boolean isFor${artifactId} = false; + if ( this.mSU != null ) { + try { + isFor${artifactId} = this.mSU.getSUDescriptor().isFor${artifactId}(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + return isFor${artifactId}; + } + + public QName getOperationQName(String opName) { + return new QName(this.getService().getInterface().getNamespaceURI(), opName); + } + + public Operation getWSDLOperation(QName opQName) { + String opName = null; + if ( opQName != null ) { + opName = opQName.getLocalPart(); + } + Operation operation = WSDLProcessor.findOperation(this.getWSDL(), + this.getService().getInterface(), opName); + return operation; + } + + public Binding getWSDLBinding() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + if ( serviceName != null ) { + return WSDLProcessor.findServiceBinding(this.getWSDL(), serviceName, endpointName); + } else { + return WSDLProcessor.findInterfaceBinding(this.getWSDL(), interfaceName, null); + } + } + /** @return logger */ + public Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** @return ComponentContext */ + public ComponentContext getComponentContext() { + return RuntimeHelper.getComponentContext(); + } + /** @return DeliveryChannel */ + public DeliveryChannel getDeliveryChannel() { + return RuntimeHelper.getDeliveryChannel(); + } + /** + * helper function to get the MessageExchangeSupport object + */ + public MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + public MessageExchangeHandler createMessageExchangeHandler() { + return null; + } + /** + * creates the message exchange listener. Extended classes should return + * MessageExchangeListener implementation. + * @return MessageExchangeListener or null. + * + */ + protected MessageExchangeListener createMessageExchangeListener() { + return null; + } + /** + * Creates and adds message exchange listener to receive message exchange received notification. + */ + protected void addMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeListener meListener = createMessageExchangeListener(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null && meListener != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName, meListener); + if ( serviceName != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), null, serviceName, endpointName, meListener); + } + } + } + /** + * Removes message exchange listener from the MessageExchangeSupport. + */ + protected void removeMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName); + if ( serviceName != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), null, serviceName, endpointName); + } + } + } + + public final boolean processMessageExchangeWithHandler(ExchangeStatus status, MessageExchange me) { + + //1. lookup handler + //2. if not there create one and register + //3. call process message exchange on it + //4. check status. if that is the end, remove the handler + + MessageExchangeSupport support = this.getMessageExchangeSupport(); + if ( support == null ) { + getLogger().fine("No MessageExchangeSupport present"); + return false; + } + MessageExchangeHandler handler = support.findMessageExchangeHandler(me); + if ( handler == null ) { + handler = this.createMessageExchangeHandler(); + if ( handler == null ) { + getLogger().fine("MessageExchangeHandler not supported"); + return false; + } + support.addMessageExchangeHandler(me, handler); + } + + handler.processMessageExchange(status, me); + + getLogger().fine("XXX MX Handler processed ME with STATUS: " + status); + + if (!ExchangeStatus.ACTIVE.equals(status) ) { + // DONE or ERROR means done with the me. + getLogger().fine("End of ME processing. STATUS: " + status + + ". Removing the MX Handler ..."); + support.removeMessageExchangeHandler(me); + } + + return true; + } + +} + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java new file mode 100644 index 000000000..4bd932fc1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java @@ -0,0 +1,107 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ProviderEndpoint.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Service; +import javax.jbi.JBIException; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service provider. {@link ServiceUnit${symbol_pound}createProviderEndpoint} creates the object of this + * type to implement the service provider functionality. It makes sure that this class or the extended + * classes will activate or deactivate the ServiceEndpoint corresponding to the service + * provided by the endpoint is performed during the activate and deactivate method calls as part of the + * endpoint lifecycle. + * + * @see ServiceUnit${symbol_pound}createProviderEndpoint + * @author chikkala + */ + +public class ProviderEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with PROVIDER role and makes sure that the service + * description passed to it is of provider description. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(Role.PROVIDER, provides, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef) { + this(provides, wsdlDef, null); + } + /** + * initializes the endpoint and creates and registers the MessageExchangeListener with + * MessageExchangeSupport. + */ + public final void init() throws JBIException { + getLogger().fine("ProviderEndpiont: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + /** + * calls activatesServiceEndpoint for the Provider. + */ + public final void activate() throws JBIException { + getLogger().fine("ProviderEndpiont: activate called"); + activateServiceEndpoint(); //1. activate service endpoint in NMR + doActivate(); //2. do any other activation related tasks. + } + /** + * calls deactivateServiceEndpoint for the Provider. + */ + public final void deactivate() throws JBIException { + getLogger().fine("ProviderEndpiont: deactivate called"); + deactivateServiceEndpoint(); //1. deactivates the service endpoint in NMR + doDeactivate(); //2. do any other deactivation related tasks. + } + /** + * removes the message exchange listener. cleans up other resources + */ + public final void clean() throws JBIException { + getLogger().fine("ProviderEndpiont: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + /** + * Activates the ServiceEndpoint with NMR + */ + private void activateServiceEndpoint() throws JBIException { + Service service = this.getService(); + ServiceEndpoint svcEP = this.getComponentContext().activateEndpoint( + service.getServiceName(), service.getEndpointName()); + this.setServiceEndpoint(svcEP); + } + /** + * Deactivates ServiceEndpoint in NMR + */ + private void deactivateServiceEndpoint() throws JBIException { + this.getComponentContext().deactivateEndpoint(this.getServiceEndpoint()); + this.setServiceEndpoint(null); + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java new file mode 100644 index 000000000..3710afa62 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java @@ -0,0 +1,364 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SUDescriptor.java + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import javax.jbi.management.DeploymentException; +import javax.xml.namespace.QName; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * This interface represent the service unit descriptor (jbi.xml) model. This will be used in + * ServiceUnit implementation to find the services provided and consumed by this service unit. + * {@link SUDescriptorFactory${symbol_pound}getSUDescriptor} method reads the jbi.xml in the service unit to + * to the implementation of this interface. + * + * @see SUDescriptorFactory + * @see Consumes + * @see Provides + * @see ServiceUnit + * + * @author chikkala + */ +public interface SUDescriptor { + + Collection getProvidedServices(); + + Collection getConsumedServices(); + + boolean isFor${artifactId}(); + + /** + * base interface that models the service information described in the service unit descriptor for + * consumed services and provided services. + */ + public interface Service { + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + QName getInterface(); + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + QName getServiceName(); + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + String getEndpointName(); + } + /** + * marker interface that represents the provided services in the service unit + */ + public interface Provides extends Service { + } + /** + * this interface represents the consumed service information in the su descriptor. + */ + public interface Consumes extends Service { + + public final static String STANDARD_LINK = "standard"; + public final static String SOFT_LINK = "soft"; + public final static String HARD_LINK = "hard"; + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + String getLinkType(); + } + /** + * This is a factory class that can build the Service Unit Descriptor model from the jbi.xml + */ + public static class SUDescriptorFactory { + + protected final static String JBI_TAG_NAME = "services"; + protected final static String SERVICES_TAG_NAME = "services"; + protected final static String BC_TAG_NAME = "binding-component"; + protected final static String PROVIDES_TAG_NAME = "provides"; + protected final static String CONSUMES_TAG_NAME = "consumes"; + protected final static String INTERFACE_TAG_NAME = "interface-name"; + protected final static String SERVICE_TAG_NAME = "service-name"; + protected final static String ENDPOINT_TAG_NAME = "endpoint-name"; + protected final static String LINK_TYPE_TAG_NAME = "link-type"; + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(String jbiXmlPath) throws Exception { + FileReader reader = null; + try { + reader = new FileReader(jbiXmlPath); + SUDescriptor suDesc = getSUDescriptor(reader); + return suDesc; + } finally { + if ( reader != null ) { + try { + reader.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(Reader reader) throws Exception { + SUDescriptor suDescriptor = null; + Document suDescDoc = RuntimeHelper.buildDOMDocument(reader); + Element jbiEl = suDescDoc.getDocumentElement(); + if (JBI_TAG_NAME.equals(jbiEl.getTagName())) { + throw new DeploymentException("Invalid service unit descriptor : no jbi root element"); + } + + NodeList servicesNL = jbiEl.getElementsByTagName(SERVICES_TAG_NAME); + if (servicesNL != null && servicesNL.getLength() == 1) { + Element servicesEl = (Element) servicesNL.item(0); + suDescriptor = SUDescriptorImpl.createSUDescriptor(servicesEl); + } else { + throw new DeploymentException("Invalid service unit descriptor : invalid services element"); + } + + return suDescriptor; + } + + } + /** + * This class implements SUDescriptor + */ + public static class SUDescriptorImpl implements SUDescriptor { + + private List mConsumedList; + private List mProvidedList; + private boolean mIsFor${artifactId}; + + protected SUDescriptorImpl(boolean isFor${artifactId}) { + this.mIsFor${artifactId} = isFor${artifactId}; + this.mConsumedList = new ArrayList(); + this.mProvidedList = new ArrayList(); + } + + protected void addProvidedService(Provides provides) { + this.mProvidedList.add(provides); + } + + protected void addConsumedService(Consumes consumes) { + this.mConsumedList.add(consumes); + } + + public Collection getProvidedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mProvidedList); + } + + public Collection getConsumedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mConsumedList); + } + + public boolean isFor${artifactId}() { + return this.mIsFor${artifactId}; + } + + protected static SUDescriptor createSUDescriptor(Element servicesEl) throws Exception { + boolean isForBC = false; + String bcTagString = servicesEl.getAttribute(SUDescriptorFactory.BC_TAG_NAME); + isForBC = Boolean.valueOf(bcTagString).booleanValue(); + SUDescriptorImpl suDesc = new SUDescriptorImpl(isForBC); + // add consumes + NodeList consumesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.CONSUMES_TAG_NAME); + for ( int i=0; i < consumesNL.getLength(); ++i) { + Element consumesEl = (Element) consumesNL.item(i); + Consumes consumes = ConsumedService.createConsumedService(consumesEl); + suDesc.addConsumedService(consumes); + } + // add provides + NodeList providesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.PROVIDES_TAG_NAME); + for ( int i=0; i < providesNL.getLength(); ++i) { + Element providesEl = (Element) providesNL.item(i); + Provides provides = ProvidedService.createProvidedService(providesEl); + suDesc.addProvidedService(provides); + } + + return suDesc; + } + } + /** + * Base class that implements the Service interface + */ + public static abstract class AbstractService implements Service { + + private QName mInterface; + private QName mServiceName; + private String mEndpointName; + + private AbstractService() { + } + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + public QName getInterface() { + return this.mInterface; + } + + /** + * Setter for property interfaceQName. + * @param interfaceQName New value of property interfaceQName. + */ + protected void setInterface(QName interfaceQName) { + this.mInterface = interfaceQName; + } + + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + public QName getServiceName() { + return this.mServiceName; + } + + /** + * Setter for property serviceName. + * @param serviceName New value of property serviceName. + */ + protected void setServiceName(QName serviceName) { + this.mServiceName = serviceName; + } + + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + public String getEndpointName() { + return this.mEndpointName; + } + + /** + * Setter for property endpointName. + * @param endpointName New value of property endpointName. + */ + protected void setEndpointName(String endpointName) { + this.mEndpointName = endpointName; + } + + } + /** + * This class implements the Provides interface + */ + public static class ProvidedService + extends AbstractService + implements Provides { + protected ProvidedService(QName interfaceQName, QName serviceName, String endpointName) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + } + + @Override + public String toString() { + return "Provides :" + + "${symbol_escape}n${symbol_escape}t interface-name= " + getInterface() + + "${symbol_escape}n${symbol_escape}t service-name= " + getServiceName() + + "${symbol_escape}n${symbol_escape}t endpont-name= " + getEndpointName(); + } + + protected static Provides createProvidedService(Element providesEl) throws Exception { + + String ifName = providesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = providesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = providesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + if ( ifName == null || serviceName == null || endpointName == null ) { + throw new Exception("Invalid provides element: missing " + SUDescriptorFactory.INTERFACE_TAG_NAME + + " or " + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, providesEl); + QName serviceQName = RuntimeHelper.resolveAttrQName(serviceName, providesEl); + + return new ProvidedService(ifQName, serviceQName, endpointName); + } + } + /** + * This class implements the Consumes interface. + */ + public static class ConsumedService + extends AbstractService + implements Consumes { + private String mLinkType; + protected ConsumedService(QName interfaceQName, + QName serviceName, String endpointName, String linkType) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + this.mLinkType = linkType; + } + + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + public String getLinkType() { + return this.mLinkType; + } + + @Override + public String toString() { + return "Cosumes :" + + "${symbol_escape}n${symbol_escape}t interface-name= " + getInterface() + + "${symbol_escape}n${symbol_escape}t service-name= " + getServiceName() + + "${symbol_escape}n${symbol_escape}t endpont-name= " + getEndpointName() + + "${symbol_escape}n${symbol_escape}t link-type= " + getLinkType(); + } + + protected static Consumes createConsumedService(Element consumesEl) throws Exception { + + String ifName = consumesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = consumesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = consumesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + String linkType = consumesEl.getAttribute(SUDescriptorFactory.LINK_TYPE_TAG_NAME); + if ( linkType == null || linkType.trim().length() == 0 ) { + linkType = STANDARD_LINK; + } + + if ( ifName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.INTERFACE_TAG_NAME ); + } + if ( serviceName == null || endpointName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, consumesEl); + QName serviceQName = null; + if ( serviceName != null ) { + serviceQName = RuntimeHelper.resolveAttrQName(serviceName, consumesEl); + } + if ( serviceQName != null && endpointName != null && linkType != null ) { + if (!(STANDARD_LINK.equals(linkType) || + SOFT_LINK.equals(linkType) || HARD_LINK.equals(linkType)) ) { + throw new Exception("Invalid consumes attribute value" + + SUDescriptorFactory.LINK_TYPE_TAG_NAME + "=" + linkType); + } + } + return new ConsumedService(ifQName, serviceQName, endpointName, linkType); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java new file mode 100644 index 000000000..1794d9333 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java @@ -0,0 +1,464 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ServiceUnit.java + * + */ + +package net.openesb.component.${artifactId}.common.deployment; + +import net.openesb.component.${artifactId}.common.RuntimeHelper; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Provides; +import net.openesb.component.${artifactId}.common.deployment.SUDescriptor.Service; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; + +/** + * This is an abstract class that implements the service unit functionality in the component which + * processes the service unit artifacts and implement the actual service unit lifecycle functionality. + * The AbstractServiceUnitManager and its extended classes that implement the ServiceUnitManager + * functionality creates and maintains the reference to the concrete implementation of this class to + * invoke the functionality implemented by this class and its concrete implementation during the + * execution of the ServiceUnitMangers lifecycle methods by the jbi runtime. + *

+ * The main lifecycle methods of this class that will be called by the ServiceUnitManger implementation + * during the service unit deployment lifecycle are {@link ${symbol_pound}doload}, {@link ${symbol_pound}doDeploy}, {@link ${symbol_pound}doUndeploy}, + * {@link ${symbol_pound}doInit}, {@link ${symbol_pound}doStart}, {@link ${symbol_pound}doStop} and {@link ${symbol_pound}doShutdown} + *

+ * Service unit processing supported by this implementation is based on wsdl 1.1 deployments where the + * services provided and consumed in this service unit are described using wsdl 1.1 definitions. + *

+ * The main service unit artifacts that will be processed during deployment lifecycle of the service + * unit are 1.Service unit descriptor(jbi.xml) that describes the services provided and consumed by + * this service unit. 2.WSDL 1.1 document that describes the service definition 3.Component specific + * configurations related to services provided and consumed by this service unit. + *

+ * When the service unit is for Binding Component, the component specific configurations are read + * from the WSDL1.1 extensions defined in the WSDL document corresponding to the service provider + * or consumer deployed with this service unit. + *

+ * When the service unit is for Service Engine, the component specific configurations are read + * from the deployment artifacts such as xslt files and mapping files in the service unit zip file + * along with the WSDL document corresponding to the service provider or consumer deployed with this + * service unit. + * + * @see SUDescriptor + * @see Endpoint + * @see ProviderEndpoint + * @see ConsumerEndpoint + * @see WSDLProcessor + * @author chikkala + */ +public abstract class ServiceUnit { + /** Service Unit Name */ + private String mSUName; + /** Service Unit Root path passed by jbi runtime */ + private String mSURootPath; + /** service unit descriptor model unmarshalled from service unit jbi.xml */ + private SUDescriptor mSUDescriptor; + /** Map of Endpoint Key to ProviderEndpoint configurations in this service unit */ + private Map mProviderEndpointMap; + /** Map of Endpoint Key to ConsumerEndpoint configurations in this service unit */ + private Map mConsumerEndpointMap; + /** Map of Service Key to the WSDL Definition in this service unit */ + private Map mWSDLMap; + /** WSDLProcessor configured for this service unit to process wsdls in the service unit */ + private WSDLProcessor mWSDLProcessor; + /** + * + * @param suName + * @param suRootPath + */ + protected ServiceUnit(String suName, String suRootPath) { + this.mSUName = suName; + this.mSURootPath = suRootPath; + this.mSUDescriptor = null; + this.mWSDLMap = new HashMap(); + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + } + /** returns service unit name + * @return service unit name + */ + public String getName() { + return this.mSUName; + } + /** returns service unit root path where the su artifacts are unzipped by the jbi runtime + * @return path to the service unit root directory. + */ + public String getSURootPath() { + return this.mSURootPath; + } + protected SUDescriptor createSUDescriptor() throws Exception { + File jbiXmlFile = new File(this.getSURootPath(), "META-INF/jbi.xml"); + String jbiXmlPath = jbiXmlFile.getAbsolutePath(); + return SUDescriptor.SUDescriptorFactory.getSUDescriptor(jbiXmlPath); + } + /** return the Service unit descriptor model that was read from the jbi.xml + * @return SUDescriptor + */ + public SUDescriptor getSUDescriptor() throws Exception { + if ( this.mSUDescriptor == null ) { + this.mSUDescriptor = createSUDescriptor(); + } + return this.mSUDescriptor; + } + public ProviderEndpoint getProviderEndpoint(String providerID) { + return this.mProviderEndpointMap.get(providerID); + } + public Collection getProviderEndpoints() { + return Collections.unmodifiableCollection(this.mProviderEndpointMap.values()); + } + public ConsumerEndpoint getConsumerEndpoint(String cosumerID) { + return this.mConsumerEndpointMap.get(cosumerID); + } + + public Collection getConsumerEndpoints() { + return Collections.unmodifiableCollection(this.mConsumerEndpointMap.values()); + } + /** + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * extended classes implement this method to create the su specific WSDLProcessor. for examples, + * a su supporting binding component may have wsdl extensions that it want to registry for reading + * the configurations from the wsdl file. + * @return WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + */ + protected WSDLProcessor createWSDLProcessor() { + return new WSDLProcessor(this.getSURootPath()); + } + /** + * return the WSDLProcessor reference by creates if it is not yet created. + * @return WSDLProcessor. + */ + public final WSDLProcessor getWSDLProcessor() { + if ( this.mWSDLProcessor == null ) { + this.mWSDLProcessor = createWSDLProcessor(); + } + return this.mWSDLProcessor; + } + /** + * loads the service unit artifacts into the SU model. AbstractServiceUnitManager implementation + * calls this method during the during deploy and init lifecycle methods when the service unit + * object is newly created. + */ + public void doLoad() throws DeploymentException { + try { + SUDescriptor suDesc = getSUDescriptor(); // load jbi.xml + loadServiceDefinitions(); // check if the wsdls are valid for corresponding services. + loadOtherArtifacts(); // additional validations specific to component deployment features. + loadEndpoints(); // create endpoints + } catch ( DeploymentException jbiEx) { + throw jbiEx; + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + /** extended classes implement this method to perform the su specific deployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doDeploy() throws DeploymentException { + // NOOP. doLoad has done it all. + this.getLogger().fine("ServiceUnit.doDeploy"); + } + /** extended classes implement this method to perform the su specific undeployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doUndeploy() throws DeploymentException { + //NOOP + this.getLogger().fine("ServiceUnit.doUndeploy"); + } + /** extended classes implement this method to perform the su specific initialization tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doInit() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doInit"); + this.doInitEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on start in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStart() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStart"); + this.doActivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on stop in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStop() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStop"); + this.doDeactivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on shutdown in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doShutdown() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doShutdown"); + this.doCleanEndpoints(); + } + /** + * create the ProviderEndpoint that implement the service provider implementation specific to this su. + * @return ProviderEndpoint or null if the SU does not support the service provider access + */ + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return null; + } + /** + * create the ProviderEndpoint that implement the service consumer implementation specific to this su. + * @return ConsumerEndpoint or null if the SU does not support the service consumer access + */ + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return null; + } + /** + * generates the key based on the service to store the wsdl definitions . + */ + protected String getServiceKey(Service service) { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(service.getInterface()).append("+"); + strBuff.append(service.getServiceName()).append("+"); + strBuff.append(service.getEndpointName()); + return strBuff.toString(); + } + /** + * looks up the wsdl definition loaded for this service. + */ + protected Definition findWSDLFor(Service service) throws WSDLException { + Definition wsdlDef = null; + String key = this.getServiceKey(service); + wsdlDef = this.mWSDLMap.get(key); + return wsdlDef; + } + + protected Definition findWSDL(List wsdlList, Service service, boolean ignoreEndpointLookup) { + Definition foundDef = null; + for ( Definition def : wsdlList ) { + if ( WSDLProcessor.isWSDLFor(def, service.getInterface(), service.getServiceName(), + ((ignoreEndpointLookup) ? null : service.getEndpointName()) ) ) { + foundDef = def; + break; + } + } + return foundDef; + } + /** + * loads the WSDL definitions corresponds to the service providers and consumers defined in the + * service unit descriptor. + */ + protected void loadServiceDefinitions() throws Exception { + + this.mWSDLMap = new HashMap(); + + WSDLProcessor wsdlProcessor = getWSDLProcessor(); + List wsdlList = wsdlProcessor.readWSDLs(this.getSURootPath()); + this.getLogger().fine("Number of wsdl definitions in service unit " + wsdlList.size()); + + List services = new ArrayList(); + services.addAll(this.getSUDescriptor().getProvidedServices()); + services.addAll(this.getSUDescriptor().getConsumedServices()); + + boolean isForBinding = this.getSUDescriptor().isFor${artifactId}(); + this.getLogger().fine("Is this service unit for Binding? " + isForBinding); + + for ( Service service : services ) { + this.getLogger().fine("Looking up WSDL for service " + service); + boolean ignoreEndpointLookup = false; + boolean providerAtEngine = false; + if ( !isForBinding && service instanceof Provides ) { + ignoreEndpointLookup = true; + providerAtEngine = true; + } + Definition def = findWSDL(wsdlList, service, ignoreEndpointLookup); + if ( def == null ) { + throw new Exception("WSDL Definition not found for " + service); + } + this.mWSDLMap.put(getServiceKey(service), def); + if ( providerAtEngine ) { + // provider at engine. so add engine binding and endpoint to the wsdl + wsdlProcessor.createServiceEngineBinding(def, + service.getInterface(), service.getServiceName(), service.getEndpointName()); + } + } + } + /** extended classes implement this method to perform the su specific artifacts validation in + * this method implementation. + * @throws DeploymentException on error. + */ + protected void loadOtherArtifacts() throws DeploymentException { + // nothing to validate further. + this.getLogger().fine("ServiceUnit.loadOtherArtifacts"); + } + /** + * creates ProviderEndpoint and ConsumerEndpoint objects corresponding to the service providers + * and consumers described in the su descriptor ( jbi.xml ) + */ + protected void loadEndpoints() throws Exception { + + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + + Collection providesList = this.getSUDescriptor().getProvidedServices(); + for ( Provides provides : providesList ) { + Definition wsdlDef = findWSDLFor(provides); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + provides); + } + ProviderEndpoint provider = createProviderEndpoint(provides, wsdlDef); + this.mProviderEndpointMap.put(provider.getID(), provider); + } + + Collection consumesList = this.getSUDescriptor().getConsumedServices(); + for ( Consumes consumes : consumesList ) { + Definition wsdlDef = findWSDLFor(consumes); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + consumes); + } + ConsumerEndpoint consumer = createConsumerEndpoint(consumes, wsdlDef); + this.mConsumerEndpointMap.put(consumer.getID(), consumer); + } + } + /** + * initializes the Endpoint objects created corresponding to the consumer and providers defined + * in the su descriptor + */ + protected void doInitEndpoints() throws DeploymentException { + // init endpoints. if any initialization fails, rollback the already inited endpoints + List initedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.init(); + initedEndpoints.add(endpoint); + } catch ( Exception initEx) { + doCleanEndpoints(initedEndpoints); + throw new DeploymentException(initEx); + } + } + + } + /** + * invokes activates method of all provider and consumer endpoint object in this su. if there is + * and error activating any one the endpoints, it deactivates the already activated ones and throws + * the error + */ + protected void doActivateEndpoints() throws DeploymentException { + // activate providers first and then consumers + List activatedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.activate(); + activatedEndpoints.add(endpoint); + } catch ( Exception actEx) { + doDeactivateEndpoints(activatedEndpoints); + throw new DeploymentException(actEx); + } + } + } + /** + * invokes deactivate method on the list of Endpoint objects passed to this method + */ + protected void doDeactivateEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.deactivate(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes deactivate method on the all consumer and provider endpoint objects + */ + protected void doDeactivateEndpoints() { + // deactivate consumers first and then the providers + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doDeactivateEndpoints(allEndpoints); + } + /** + * invokes clean method on the list of endpoint objects + */ + protected void doCleanEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.clean(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes clean method on the all consumer and provider endpoint objects in this su. + */ + protected void doCleanEndpoints() { + + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doCleanEndpoints(allEndpoints); + } + /** + * prints the service unit description + */ + protected final String printDetails() { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + + out.println("ServiceUnit Name : " + this.getName()); + out.println("ServiceUnit Root : " + this.getSURootPath()); + + SUDescriptor suDesc = null; + try { + suDesc = this.getSUDescriptor(); + for ( SUDescriptor.Consumes consumer : suDesc.getConsumedServices()) { + out.println(consumer); + } + for ( SUDescriptor.Provides provides : suDesc.getProvidedServices()) { + out.println(provides); + } + } catch (Exception ex) { + ex.printStackTrace(out); + } + return writer.getBuffer().toString(); + } + + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java new file mode 100644 index 000000000..67bbf5a45 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java @@ -0,0 +1,44 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensibilityElement.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This is an abstract class which can be extended to create jwsdl (wsdl4j's) extension elements model to + * read/write the wsdl extension elements in wsdl 1.1 xml. + * + * @author chikkala + */ +public abstract class AbstractExtensibilityElement implements ExtensibilityElement, java.io.Serializable { + public static final long serialVersionUID = 1; + private QName mElementType; + private Boolean mRequired; + + /** Creates a new instance of AbstractExtensibilityElement */ + protected AbstractExtensibilityElement() { + } + + public void setElementType(QName elementType) { + this.mElementType = elementType; + } + + public QName getElementType() { + return this.mElementType; + } + + public void setRequired(Boolean required) { + this.mRequired = required; + } + + public Boolean getRequired() { + return this.mRequired; + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java new file mode 100644 index 000000000..0882bd65f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java @@ -0,0 +1,45 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensionRegistry.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.List; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This is the abstract class used to add the wsdl extension serializers and deserializers to the + * wsdl extension registry configured to read/write wsdl extensions into a know java model. + * @see AbstractExtensionSerializer + * @see WSDLProcessor + * @author chikkala + */ +public abstract class AbstractExtensionRegistry extends ExtensionRegistry { + + /** Creates a new instance of AbstractSerializer + * it calls the createSerializers method to get the list of + * serializers and then call registerSerializer on each AbstractExtensionSerializer + * to register them with this registry. + * @see AbstractExtensionSerializer${symbol_pound}registerSerializer + */ + protected AbstractExtensionRegistry() { + super(); + List list = createSerializers(); + for (AbstractExtensionSerializer ser : list ) { + ser.registerSerializer(this); + } + // register ServiceEngine Binding serializers + AbstractExtensionSerializer seBindingSer = new SEBindingExt.SEBindingExtSerializer(); + seBindingSer.registerSerializer(this); + } + /** + * create wsdl extension serializers for each extension element to register with the extension + * registry. + * @return List of AbstractExtensionSerializer objects for serializing/deserializing the wsdl extensions. + * @see AbstractExtensionSerializer + */ + protected abstract List createSerializers(); +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java new file mode 100644 index 000000000..4ac1b37d6 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java @@ -0,0 +1,123 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractExtensionSerializer.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.PrintWriter; +import java.io.Serializable; +import java.util.Set; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionDeserializer; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.extensions.ExtensionSerializer; +import javax.xml.namespace.QName; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +/** + * This class is an abstract class that should be extended to implements extension serializer and + * deserializer. This class implements the code required for registering the serializer and deserializer + * implemented by this class. THe AbstractExtensionRegistry class calls the ${symbol_pound}registerSerializer method + * to register the concrete implementation of this class with extension registry. + * @see AbstractExtensionRegistry + * @author chikkala + */ +public abstract class AbstractExtensionSerializer + implements ExtensionSerializer, ExtensionDeserializer, Serializable { + + public static final long serialVersionUID = 1; + + private Class mParentType; + private Class mExtensionType; + private QName mElementType; + + /** Creates a new instance of AbstractSerializer */ + public AbstractExtensionSerializer(Class parentType, QName elementType, Class extensionType) { + this.mParentType = parentType; + this.mElementType = elementType; + this.mExtensionType = extensionType; + } + + public Class getParentType() { + return this.mParentType; + } + public QName getElementType() { + return this.mElementType; + } + public Class getExtensionType() { + return this.mExtensionType; + } + + public void registerSerializer(ExtensionRegistry extReg) { + extReg.registerSerializer(this.mParentType, this.mElementType, this); + extReg.registerDeserializer(this.mParentType, this.mElementType, this); + extReg.mapExtensionTypes(this.mParentType, this.mElementType, this.mExtensionType); + } + + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + // DO NOTHING. Binding component runtime does not need to serialize the wsdl extensions. + } + + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + return null; + } + + public static String getAttribute(Element el, String attrName) { + String attrValue = null; + Attr attr = el.getAttributeNode(attrName); + if ( attr != null ) { + attrValue = attr.getValue(); + } + return attrValue; + } + + protected String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + /** + * @return the name with the prefix defined for the namespaceURI in the wsdl definition. + * @throws WSDLException if the prefix not found in the wsdl definition. note that the + * default prefix is an empty string. + */ + protected String getQualifiedName(Definition def, + String namespaceURI, String localName) throws WSDLException { + String prefix = null; + if (namespaceURI != null && !namespaceURI.equals("")) { + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + throw new WSDLException(WSDLException.OTHER_ERROR, + "Can not find prefix in WSDL Definition for " + namespaceURI); + } + } + if ( prefix != null && !prefix.equals("")) { + return prefix + ":" + localName; + } else { + return localName; + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java new file mode 100644 index 000000000..b10800550 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java @@ -0,0 +1,229 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * AbstractNormalizer.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.ArrayList; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Part; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * This is an abstract class that implements most of the functionality to normalize the binding protocol + * specific concrete message to jbi wrapper and and denormalize jbi wrapper to the concrete binding + * protocol specific message. + *

+ * The extended classes specific to particular binding protocol will be used when a jbi binding + * component is sending and receiving messages from the external service providers and consumers using + * a particular binding protocol known to this class. Extended implementation of this class should make + * use of the helper methods in this class in normalizing and denormalizing the messages. + * @see JMXBindingNormalizer + * @author chikkala + */ +public abstract class AbstractNormalizer { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + /** wsdl definition to use when normalizing and denormalizing */ + private Definition mWSDL; + /** Binding definition to use when normalizing and denormalizing */ + private Binding mBinding; + + private AbstractNormalizer() {} + /** Creates a new instance of JMXBCNormalizer */ + public AbstractNormalizer(Definition wsdl, Binding binding) { + this.mWSDL = wsdl; + this.mBinding = binding; + } + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete mssage of a particular binding protocol. + */ + public abstract void normalizeInput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeOutput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be de-normalized. + * @param normMsg NormalizedMessage which should be used to create de-normalized message. + */ + public abstract DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + + /** + * denormalized the normalized fault message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException; + /** + * @return the wsdl definition to use in normalizing and denormalizing the message + */ + protected Definition getWSDL() { + return this.mWSDL; + } + /** + * @return the wsdl binding definition to use in normalizing and denormalizing the message + */ + protected Binding getBinding() { + return this.mBinding; + } + /** + * create and add message parts to the jbiWrapper according to the abstract message model. This + * method assumes that the each element in the msgParts list passed to it is mapped to the part + * of the abstract wsdl message and uses the type or element attribute of the abstract message to + * determine whether the element is actual part element or a wrapped part type. + * Use this method in normalizing the concrete protocol specific message to jbi wrapper message. + * @param jbiWrapper object that holds the jbi wrapper information. + * @param wsdlMsg abstract message from the wsdl definition + * @param msgParts actual message parts from the concrete message + */ + protected void addMessagePartsToJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg, List msgParts) throws MessagingException { + List wsdlParts = wsdlMsg.getOrderedParts(null); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= msgParts.size() ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + Element msgPart = msgParts.get(i); + if ( wsdlPart.getElementName() != null ) { + jbiWrapper.appendPart(msgPart); + } else { + // it is type. + // check the element name is same as part + if ( !wsdlPart.getName().equals(msgPart.getLocalName()) ) { + throw new MessagingException("mismatched message content for part " + wsdlPart.getName()); + } + if ( !wsdlMsg.getQName().getNamespaceURI().equals(msgPart.getNamespaceURI()) ) { + throw new MessagingException("mismatched message content namespace for part " + wsdlPart.getName()); + } + // check the content is text or element. + List partContent = getChildElements(msgPart); + if ( partContent.size() > 0 ) { + // add content as part elements + jbiWrapper.appendPart(partContent); + } else { + // add the content as text + jbiWrapper.appendPart(msgPart.getTextContent()); + } + } + } + } + /** + * extracts the message parts from the jbiWrapper according to the abstract wsdl message + * definition passed to it. Use this method in denormalizing the jbi wrapper message into the + * binding protocol specific concrete message. + * @param jbiWrapper jbi wrapper object that contains message parts and the message type information. + * @param wsdlMsg abstract wsdl message definition to use in constructing the part elements. + */ + protected List getMessagePartsFromJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg) + throws MessagingException, ParserConfigurationException { + + List msgParts = new ArrayList(); + int jbiPartCount = jbiWrapper.getPartCount(); + List wsdlParts = wsdlMsg.getOrderedParts(null); + QName msgType = jbiWrapper.getType(); + if (!wsdlMsg.getQName().getNamespaceURI().equals(msgType.getNamespaceURI())) { + throw new MessagingException("Namespace mismatch between jbi wrapper message type and wsdl message"); + } + Document newDoc = jbiWrapper.getDocumentBuilder().newDocument(); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= jbiPartCount ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + if ( wsdlPart.getElementName() != null ) { + msgParts.add(jbiWrapper.getPartAsElement(i)); + } else { + // it is type. create a new element for a typed part + // check the element name is same as part + String prefix = msgType.getPrefix(); + String nsURI = msgType.getNamespaceURI(); + String localName = wsdlPart.getName(); + Element partEl = newDoc.createElementNS(nsURI, prefix + ":" + localName); + partEl.setAttributeNS(XMLNS_NS, "xmlns:"+prefix, nsURI); + NodeList partContent = jbiWrapper.getPart(i); + appendChildren(partEl, partContent, newDoc, true); + msgParts.add(partEl); + } + } + return msgParts; + } + /** + * utility method that can append the nodeList passed to it to the element children. + * @param el element node to which the nodeList should be appended + * @param doc the document object that should be used to import the nodeList + * @param importNode true if the nodeList should be imported while appending the nodeList to the + * element children. false if no import is necessary. + */ + protected void appendChildren(Element el, NodeList nodeList, Document doc, boolean importNode) { + + for ( int pIdx = 0; pIdx < nodeList.getLength(); ++pIdx) { + Node node = nodeList.item(pIdx); + if ( importNode ) { + node = doc.importNode(node, true); + } + el.appendChild(node); + } + } + /** + * @param el element from which to extract the child elements + * @return List list of child Element nodes. + */ + protected List getChildElements(Element el) { + List list = new ArrayList(); + NodeList nodeList = el.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if (!(node instanceof Element) ){ + continue; + } + list.add((Element)node); + } + return list; + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java new file mode 100644 index 000000000..de59e0360 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java @@ -0,0 +1,99 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SEBindingExt.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation classes implement wsdl 1.1 extension model for the + * jbi service engine binding that is defined in jsr 208(sec. 5.5.6.1). to read/write concrete binding + * element in the wsdl definition for the service endpoint binding provided by the service engine. + * The wsdl definition with this binding information can be used in providing the service provider + * metadata returned by the service engine in Component.getServiceDescription. + *

+ * AbstractExtensionRegistry by default include this extension serializers in the + * registry to read/write this service engine binding type in the wsdl definition. + *

+ * During a service unit deployment/initialization in the service engine, the deployed wsdl definition + * is loaded and modified to provide this binding for the service provided by the engine. + * + * @see WSDLProcessor${symbol_pound}createServiceEngineBinding + * @see AbstractExtensionRegistry + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit${symbol_pound}loadServiceDefinitions + * @author chikkala + */ +public interface SEBindingExt extends ExtensibilityElement, java.io.Serializable { + + public static final String NS_URI = "http://java.sun.com/xml/ns/jbi/binding/service+engine"; + public static final String NS_DEF_PREFIX = "jbise"; + /** Element names. */ + public static final String EL_BINDING_EXT = "binding"; + /**Qualified element names.*/ + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + + public static class SEBindingExtImpl extends AbstractExtensibilityElement implements SEBindingExt { + + public SEBindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + @Override + public String toString() { + StringBuffer buff = new StringBuffer(); + buff.append("<"+NS_DEF_PREFIX+":"+EL_BINDING_EXT); + buff.append("/>"); + return buff.toString(); + } + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static SEBindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + SEBindingExtImpl bindingExt = new SEBindingExt.SEBindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, SEBindingExt.NS_DEF_PREFIX); + return bindingExt; + } + } + /** + * serializer and descrializer implementation for the binding extension element. + */ + public static class SEBindingExtSerializer extends AbstractExtensionSerializer { + + public SEBindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, SEBindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + SEBindingExt extObj = (SEBindingExt)extReg.createExtension(parentType, elementType); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + + SEBindingExt extObj = (SEBindingExt)extension; + + StringBuffer buff = new StringBuffer(); + buff.append("<" + elName ); + buff.append("/>"); + pw.println(buff.toString()); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java new file mode 100644 index 000000000..92606104d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java @@ -0,0 +1,471 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDL11JBIWrapper.java + * + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +/** + * This class wraps the wsdl11 messages to the jbi wrapper message suitable for + * processing in the wsdl2.0 model of the normalized message in jbi as defined in jsr208 like + * + * + * + * + * + * + * + * + * + * + * @author chikkala + */ +public class WSDL11JBIWrapper { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + public static final String WRAPPER_NAMESPACE = "http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; + public static final String DEF_NS_PREFIX = "jbiwrp"; + public static final String DEF_MESSAGE_NS_PREFIX = "msgns"; + public static final String JBI_MESSAGE_EL = "message"; + public static final String JBI_PART_EL = "part"; + public static final String VERSION_ATTR = "version"; + public static final String VERSION_ATTR_VALUE = "1.0"; + public static final String TYPE_ATTR = "type"; + public static final String NAME_ATTR = "name"; + + private static DocumentBuilder sDocBuilder = null; + /** qname of message attribute from wsdl:input, wsdl:output or wsdl:fault */ + private QName mType; + /** optional name attribute from wsdl:input, wsdl:output or wsdl:fault */ + private String mName; + /** each parts contents as node list */ + List mPartConentList = new ArrayList(); + + /** Creates a new instance of WSDL11JBIWrapper */ + public WSDL11JBIWrapper() { + } + /** creates the namespace aware document builder. extended classes can override this method + * to return the doc builder created else where. + */ + protected DocumentBuilder createDocumentBuilder() throws ParserConfigurationException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + return factory.newDocumentBuilder(); + } + /** return the document builder + * @return DocumentBuilder + */ + public final DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { + if ( WSDL11JBIWrapper.sDocBuilder == null ) { + WSDL11JBIWrapper.sDocBuilder = createDocumentBuilder(); + } + return WSDL11JBIWrapper.sDocBuilder; + } + /** + * @return type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public QName getType() { + return this.mType; + } + /** + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public void setType(QName type) { + this.mType = type; + } + /** @return name attribute from wsdl:input, wsdl:output or wsdl:fault. or null if not set. */ + public String getName() { + return this.mName; + } + /** + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault. can be null. + */ + public void setName(String name) { + this.mName = name; + } + /** + * appends part content as node list + */ + public void appendPart(NodeList partContent) { + this.mPartConentList.add(partContent); + } + /** + * append part content from the List of nodes + */ + public void appendPart(List partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content as element + */ + public void appendPart(Element partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content from DOMSource + */ + public void appendPart(DOMSource partContent) { + Element partConentEl = getElement(partContent.getNode()); + this.mPartConentList.add(new NodeListImpl(partConentEl)); + } + /** + * append part content as text node. + */ + public void appendPart(String partContent) { + Text textContent = null; + try { + textContent = this.getDocumentBuilder().newDocument().createTextNode(partContent); + } catch (ParserConfigurationException ex) { + ex.printStackTrace(); + } + if ( textContent != null ) { + this.mPartConentList.add(new NodeListImpl(textContent)); + } + } + /** + * append list of part contents each is a NodeList to the parts + */ + public void appendParts(List partContentList) { + this.mPartConentList.addAll(partContentList); + } + /** + * returned the ordered list of part contents. + */ + public List getParts() { + return Collections.unmodifiableList(this.mPartConentList); + } + /** + * return the number of parts + */ + public int getPartCount() { + return this.mPartConentList.size(); + } + /** + * return the part content at a particular index as NodeList. + */ + public NodeList getPart(int idx) { + return this.mPartConentList.get(idx); + } + /** + * return part context at a particular index as text + */ + public String getPartAsText(int idx) { + NodeList partNodes = getPart(idx); + Document doc; + try { + doc = this.getDocumentBuilder().newDocument(); + Element el = doc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + for ( int i=0; i < partNodes.getLength(); ++i) { + el.appendChild(partNodes.item(i)); + } + return el.getTextContent(); + } catch (ParserConfigurationException ex) { + return null; + } + } + /** + * return part context at a particular index as Element + */ + public Element getPartAsElement(int idx) { + Element contentEl = null; + NodeList partNodes = getPart(idx); + for ( int i=0; i < partNodes.getLength(); ++i) { + Node node = partNodes.item(i); + if ( node instanceof Element) { + contentEl = (Element)node; + break; + } + } + return contentEl; + } + /** + * creates Document from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return Document containing the wsdl 11 wrapper xml + */ + public Document toDocument() throws ParserConfigurationException { + + Document wrapperDoc = getDocumentBuilder().newDocument(); + Element jbiMessage = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_MESSAGE_EL); + jbiMessage.setAttribute(VERSION_ATTR, VERSION_ATTR_VALUE); + wrapperDoc.appendChild(jbiMessage); + + QName type = this.getType(); + if ( type == null ) { + type = new QName("", "", DEF_MESSAGE_NS_PREFIX); + } + // set the jbiMessage attributes + String prefix = type.getPrefix(); + if (prefix == null || prefix.length() == 0) { + prefix = DEF_MESSAGE_NS_PREFIX; + } + jbiMessage.setAttribute(TYPE_ATTR, prefix + ":" + type.getLocalPart()); + jbiMessage.setAttributeNS( XMLNS_NS, "xmlns:" + prefix, type.getNamespaceURI()); + + String name = this.getName(); + if (name != null && name.trim().length() > 0 ) { + jbiMessage.setAttribute(NAME_ATTR, name); + } + + List partContentList = this.getParts(); + for ( NodeList nodeList : partContentList ) { + // set jbi part message + Element jbiPart = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + jbiMessage.appendChild(jbiPart); + for ( int i =0; i < nodeList.getLength(); ++i ) { + Node importedMsgNode = wrapperDoc.importNode(nodeList.item(i), true); + jbiPart.appendChild(importedMsgNode); + } + } + + return wrapperDoc; + + } + /** + * creates DOMSource from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return DOMSource containing the wsdl 11 wrapper xml + */ + public DOMSource toDOMSource() throws ParserConfigurationException { + DOMSource wrappedSource = new DOMSource(); + wrappedSource.setNode(toDocument()); + return wrappedSource; + } + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + /** + * creates wrapper object from the DOMSource that has wsdl 11 wrapper xml. + * @param wrappedMsg wsdl 11 wrapper xml as DOMSource + * @return WSDL11JBIWrapper representing the wrapper xml. + */ + public static WSDL11JBIWrapper sourceToWrapper(DOMSource wrappedMsg) { + Element jbiMessage = getElement(wrappedMsg.getNode()); + if ( jbiMessage == null ) { + return null; + } + String nsURI = jbiMessage.getNamespaceURI(); + String tagName = jbiMessage.getLocalName(); + if (!WRAPPER_NAMESPACE.equals(nsURI) || !JBI_MESSAGE_EL.equals(tagName)) { + return null; + } + String name = jbiMessage.getAttribute(NAME_ATTR); + String typeQN = jbiMessage.getAttribute(TYPE_ATTR); + String typePrefix = ""; + String typeName = ""; + if ( typeQN != null && typeQN.trim().length() > 0 ) { + int idx = typeQN.indexOf(':'); + if ( idx >= 0 ) { + typePrefix = typeQN.substring(0, idx); + if ( typeQN.length() > idx ) { + typeName = typeQN.substring(idx+1); + } + } else { + typePrefix = ""; + typeName = typeQN; + } + } + String typeURI = jbiMessage.getAttribute("xmlns:" + typePrefix); + QName typeQName = new QName(typeURI, typeName, typePrefix); + + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(typeQName); + NodeList jbiPartList = jbiMessage.getElementsByTagNameNS(WRAPPER_NAMESPACE, JBI_PART_EL); + for ( int i=0; i < jbiPartList.getLength(); ++i) { + Node jbiPart = jbiPartList.item(i); + wrapper.appendPart(jbiPart.getChildNodes()); + } + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object and sets the type and name of the object + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name ) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(type); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content has multiple child element. + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, NodeList partContent) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + wrapper.appendPart(partContent); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content is a single element + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, Element msgEl) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name, new WSDL11JBIWrapper.NodeListImpl(msgEl)); + return wrapper; + } + + public static WSDL11JBIWrapper createWrapper(QName type, String name, DOMSource inputSource) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + Node msgNode = getElement(inputSource.getNode()); + NodeList nodeList = new WSDL11JBIWrapper.NodeListImpl(msgNode); + wrapper.appendPart(nodeList); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations input element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createInputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Input input = operation.getInput(); + if ( input == null ) { + return null; + } + name = input.getName(); + Message wsdlMsg = input.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createOutputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Output output = operation.getOutput(); + if ( output == null) { + return null; + } + name = output.getName(); + Message wsdlMsg = output.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @param faultName fault name, can be null to look for the fault with no name. + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createFaultWrapper(Operation operation, String faultName) throws ParserConfigurationException { + QName type = null; + String name = null; + @SuppressWarnings("unchecked") + Map faultMap = operation.getFaults(); + Fault fault = faultMap.get(faultName); + + if ( fault == null ) { + return null; + } + name = fault.getName(); + Message wsdlMsg = fault.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * NodeList implementation. + */ + public static class NodeListImpl extends ArrayList implements NodeList { + + public NodeListImpl() { + super(); + } + + public NodeListImpl(Node aNode) { + super(); + if (aNode != null) { + this.add(aNode); + } + } + + public NodeListImpl(List nodes) { + if (nodes != null) { + this.addAll(nodes); + } + } + + public int getLength() { + return this.size(); + } + + public Node item(int idx) { + return this.get(idx); + } + + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java new file mode 100644 index 000000000..b5a1bb331 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java @@ -0,0 +1,419 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDLProcessor.java + */ + +package net.openesb.component.${artifactId}.common.wsdl; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.wsdl.Port; +import javax.wsdl.PortType; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ElementExtensible; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.wsdl.xml.WSDLWriter; +import javax.xml.namespace.QName; + +/** + * This class is used to configure jwsdl(wsdl4j) to read and process wsdl documents with wsdl extensions. + * It provides set of helper methods to read and process the wsdl definitions from files with .wsdl + * extension from a specified directory. + *

+ * A Binding Component that is processing the wsdl extensions for its deployment configuration would + * extend this class and provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + *

+ * A Service Engine that is processing the wsdl during deployment can directly use this class + * to process the wsdl as the default implementation returned by this class configures the wsdl extension + * registry to read/write the service engine binding extensions. + * + * @see AbstractExtensionRegistry + * @see SEBindingExt + * @author chikkala + */ +public class WSDLProcessor { + + private String mXmlCatalogPath = "xml-catalog.xml"; + private String mWsdlDirPath = ""; + private WSDLReader mReader; + + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir) { + this(wsdlDir, null); + } + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir, String xmlCatPath) { + if ( wsdlDir != null ) { + this.mWsdlDirPath = wsdlDir; + } + if ( xmlCatPath != null ) { + this.mXmlCatalogPath = xmlCatPath; + } + } + /** @return directory path from which this class reads the wsdl files with .wsdl as file extension. */ + public String getWSDLDirectory() { + return this.mWsdlDirPath; + } + /** path to the xml catalog file in the service unit which can be used for Catalog-based entity + * and URI resolution. + */ + public String getXmlCatelogPath() { + return this.mXmlCatalogPath; + } + /** wsdl extension registry required for processing the wsdl extensions in the wsdl definition to + * java model. Binding component that is processing the wsdl extensions for its deployment + * configuration would provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + * @return ExtensionSerializer + * @see AbstractExtensionSerializer + */ + protected ExtensionRegistry getExtensionRegistry() { + return new AbstractExtensionRegistry() { + protected List createSerializers() { + return new ArrayList(); + } + }; + } + /** + * @return the WSDLReader configured with extension registry to process the wsdl extensions. + */ + public final WSDLReader getWSDLReader() throws WSDLException { + if ( this.mReader == null ) { + WSDLFactory factory = WSDLFactory.newInstance(); + this.mReader = factory.newWSDLReader(); + // reader.setFeature("javax.wsdl.verbose", true); + // reader.setFeature("javax.wsdl.importDocuments", true); + this.mReader.setExtensionRegistry(getExtensionRegistry()); + } + return this.mReader; + } + /** + * reads the wsdl file and returns the wsdl definition jwsdl model. + * @param wsldFilePath relative path to wsdl file from the the root wsdl directory returns from + * ${symbol_pound}getWSDLDirectory in the service unit or or absolute path . + * @return Definition + */ + public Definition readWSDL(String wsdlFilePath) throws WSDLException { + File wsdlFile = new File(wsdlFilePath); + if ( !wsdlFile.isAbsolute() ) { + wsdlFile = new File(this.mWsdlDirPath, wsdlFilePath); + } + return getWSDLReader().readWSDL(wsdlFile.getAbsolutePath()); + } + /** + * reads the files with .wsdl file extension in a directory. If the directory should + * be searched recursively, it searches this directory, all child directories of this + * directory and then to their child directories recursively. + * @param dir directory file to search for .wsdl files + * @param rec if set to true, it recursively searches the directory. if set to false, only + * this directory is searched. + * @return List of Files with .wsdl extension. + */ + public List listWSDLFiles(File dir, final boolean rec) throws IOException { + if ( dir == null || !dir.isDirectory()) { + throw new IOException(dir + " is not a directory for looking up wsdl files"); + } + List wsdlList = new ArrayList(); + File[] files = dir.listFiles(new FileFilter() { + public boolean accept(File pathname) { + if ( rec && pathname.isDirectory()) { + return true; + } else { + String name = pathname.getName(); + int idx = name.lastIndexOf('.'); + if ( idx < 0 ) { + return false; + } + String ext = name.substring(idx); + return ".wsdl".equalsIgnoreCase(ext); + } + } + }); + for ( File file : files ) { + if ( rec && file.isDirectory()) { + List wsdlFiles = listWSDLFiles(file, rec); + wsdlList.addAll(wsdlFiles); + } else { + wsdlList.add(file); + } + } + return wsdlList; + } + /** + * reads the files with .wsdl file extension in a directory fromDir and return the list of + * wsdl definitions corresponding to them. + * @param fromDir path to the directory relative to the root wsdl directory returns from + * ${symbol_pound}getWSDLDirectory or the absolute path to the directory. + */ + public List readWSDLs(String fromDir) throws WSDLException { + if ( fromDir == null ) { fromDir = ""; } + File wsdlDir = new File(fromDir); + if (!wsdlDir.isAbsolute()) { + wsdlDir = new File(this.mWsdlDirPath, fromDir); + } + + List wsdlFiles = new ArrayList(); + try { + wsdlFiles = listWSDLFiles(wsdlDir, true); + } catch (IOException ioEx) { + throw new WSDLException("WSDLFileReadError", ioEx.getMessage(),ioEx); + } + + List wsdlPaths = new ArrayList(); + for ( File wsdlFile : wsdlFiles) { + wsdlPaths.add(wsdlFile.getAbsolutePath()); + } + Collections.sort(wsdlPaths); + + List wsdlList = new ArrayList(); + for ( String wsdlPath : wsdlPaths ) { + Definition wsdlDef = readWSDL(wsdlPath); + wsdlList.add(wsdlDef); + } + return wsdlList; + } + /** + * finds PortType using port type ( interface ) qname. + */ + public static PortType findInterface(Definition wsdlDef, QName interfaceName) { + return wsdlDef.getPortType(interfaceName); + } + /** finds the Service using service qname */ + public static Service findService(Definition wsdlDef, QName serviceName) { + return wsdlDef.getService(serviceName); + } + /** finds the wsdl port using service qname and endpoint name */ + public static Port findServiceEndpoint(Definition wsdlDef, QName serviceName, String endpointName) { + Service service = null; + Port port = null; + service = findService(wsdlDef, serviceName); + if ( service != null ) { + port = service.getPort(endpointName); + } + return port; + } + /** + * finds the binding definition to which the service with serviceName and endpointName was bound. + */ + public static Binding findServiceBinding(Definition wsdlDef, QName serviceName, String endpointName) { + Binding binding = null; + Port port = findServiceEndpoint(wsdlDef, serviceName, endpointName); + if ( port != null ) { + binding = port.getBinding(); + } + return binding; + } + /** + * finds the binding definition using the interface(portType) qname with a + */ + public static Binding findInterfaceBinding(Definition wsdlDef, + QName interfaceQName, QName extQName) { + Map bindingMap = wsdlDef.getBindings(); + @SuppressWarnings("unchecked") + Collection bindings = bindingMap.values(); + for ( Binding binding : bindings ) { + if ( binding.getPortType().getQName().equals(interfaceQName)) { + return binding; + } + } + return null; + } + + /** + * find the wsdl4j operation corresponds to the interface+operation. + * @param wsdlDef wsdl definition + * @param portTypeQName portType QName + * @param opName operation name. if null, first operation in the portType + * is returned. + * @return Operation corresponding to the portType+opName + */ + public static Operation findOperation(Definition wsdlDef, + QName portTypeQName, String opName) { + Operation operation = null; + PortType portType = wsdlDef.getPortType(portTypeQName); + if ( portType != null ) { + if ( opName != null ) { + operation = portType.getOperation(opName, null, null); + } else { + @SuppressWarnings("unchecked") + List list = portType.getOperations(); + if ( list != null && list.size() > 0 ) { + operation = list.get(0); + } + } + } + return operation; + } + /** + * verifies whether the wsdl definition contains the specified service descriptions or not. Used + * to locate the wsdl definition for the services describes in service unit deployment + * descriptor(jbi.xm). + * @param interfaceName portType qname to find in the definition. can be null if you are trying to + * find only service endpoint description. + * @param serviceName qname for the service to find in this wsdl. can be null if + * you are trying to find only portType (abstract service) description. + * @param endpointName port name to find in the service definition. null if only + * service with any port should be looked up. + * + * @return true if the wsdl definition contains the specified service description. + */ + public static boolean isWSDLFor(Definition wsdlDef, + QName interfaceName, QName serviceName, String endpointName) { + PortType portType = null; + Service service = null; + Port port = null; + if ( interfaceName != null ) { + portType = findInterface(wsdlDef, interfaceName); + } + + if ( serviceName != null ) { + service = findService(wsdlDef, serviceName); + } + + if ( endpointName != null && service != null ) { + port = service.getPort(endpointName); + } + + boolean isWSDL = true; + + if ( (interfaceName != null && portType == null) || + ( serviceName != null && service == null ) || + ( endpointName != null && (service == null || port == null)) ) { + isWSDL = false; + } + + return isWSDL; + } + /** + * creates a binding definition that contains a service engine binding elements in the specified + * wsdl definition for a portType. It will try to find/create the binding element with interface + * local name with a "_JBISEBinding" suffix and add service engine binding element to it if it + * is not present. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding createServiceEngineBinding(Definition wsdl, QName interfaceName) { + QName bindingQName = new QName(wsdl.getQName().getNamespaceURI(), + interfaceName.getLocalPart() + "_JBISEBinding"); + Binding binding = wsdl.getBinding(bindingQName); + if ( binding == null ) { + binding = wsdl.createBinding(); + binding.setQName(bindingQName); + binding.setPortType(wsdl.getPortType(interfaceName)); + binding.setUndefined(false); + + ExtensibilityElement bindingExt = + SEBindingExt.SEBindingExtImpl.addExtensibilityElement(wsdl, binding); + + wsdl.addBinding(binding); + } + return binding; + } + /** + * creates port and binding elements that provide the the service engine binding for a service. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @param serviceName service under which the port definition bound to the service engine binding + * should be created. + * @param endpointName port name. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding createServiceEngineBinding(Definition wsdl, QName interfaceName, QName serviceName, String endpointName ) { + Binding binding = null; + Service service = findService(wsdl, serviceName); + if ( service == null ) { + return null; + } + Port port = service.getPort(endpointName); + if ( port != null ) { + binding = port.getBinding(); + } else { + // create port + port = wsdl.createPort(); + port.setName(endpointName); + binding = createServiceEngineBinding(wsdl, interfaceName); + port.setBinding(binding); + service.addPort(port); + } + return binding; + } + /** prints the wsdl to text from the wsdl definition */ + public static void printWSDL(PrintWriter out, Definition def) { + try { + WSDLFactory factory = WSDLFactory.newInstance(); + WSDLWriter wsdlWriter = factory.newWSDLWriter(); + wsdlWriter.writeWSDL(def, out); + } catch (WSDLException ex) { + ex.printStackTrace(out); + } + } + /** prints the wsdl to text from the wsdl definition */ + public static String printWSDLToString(Definition def) { + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + printWSDL(out, def); + out.close(); + return writer.getBuffer().toString(); + } + /** returns an existing namespace prefix or create one if not exists for the corresponding namespaceURI */ + public static String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static void addExtensibilityElement(Definition wsdlDef, + ElementExtensible extensibleEl, ExtensibilityElement extEl, String defPrefix) { + QName elementType = extEl.getElementType(); + String namespaceURI = elementType.getNamespaceURI(); + String prefix = wsdlDef.getPrefix(namespaceURI); + if ( prefix == null ) { + // no namespace prefix defined. create one. + prefix = WSDLProcessor.getNamespacePrefix(wsdlDef, namespaceURI, defPrefix); + wsdlDef.addNamespace(prefix, namespaceURI); + } + extensibleEl.addExtensibilityElement(extEl); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/BindingExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/BindingExt.java new file mode 100644 index 000000000..f61d31f64 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/BindingExt.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * BindingExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * extension element. The inner classes BindingExtImpl implements the interface + * and the BindingExtSerializer provides the serializer and deserializer + * implementation. The implementation and serializer classes will be registered + * with the ExtensionRegistry to process the binding extension element in the + * wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface BindingExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + //TODO: define get/set methods for properties for BindingExt if the extension element has attributes. + + /** + * This class is an implementation of BindingExt interface that provides + * java model for binding extensibility element. + */ + public static class BindingExtImpl extends AbstractExtensibilityElement implements BindingExt { + + public BindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + + /** + * creates and adds the binding extensibility element to the wsdl + * definition + */ + public static BindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + BindingExtImpl bindingExt = new BindingExt.BindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, NS_DEF_PREFIX); + return bindingExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding extensibility element. + */ + public static class BindingExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public BindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, BindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + BindingExt extObj = (BindingExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + BindingExt extObj = (BindingExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=${symbol_escape}"" + myAttr + "${symbol_escape}""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java new file mode 100644 index 000000000..2a7b8d153 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java @@ -0,0 +1,52 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ExtConstants.java + * + */ +package net.openesb.component.${artifactId}.wsdlext; + +import javax.xml.namespace.QName; + +/** + * This interface defines the constants for the namespace, elements, attributes + * and qnames corresponding to the wsdl extensions that this component + * processes. These constants will be used in the wsdl extension model used to + * process a particular wsdl extensions. + * + * @see WSDLExtensionRegistry + * @see PortExt + * @see BindingExt + * @author chikkala + */ +public interface ExtConstants { + + public static final String NS_URI_WSDL = "http://schemas.xmlsoap.org/wsdl/"; + public static final String NS_URI_XMLNS = "http://www.w3.org/2000/xmlns/"; + /** + * wsdl extension namespace processed by this wsdl extension model + */ + public static final String NS_URI = "http://java.sun.com/jbi/wsdl-extensions/sample/jmx-bc/"; + public static final String NS_DEF_PREFIX = "jmxbc"; + // wsdl extension element names. + public static final String EL_BINDING_EXT = "binding"; + public static final String EL_OPERATION_EXT = "operation"; + public static final String EL_INPUT_EXT = "input"; + public static final String EL_OUTPUT_EXT = "output"; + public static final String EL_FAULT_EXT = "fault"; + public static final String EL_PORT_EXT = "address"; + // Qualified wsdl extension element names. + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + public static final QName QN_OPERATION_EXT = new QName(NS_URI, EL_OPERATION_EXT); + public static final QName QN_INPUT_EXT = new QName(NS_URI, EL_INPUT_EXT); + public static final QName QN_OUTPUT_EXT = new QName(NS_URI, EL_OUTPUT_EXT); + public static final QName QN_FAULT_EXT = new QName(NS_URI, EL_FAULT_EXT); + public static final QName QN_PORT_EXT = new QName(NS_URI, EL_PORT_EXT); + // wsdl extension elements attribute names. + public static final String ATTR_ACTION = "action"; + public static final String ATTR_SERVICE_URL = "serviceURL"; + public static final String ATTR_USERNAME = "username"; + public static final String ATTR_PASSWORD = "password"; + public static final String ATTR_MBEAN = "mbean"; +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/FaultExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/FaultExt.java new file mode 100644 index 000000000..051573122 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/FaultExt.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * FaultExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingFault; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation fault extension element. The inner classes FaultExtImpl implements + * the interface and the FaultExtSerializer provides the serializer and + * deserializer implementation. The implemenation and serializer classes will be + * registered with the ExtensionRegistry to process the binding operation fault + * extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface FaultExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define getter methods for properties for FaultExt if the extension element has attributes. + /** + * This class is an implementation of FaultExt interface that provides java + * model for binding operation fault extensibility element. + */ + public static class FaultExtImpl extends AbstractExtensibilityElement implements FaultExt { + + public FaultExtImpl() { + setElementType(QN_FAULT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static FaultExtImpl addExtensibilityElement(Definition wsdlDef, BindingFault fault) { + FaultExtImpl faultExt = new FaultExt.FaultExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, fault, faultExt, NS_DEF_PREFIX); + return faultExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation fault extensibility element. + */ + public static class FaultExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public FaultExtSerializer() { + super(BindingFault.class, QN_FAULT_EXT, FaultExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + FaultExt extObj = (FaultExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + FaultExt extObj = (FaultExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_FAULT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=${symbol_escape}"" + myAttr + "${symbol_escape}""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/InputExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/InputExt.java new file mode 100644 index 000000000..bb4f45078 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/InputExt.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * InputExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingInput; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation input extension element. The inner classes InputExtImpl implements + * the interface and the InputExtSerializer provides the serislizer and + * deserializer implementation. The implementation and serializer classes will + * be registered with the ExtensionRegistry to process the binding operation + * input extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface InputExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define get/set methods for properties for InputExt if the extension element has attributes. + /** + * This class is an implementation of InputExt interface that provides java + * model for binding operation input extensibility element. + */ + public static class InputExtImpl extends AbstractExtensibilityElement implements InputExt { + + public InputExtImpl() { + setElementType(QN_INPUT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static InputExtImpl addExtensibilityElement(Definition wsdlDef, BindingInput input) { + InputExtImpl inputExt = new InputExt.InputExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, input, inputExt, NS_DEF_PREFIX); + return inputExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation input extensibility element. + */ + public static class InputExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public InputExtSerializer() { + super(BindingInput.class, QN_INPUT_EXT, InputExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + InputExt extObj = (InputExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + InputExt extObj = (InputExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_INPUT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=${symbol_escape}"" + myAttr + "${symbol_escape}""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OperationExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OperationExt.java new file mode 100644 index 000000000..c7fd384a4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OperationExt.java @@ -0,0 +1,121 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * OperationExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingOperation; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation extension element. The inner classes OperationImpl implements the + * interface and the OperationExtSerializer provides the serilizer and + * deserializer implementation. The implementation and serializer classes will + * be registered with the ExtensionRegistry to process the binding operation + * extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface OperationExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + /** + * Getter for property action. + * + * @return Value of property action. + */ + public String getAction(); + + /** + * Setter for property action. + * + * @param action New value of property action. + */ + public void setAction(String action); + + /** + * This class is an implementation of OperationExt interface that provides + * java model for binding operation extensibility element. + */ + public static class OperationExtImpl extends AbstractExtensibilityElement implements OperationExt { + + private String mAction; + + public OperationExtImpl() { + setElementType(QN_OPERATION_EXT); + } + + public String getAction() { + return this.mAction; + } + + public void setAction(String action) { + this.mAction = action; + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static OperationExtImpl addExtensibilityElement(Definition wsdlDef, BindingOperation operation) { + OperationExtImpl operationExt = new OperationExt.OperationExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, operation, operationExt, NS_DEF_PREFIX); + return operationExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation extensibility element. + */ + public static class OperationExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public OperationExtSerializer() { + super(BindingOperation.class, QN_OPERATION_EXT, OperationExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + OperationExt extObj = (OperationExt) extReg.createExtension(parentType, elementType); + String action = el.getAttribute(ATTR_ACTION); + extObj.setAction(action); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + OperationExt extObj = (OperationExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_OPERATION_EXT); + buff.append("<" + elName); + + String action = extObj.getAction(); + if (action != null && action.trim().length() > 0) { + buff.append(" " + ATTR_ACTION + "=${symbol_escape}"" + action + "${symbol_escape}""); + } + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OutputExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OutputExt.java new file mode 100644 index 000000000..7c88fc9de --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/OutputExt.java @@ -0,0 +1,101 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * OutputExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingOutput; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation output extension element. The inner classes OutputExtImpl + * implements the interface and the OutputExtSerializer provides the serilizer + * and deserializer implementation. The implementation and serializer classes + * will be registered with the ExtensionRegistry to process the binding + * operation output extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface OutputExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define get/set methods for properties for OutputExt if the extension element has attributes. + /** + * This class is an implementation of OutputExt interface that provides java + * model for binding operation output extensibility element. + */ + public static class OutputExtImpl extends AbstractExtensibilityElement implements OutputExt { + + public OutputExtImpl() { + setElementType(QN_OUTPUT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static OutputExtImpl addExtensibilityElement(Definition wsdlDef, BindingOutput output) { + OutputExtImpl OutputExt = new OutputExt.OutputExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, output, OutputExt, NS_DEF_PREFIX); + return OutputExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation output extensibility element. + */ + public static class OutputExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public OutputExtSerializer() { + super(BindingOutput.class, QN_OUTPUT_EXT, OutputExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + OutputExt extObj = (OutputExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + OutputExt extObj = (OutputExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_OUTPUT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=${symbol_escape}"" + myAttr + "${symbol_escape}""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/PortExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/PortExt.java new file mode 100644 index 000000000..ca5ce4b09 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/PortExt.java @@ -0,0 +1,217 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * PortExt.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.${artifactId}.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for port + * extension element. The inner classes PortExtImpl implements the interface and + * the PortExtSerializer provides the serializer and deserializer implemenation. + * The implementation and serializer classes will be registered with the + * ExtensionRegistry to process the port extension element in the wsdl + * definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface PortExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + /** + * Getter for property serviceURL. + * + * @return Value of property serviceURL. + */ + public String getServiceURL(); + + /** + * Setter for property serviceURL. + * + * @param serviceURL New value of property serviceURL. + */ + public void setServiceURL(String serviceURL); + + /** + * Getter for property username. + * + * @return Value of property username. + */ + public String getUsername(); + + /** + * Setter for property username. + * + * @param username New value of property username. + */ + public void setUsername(String username); + + /** + * Getter for property password. + * + * @return Value of property password. + */ + public String getPassword(); + + /** + * Setter for property password. + * + * @param password New value of property password. + */ + public void setPassword(String password); + + /** + * Getter for property name. + * + * @return Value of property name. + */ + public String getMBean(); + + /** + * Setter for property mbean. + * + * @param name New value of property mbean. + */ + public void setMBean(String mbean); + + /** + * This class is an implementation of PortExt interface that provides java + * model for port extensibility element. + */ + public static class PortExtImpl + extends AbstractExtensibilityElement implements PortExt { + + private String mServiceURL; + private String mUsername; + private String mPassword; + private String mMBean; + + public PortExtImpl() { + setElementType(QN_PORT_EXT); + } + + public String getServiceURL() { + return this.mServiceURL; + } + + public void setServiceURL(String serviceURL) { + this.mServiceURL = serviceURL; + } + + public String getUsername() { + return this.mUsername; + } + + public void setUsername(String username) { + this.mUsername = username; + } + + public String getPassword() { + return this.mPassword; + } + + public void setPassword(String password) { + this.mPassword = password; + } + + public String getMBean() { + return this.mMBean; + } + + public void setMBean(String mbean) { + this.mMBean = mbean; + } + + /** + * creates and adds the port extensibility element to the wsdl + * definition + */ + public static PortExtImpl addExtensibilityElement(Definition wsdlDef, Port port) { + PortExtImpl portExt = new PortExt.PortExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, port, portExt, NS_DEF_PREFIX); + return portExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * port extensibility element. + */ + public static class PortExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public PortExtSerializer() { + super(Port.class, QN_PORT_EXT, PortExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + PortExt extObj = (PortExt) extReg.createExtension(parentType, elementType); + + String serviceURL = el.getAttribute(ATTR_SERVICE_URL); + extObj.setServiceURL(serviceURL); + + String mbean = el.getAttribute(ATTR_MBEAN); + extObj.setMBean(mbean); + + String username = el.getAttribute(ATTR_USERNAME); + extObj.setUsername(username); + + String password = el.getAttribute(ATTR_PASSWORD); + extObj.setPassword(password); + + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + PortExt extObj = (PortExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_PORT_EXT); + buff.append("<" + elName); + + String serviceURL = extObj.getServiceURL(); + if (serviceURL != null && serviceURL.trim().length() > 0) { + buff.append(" " + ATTR_SERVICE_URL + "=${symbol_escape}"" + serviceURL + "${symbol_escape}""); + } + + String mbean = extObj.getMBean(); + if (mbean != null && mbean.trim().length() > 0) { + buff.append(" " + ATTR_MBEAN + "=${symbol_escape}"" + mbean + "${symbol_escape}""); + } + + String username = extObj.getUsername(); + if (username != null && username.trim().length() > 0) { + buff.append(" " + ATTR_USERNAME + "=${symbol_escape}"" + username + "${symbol_escape}""); + } + + String password = extObj.getUsername(); + if (password != null && password.trim().length() > 0) { + buff.append(" " + ATTR_PASSWORD + "=${symbol_escape}"" + password + "${symbol_escape}""); + } + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java new file mode 100644 index 000000000..c73d4e3f6 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java @@ -0,0 +1,223 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDLExtHelper.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import java.util.List; +import javax.wsdl.Binding; +import javax.wsdl.BindingFault; +import javax.wsdl.BindingInput; +import javax.wsdl.BindingOperation; +import javax.wsdl.BindingOutput; +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This class is a helper class for processing the wsdl extensions. It has + * methods that help locate the extension elements and return the java models + * corresponds to the extension elements. + * + * @author chikkala + */ +public final class WSDLExtHelper { + + /** + * creates the java object for the port extension element. + * + * @param def wsdl definition + * @param serviceName QName of the service + * @param endpointName name of the port under which to lookup for the port + * extension. + * @return java object for the port extension element + */ + public static PortExt getPortExt(Definition def, QName serviceName, String endpointName) { + PortExt portExt = null; + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + @SuppressWarnings("unchecked") + List extElList = port.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof PortExt) { + portExt = (PortExt) extEl; + break; + } + } + return portExt; + } + + /** + * creates the java object for the binding extension element. + * + * @param def wsdl definition + * @param binding binding under which to lookup for the binding extension. + * @return java object for the port extension element + */ + public static BindingExt getBindingExt(Definition def, Binding binding) { + BindingExt bindingExt = null; + @SuppressWarnings("unchecked") + List extElList = binding.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof BindingExt) { + bindingExt = (BindingExt) extEl; + break; + } + } + return bindingExt; + } + + /** + * creates the java object for the binding extension element. + * + * @param def wsdl definition + * @param serviceName QName of the service + * @param endpointName name of the port that references the binding. + * @return java object for the port extension element + */ + public static BindingExt getBindingExt(Definition def, QName serviceName, String endpointName) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getBindingExt(def, binding); + } + + /** + * @return OperationExt java object corresponding to the operation extension + * element under binding + */ + public static OperationExt getOperationExt(Definition def, Binding binding, String operation) { + OperationExt operationExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, null); + if (bindingOp != null) { + @SuppressWarnings("unchecked") + List extElList = bindingOp.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof OperationExt) { + operationExt = (OperationExt) extEl; + break; + } + } + } + return operationExt; + } + + /** + * @return OperationExt java object corresponding to the operation extension + * element under binding + */ + public static OperationExt getOperationExt(Definition def, QName serviceName, String endpointName, String operation) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getOperationExt(def, binding, operation); + } + + /** + * @return InputExt java object corresponding to input extension element of + * the the binding operation under binding + */ + public static InputExt getInputExt(Definition def, Binding binding, + String operation, String input) { + InputExt inputExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, input, null); + if (bindingOp != null) { + BindingInput bindingInput = bindingOp.getBindingInput(); + @SuppressWarnings("unchecked") + List extElList = bindingInput.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof InputExt) { + inputExt = (InputExt) extEl; + break; + } + } + } + return inputExt; + } + + /** + * @return InputExt java object corresponding to input extension element of + * the the binding operation under binding + */ + public static InputExt getInputExt(Definition def, + QName serviceName, String endpointName, String operation, String input) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getInputExt(def, binding, operation, input); + } + + /** + * @return OutputExt java object corresponding to output extension element + * of the the binding operation under binding + */ + public static OutputExt getOutputExt(Definition def, Binding binding, + String operation, String output) { + OutputExt outputExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, output); + if (bindingOp != null) { + BindingOutput bindingOutput = bindingOp.getBindingOutput(); + @SuppressWarnings("unchecked") + List extElList = bindingOutput.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof OutputExt) { + outputExt = (OutputExt) extEl; + break; + } + } + } + return outputExt; + } + + /** + * @return OutputExt java object corresponding to output extension element + * of the the binding operation under binding + */ + public static OutputExt getOutputExt(Definition def, + QName serviceName, String endpointName, String operation, String output) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getOutputExt(def, binding, operation, output); + } + + /** + * @return FaultExt java object corresponding to fault extension element of + * the the binding operation under binding + */ + public static FaultExt getFaultExt(Definition def, Binding binding, + String operation, String faultName) { + FaultExt faultExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, null); + if (bindingOp != null) { + BindingFault bindingFault = bindingOp.getBindingFault(faultName); + if (bindingFault != null) { + @SuppressWarnings("unchecked") + List extElList = bindingFault.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof FaultExt) { + faultExt = (FaultExt) extEl; + break; + } + } + } + } + return faultExt; + } + + /** + * @return FaultExt java object corresponding to fault extension element of + * the the binding operation under binding + */ + public static FaultExt getFaultExt(Definition def, + QName serviceName, String endpointName, String operation, String faultName) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getFaultExt(def, binding, operation, faultName); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd new file mode 100644 index 000000000..1311a03c9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd @@ -0,0 +1,98 @@ + + + + + + + + + "binding" defines a protocol based binding details. + + + + + + + + + + + + + + "operation" defines the protocol based binding operation details. + + + + + + + + + + + + + + + "input" defines the protocol based binding input details. + + + + + + + + + + + + + + "output" defines the protocol based binding output details. + + + + + + + + + + + + + + "fault" defines the protocol based binding fault details. + + + + + + + + + + + + + + "address" indicates protocol based binding port details. + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java new file mode 100644 index 000000000..36154acfb --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java @@ -0,0 +1,46 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * WSDLExtensionRegistry.java + */ +package net.openesb.component.${artifactId}.wsdlext; + +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionRegistry; +import net.openesb.component.${artifactId}.common.wsdl.AbstractExtensionSerializer; +import java.util.ArrayList; +import java.util.List; + +/** + * This class extends + * AbstractExtensionRegistry to create the serializers and deserializers + * for processing wsdl extensions. + * + * @see AbstractExtensionRegistry + * @author chikkala + */ +public class WSDLExtensionRegistry extends AbstractExtensionRegistry { + + /** + * Creates a new instance of JMXBindingExtensionRegistry + */ + public WSDLExtensionRegistry() { + super(); + } + + /** + * creates serializers and deserializers for all the extension elements + */ + protected List createSerializers() { + List list = new ArrayList(); + + list.add(new BindingExt.BindingExtSerializer()); + list.add(new OperationExt.OperationExtSerializer()); + list.add(new InputExt.InputExtSerializer()); + list.add(new OutputExt.OutputExtSerializer()); + list.add(new FaultExt.FaultExtSerializer()); + list.add(new PortExt.PortExtSerializer()); + + return list; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/BindingComponentTest.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/BindingComponentTest.java new file mode 100644 index 000000000..defb6afd4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/BindingComponentTest.java @@ -0,0 +1,55 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * ${artifactId}Test.java + */ +package bindingtest; +import net.openesb.component.${artifactId}.test.JBIComponentTestClient; +import net.openesb.component.${artifactId}.test.JMXBindingTestClient; +import java.util.Properties; + import junit.framework.TestCase; + +/** + * The test method in this testcase uses the JMXBindingTestClient to send the + * input document to the echo service provided by service engine via the binding + * component by sending the input to the binding using jmx interface. The output + * received from the service invocation will be placed in test results directory + * under the same package as this test case. + * @see com.sun.jbi.sample.component.test.JMXBindingTestClinet + * + * @author chikkala + */ +public class BindingComponentTest + extends TestCase +{ + + public BindingComponentTest(String testName) { + super(testName); + } + + public void test1() throws Exception { + String testPropertiesPath = "test1.properties"; + JBIComponentTestClient testClient = new JMXBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public void test2() throws Exception { + String testPropertiesPath = "test2.properties"; + JBIComponentTestClient testClient = new JMXBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public static void main(String[] args) { + try { + BindingComponentTest compTest = new BindingComponentTest("BindingComponentTest"); + compTest.test1(); + compTest.test2(); + } catch(Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test1.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test1.properties new file mode 100644 index 000000000..02707a88a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test1.properties @@ -0,0 +1,16 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Sample ResourceBundle properties file + +${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} test properties for testing the binding component +input.file=test1Input.xml +${symbol_pound}exptected.file=Expected.xml +output.file=test1Output.xml + +consumer.jmx.bc.ep.operation=sayHello +consumer.jmx.bc.ep.address.mbean=com.sun.jbi.sample.jmxbc:jmxbc-ep-address=BindingComponent/greetings +consumer.jmx.bc.ep.address.serviceURL=service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi +consumer.jmx.bc.ep.address.username=admin +consumer.jmx.bc.ep.address.password=this really long string is used to identify a password that has been stored in the Keyring + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test1Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test1Input.xml new file mode 100644 index 000000000..ac1004c3e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test1Input.xml @@ -0,0 +1,12 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test2.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test2.properties new file mode 100644 index 000000000..4921dee72 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test2.properties @@ -0,0 +1,15 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Sample ResourceBundle properties file + +${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} test properties for testing the binding component +input.file=test2Input.xml +${symbol_pound}exptected.file=Expected.xml +output.file=test2Output.xml + +consumer.jmx.bc.ep.operation=sayGoodbye +consumer.jmx.bc.ep.address.mbean=com.sun.jbi.sample.jmxbc:jmxbc-ep-address=BindingComponent/greetings +consumer.jmx.bc.ep.address.serviceURL=service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi +consumer.jmx.bc.ep.address.username=admin +consumer.jmx.bc.ep.address.password=this really long string is used to identify a password that has been stored in the Keyring diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test2Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test2Input.xml new file mode 100644 index 000000000..31058414d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/bindingtest/test2Input.xml @@ -0,0 +1,12 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java new file mode 100644 index 000000000..919ad6829 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java @@ -0,0 +1,298 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JBIComponentTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; + +/** + * This class implements the base framework for the testing the JBI components. + * Testing the JBI component involves may require deploying a service to the + * component(s) to enable the service provided by the test component and then + * invoking the service provided by the test component. If the test component is + * a binding component, then a service provider component such as sample service + * engine is required to test the component end to end. If the test component is a + * service engine, then the service on the test component can be invoked via + * soap/http binding component. + * + * This class provides the utilites to read the test properties, read the input + * message from the file and save the output to the file. The testService + * method implemented here can be executed as the test for the component. The + * testService method calls the invokeService method with the input document and + * expects a output document or error that will be saved to the output file. + * The method invokeService should be implemented by the extended test classes to + * inplement a suitable service consumer implemenation for the test compoent. + * See JMXBindingTestClient.java or SOAPBidningTestClient.java for more details + * on how to implement a partucular test service consumer. + * + * @author chikkala + */ +public abstract class JBIComponentTestClient { + + public static final String TEST_PROPS_FILE_PROP = "test.properties.file"; + public static final String TEST_RESULTS_DIR_PROP = "test.results.dir"; + public static final String TEST_SRC_DIR_PROP = "test.src.dir"; + + public static final String TEST_PACKAGE_PROP = "test.package.name"; + + public static final String INPUT_FILE_PROP = "input.file"; + public static final String EXPECTED_FILE_PROP = "expected.file"; + public static final String OUTPUT_FILE_PROP = "output.file"; + + public static final String DEF_TEST_PROP_FILE = "test.properties"; + public static final String DEF_INPUT_FILE = "Input.xml"; + public static final String DEF_OUTPUT_FILE = "Output.xml"; + public static final String DEF_TEST_RESULTS_DIR = "test-results"; + + public JBIComponentTestClient() { + } + /** + * returns the absolute resource path w.r.t. the packagePath if the resource name + * is relative else return the resourceName as it is. + * @param package name ( dot separated ) + * @param resourcName dot separated name or a absolute resource path + * @return abosolute resource path with path separator + */ + public static String resolveResourcePath(String packageName, String resourceName) { + String resourcePath = resourceName; + if ( !resourceName.startsWith("/")) { + // it is relative resource file. resolve it w.r.t. testPackage + String pkgDir = packageName.trim().replace('.', '/'); + if ( pkgDir.length() != 0 ) { + pkgDir += "/"; + } + resourcePath = "/" + pkgDir + resourceName; + } + return resourcePath; + } + /** + * loads the resource file as properties. + * @param testPackage package name where this test belongs + * @param testPropPath resource path relative to testPackage or absolute resource path + */ + public Properties loadTestProperties(String testPackage, String testPropPath) throws IOException { + String propsResourcePath = resolveResourcePath(testPackage, testPropPath); + + InputStream testPropIS = null; + try { + testPropIS = this.getClass().getResourceAsStream(propsResourcePath); + Properties testProps = new Properties(); + testProps.load(testPropIS); + testProps.setProperty(TEST_PACKAGE_PROP, testPackage); + return testProps; + } finally { + if ( testPropIS != null ) { + try { + testPropIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @param testPropPath resource path relative to testPackage or absolute resource path + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass, String testPropPath) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), testPropPath ); + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), DEF_TEST_PROP_FILE ); + } + /** + * loads the resource file to string bugger + * @param inputFile resource file path + */ + public StringBuffer loadResourceFile(String resourcePath) throws FileNotFoundException, IOException { + + InputStream inputIS = null; + InputStreamReader inputReader = null; + BufferedReader reader = null; + StringWriter strWriter = null; + PrintWriter writer = null; + try { + inputIS = this.getClass().getResourceAsStream(resourcePath); + inputReader = new InputStreamReader(inputIS); + reader = new BufferedReader(inputReader); + strWriter = new StringWriter(); + writer = new PrintWriter(strWriter); + for ( String line = null; (line = reader.readLine()) != null ; ) { + writer.println(line); + } + writer.close(); + strWriter.close(); + return strWriter.getBuffer(); + } finally { + if ( inputIS != null ) { + try { + inputIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + + /** + * reads data from the reader and saves to file + * @param reader reader from which to read the data and save to file + * @param outputFilePath absolute file path + */ + public void saveOutputToFile(Reader reader, String outputFilePath) throws IOException { + + BufferedReader buff = null; + FileWriter fileWriter = null; + PrintWriter writer = null; + try { + buff = new BufferedReader(reader); + fileWriter = new FileWriter(outputFilePath); + writer = new PrintWriter(fileWriter); + for ( String line = null; (line = buff.readLine()) != null ; ) { + writer.println(line); + } + } finally { + if ( writer != null ) { + writer.close(); + } + if ( fileWriter != null ) { + fileWriter.close(); + } + } + } + + /** + * resource path. + */ + public String getInputFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String inputFile = testProps.getProperty(INPUT_FILE_PROP, DEF_INPUT_FILE); + String resourcePath = resolveResourcePath(testPkg, inputFile); + return resourcePath; + } + /** + * return resource path + */ + public String getExpectedFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String resourcePath = null; + String expFile = testProps.getProperty(EXPECTED_FILE_PROP, null); + if ( expFile != null ) { + resourcePath = resolveResourcePath(testPkg, expFile); + } + return resourcePath; + } + /** + * return the absolute path to the output file + */ + public String getOutputFilePath(Properties testProps) { + + String defPackage = this.getClass().getPackage().getName(); + String testPackage = testProps.getProperty(TEST_PACKAGE_PROP, defPackage); + String testPackageDir = testPackage.replace('.','/'); + String outputFile = testProps.getProperty(OUTPUT_FILE_PROP, DEF_OUTPUT_FILE); + + String userHomeDir = System.getProperty("user.home", ""); + String userDir = System.getProperty("user.dir", userHomeDir); + String defResultsDir = userDir + "/" + DEF_TEST_RESULTS_DIR; + String sysResultDir = System.getProperty(TEST_RESULTS_DIR_PROP, defResultsDir); + String resultDir = testProps.getProperty(TEST_RESULTS_DIR_PROP, sysResultDir); + + File outputDir = new File(resultDir, testPackageDir); + // System.out.println("Creating the test results output dir " + outputDir); + outputDir.mkdirs(); + return (new File(outputDir, outputFile)).getAbsolutePath(); + } + + /** + * This is the method where the actual service invocation code based on the + * type of client will be implemented. testService method calls this method + * after preparing the test input and then processes the output returned by + * this method to complte the test. + * @param inputDoc + * @param testProps + * @throws java.lang.Exception + * @return + */ + public abstract StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception; + + /** + * abstract method implemented by the extended classes to compare the output + * document with the expected output to determine the test is a failure or + * success. + * @param outputDoc + * @param expectedDoc + * @param testProps + * @throws java.lang.Exception + */ + public abstract void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, Properties testProps) throws Exception; + + /** + * This is the main test method that a test case will call to test the + * service. The standard steps that required to invoke the service and + * process the output will be done in this method. Each test case creates + * the test Properties required for that test and executes this method for + * testing the service by passing the test properties to it. This method + * prepares the input and executes the invokeService method to invoke a + * service with the prepared input. It then processes the return value from + * the invokeService to complete the test. + * + * @param testProps + * @throws java.lang.Exception + */ + public void testService(Properties testProps) throws Exception { + + String inFilePath = getInputFileResourcePath(testProps); + String outFilePath = getOutputFilePath(testProps); + String expFilePath = getExpectedFileResourcePath(testProps); + File outDir = (new File(outFilePath)).getParentFile(); + outDir.mkdirs(); + + StringBuffer outputDoc = new StringBuffer(); + + try { + StringBuffer inputDoc = loadResourceFile(inFilePath); + outputDoc = invokeService(inputDoc, testProps); + if ( expFilePath != null ) { + StringBuffer expOutputDoc = loadResourceFile(expFilePath); + compareWithExpectedOutput(inputDoc, expOutputDoc, testProps); + } + } catch (Exception ex) { + StringWriter out = new StringWriter(); + ex.printStackTrace(new PrintWriter(out)); + outputDoc.append(out.getBuffer()); + throw ex; + } finally { + if ( outputDoc != null ) { + System.out.println(outputDoc); + this.saveOutputToFile(new StringReader(outputDoc.toString()), outFilePath); + } + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java new file mode 100644 index 000000000..7cc8c103e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java @@ -0,0 +1,136 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * JMXBindingTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the proxy service consumer implementation by a binding component + * that can communicate with the external service consumers using JMX interface. + * @author chikkala + */ +public class JMXBindingTestClient extends JBIComponentTestClient { + + public static final String CONSUMER_EP_INBOUND_OPERATION_PROP = "consumer.jmx.bc.ep.operation"; + public static final String CONSUMER_EP_ADDRESS_MBEAN_PROP = "consumer.jmx.bc.ep.address.mbean"; + public static final String CONSUMER_EP_ADDRESS_URL_PROP = "consumer.jmx.bc.ep.address.serviceURL"; + public static final String CONSUMER_EP_ADDRESS_USERNAME_PROP = "consumer.jmx.bc.ep.address.username"; + public static final String CONSUMER_EP_ADDRESS_PASSWORD_PROP = "consumer.jmx.bc.ep.address.password"; + + public static final String PROVIDER_EP_INBOUND_OPERATION_PROP = "provider.jmx.bc.ep.operation"; + public static final String PROVIDER_EP_ADDRESS_MBEAN_PROP = "provider.jmx.bc.ep.address.mbean"; + public static final String PROVIDER_EP_ADDRESS_URL_PROP = "provider.jmx.bc.ep.address.serviceURL"; + public static final String PROVIDER_EP_ADDRESS_USERNAME_PROP = "provider.jmx.bc.ep.address.username"; + public static final String PROVIDER_EP_ADDRESS_PASSWORD_PROP = "provider.jmx.bc.ep.address.password"; + + + /** + * Creates a new instance of JMXBindingTestClient + */ + public JMXBindingTestClient() { + super(); + } + /** + * creates jmx connection to send the input message to the binding component. + */ + public static MBeanServerConnection getJMXConnection(Properties testProps) + throws MalformedURLException, IOException { + + String jmxUrl = testProps.getProperty(CONSUMER_EP_ADDRESS_URL_PROP); + String username = testProps.getProperty(CONSUMER_EP_ADDRESS_USERNAME_PROP); + String password = testProps.getProperty(CONSUMER_EP_ADDRESS_PASSWORD_PROP); + + Map env = new HashMap(); + if ( username != null ) { + String [] credentials = new String [] {username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, JMXBindingTestClient.class.getClassLoader()); + } + JMXServiceURL serviceURL = new JMXServiceURL(jmxUrl); + JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, env); + MBeanServerConnection mbeanServerConnection = jmxConnector.getMBeanServerConnection(); + return mbeanServerConnection; + } + /** + * constructs the jmx mbean objectname + */ + public static ObjectName createJMXEndpointMBeanObjectName(String endpointAddressMBean) throws MalformedObjectNameException { + // String objectName = JMX_DOMAIN + ":" + JMX_ENDPOINT_ADDRESS_KEY + "=" + endpointAddressMBean; + return new ObjectName(endpointAddressMBean); + } + /** + * invokes a jmx mbean to send message. + */ + public static StringBuffer invokeSendMessage(MBeanServerConnection jmxConn, ObjectName epAddressName, + String operation, StringBuffer inputDoc) + throws MalformedObjectNameException, InstanceNotFoundException, + MBeanException, ReflectionException, IOException { + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if ( result != null ) { + outDoc = (StringBuffer)result; + } + + return outDoc; + } + /** + * invokes the service via jmx interface. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + ObjectName epAddressName = new ObjectName(testProps.getProperty(CONSUMER_EP_ADDRESS_MBEAN_PROP)); + String operation = testProps.getProperty(CONSUMER_EP_INBOUND_OPERATION_PROP); + + MBeanServerConnection jmxConn = getJMXConnection(testProps); + StringBuffer outputDoc = null; + try { + outputDoc = invokeSendMessage(jmxConn, epAddressName, operation, inputDoc); + } catch (MBeanException ex) { + Exception targetEx = ex.getTargetException(); + if ( targetEx != null ) { + throw targetEx; + } else { + throw ex; + } + } + return outputDoc; + } + /** no expected output comparison implemented */ + public void compareWithExpectedOutput(StringBuffer inputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java new file mode 100644 index 000000000..28f534612 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java @@ -0,0 +1,159 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +/* + * SOAPBindingTestClient.java + */ + +package net.openesb.component.${artifactId}.test; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.util.Properties; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPConnection; +import javax.xml.soap.SOAPConnectionFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPFault; +import javax.xml.soap.SOAPMessage; +import javax.xml.soap.SOAPPart; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the Service Engine via SOAP Binding by invoking the service using + * SOAP Client that sends the message to the service provider via soaphttp binding. + * + * @author chikkala + */ +public class SOAPBindingTestClient extends JBIComponentTestClient { + + private static final String ADDRESS_PROP = "soap.binding.inbound.endpoint.address.location"; + private static final String SOAP_ACTION_PROP = "soap.binding.soapaction"; + private static final String FAIL_ON_SOAP_FAULT_PROP = "fail.on.soap.fault"; + + private static MessageFactory messageFactory; + private static SOAPConnectionFactory soapConnFactory; + private static SOAPConnection connection; + + public SOAPBindingTestClient() throws SOAPException { + init(); + } + /** initializes SOAP client */ + private synchronized void init() throws SOAPException { + if ( messageFactory == null ) { + messageFactory = MessageFactory.newInstance(); + } + if ( soapConnFactory == null ) { + soapConnFactory = SOAPConnectionFactory.newInstance(); + } + if ( connection == null ) { + connection = soapConnFactory.createConnection(); + } + } + + /** + * read in a soap message from the given input file + */ + private static SOAPMessage loadMessage(Reader inReader) throws SOAPException, IOException { + //Create and populate the message from a file + SOAPMessage message = messageFactory.createMessage(); + SOAPPart soapPart = message.getSOAPPart(); + StreamSource preppedMsgSrc = new StreamSource(inReader); + soapPart.setContent(preppedMsgSrc); + message.saveChanges(); + return message; + } + /** saves the SOAP message as xml text to a writer */ + private static void saveMessage(SOAPMessage response, Writer outWriter) + throws TransformerConfigurationException, SOAPException, TransformerException { + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute("indent-number", new Integer(2)); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + SOAPPart replySOAPPart = response.getSOAPPart(); + Source sourceContent = replySOAPPart.getContent(); + StreamResult result = new StreamResult(outWriter); + try { + transformer.transform(sourceContent, result); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + } + /** + * Send a soap message + * @param destination URL to send to + * @param message message to send + * @param expectedHttpStatus expected http status code or null if success is expected + * @return reply soap message + */ + private static SOAPMessage sendMessage(String destination, SOAPMessage message, String soapAction) throws SOAPException { + + // Add soapAction if not null + if (soapAction != null) { + MimeHeaders hd = message.getMimeHeaders(); + hd.setHeader("SOAPAction", soapAction); + } + // Send the message and get a reply + SOAPMessage reply = null; + reply = connection.call(message, destination); + return reply; + } + /** check the xml text in the StringBuffer passed contains SOAP Fault. */ + public boolean isSOAPFault(StringBuffer msgBuff) { + SOAPFault soapFault = null; + try { + SOAPMessage inMsg = loadMessage(new StringReader(msgBuff.toString())); + soapFault = inMsg.getSOAPBody().getFault(); + } catch (Exception ex) { + // any exception, means either no fault elem or invalid xml + } + return (soapFault != null); + } + /** + * invokes the service ny sending the input message and return the output + * message returned by the service. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + String soapAction = testProps.getProperty(SOAP_ACTION_PROP); + String destination = testProps.getProperty(ADDRESS_PROP); + SOAPMessage inMsg = loadMessage(new StringReader(inputDoc.toString())); + SOAPMessage outMsg = sendMessage(destination, inMsg, soapAction); + StringWriter out = new StringWriter(); + saveMessage(outMsg, out); + StringBuffer outDoc = out.getBuffer(); + Boolean failOnSoapFault = Boolean.valueOf(testProps.getProperty(FAIL_ON_SOAP_FAULT_PROP, "false")); + if ( failOnSoapFault ) { + if (isSOAPFault(outDoc)) { + StringBuffer errBuff = new StringBuffer("${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} SOAP FAULT ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound} ${symbol_escape}n"); + errBuff.append(outDoc); + throw new Exception(errBuff.toString()); + } + } + return outDoc; + } + /** comparing the received output document with the expected document. throw + * exception if the docs are not same. throwing the exception in this method + * fails the test. + */ + public void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/build.properties new file mode 100644 index 000000000..945269943 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/build.properties @@ -0,0 +1,22 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service assembly builds +${symbol_pound} user.properties.file=../../user.properties +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +build.dir=build +service.assembly.name=testSA + +${symbol_pound}no.deps=true set the no.deps property if there are no SUs to build +${symbol_pound} for each testSU define the properties here. +${symbol_pound} dependent BC SU projects dependency +${symbol_pound} service unit name +service.unit.name.testSUBC=testSUBC +${symbol_pound} service unit project directory +project.testSUBC=testSUBC + +${symbol_pound} service unit name +service.unit.name.testSUSE=testSUSE +${symbol_pound} service unit project directory +project.testSUSE=testSUSE diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/build.xml new file mode 100644 index 000000000..02f75e641 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/build.xml @@ -0,0 +1,140 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..3ced1c59e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,44 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + ${artifactId}_TestSA + This is a test Service Assembly to test Binding + + + + + ${artifactId}_TestSUBC + This service unit enables inbound endpoint in the JMXBinding for a service in service engine + + + testSUBC.zip + ${artifactId} + + + + + ${artifactId}_TestSUSE + This service unit enables greetings service provider in the service engine + + + testSUSE.zip + ServiceEngine + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.properties new file mode 100644 index 000000000..caaefb87b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.properties @@ -0,0 +1,10 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service unit builds +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +${symbol_pound}build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUBC + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..777fb3cf9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/build.xml @@ -0,0 +1,74 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl new file mode 100644 index 000000000..cf1d4ccc3 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/Greetings.wsdl @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..112a9decb --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.properties new file mode 100644 index 000000000..1bfd81c69 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.properties @@ -0,0 +1,10 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} Build properties for the service unit builds +src.dir=src +${symbol_pound} This directory is removed when the project is cleaned: +${symbol_pound}build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..846415d3a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/build.xml @@ -0,0 +1,74 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl new file mode 100644 index 000000000..9c6322558 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..e1edc9a96 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,17 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/hello.xsl b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties new file mode 100644 index 000000000..44baf5452 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/classes/archetype-resources/test/testSA/testSUSE/src/xsltmap.properties @@ -0,0 +1,31 @@ +#set( $symbol_pound = '#' ) +#set( $symbol_dollar = '$' ) +#set( $symbol_escape = '\' ) +${symbol_pound} properties will be used to find the xslt file that will be used for invoking a +${symbol_pound} service operation. +${symbol_pound} The "xsltmap.properties" file should contain two types of properties +${symbol_pound} 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +${symbol_pound} "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +${symbol_pound} 2. a service description to xslt file properties with syntax like +${symbol_pound} "{tns-prefix}service-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +${symbol_pound} "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +${symbol_pound} the service description property is a "." delimited tokens that represents +${symbol_pound} a serive or interface qname and a operation name. To locate xslt file either with +${symbol_pound} service qname or service qname and operaton or serivice qname and interface qname +${symbol_pound} and operation, all the three properties specified above should be there for each xslt file. +${symbol_pound} + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +${symbol_pound} just service level default settings +{greet2}greetService=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +${symbol_pound} service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +${symbol_pound} service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/archetype.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/archetype.properties new file mode 100644 index 000000000..cdd05f905 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/archetype.properties @@ -0,0 +1,6 @@ +#Tue Jul 30 12:43:25 IST 2013 +package=it.pkg +version=0.1-SNAPSHOT +groupId=archetype.it +artifactId=BindingComponent-archetype +glassfishLocation=C:\\GlassFishESBv22\\glassfish \ No newline at end of file diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/goal.txt b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/goal.txt new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/build.log b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/build.log new file mode 100644 index 000000000..e69de29bb diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/build.xml new file mode 100644 index 000000000..8fc9afb3b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/build.xml @@ -0,0 +1,69 @@ + + + + + + Builds, tests, and runs the project BindingComponent-archetype. + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild-impl.xml new file mode 100644 index 000000000..5c4fb1097 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild-impl.xml @@ -0,0 +1,127 @@ + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild.properties new file mode 100644 index 000000000..5bab5aa6b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild.properties @@ -0,0 +1,45 @@ +# build properties file to set/override the properties of the netbeans project +# build properties when the netbeans build is called from the maven build lifecycle. +# Netbeans project when build from the IDE, uses a build.properties from the user.dir +# of the Netbeans IDE to resolve some of the properties used in the project such as +# the libraries classpath. +# When invoking the Netbeans project build from maven, this build.properties file +# is not available. So, you can add the properties defined in ide build properties +# that this project uses here. +# + +# default local repository settings. If the repository location is different +# -D command line option should override this (e.g. mvn -Dmaven.repo.local=/my/m2/repository +maven.repo.local=${user.home}/.m2/repository +# begin jbi admin settings +# set the below properties if you want to override the properties from nbproject/project.properties +# that sets the application server admin settings. +# +# jbi.as.home=C:/Sun/glassfish-v2-b58g +# jbi.host=localhost +# jbi.port=4848 +# jbi.username=admin +# jbi.password=adminadmin +# end jbi admin settings +# + +# classpath settings +junit.ant.task.classpath=${maven.repo.local}/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar +junit.runtime.classpath=${maven.repo.local}/junit/junit/3.8.2/junit-3.8.2.jar +libs.junit.classpath=${junit.runtime.classpath}:${junit.ant.task.classpath} +libs.jbi-cdk-ant-tasks.classpath=${maven.repo.local}/open-esb/jbi-cdk/jbi-cdk-ant-tasks/0.1-SNAPSHOT/jbi-cdk-ant-tasks-0.1-SNAPSHOT.jar + +libs.jbi.classpath=${maven.repo.local}/open-esb/jbi/1.0/jbi-1.0.jar +libs.wsdl4j.162.classpath=${maven.repo.local}/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar +# libs.jaxws21.classpath=${jbi.as.home}/lib/javaee.jar:${jbi.as.home}/lib/webservices-rt.jar +libs.jaxws21.classpath=\ +${maven.repo.local}/javax/activation/activation/1.1/activation-1.1.jar:\ +${maven.repo.local}/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:\ +${maven.repo.local}/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:\ +${maven.repo.local}/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:\ +${maven.repo.local}/com/sun/xml/ws/jaxws-rt/2.1.2/jaxws-rt-2.1.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild.xml new file mode 100644 index 000000000..6557242cf --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/m2nbbuild.xml @@ -0,0 +1,34 @@ + + + + + + This project compile, package and test the JBI Components when invoked from Maven2. + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/build-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/build-impl.xml new file mode 100644 index 000000000..7458ae806 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/build-impl.xml @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task is getting executed! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inside: postArchTypeGen - Post task executed successfully! + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/genfiles.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/genfiles.properties new file mode 100644 index 000000000..d36e5a48b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=f37ab647 +build.xml.script.CRC32=9068f2c7 +build.xml.stylesheet.CRC32=8add101f@1.0 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=f37ab647 +nbproject/build-impl.xml.script.CRC32=d15987fd +nbproject/build-impl.xml.stylesheet.CRC32=4ed53ee0@1.0 diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/jbi_admin.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/jbi_admin.xml new file mode 100644 index 000000000..623507a02 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/jbi_admin.xml @@ -0,0 +1,501 @@ + + + + + +This ant script contains the jbi ant tasks and the targets and properties using +which the jbi admin commands can be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Usage : ant -f <fullpath>/jbi_admin.xml [options] [target] + options: -D<property>=<value> + Specify a property/value pairs as options that are valid for the target. + target : ant target name in jbi_admin.xml + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/jbiadmin-impl.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/jbiadmin-impl.xml new file mode 100644 index 000000000..cde39fb8b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/jbiadmin-impl.xml @@ -0,0 +1,336 @@ + + + Install, uninstall, reinstall, start, stop, shutdown jbi components. + + + + + + + + + + + + + + Must set jbi.host + Must set jbi.port + Must set jbi.username + Must set jbi.password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/private/private.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/private/private.properties new file mode 100644 index 000000000..f4fdfea51 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/private/private.properties @@ -0,0 +1,3 @@ +javac.debug=true +javadoc.preview=true +user.properties.file=D:\\softwares\\openesb_logicoy_last_working57\\.netbeans\\openesb\\build.properties diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/project.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/project.properties new file mode 100644 index 000000000..f3c08640d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/project.properties @@ -0,0 +1,90 @@ +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.predist.dir=${build.dir}/predist +build.predist.jar=${build.predist.dir}/component.jar +build.predist.lib.dir=${build.predist.dir}/lib +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.dir=${build.dir}/test +build.test.results.dir=${build.dir}/test/results +conf.dir=src/conf +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/BindingComponent-archetype.zip +dist.javadoc.dir=${dist.dir}/javadoc +jar.compress=false +javac.classpath=\ + ${libs.jbi.classpath}:\ + ${jbi.component.sharedlibs.classpath}:\ + ${jbi.component.lib.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.jaxws21.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jbi.ant.tasks.classpath=\ + ${jbi.as.home}/lib/sun-appserv-ant.jar:\ + ${jbi.as.home}/jbi/lib/jbi-ant-tasks.jar +#jbi.as.home=D:\\softwares\\openesb_logicoy_last_working53\\glassfish +jbi.as.home=C:\GlassFishESBv22\glassfish +#jbi.as.instance.id=[D:\\softwares\\openesb_logicoy_last_working53\\glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.as.instance.id=[C:\GlassFishESBv22\glassfish]deployer:Sun:AppServer::localhost:4848 +jbi.component.bootstrap.class=BindingComponent-archetype.JMXBindingInstaller +jbi.component.class=BindingComponent-archetype.JMXBindingRuntime +jbi.component.description=Description of binding component : BindingComponent-archetype +jbi.component.lib.classpath=\ + ${libs.wsdl4j.162.classpath} +jbi.component.name=BindingComponent-archetype +jbi.component.sharedlibs.classpath= +jbi.component.type=binding-component +jbi.host=localhost +jbi.install.params.file=install-params.properties +jbi.install.with.params=false +jbi.password=this really long string is used to identify a password that has been stored in the Keyring +jbi.port=4848 +jbi.soap.binding.name=sun-http-binding +jbi.username=admin +meta.inf.dir=${conf.dir}/META-INF +platform.active=default_platform +project.jbi.deploy.plugin=./deploy-plugin +project.testSA=test/testSA +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src/java +test-sys-prop.test.results.dir=${build.test.results.dir} +test-sys-prop.test.src.dir=test-sys-prop.test.src.dir +test.src.dir=test/java +testSA.enabled=true +testSA.name=BindingComponent-archetype_TestSA diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/project.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/project.xml new file mode 100644 index 000000000..4430c8228 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/nbproject/project.xml @@ -0,0 +1,17 @@ + + + org.netbeans.modules.jbi.apisupport.project.jbicomponent + + + BindingComponent-archetype + binding-component + 1.6.5 + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/pom.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/pom.xml new file mode 100644 index 000000000..1b370ee15 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/pom.xml @@ -0,0 +1,268 @@ + + + + 4.0.0 + archetype.it + BindingComponent-archetype + jar + 0.1-SNAPSHOT + JBI Component[BindingComponent-archetype] + Maven project for JBI Component that contains the + maven and netbeans build setup and component code to build and test the JBI Component. + http://open-esb.org + + build + src/java + test/java + build/classes + build/test/classes + package + + + org.apache.maven.plugins + maven-compiler-plugin + + true + 1.5 + 1.5 + + + **/*.java + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + + **/*.* + + + + + maven-surefire-plugin + 2.1.3 + true + + + true + + **/bindingtest/*.java + **/enginetest/*.java + + + + + + maven-antrun-plugin + 1.2 + + + m2nbbuild-compile + compile + run + + + + + + + + m2nbbuild-compile-test + test-compile + run + + + + + + + + m2nbbuild-package + package + run + + + + + + + + m2nbbuild-utest + test + run + + + + + + + + m2nbbuild-itest + integration-test + run + + + + + + + + m2nbbuild-clean + clean + run + + + + + + + default-cli + + run + + + + !!!!!!!!!!!!!!!!!!!!!! Moving Files and organizing package !!!!!!!!!!!!!!!!!!!!!!!! + + + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + + + + + + + maven2-repo1 + Maven2 Central Repository + http://repo1.maven.org/maven2 + + + download-java-net-maven2-repository + download.java.net Maven 2.x repository + http://download.java.net/maven/2/ + + + maven-repository.dev.java.net-repository + https://maven-repository.dev.java.net/nonav/repository/ + legacy + + + ws-zones + ws.zones maven repository + http://ws.zones.apache.org/repository2/ + + + apache.org + Maven Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + + apache.org + Maven Plugin Snapshots + http://people.apache.org/repo/m2-snapshot-repository + + false + + + + + + + + ant + ant-nodeps + 1.6.5 + + + ant + ant-junit + 1.6.5 + test + + + junit + junit + 3.8.2 + test + + + org.apache.maven + maven-ant-tasks + 2.0.7 + + + open-esb.jbi-cdk + jbi-cdk-ant-tasks + 1.0-SNAPSHOT + + + open-esb + jbi + 1.0 + + + wsdl4j + wsdl4j + 1.6.2 + + + com.sun.xml.ws + jaxws-rt + 2.1.2 + test + + + + + ${maven.repo.local} + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/conf/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/conf/META-INF/jbi.xml new file mode 100644 index 000000000..33ec52082 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/conf/META-INF/jbi.xml @@ -0,0 +1,42 @@ + + + + + + + BindingComponent-archetype + Description of binding component : BindingComponent-archetype + + + net.openesb.component.BindingComponent-archetype.JMXBindingRuntime + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + net.openesb.component.BindingComponent-archetype.JMXBindingInstaller + + + component.jar + + lib/wsdl4j-1.6.2.jar + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java new file mode 100644 index 000000000..86407044a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingComponentLifeCycle.java @@ -0,0 +1,49 @@ +/* + * JMXBindingComponent-archetypeLifeCycle.java + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.common.BasicComponentLifeCycle; +import net.openesb.component.BindingComponent-archetype.common.DefaultMessageExchangeReceiver; +import net.openesb.component.BindingComponent-archetype.common.MessageExchangeReceiver; +import net.openesb.component.BindingComponent-archetype.common.RuntimeContext; +import javax.jbi.JBIException; +import javax.jbi.component.Component; + +/** + * This class extends the basic ComponentLifeCycle implementation to provide + * component specific implementation of the ComponentLifeCycle. + * + * @see javax.jbi.ComponentLifeCycle + * @see com.sun.jbi.sample.component.common.BasicComponentLifeCycle + * @author chikkala + */ +public class JMXBindingComponentLifeCycle extends BasicComponentLifeCycle { + + /** + * constructor for the ComponentLifecycle implementation. + */ + public JMXBindingComponentLifeCycle(Component compRuntime) { + super(compRuntime); + } + + /** + * creates DefaultMessageExchangeReceiver to handles receiving and + * processing the message exchanges from the delivery channel. + */ + @Override + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return new DefaultMessageExchangeReceiver(); + } + + /** + * chance to extended classes to do the component specific init + * + * @throws javax.jbi.JBIException + */ + @Override + protected void doInit() throws JBIException { + // NOOP + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java new file mode 100644 index 000000000..ecd37c66d --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingConsumerEndpoint.java @@ -0,0 +1,150 @@ +/* + * JMXBindingConsumerEndpoint.java + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.wsdlext.PortExt; +import net.openesb.component.BindingComponent-archetype.wsdlext.WSDLExtHelper; +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import net.openesb.component.BindingComponent-archetype.common.deployment.ConsumerEndpoint; +import net.openesb.component.BindingComponent-archetype.common.deployment.SUDescriptor; +import net.openesb.component.BindingComponent-archetype.common.deployment.ServiceUnit; +import javax.jbi.JBIException; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanRegistrationException; +import javax.management.ObjectName; +import javax.management.StandardMBean; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends ConsumerEndpoint to implement the component specific + * consumer endpoint configuration. It uses JMXBindingConsumerProxy to receive + * messages from external service consumers and initiate the InOut message + * exchange. This implementation shows how a synchronous send/receive from the + * delivery channel will be used in InOut message exchange in a service + * invocation by the external consumers. + * + * @author chikkala + */ +public class JMXBindingConsumerEndpoint extends ConsumerEndpoint { + + private ObjectName mJMXEndpointMBeanName; + private JMXEndpointMBean mJMXEndpointMBean; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public JMXBindingConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(consumes, wsdlDef, su); + } + + @Override + protected void doInit() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): init called"); + this.initJMXEndpoint(); + } + + @Override + protected void doActivate() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): activate called"); + this.activateJMXEndpoint(); + } + + @Override + protected void doDeactivate() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): deactivate called"); + this.deactivateJMXEndpoint(); + } + + @Override + protected void doClean() throws JBIException { + RuntimeHelper.getLogger().fine("JMXBindingEndpoint(Consumer): clean called"); + this.cleanJMXEndpoint(); + } + + /** + * creates the JMXEndpointMBean implementation. + */ + protected JMXEndpointMBean createJMXEndpointMBean() { + // JMX EndpointMBean implementation that initiates in-out message exchange. + return new JMXBindingConsumerProxy(this); + } + + /** + * get the mbean object name from the endpoint address of the jmx wsdl + * extension element + */ + protected ObjectName createJMXEndpointMBeanName() throws JBIException { + ObjectName mbeanObjectName = null; + try { + mbeanObjectName = new ObjectName(findMBeanNameFromWSDL()); + } catch (Exception ex) { + throw new JBIException(ex); + } + return mbeanObjectName; + } + + public final ObjectName getJMXEndpointMBeanName() { + return this.mJMXEndpointMBeanName; + } + + public final JMXEndpointMBean getJMXEndpointMBean() { + return this.mJMXEndpointMBean; + } + + protected final void initJMXEndpoint() throws JBIException { + // create jmx mbean resources + this.mJMXEndpointMBeanName = createJMXEndpointMBeanName(); + this.mJMXEndpointMBean = createJMXEndpointMBean(); + } + + protected final void activateJMXEndpoint() throws JBIException { + // open jmx connectivity to external consumers by registering the + // external endpoint mbean implementation. + try { + StandardMBean mbean = new StandardMBean(this.mJMXEndpointMBean, JMXEndpointMBean.class); + this.getComponentContext().getMBeanServer().registerMBean(mbean, this.mJMXEndpointMBeanName); + } catch (Exception ex) { + throw new JBIException(ex); + } + } + + protected final void deactivateJMXEndpoint() throws JBIException { + // close the jmx connectivity to external consumers by unregistering + // the external endpoint mbean. + try { + this.getComponentContext().getMBeanServer().unregisterMBean(this.mJMXEndpointMBeanName); + } catch (InstanceNotFoundException ex) { + ex.printStackTrace(); + } catch (MBeanRegistrationException ex) { + ex.printStackTrace(); + } + } + + protected final void cleanJMXEndpoint() throws JBIException { + // release jmx mbean resources + this.mJMXEndpointMBean = null; + this.mJMXEndpointMBeanName = null; + } + + /** + * get the mbean object name from the endpoint address of the jmx wsdl + * extension element + */ + protected String findMBeanNameFromWSDL() { + String mbeanName = null; + try { + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + Definition def = this.getWSDL(); + PortExt address = WSDLExtHelper.getPortExt(def, serviceName, endpointName); + if (address != null) { + mbeanName = address.getMBean(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + return mbeanName; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java new file mode 100644 index 000000000..296ad7430 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingConsumerProxy.java @@ -0,0 +1,234 @@ +/* + * JMXBindingConsumerProxy.java + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import net.openesb.component.BindingComponent-archetype.common.deployment.ConsumerEndpoint; +import java.io.StringReader; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Operation; +import javax.wsdl.OperationType; +import javax.xml.namespace.QName; +import javax.xml.transform.Source; + +/** + * This class acts as a proxy to the external service consumer that can receive + * messages from the external consumer using JMX interface and then initiate the + * InOut message exchange to invoke a service provided by the component in the + * jbi environment. + * + * this code shows how a synchronous send/receive messages from the delivery + * channel can be used in InOut message exchange to complete a service + * invocation. + * + * @author chikkala + */ +public class JMXBindingConsumerProxy implements JMXEndpointMBean { + + /** + * Synchronous send timeout + */ + private static final long SEND_SYNC_TIMEOUT = 60000; + private ConsumerEndpoint mEndpoint; + private JMXBindingNormalizer mNormalizer; + + /** + * Creates a new instance of JMXEndpointMBeanImpl + */ + public JMXBindingConsumerProxy(ConsumerEndpoint endpoint) { + this.mEndpoint = endpoint; + this.mNormalizer = new JMXBindingNormalizer(endpoint.getWSDL(), endpoint.getWSDLBinding()); + } + + public StringBuffer sendMessage(String operation, StringBuffer inputDoc) throws Exception { + // when receive input from external service consumer, + // 1. normalized the message, 2. send in-out message exchange. 3. denormalize out message. + Source inMsgSource = RuntimeHelper.createDOMSource(new StringReader(inputDoc.toString())); + QName operationQName = this.mEndpoint.getOperationQName(operation); + Source out = initiateMessageExchange(operationQName, inMsgSource); + StringBuffer outBuff = null; + if (out != null) { + // read the denormalized out message to string buffer. + outBuff = RuntimeHelper.readFromSource(out); + } + // return the out message content to the external service consumer. + return outBuff; + } + + public Source initiateMessageExchange(QName operation, Source inSource) throws JBIException { + // 1. Decide what type of message exchange needed for this operation. + Source outSource = null; + try { + Operation wsdlOp = this.mEndpoint.getWSDLOperation(operation); + if (OperationType.REQUEST_RESPONSE.equals(wsdlOp.getStyle())) { + outSource = doInOutMessageExchange(operation, inSource); + } else if (OperationType.ONE_WAY.equals(wsdlOp.getStyle())) { + doInOnlyMessageExchange(operation, inSource); + } else { + throw new JBIException("Unsupported MEP " + wsdlOp.getStyle() + + "for operation " + operation); + } + return outSource; + } catch (Exception ex) { + throw new JBIException(ex); + } + } + + /** + * invokes the service provider with in-only message exchange sent to + * delivery channel by the consumer + * + * @param operation operation name on a service + * @param inSource input xml document for the InOut operation + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + * @return output xml document as a Source object received from InOut + * operation of the service invoked. + */ + private void doInOnlyMessageExchange(QName operation, Source inSource) + throws Exception { + // 2. normalized the message. + // 3. locate service endpoint + // 4. create message exchange according to the Opeations MEP + + // get the component context and the delivery channel for preparing to send message + ComponentContext compContext = this.mEndpoint.getComponentContext(); + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + // create INOUT Message Exchange + InOnly inOnlyME = this.mEndpoint.createInOnlyMessageExchange(operation); + // set the content of the IN normalized message ( Normalize the message ) + NormalizedMessage inMsg = inOnlyME.getInMessage(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(inOnlyME.getOperation()); + this.mNormalizer.normalizeInput(wsdlOperation, inMsg, RuntimeHelper.sourceToDOMSource(inSource)); + // send the message exchange and wait for response + boolean isSent = channel.sendSync(inOnlyME, SEND_SYNC_TIMEOUT); + if (!isSent) { + throw new Exception("JMXBinding:Timeout occured in sending the message to provider"); + } + // check if you got a done message or error ( done or error are only allowed in in-only) + // process the Message Exchange to check for done or error message and + // complete InOut message exchange with provider + //TODO: put this below code in processInOnlyMessageExchangeOnConsumer() + ExchangeStatus status = inOnlyME.getStatus(); + this.mEndpoint.getLogger().fine("Consumer:InOnly:Processing Message Exchange with status " + status); + if (ExchangeStatus.DONE.equals(status)) { + this.mEndpoint.getLogger().fine("Consumer: Completed the INONLY MessageExchange"); + return; + } else if (ExchangeStatus.ERROR.equals(status)) { + // error can occur any time. so just return the error back to client. + Exception serverSideEx = inOnlyME.getError(); + StringBuffer exMsgBuff = RuntimeHelper.getExceptionStackTrace(serverSideEx); + throw new Exception("Consumer:INONLY Message Exchange status ERROR.\n" + exMsgBuff); + } else { + // any other status is error. + throw new Exception("Consumer:INONLY Message Exchange error. status: " + status); + } + } + + /** + * invokes service provider with in-out message exchange sent to delivery + * channel by the consumer + * + * @param operation operation name on a service + * @param inSource input xml document for the InOut operation + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + * @return output xml document as a Source object received from InOut + * operation of the service invoked. + */ + private Source doInOutMessageExchange(QName operation, Source inSource) + throws Exception { + // 2. normalized the message. + // 3. locate service endpoint + // 4. create message exchange according to the Opeations MEP + + // get the component context and the delivery channel for preparing to send message + ComponentContext compContext = this.mEndpoint.getComponentContext(); + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + // create INOUT Message Exchange + InOut inOutME = this.mEndpoint.createInOutMessageExchange(operation); + // set the content of the IN normalized message ( Normalize the message ) + NormalizedMessage inMsg = inOutME.getInMessage(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(inOutME.getOperation()); + this.mNormalizer.normalizeInput(wsdlOperation, inMsg, RuntimeHelper.sourceToDOMSource(inSource)); + // send the message exchange and wait for response + boolean isSent = channel.sendSync(inOutME, SEND_SYNC_TIMEOUT); + if (!isSent) { + throw new Exception("JMXBinding:Timeout occured in sending the message to provider"); + } + // check if you got a out message or fault or error + // process the Message Exchange to get the output message and + // complete InOut message exchange with provider + NormalizedMessage outMsg = processInOutMessageExchangeOnConsumer(inOutME); + Source outSource = this.mNormalizer.denormalizeOutput(wsdlOperation, outMsg); + return outSource; + } + + /** + * takes the InOut message exchange received from sendSync call and + * processes it further to complete InOut message exchange with provider and + * returns the out message or throws exception in case of error or faults. + */ + private NormalizedMessage processInOutMessageExchangeOnConsumer(InOut inoutExchange) + throws Exception { + // InOut MessageExchange processing on consumer side + // 1. ACTIVE status receives a fault or out message, + // send the done status to complete message exchange + // return the fault/out message to external consumer + // 2. can not receive DONE status + // 3. when received ERROR status, return the error to consumer. + + // process the message exchange based on its state. + ExchangeStatus status = inoutExchange.getStatus(); + this.mEndpoint.getLogger().fine("Consumer:Processing Message Exchange with status " + status); + + if (ExchangeStatus.ACTIVE.equals(status)) { + + Fault fault = inoutExchange.getFault(); + NormalizedMessage outMsg = inoutExchange.getOutMessage(); + + // send done to complete message exchange. + DeliveryChannel channel = this.mEndpoint.getDeliveryChannel(); + inoutExchange.setStatus(ExchangeStatus.DONE); + channel.send(inoutExchange); + this.mEndpoint.getLogger().fine("Consumer: Completed the INOUT MessageExchange"); + + // process fault or out message + if (fault != null) { + // throw an exception if there is a fault message. + Source faultContent = fault.getContent(); + StringBuffer faultContentBuff = null; + if (faultContent != null) { + faultContentBuff = RuntimeHelper.readFromSource(faultContent); + } + throw new Exception("Consumer:INOUT message exchange Fault \n" + + faultContentBuff); + } + + // return the outMessage for processing + if (outMsg != null) { + return outMsg; + } else { + throw new Exception("Consumer: Null Out message in INOUT message exchange. "); + } + } else if (ExchangeStatus.DONE.equals(status)) { + // can not get DONE on Consumer side in INOUT message exchange. + throw new Exception("Consumer: Illegal status DONE on INOUT message exchange"); + } else if (ExchangeStatus.ERROR.equals(status)) { + // error can occur any time. so just return the error back to client. + Exception serverSideEx = inoutExchange.getError(); + StringBuffer exMsgBuff = RuntimeHelper.getExceptionStackTrace(serverSideEx); + throw new Exception("Consumer:INOUT Message Exchange status ERROR.\n" + exMsgBuff); + } else { + throw new Exception("Consumer:INOUT Message Exchange error. status: " + status); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingInstaller.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingInstaller.java new file mode 100644 index 000000000..eaeae9ae1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingInstaller.java @@ -0,0 +1,31 @@ + /* + * JMXBindingInstaller.java + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.common.ComponentInstaller; + +/** + * This class extends the ComponentInstaller that implements the + * javax.jbi.component.Bootstrap for a component installation contract. + * + * If the default implemenation of the javax.jbi.component.Bootstrap in + * com.sun.jbi.sample.component.common.ComponentInstaller is not sufficient for + * this components install, uninstall and upgrade requirements, override the + * default implementation here to add component specific installation and + * upgrade tasks such as initializing configuration mbean and creating resources + * specific to component or upgrade workspace and service units during upgrading + * the component. + * + * @see javax.jbi.Bootstrap + * @see com.sun.jbi.sample.component.common.ComponentInstaller + * @author chikkala + */ +public class JMXBindingInstaller extends ComponentInstaller { + + /** + * Constructor to create the ComponentInstaller. + */ + public JMXBindingInstaller() { + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingNormalizer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingNormalizer.java new file mode 100644 index 000000000..a0886f7d4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingNormalizer.java @@ -0,0 +1,239 @@ +/* + * JMXBindingNormalizer.java + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractNormalizer; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDL11JBIWrapper; +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * This class is a concrete implementation of the AbstractNormalizer to + * implement normalize jmx binding specific concrete messages to jbi wrapper + * messages and denormalize the jbi wrapper messages to jmx binding specific + * messages. The jmx binding concrete message has "message" as the root element + * that contains the part elements as its children. for example + * + * + * + * + * This is the sample code that demonstrate how to normalize and denormalize + * messages to/from jbi wrapper from/to concrete messages specific to a binding + * protocol + * + * @author chikkala + */ +public class JMXBindingNormalizer extends AbstractNormalizer { + + public static final String JMXBC_MSG_NS = "http://java.sun.com/jbi/sample/jmx-bc/envelope/"; + public static final String DEF_NS_PREFIX = "jmxbc"; + public static final String MESSAGE_EL = "message"; + + /** + * Creates a new instance of JMXBCNormalizer + */ + public JMXBindingNormalizer(Definition wsdl, Binding binding) { + super(wsdl, binding); + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeInput(Operation operation, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Input input = operation.getInput(); + Message wsdlMsg = input.getMessage(); + //TODO: get the binding input extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeOutput(Operation operation, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Output output = operation.getOutput(); + Message wsdlMsg = output.getMessage(); + //TODO: get the binding output extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * normalizes the jmx binding protocol specific concrete message to jbi + * normalized message + */ + public void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, + DOMSource msgSource) throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.createInputWrapper(operation); + Fault wsdlFault = operation.getFault(faultName); + Message wsdlMsg = wsdlFault.getMessage(); + //TODO: get the binding fault extension here if needed. + Element jmxMessage = RuntimeHelper.getElement(msgSource); + + if (!JMXBC_MSG_NS.equals(jmxMessage.getNamespaceURI()) + || !MESSAGE_EL.equals(jmxMessage.getLocalName())) { + throw new MessagingException("invalid root element for jmxbc envelope"); + } + List jmxMsgParts = getChildElements(jmxMessage); + + addMessagePartsToJBIWrapper(jbiWrapper, wsdlMsg, jmxMsgParts); + + DOMSource wrappedSource = jbiWrapper.toDOMSource(); + normMsg.setContent(wrappedSource); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException { + try { + + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Input input = operation.getInput(); + Message wsdlMsg = input.getMessage(); + //TODO: get the binding input extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + jmxMsgDoc.appendChild(jmxMessage); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException { + try { + + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Output output = operation.getOutput(); + Message wsdlMsg = output.getMessage(); + //TODO: get the binding output extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + jmxMsgDoc.appendChild(jmxMessage); + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } + + /** + * denormalizes the jbi message to the jmx binding protocol specific + * concrete message. + */ + public DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException { + try { + WSDL11JBIWrapper jbiWrapper = WSDL11JBIWrapper.sourceToWrapper( + RuntimeHelper.sourceToDOMSource(normMsg.getContent())); + Fault wsdlFault = operation.getFault(faultName); + Message wsdlMsg = wsdlFault.getMessage(); + //TODO: get the binding fault extension here if needed. + + Document jmxMsgDoc = jbiWrapper.getDocumentBuilder().newDocument(); + Element jmxMessage = jmxMsgDoc.createElementNS(JMXBC_MSG_NS, DEF_NS_PREFIX + ":" + MESSAGE_EL); + jmxMessage.setAttributeNS(XMLNS_NS, "xmlns:" + DEF_NS_PREFIX, JMXBC_MSG_NS); + + List jmxMsgParts = getMessagePartsFromJBIWrapper(jbiWrapper, wsdlMsg); + + for (int i = 0; i < jmxMsgParts.size(); ++i) { + jmxMessage.appendChild(jmxMsgDoc.importNode(jmxMsgParts.get(i), true)); + } + jmxMsgDoc.appendChild(jmxMessage); + DOMSource unwrappedSource = new DOMSource(jmxMsgDoc); + return unwrappedSource; + } catch (DOMException ex) { + throw new MessagingException(ex); + } catch (ParserConfigurationException ex) { + throw new MessagingException(ex); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java new file mode 100644 index 000000000..b0cb8f988 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingProviderEndpoint.java @@ -0,0 +1,84 @@ +/* + * JMXBindingProviderEndpoint.java + * + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.wsdlext.PortExt; +import net.openesb.component.BindingComponent-archetype.wsdlext.WSDLExtHelper; +import net.openesb.component.BindingComponent-archetype.common.MessageExchangeHandler; +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import net.openesb.component.BindingComponent-archetype.common.MessageExchangeListener; +import net.openesb.component.BindingComponent-archetype.common.deployment.ProviderEndpoint; +import net.openesb.component.BindingComponent-archetype.common.deployment.SUDescriptor; +import net.openesb.component.BindingComponent-archetype.common.deployment.ServiceUnit; +import java.util.logging.Level; +import javax.jbi.JBIException; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends the ProviderEndpoint to implement component specific + * endpoint configuration. It implements the MessageExchangeListener to receive + * message exchange notifications from the MessageExchangeSupport fired by + * MessageExchangeReceiver and process it using a message exchange handler to + * show how an asynchronous processing of message exchange can be done. + * + * This endpoint uses the JMXBindingProviderProxy as a message exchange handler + * that can invoke the external provider to send a message and receive the + * response in a InOut message exchange. + * + * @author chikkala + */ +public class JMXBindingProviderEndpoint extends ProviderEndpoint implements MessageExchangeListener { + + JMXBindingProviderProxy mProviderProxy; + + /** + * Creates a new instance of XSLTProviderEndpoint + */ + public JMXBindingProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(provides, wsdlDef, su); + } + + @Override + public void doInit() throws JBIException { + RuntimeHelper.getLogger().info("JMXBindingProviderEndpoint:doInit called"); + this.mProviderProxy = new JMXBindingProviderProxy(this); + } + + @Override + public MessageExchangeHandler createMessageExchangeHandler() { + return this.mProviderProxy; + } + + @Override + protected MessageExchangeListener createMessageExchangeListener() { + return this; + } + + public void messageExchangeReceived(ExchangeStatus status, MessageExchange me) { + try { + RuntimeHelper.getLogger().fine("MXListener.MessageExchangeReceived: with Status: " + status); + processMessageExchangeWithHandler(status, me); + // processMessageExchange(me); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public PortExt getJMXProviderInfo() { + PortExt portExt = null; + try { + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + Definition def = this.getWSDL(); + portExt = WSDLExtHelper.getPortExt(def, serviceName, endpointName); + } catch (Exception ex) { + getLogger().log(Level.FINE, ex.getMessage(), ex); + } + return portExt; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java new file mode 100644 index 000000000..b92d41878 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingProviderProxy.java @@ -0,0 +1,232 @@ +/* + * JMXBindingProviderProxy.java + * + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.wsdlext.PortExt; +import net.openesb.component.BindingComponent-archetype.common.AbstractMessageExchangeHandler; +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import java.io.IOException; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.management.MBeanServerConnection; +import javax.management.ObjectName; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; + +/** + * This is a provider side implementation of the message exchange handler on a + * binding component which acts as a service provider proxy for the external + * provider. During the message exchange processing of the InOut message + * exchange, this handler acting as a proxy to the external provider invokes the + * service operation on the external provider and does required normalization + * and denormalization in processing out and in messages received from or send + * to the external service provider. + * + * @author chikkala + */ +public class JMXBindingProviderProxy extends AbstractMessageExchangeHandler { + + private JMXBindingProviderEndpoint mEndpoint; + private String mServiceURL; + private String mUsername; + private String mPassword; + private String mMBeanName; + private JMXBindingNormalizer mNormalizer; + + /** + * Creates a new instance of ProviderSEMXHandler + */ + public JMXBindingProviderProxy(JMXBindingProviderEndpoint endpoint) { + + this.mEndpoint = endpoint; + + PortExt jmxInfo = this.mEndpoint.getJMXProviderInfo(); + this.mServiceURL = jmxInfo.getServiceURL(); + this.mUsername = jmxInfo.getUsername(); + this.mPassword = jmxInfo.getPassword(); + this.mMBeanName = jmxInfo.getMBean(); + + this.mNormalizer = new JMXBindingNormalizer(endpoint.getWSDL(), endpoint.getWSDLBinding()); + } + + protected Logger getLogger() { + return this.mEndpoint.getLogger(); + } + + protected DeliveryChannel getDeliveryChannel() { + return this.mEndpoint.getDeliveryChannel(); + } + + protected void validateMessageExchange() throws MessagingException { + MessageExchange msgExchange = this.getMessageExchange(); + + if (this.getMessageExchange() == null) { + throw new MessagingException("MessageExchange Object is null in MessageExchageHandler"); + } + + if (MessageExchange.Role.CONSUMER.equals(msgExchange.getRole())) { + throw new MessagingException("Provider Message Exchange Handler can not have MessageExchange with CONSUMER Role"); + } + + if (!(msgExchange instanceof InOut)) { + throw new MessagingException("InOut Message Exchange Handler MessageExchange object should be instanceof javax.jbi.messaging.InOut "); + } + } + + protected void processError(Exception ex) { + MessageExchange msgExchange = this.getMessageExchange(); + Exception errEx = msgExchange.getError(); // get the error and print + RuntimeHelper.getLogger().info( + "InOut Message Exchange Provider received Error: " + errEx.getMessage()); + msgExchange.getError().printStackTrace(); + } + + protected void processDone() { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.getLogger().info("InOut Message Exchange Provider received DONE :" + + " END of service invocation"); + } + + protected void processFault(Fault fault) { + MessageExchange msgExchange = this.getMessageExchange(); + RuntimeHelper.logError("InOut Message Exchange Provider Handler can not receive Fault on Provider side"); + } + + protected void processMessage() { + try { + processInMessageOnProvider((InOut) this.getMessageExchange()); + } catch (JBIException ex) { + ex.printStackTrace(); + } + } + + protected void processInMessageOnProvider(InOut inOutExchange) throws JBIException { + RuntimeHelper.getLogger().fine("Processing In Message on Provider side " + inOutExchange); + // receive IN message. + NormalizedMessage inMsg = inOutExchange.getInMessage(); + NormalizedMessage outMsg = null; + Fault fault = null; + DOMSource inContent = null; + DOMSource outContent = null; + Source faultContent = null; + String faultAsText = null; + + QName opName = inOutExchange.getOperation(); + QName svcName = inOutExchange.getEndpoint().getServiceName(); + Operation wsdlOperation = this.mEndpoint.getWSDLOperation(opName); + + // process in message + // invoke the service operation + try { + inContent = this.mNormalizer.denormalizeInput(wsdlOperation, inMsg); + StringBuffer outputDoc = invokeOperation(opName.getLocalPart(), + RuntimeHelper.readFromDOMSource(inContent)); + outContent = RuntimeHelper.createDOMSource(new StringReader(outputDoc.toString())); + } catch (Exception ex) { + // exception invoking the operation. so, set exception text as fault content. + ex.printStackTrace(); + faultAsText = RuntimeHelper.getExceptionAsText(ex); + String faultText = RuntimeHelper.getExceptionAsXmlText(ex); + faultContent = RuntimeHelper.createDOMSource(new StringReader(faultText)); + } + // set out or fault message + if (outContent != null) { + // set the out message content. + outMsg = inOutExchange.createMessage(); + inOutExchange.setOutMessage(outMsg); + this.mNormalizer.normalizeOutput(wsdlOperation, outMsg, outContent); + // outMsg.setContent(outContent); + } else if (faultContent != null) { + fault = inOutExchange.createFault(); + inOutExchange.setFault(fault); + fault.setContent(faultContent); // may need to normalize the content. + } + // send out or fault message. + this.send(); + } + + protected StringBuffer invokeOperation(String operation, StringBuffer inputDoc) throws MessagingException { + try { + StringBuffer outputDoc = invokeSendMessage(this.mServiceURL, this.mUsername, this.mPassword, + this.mMBeanName, operation, inputDoc); + return outputDoc; + } catch (Exception ex) { + ex.printStackTrace(); + throw new MessagingException(ex); + } + } + + /** + * invokes a jmx mbean to send message. + */ + protected StringBuffer invokeSendMessage(String serviceURL, String username, String password, + String mbeanName, String operation, StringBuffer inputDoc) + throws MessagingException { + + JMXConnector jmxConnector = null; + MBeanServerConnection jmxConn = null; + JMXServiceURL jmxURL = null; + ObjectName epAddressName = null; + + Map env = new HashMap(); + if (username != null) { + String[] credentials = new String[]{username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, this.getClass().getClassLoader()); + } + + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + try { + jmxURL = new JMXServiceURL(serviceURL); + epAddressName = new ObjectName(mbeanName); + + jmxConnector = JMXConnectorFactory.connect(jmxURL, env); + jmxConn = jmxConnector.getMBeanServerConnection(); + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if (result != null) { + outDoc = (StringBuffer) result; + } + } catch (Exception ex) { + throw new MessagingException(ex); + } finally { + if (jmxConnector != null) { + try { + jmxConnector.close(); + } catch (IOException ex) { + RuntimeHelper.logDebug(ex); + // ingore + } + } + } + return outDoc; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingRuntime.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingRuntime.java new file mode 100644 index 000000000..e2ccb783f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingRuntime.java @@ -0,0 +1,54 @@ +/* + * JMXBindingRuntime.java + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.common.ComponentRuntime; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; + +/** + * This class extends the ComponentRuntime that implements + * javax.jbi.component.Component interface required for the component contract + * at runtime. + * + * This class provides the component specific ComponentLifeCycle implementation + * as well as the component specific ServiceUnitManager implementation. + * + * Add any additional component runtime specific functionality here. + * + * @see javax.jbi.component.Component + * @see com.sun.jbi.sample.component.common.ComponentRuntime + * @see com.sun.jbi.sample.component.common.BasicComponentLifecycle + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @author chikkala + */ +public class JMXBindingRuntime extends ComponentRuntime { + + /** + * Creates a new instance of MyBindingRuntime + */ + public JMXBindingRuntime() { + super(); + } + + /** + * overriding the parent's createComponentLifeCycle to create MyBinding + * specific component lifecycle implementation. + */ + @Override + protected ComponentLifeCycle createComponentLifeCycle() { + return new JMXBindingComponentLifeCycle(this); + } + + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. Extended classes can override + * this method and do their own ServiceUnitManager specific creation. + */ + @Override + protected ServiceUnitManager createServiceUnitManager() { + return new JMXBindingSUManager(this); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingSUManager.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingSUManager.java new file mode 100644 index 000000000..e2b4a5ce7 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingSUManager.java @@ -0,0 +1,48 @@ +/* + * JMXBindingSUManager.java + * + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import net.openesb.component.BindingComponent-archetype.common.deployment.AbstractServiceUnitManager; +import net.openesb.component.BindingComponent-archetype.common.deployment.ServiceUnit; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; + +/** + * This class extends the AbstractServiceUnitManager to implement component + * specific service unit manager by creating the component specific ServiceUnit + * implementation. + * + * @see + * com.sun.jbi.sample.component.common.deployment.AbstractServiceUnitManager + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit + * + * @author chikkala + */ +public class JMXBindingSUManager extends AbstractServiceUnitManager { + + private JMXBindingRuntime mRuntime; + + /** + * Creates a new instance of JMXBindingSUManager + */ + public JMXBindingSUManager(JMXBindingRuntime compRuntime) { + super(); + this.mRuntime = compRuntime; + } + + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + + protected String getComponentName() { + return RuntimeHelper.getComponentName(); + } + + //TODO implement ProviderSEServiceUnit + protected ServiceUnit createServiceUnit(String suName, String suRootPath) throws DeploymentException { + return new JMXBindingServiceUnit(suName, suRootPath); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java new file mode 100644 index 000000000..2ffef6ef7 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingServiceUnit.java @@ -0,0 +1,52 @@ +/* + * JMXBindingServiceUnit.java + * + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.common.deployment.ConsumerEndpoint; +import net.openesb.component.BindingComponent-archetype.common.deployment.ProviderEndpoint; +import net.openesb.component.BindingComponent-archetype.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.BindingComponent-archetype.common.deployment.SUDescriptor.Provides; +import net.openesb.component.BindingComponent-archetype.common.deployment.ServiceUnit; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; + +/** + * This class extends the ServiceUnit to implement the component specific + * service unit processing. It creates the component specific ProviderEndpoint + * and ConsumerEndpoint implementation to configure the service provider and + * consumer endpoints on this component deployed in the service unit. + * + * @author chikkala + */ +public class JMXBindingServiceUnit extends ServiceUnit { + + /** + * Creates a new instance of ProviderSEServiceUnit + */ + public JMXBindingServiceUnit(String suName, String suRootPath) { + super(suName, suRootPath); + } + + @Override + protected WSDLProcessor createWSDLProcessor() { + return new JMXBindingWSDLProcessor(this.getSURootPath()); + } + + @Override + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return new JMXBindingConsumerEndpoint(consumes, wsdlDef, this); + } + + @Override + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return new JMXBindingProviderEndpoint(provides, wsdlDef, this); + } + + @Override + protected void loadOtherArtifacts() throws DeploymentException { + //TODO: load any component specific service unit artifacts + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java new file mode 100644 index 000000000..c8ee05b68 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXBindingWSDLProcessor.java @@ -0,0 +1,40 @@ +/* + * JMXBindingWSDLProcessor.java + * + */ +package net.openesb.component.BindingComponent-archetype; + +import net.openesb.component.BindingComponent-archetype.wsdlext.WSDLExtensionRegistry; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This class extends form the WSDLProcessor to configure the wsdl processor use + * the wsdl extension registry configured to process the binding specific + * extension elements in the wsdl documents. + * + * WSDLExtensionRegistry that is created here has the wsdl extension model + * required to process the extension elements specific to the binding used by + * this binding component. + * + * @author chikkala + */ +public class JMXBindingWSDLProcessor extends WSDLProcessor { + + private WSDLExtensionRegistry mExtRegistry; + + /** + * Creates a new instance of JMXBindingWSDLProcessor + */ + public JMXBindingWSDLProcessor(String wsdlDir) { + super(wsdlDir); + } + + @Override + protected ExtensionRegistry getExtensionRegistry() { + if (this.mExtRegistry == null) { + this.mExtRegistry = new WSDLExtensionRegistry(); + } + return this.mExtRegistry; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXEndpointMBean.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXEndpointMBean.java new file mode 100644 index 000000000..cdd79fc8f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/JMXEndpointMBean.java @@ -0,0 +1,38 @@ +/* + * JMXEndpointMBean.java + */ +package net.openesb.component.BindingComponent-archetype; + +/** + * The sample BC implemented as a jmx binding component exposes this interface + * as a external connectivity (endpoint address) to the external service + * consumers that can exchange messages over jmx protocol to invoke services + * provided inside jbi environment. + * + * A jmx client can send a message by invoking this method using jmx management + * interface. When this mbean method is executed in the BC as a result of mbean + * call from the jmx client, the BC acts as a proxy service consumer inside the + * jbi environment and starts a message exchange with the service provider. + * + * If the operation being executed is a InOut operation, the BC should return + * the Out or Fault message from the InOut message exchange as a return value to + * complete invocation of the service by the external consumer. + * + * @author chikkala + */ +public interface JMXEndpointMBean { + + /** + * This method will be called by a jmx client as a service consumer to send + * message to the echo service provider to invoke the service for a InOut + * message exchange. + * + * @param operation operation name on a service + * @param inputDoc input xml document for the InOut operation + * @return output xml document in a StringBuffer received from InOut + * operation of the service invoked. or null if the operation is InOnly. + * @throws java.lang.Exception if any error occurs in invoking the operation + * on the service. + */ + StringBuffer sendMessage(String operation, StringBuffer inputDoc) throws Exception; +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java new file mode 100644 index 000000000..053197e96 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/AbstractMessageExchangeHandler.java @@ -0,0 +1,138 @@ +/* + * AbstractMessageExchangeHandler.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import java.io.StringReader; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.Fault; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; +import javax.xml.namespace.QName; + +/** + * This class is an abstract implementation of the MessageExchangeHandler which + * provides the base implementation of the ME processing and provides hooks to + * extended classes to implement component specific processing. + * + * @author chikkala + */ +public abstract class AbstractMessageExchangeHandler implements MessageExchangeHandler { + + public static String IN_MESSAGE = "in"; + public static String OUT_MESSAGE = "out"; + + private MessageExchange mMessageExchange; + private ExchangeStatus mStatus; + /** Creates a new instance of AbstractMessageExchangeHandler */ + protected AbstractMessageExchangeHandler() { + this.mMessageExchange = null; + } + + protected abstract Logger getLogger(); + protected abstract DeliveryChannel getDeliveryChannel(); + protected abstract void validateMessageExchange() throws MessagingException; + protected abstract void processError(Exception ex); + protected abstract void processDone(); + protected abstract void processMessage(); + protected abstract void processFault(Fault fault); + + public final MessageExchange getMessageExchange() { + return this.mMessageExchange; + } + + public final void setMessageExchange(MessageExchange msgExchange) { + this.mMessageExchange = msgExchange; + } + + public final ExchangeStatus getMessageExchangeStatus() { + if ( this.mStatus != null ) { + return this.mStatus; + } else if ( this.mMessageExchange != null ) { + return this.mMessageExchange.getStatus(); + } else { + return null; + } + } + + public final void setMessageExchangeStatus(ExchangeStatus status) { + this.mStatus = status; + } + + protected void send() throws MessagingException { + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected boolean sendSync(long timeout) throws MessagingException { + return this.getDeliveryChannel().sendSync(this.mMessageExchange, timeout); + } + + protected void sendDone() throws MessagingException { + this.mMessageExchange.setStatus(ExchangeStatus.DONE); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendError(Exception ex) throws MessagingException { + this.mMessageExchange.setError(ex); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void sendFault(Exception ex, QName type, String name) throws MessagingException { + Fault fault = this.mMessageExchange.createFault(); + if ( ex != null ) { + String xmlText = RuntimeHelper.getExceptionAsXmlText(ex); + fault.setContent(RuntimeHelper.createDOMSource(new StringReader(xmlText))); + } + this.mMessageExchange.setFault(fault); + this.getDeliveryChannel().send(this.mMessageExchange); + } + + protected void processActive() { + Fault fault = this.getMessageExchange().getFault(); + if ( fault != null ) { + processFault(fault); + } else { + processMessage(); + } + } + /** + * implementation of the MessageExchangeHandler#processMessageExchange method. + */ + public void processMessageExchange(ExchangeStatus status, MessageExchange msgEx) { + + getLogger().fine("MessageExchangeHandler.processMessageExchange:status: " + status ); + + this.setMessageExchangeStatus(status); + this.setMessageExchange(msgEx); + + try { + validateMessageExchange(); + } catch (MessagingException ex) { + getLogger().log(Level.FINE, "Invalid message exchange for processing ", ex); + if ( this.getMessageExchange() != null ) { + try { + sendError(ex); + } catch (MessagingException errEx) { + getLogger().log(Level.FINE, "Can not send invalid message exchange error", errEx); + } + } + return; + } + + MessageExchange msgExchange = this.getMessageExchange(); + + if (ExchangeStatus.ACTIVE.equals(status) ) { + processActive(); + } else if (ExchangeStatus.DONE.equals(status) ) { + processDone(); + } else if (ExchangeStatus.ERROR.equals(status) ) { + processError(msgExchange.getError()); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java new file mode 100644 index 000000000..4f2ed2aa2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/BasicComponentLifeCycle.java @@ -0,0 +1,395 @@ +/* + * AbstractComponentLifeCycle.java + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.MessagingException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.ComponentLifeCycle. This is an + * abstract class that keeps the reference to the component context and the lifecycle + * extension mbeans. It implements the lifecycle method and provide the extended methods + * for each lifecycle methods to implement component specific functionality. + *

+ * It makes sure that the mininum initialization required for the component + * lifecycle is implemented by this class or the classes extending this class. + *

+ * Another important functionality implemented in this class is that it initializes the global + * RuntimeContext for the component with the ComponentContext passed by the JBI runtime and the + * opened delivery channel to make them available globally to any class in the component implementation + * that may need it during component lifecycle + *

+ * Service engine or a binding component lifecycle implementation can directly extend + * this class for their required functionality and override some of the methods to provide + * their own implementation. + * + * @see javax.jbi.ComponentLifeCycle + * @author chikkala + */ +public class BasicComponentLifeCycle implements ComponentLifeCycle { + /** reference to the component runtime */ + private Component mCompRuntime; + /** component context */ + private ComponentContext mComponentContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + /** a message receiver that accepts messages from delivery channel */ + private MessageExchangeReceiver mMsgExchReceiver; + + /** + * constructor for the ComponentLifecycle implementation. + * @param compRuntime + */ + protected BasicComponentLifeCycle(Component compRuntime) { + this.mCompRuntime = compRuntime; + } + /** + * @return Component + */ + public final Component getComponentRuntime() { + return this.mCompRuntime; + } + /** + * @return ComponentContext component context. + */ + public final ComponentContext getComponentContext() { + return mComponentContext; + } + /** + * @return component name + */ + protected String getComponentName() { + return (this.mComponentContext != null) ? + this.mComponentContext.getComponentName() : null; + } + /////////////////////////////////////////////////////////////////////////// + // ComponentLifeCycle interface implemenation + /////////////////////////////////////////////////////////////////////////// + + /** + * Initializes the component lifecycle. This method makes sure that the + * component context passed by the jbi runtime is saved in the lifecycle + * object before calling the other component initialization methods to + * completely initialize the component. + * @param context Component context + * @see javax.jbi.component.ComponentLifeCycle#init(javax.jbi.component.ComponentContext) + * @throws javax.jbi.JBIException on error + */ + public final void init(ComponentContext context) throws JBIException { + + if ( context == null ) { + throw new JBIException("Null Component Context received in " + + "Component Lifecycle init "); + } + this.mComponentContext = context; // 0. save the component context passed by jbi framework. + // initialize the content + initGlobalContext(); // 1. Initialize component runtime context. + registerExtensionMBean(); // 2. Create and register extension mbean. + openDeliveryChannel(); // 3. Open delivery channel. + initMessageExchangeReceiver(); // 4. Create message exchange receiver. + doInit(); // 5. Do any component specific initialization such + // as static service providers and consumers initialization. + + this.getLogger().fine("Component " + this.getComponentName() + " initialized"); + } + + /** + * Starts the component. Extended classes can override/implement the methods called + * in this method to provide component specify start functionality. + * + * @see javax.jbi.component.ComponentLifeCycle#start() + * @throws javax.jbi.JBIException on error + */ + public final void start() throws JBIException { + + doStart(); // 1. do any other component specific start tasks such as + // activating any static service providers and consumers. + startMessageExchangeProcessing(); // 2. begin accepting and processing message exchanges. + + this.getLogger().fine("Component " + this.getComponentName() + " started"); + } + + /** + * Stop the component.Extended classes can override/implement the methods called + * in this method to provide component specify stop functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle#stop() + */ + public final void stop() throws JBIException { + + stopMessageExchangeProcessing(); // 1. stop accepting and processing message exchanges. + doStop(); // 2. do any other component specific stop tasks such as + // deactivating any static service providers and consumers. + this.getLogger().fine("Component " + this.getComponentName() + " stopped."); + } + + /** + * Shut down the component. Extended classes can override/implement the methods called + * in this method to provide component specify shut down functionality. + * @throws javax.jbi.JBIException + * @see javax.jbi.component.ComponentLifeCycle#shutDown() + */ + public final void shutDown() throws JBIException { + // clean up all resources. + shutdownMessageExchangeReceiver(); // 1. remove the message receiver. + closeDeliveryChannel(); // 2. close delivery channel + unregisterExtensionMBean(); // 3. unregister and remove extension mbean if exists. + doShutDown(); // 4. do any other component specific clean up tasks such + // as clean any static service providers and consumer resource. + this.getLogger().fine("Component " + this.getComponentName() + " shut down"); + } + /** + * create jmx object name for the extension mbean. default implementation does + * not required to have the extension mbean. + * @return ObjectName of the extension mbean + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * gets the reference to the extension mbean name. + * @see javax.jbi.component.ComponentLifeCycle#getExtensionMBeanName() + * @return ObjectName of the extension mbean objectname or null if component + * does not support extension mbean + */ + public final ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = this.createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. default + * implementation does not require the extension mbean + * @return the ExtensionMBean implementation as StandardMBean + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * gets the reference to the extension mbean. + * @return extension mbean implementation or null if component does not support. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + * @throws JBIException on error registering mbean + */ + protected final void registerExtensionMBean() throws JBIException { + // creatre the extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server if any. + */ + protected final void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = RuntimeHelper.getComponentContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Extension MBean from MBeanServer for " + this.getComponentName(), e); + } + } + /** + * creates MessageExchangeReceiver implementation that handles receiving and processing + * the message exchanges from the delivery channel. Component should implement + * this method to provide the MessageReceiver. + * + * Component may return null indicating that they don't need the message receiver + * that can receive and process message exchanges from delivery channel. For example, + * components that have only service consumers which send a synchronous messages to + * providers don't need this. + * + * @throws java.lang.Exception + * @return MessageExchangeReceiver implementation. null if the component does not support it. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle#createMessageExchangeReceiver + */ + protected MessageExchangeReceiver createMessageExchangeReceiver() { + return null; + } + /** + * returns the message exchange receiver implementation reference + * @return MessageExchangeReceiver interface + */ + protected final MessageExchangeReceiver getMessageExchangeReceiver() { + if ( this.mMsgExchReceiver == null ) { + this.mMsgExchReceiver = createMessageExchangeReceiver(); + } + return this.mMsgExchReceiver; + } + /** + * creates a message receiver object as part of the component initialization. + * @throws javax.jbi.JBIException + */ + protected void initMessageExchangeReceiver() throws JBIException { + // create and initialize the MessageExchangeReceiver + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.initReceiver(); + } + } + /** + * allows the component to accept the message exchange objects from the + * delivery channel and process it as part of the component startup process. + * @throws javax.jbi.JBIException + */ + protected void startMessageExchangeProcessing() throws JBIException { + // start message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.startProcessing(); + } + } + /** + * stops the component from accepting the message exchange objects from the + * delivery channel as part of the component stop process + * @throws javax.jbi.JBIException + */ + protected void stopMessageExchangeProcessing() throws JBIException { + // stop message processing + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.stopProcessing(); + } + } + /** + * removes the message receiver as part of the component shutdown process + * @throws javax.jbi.JBIException + */ + protected void shutdownMessageExchangeReceiver() throws JBIException { + // clean up message processing. + MessageExchangeReceiver mxReceiver = getMessageExchangeReceiver(); + if ( mxReceiver != null ) { + mxReceiver.shutdownReceiver(); + } + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * initializes the RuntimeContext during component init lifecycle phase. This + * includes setting the ComponentContext and loggers etc. extended classes must + * save the component context in the RuntimeContext in this methods implementation. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle#initGlobalContext + */ + protected void initGlobalContext() { + RuntimeContext.getInstance().setComponentContext(this.getComponentContext()); + RuntimeContext.getInstance().setLogger(this.getClass().getName(), null); + } + /** opens the delivery channel to accept or send message exchange objects + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle#openDeliveryChannel + */ + protected void openDeliveryChannel() { + try { + DeliveryChannel channel = this.getComponentContext().getDeliveryChannel(); + RuntimeContext.getInstance().setDeliveryChannel(channel); + } catch (MessagingException ex) { + ex.printStackTrace(); + } + } + /** closes the delivery channel as part of the component shutdown process. + * @see com.sun.jbi.sample.component.common.DefaultComponentLifecycle#closeDeliveryChannel + */ + protected void closeDeliveryChannel() { + // closes delivery channel and remove the reference. + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel != null ) { + channel.close(); + } + } catch (MessagingException ex) { + ex.printStackTrace(); + } finally { + RuntimeContext.getInstance().setDeliveryChannel(null); + } + } + /** + * chance to extended classes to do any extra component specific init tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * initialized here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle#init method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle#init + */ + protected void doInit() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific start tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * activated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle#start method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle#start + */ + protected void doStart() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific stop tasks. If the component + * supports static service providers or consumers without deployment support, they can be + * deactivated here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle#stop method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle#stop + */ + protected void doStop() throws JBIException { + //NOOP + } + /** + * chance to extended classes to do any extra component specific shutdown tasks.If the component + * supports static service providers or consumers without deployment support, they can be + * cleaned up here in the class extended from this class in implementing such a component. + * This method is invoked in the implementation of ComponentLifeCycle#shutdown method by this class. + * @throws javax.jbi.JBIException + * @see com.sun.jbi.sample.component.common.AbstractComponentLifecycle#shutdown + */ + protected void doShutDown() throws JBIException { + //NOOP + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/ComponentInstaller.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/ComponentInstaller.java new file mode 100644 index 000000000..5fdee0912 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/ComponentInstaller.java @@ -0,0 +1,272 @@ + /* + * ComponentInstaller.java + */ +package net.openesb.component.BindingComponent-archetype.common; + +import java.util.List; +import java.util.logging.Level; +import javax.jbi.component.Bootstrap; +import javax.jbi.component.InstallationContext; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +/** + * This class implements the javax.jbi.component.Bootstrap. This class implements + * the minimum required functionality for component installation contract + * of the jbi component in the jbi environment. It also takes care of maintaining + * the installation context reference and installation specific logger creation and + * installation extension mbean registration and unregistration during initialization + * and cleanup. Extended classes only need to supply the mbean name and its implementation + * object for the installation extensions. + * + * It makes sure that the installation context and the loggers are available to + * the classes extended from this class to add more installation specific functionality. + * + * Service engine or a binding component installation implementation can directly use + * this class or extend this class to add more functionality to their installation + * process. + * + * @see javax.jbi.Bootstrap + * @author chikkala + */ +public class ComponentInstaller implements Bootstrap { + /** default logger*/ + private Logger mDefLogger; + /** bootstrap logger */ + private Logger mBTLogger ; + /** Installation Context . */ + private InstallationContext mInstallationContext; + /** Extension Mbean Name*/ + private ObjectName mExtensionMBeanName; + /** Extension Mbean Implementation*/ + private StandardMBean mExtensionMBeanImpl; + + /** Constructor to create the ComponentInstaller. */ + public ComponentInstaller() { + } + /** + * @return InstallationContext of the component. + */ + public final InstallationContext getInstallationContext() { + return this.mInstallationContext; + } + protected String getComponentName() { + return (this.mInstallationContext != null) ? + this.mInstallationContext.getComponentName() : null; + } + /** + * @return logger initialized from the installation context or a default + * logger. + */ + protected Logger getLogger() { + // try init bootstrap logger + if (this.mBTLogger == null && this.mInstallationContext != null ) { + try { + this.mBTLogger = + this.mInstallationContext.getContext().getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mBTLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mBTLogger != null) ? this.mBTLogger : this.mDefLogger; + } + /** + * Initializes the installation environment for a component. + * @see javax.jbi.component.Bootstrap#init(javax.jbi.component.InstallationContext) + */ + public final void init(InstallationContext installContext) throws javax.jbi.JBIException { + + if ( installContext == null ) { + throw new JBIException("Null Installation Context received in " + + "Component Bootstrap initialization"); + } + // save the installation context reference passed by the jbi framework. + this.mInstallationContext = installContext; + registerExtensionMBean(); // create and register extension mbean + doInit(); // do any other extra initialization required specific to the component installation. + // initialize logger + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component Installer initialized"); + } + /** + * default implementation just logs the method call. extended classes should override this. + * @see javax.jbi.component.Bootstrap#onInstall() + */ + public void onInstall() throws javax.jbi.JBIException { + //TODO: do required initializaton and resource creation + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component installed."); + } + /** + * default implementation just logs the method call. + * @see javax.jbi.component.Bootstrap#onUninstall() + */ + public void onUninstall() throws javax.jbi.JBIException { + //TODO: do clean up the resource and other stuff. + this.getLogger().fine(this.mInstallationContext.getComponentName() + + " : Component uninstalled"); + } + /** + * default noop implementation of the cleanup. + * @see javax.jbi.component.Bootstrap#cleanUp() + */ + public final void cleanUp() throws javax.jbi.JBIException { + + unregisterExtensionMBean(); // unregister extension mbean and remove it + doCleanUp(); // do any other extra cleanup specific to the component installation. + this.getLogger().fine( this.mInstallationContext.getComponentName() + + " Component Installer Cleaned up"); + } + + /** + * create jmx object name for the extension mbean. Extended classes should + * return the component specific installer extension mbean name here. + */ + protected ObjectName createExtensionMBeanName() { + return null; + } + /** + * default implementation that does not have extension mbean return null. + * @see javax.jbi.component.Bootstrap#getExtensionMBeanName() + */ + public final javax.management.ObjectName getExtensionMBeanName() { + if ( this.mExtensionMBeanName == null ) { + this.mExtensionMBeanName = createExtensionMBeanName(); + } + return this.mExtensionMBeanName; + } + /** + * create mbean implementation for the extension mbean as a StandardMBean. Extended + * classes should return the installer extension mbean implementation as the + * standard mbean. + */ + protected StandardMBean createExtensionMBean() { + return null; + } + /** + * returns the installation extension mbean implementation. + * @return StandardMBean for the extension mbean implementation. + */ + protected final StandardMBean getExtensionMBean() { + if ( this.mExtensionMBeanImpl == null ) { + this.mExtensionMBeanImpl = this.createExtensionMBean(); + } + return this.mExtensionMBeanImpl; + } + /** + * Chance to extended classes to do the component installation specific init. + * Installation context will be initialized before calling this method. So, + * initialize other things if required in this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller#init( + * javax.jbi.component.InstallationContext) + */ + protected void doInit() throws JBIException { + this.getLogger().info(this.getInstallationContext().getComponentName() + + " : Component Installer initialized"); + } + /** + * Chance to extended classes to do the component installation specific cleanup. + * ExtensionMbean will be unregistered before calling this method. + * @throws javax.jbi.JBIException on error + * @see com.sun.jbi.sample.component.common.ComponentInstaller#cleanUp( + * javax.jbi.component.InstallationContext) + */ + protected void doCleanUp() throws JBIException { + this.getLogger().fine(this.getInstallationContext().getComponentName() + + " : Component Installer doCleanUp"); + } + /** + * if there is an extension mbean supported by the component, then register + * it with the mbean server. + */ + protected void registerExtensionMBean() throws JBIException { + // creatre the installation extension mbean's object name + ObjectName mbeanName = this.getExtensionMBeanName(); + // create the extension mbean implemenation if the object name is created. + StandardMBean mbeanImpl = this.getExtensionMBean(); + + if ( mbeanName == null || mbeanImpl == null ) { + this.getLogger().fine(this.getComponentName() + + " Does not have Installation Extension MBean implemenation "); + return; + } + // register with mbean only if object name and implementation are non null + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.registerMBean(mbeanImpl, mbeanName); + } catch (Exception e) { + throw new JBIException("Failed to register Installation Extension MBean for " + + this.getComponentName(), e); + } + } + /** + * remove the registered extension mbean from the mbean server. + */ + protected void unregisterExtensionMBean() { + ObjectName mbeanName = this.getExtensionMBeanName(); + if ( mbeanName == null ) { + return; + } + try { + MBeanServer mbServer = this.getInstallationContext().getContext().getMBeanServer(); + mbServer.unregisterMBean(mbeanName); + } catch (Exception e) { + this.getLogger().log(Level.WARNING, + "Failed to unregister Installation extension MBean for " + this.getComponentName(), e); + } + } + /** + * This method is called by the JBI runtime to allow a component to upgrade + * it's workspace and any existing Service Units to match the new version of + * the component. The JBI runtime copies the existing workspace root to the + * new workspace root prior to calling this method, so that the component + * can examine the contents of the workspace root to determine the version + * of the component from which the upgrade is being made. All updates to the + * workspace root are done in-place; in the event of a failure, the JBI + * runtime reverts back to the original workspace root, the original install + * root, and the original Service Unit roots for the component. + * + * Note1: The component must ensure that it never holds open references + * to any files in the workspace root or any of the Service Unit roots upon + * returning from this method. Failure to do so will cause problems when + * the runtime attempts to complete the upgrade processing. + * + * Note2: The installation context that is normally initialized + * by the runtime by calling #init method of the javax.jbi.Bootstrap interface + * before install and uninstall will not be called before calling this + * upgrade method. So, installation context can not be used in this method's + * implementation. + * + * Note3: Since there won't be any installation context available, the logger + * that returned from the #getLogger method is a default logger created using + * the package name of this class or extended class if the method is overridden + * in the extended class. + * + * @param workspaceRoot the workspace root for the new version of the + * component that will replace the currently installed version. This is + * populated with the contents of the original workspace root and the + * component must update it to match the new version of the component. + * @param serviceUnitRoots a list of directory paths to all of the Service + * Units currently deployed to the component. The component must update all + * of these to match the new version of the component. + * @exception JBIException when there is an error requiring that the upgrade + * be terminated. + */ + public void upgrade(String workspaceRoot, List serviceUnitRoots) + throws javax.jbi.JBIException + { + //TODO: override this method in the extended class to handle the + // workspace root and service unit roots upgrade according to the + // component's requirement. + this.getLogger().fine("Default upgrade implementation. " + + "TODO: Implement workspace root and service unit roots upgrade."); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/ComponentRuntime.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/ComponentRuntime.java new file mode 100644 index 000000000..28c4424e1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/ComponentRuntime.java @@ -0,0 +1,171 @@ +/* + * ComponentRuntime.java + */ +package net.openesb.component.BindingComponent-archetype.common; + +import java.util.logging.Logger; +import javax.jbi.component.Component; +import javax.jbi.component.ComponentContext; +import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.servicedesc.ServiceEndpoint; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; + +/** + * This class implements javax.jbi.component.Component interface which is + * responsible for creating the Component Lifecycle implementation and the + * ServiceUnitManager implementation for the jbi component. + * + * This class makes sure that non null component lifecycle implementation is + * returns by this class or any classes extended from this class which is + * required as a component contract. It also provides default implementation of + * all methods of the Component interface which the extended classes can + * override to add more functionality. + * + * @see javax.jbi.component.Component + * @author chikkala + */ +public class ComponentRuntime implements Component { + /** Component LifeCycle implementation */ + private ComponentLifeCycle mLifeCycle; + /** ServiceUnitManager implementation */ + private ServiceUnitManager mSUManager; + /** default logger*/ + private Logger mDefLogger; + + /** Creates a new instance of ComponentImpl */ + public ComponentRuntime() { + this.mLifeCycle = null; + this.mSUManager = null; + } + /** + * returns the ComponentContext. Any component runtime class extended from + * this class can override this method to return their own reference to the + * ComponentContext. + * @return ComponentContext component context. + */ + public ComponentContext getComponentContext() { + ComponentContext ctx = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + ctx = ((BasicComponentLifeCycle) this.mLifeCycle).getComponentContext(); + } + return ctx; + } + /** + * Returns logger initialized from the component context or a default logger. + * @return Logger + */ + public Logger getLogger() { + Logger logger = null; + if ( this.mLifeCycle != null && this.mLifeCycle instanceof BasicComponentLifeCycle ) { + logger = ((BasicComponentLifeCycle) this.mLifeCycle).getLogger(); + } + // init default logger if required + if ( logger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (logger != null) ? logger : this.mDefLogger; + } + /** + * return the ComponentLifeCycle implementation. if returned null, the + * ComponentLifeCycleImpl will be used as the component lifecycle + * Extended classes can override this method and do their own ComponentLifecyle + * specific creation. + */ + protected ComponentLifeCycle createComponentLifeCycle() { + return new BasicComponentLifeCycle(this); + } + /** + * Get the life cycle control interface for this component. + * + * @return the life cycle control interface for this component + * @see javax.jbi.Component#getLifeCycle() + */ + public final ComponentLifeCycle getLifeCycle() { + if ( this.mLifeCycle == null ) { + this.mLifeCycle = createComponentLifeCycle(); + if ( this.mLifeCycle == null ) { + this.getLogger().fine("Creating basic component lifecycle implemenation"); + // use the default ComponentLifeCycle Impl if a component + // specific implementation return null in createComponentLifeCycle. + this.mLifeCycle = new BasicComponentLifeCycle(this); + } + } + return this.mLifeCycle; + } + /** + * if this component supports service unit deployment, then return the + * service unit manager, else return null. + * Extended classes can override this method and do their own ServiceUnitManager + * specific creation. + */ + protected ServiceUnitManager createServiceUnitManager() { + return null; + } + /** + * Get the Service Unit manager for this component. + * + * @return the ServiceUnitManager for this component, or + * null if there is none. + * @see javax.jbi.Component#getServiceUnitManager() + */ + public final ServiceUnitManager getServiceUnitManager() { + if ( this.mSUManager == null ) { + this.mSUManager = createServiceUnitManager(); + } + return this.mSUManager; + } + /** + * Retrieves a DOM representation containing metadata which describes the + * service provided by this component, through the given endpoint. + * + * Default implementation does not support service description. + * + * @see javax.jbi.Component#getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint) + */ + public Document getServiceDescription(ServiceEndpoint serviceEndpoint) { + return null; + } + /** + * This method is called by JBI to check if this component, in the role of + * provider of the service indicated by the given exchange, can actually + * perform the operation desired. + * + * Default implementation has no policy and allows all exchanges with consumer. + * + * @see javax.jbi.Component#isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithConsumerOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * This method is called by JBI to check if this component, in the role of + * consumer of the service indicated by the given exchange, can actually + * interact with the provider properly. The provider is described by the + * given endpoint and the service description supplied by that endpoint. + * + * Default implementation has no policy and allows all exchanges with provider. + * + * @see javax.jbi.Component#isExchangeWithProviderOkay( + * javax.jbi.servicedesc.ServiceEndpoint, javax.jbi.messaging.MessageExchange) + */ + public boolean isExchangeWithProviderOkay( + ServiceEndpoint serviceEndpoint, MessageExchange messageExchange) { + return true; + } + /** + * Resolve the given endpoint reference. + * + * Default implementation does not have any XML dialect. So can not resolve the + * endpoint from the document fragment. + * + * @see javax.jbi.Component#resolveEndpointReference(org.w3c.dom.DocumentFragment) + */ + public ServiceEndpoint resolveEndpointReference(DocumentFragment documentFragment) { + return null; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java new file mode 100644 index 000000000..9df6d606c --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/DefaultMessageExchangeReceiver.java @@ -0,0 +1,177 @@ +/* + * DefaultMessageExchangeReceiver.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import javax.jbi.JBIException; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessagingException; + +/** + * This class implements MessageExchangeReceiver interface. This is a default implementation that + * demonstrates the multi-threaded environment to receive and process message exchanges from the + * delivery channel. It uses a main thread to receive message exchanges from the delivery channel + * and then processes the received message exchanges in a individual threads from the thread pool. + * The controller methods of MessageExchangeReceiver controls the main thread and the thread pool + * execution. + * + * @author chikkala + */ +public class DefaultMessageExchangeReceiver implements MessageExchangeReceiver { + + /** delivery channel accept time out */ + private final static long DC_ACCEPT_TIME_OUT = 3000; // milliseconds + /** receiver thread wait time before polling for messages after woke up **/ + private final static long RECEIVER_WAIT_TIME = 2000; // milliseconds + /** receiver thread wait time before force shutdown */ + private final static long RECEIVER_SHUTDOWN_WAIT_TIME = 10; // seconds + /** handler threads wait time before forced shutdown */ + private final static long HANDLERS_SHUTDOWN_WAIT_TIME = 30; // seconds + /** handler thread pool size */ + private final static int HANDLER_THREAD_POOL_SIZE = 5; + /** receiver thread accept message exchange condition */ + private Boolean mCanAccept = false; + /** receiver thread termination condition */ + private Boolean mContinue = true; + /** receiver thread executor service */ + private ExecutorService mReceiverThreadMgr; + /** handler thread executor service */ + private ExecutorService mHandlerThreadPool; + + /** no default constructor for extended classes */ + public DefaultMessageExchangeReceiver() { + } + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + public final void initReceiver() throws JBIException { + + this.mHandlerThreadPool = Executors.newFixedThreadPool(HANDLER_THREAD_POOL_SIZE); + this.mReceiverThreadMgr = Executors.newSingleThreadExecutor(); + + this.mReceiverThreadMgr.execute(new Runnable() { + public void run() { + Thread t = Thread.currentThread(); + while ( mContinue ) { + if (mCanAccept) { + receiveAndProcessMessageExchange(); + } else { + try { + t.sleep(RECEIVER_WAIT_TIME); + } catch (InterruptedException interruptException) { + // someone must have interrupted this thread + // do nothing + RuntimeHelper.logDebug("Interrupted the MessageReceiverThread in Sleep"); + } + } + } + } + }); + } + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + public final void shutdownReceiver() throws JBIException { + + synchronized ( mContinue ) { + mContinue = false; + } + boolean terminated = false; + try { + this.mReceiverThreadMgr.shutdown(); + terminated = this.mReceiverThreadMgr.awaitTermination( + RECEIVER_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Message Receiver not shutdown. Forcing shutdown"); + this.mReceiverThreadMgr.shutdownNow(); + } + } + shutdownHandlers(); + } + /** + * shutdown all the working threads from the thread pool. + */ + private final void shutdownHandlers() throws JBIException { + + boolean terminated = false; + try { + this.mHandlerThreadPool.shutdown(); + terminated = this.mHandlerThreadPool.awaitTermination( + HANDLERS_SHUTDOWN_WAIT_TIME, TimeUnit.SECONDS); + } catch (InterruptedException ex) { + RuntimeHelper.logDebug(ex); + } finally { + if ( !terminated ) { + RuntimeHelper.logDebug("Handler threads not shutdown. Forcing shutdown"); + this.mHandlerThreadPool.shutdownNow(); + } + } + } + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + public final void startProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = true; + } + } + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + public final void stopProcessing() throws JBIException { + + synchronized ( this.mCanAccept ) { + this.mCanAccept = false; + } + } + + protected MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + private void receiveAndProcessMessageExchange() { + try { + DeliveryChannel channel = RuntimeHelper.getDeliveryChannel(); + if ( channel == null ) { + RuntimeHelper.logDebug("DeliveryChannel Not Opened for receiving messages"); + return; + } + final MessageExchange msgExchange = channel.accept(DC_ACCEPT_TIME_OUT); + if ( msgExchange == null ) { + // delivery channel timeout occurred. do nothing. + // RuntimeHelper.logDebug("DeliveryChannel returned null message exchange from accept"); + return; + } + final ExchangeStatus status = msgExchange.getStatus(); + // process message exchange in a separate thread + this.mHandlerThreadPool.execute(new Runnable() { + public void run() { + getMessageExchangeSupport().fireMessageExchangeReceived(status, msgExchange); + } + }); + + } catch (MessagingException ex) { + RuntimeHelper.logWarning(ex); + ex.printStackTrace(); + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java new file mode 100644 index 000000000..94e18aa6a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeHandler.java @@ -0,0 +1,28 @@ +/* + * MessageExchangeHandler.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface is a Handler to perform message exchanges when the component + * receives the MessageExchange object from the delivery channel. + * Implementation of this interface should implement the processing of + * the active, error, done status of the MessageExchange object according to + * the MEP for which the MessageExchange object is created. + * + * @author chikkala + */ +public interface MessageExchangeHandler { + /** + * this method will be invoked to process the MessageExchange + * object. + * @param msgExchange MessageExchange object to process. + */ + void processMessageExchange(ExchangeStatus status, MessageExchange msgExchange); + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeListener.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeListener.java new file mode 100644 index 000000000..cba79ca65 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeListener.java @@ -0,0 +1,33 @@ +/* + * MessageExchangeListener.java + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; + +/** + * This interface defines the notification mechanism with which the message exchange object received + * from the delivery channel is processed by the interesting parties. A particular service endpoint + * implementation would first register the implementation of this interface with MessageExchangeSupport + * to get the notification of a received message exchange on a particular service endpoint and the + * implementation of the interface would process the message exchange when notified. + * + * When the com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver receives the message exchange + * object, it asks the MessageExchangeSupport to notify the MessageExchangeLister that is registered for the + * received message exchange object to process the message exchange object. + * @see com.sun.jbi.sample.component.common.MessageExchangeSupport + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public interface MessageExchangeListener { + /** + * MessageExchangeSupport will call this method to notify the lister implementation that a + * message exchange is received from the delivery channel. + * @param me MessageExchange Object + */ + void messageExchangeReceived(ExchangeStatus status, MessageExchange me); +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java new file mode 100644 index 000000000..2c5d42bf6 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeReceiver.java @@ -0,0 +1,44 @@ +/* + * MessageExchangeReceiver.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import javax.jbi.JBIException; + +/** + * This interface provides the methods can controls the receiving and processing of the message + * exchange objects from the delivery channel during the component lifecycle operations. + * The implementation of this interface can use multi-threaded environment to receive and process + * message exchanges from the delivery channel during the component lifecycle. + * @see com.sun.jbi.sample.component.common.DefaultMessageExchangeReceiver + * @author chikkala + */ +public interface MessageExchangeReceiver { + /** + * this method is called from the ComponentLifecyle.init method of the AbstractComponentLifecycle + * to initialize the message exchange receiving resources such as threads and thread pools + * throws JBIException on error + */ + void initReceiver() throws JBIException; + /** + * this method is called from the ComponentLifecyle.start method of the AbstractComponentLifecycle + * to start receiving the message exchanges from the delivery channel and process them. + * throws JBIException on error + */ + void startProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.stop method of the AbstractComponentLifecycle + * to stop receiving the message exchanges from the delivery channel. + * throws JBIException on error + */ + void stopProcessing() throws JBIException; + /** + * this method is called from the ComponentLifecyle.shutdown method of the AbstractComponentLifecycle + * to cleanup the message exchange receiving resources such as threads and thread pools. + * throws JBIException on error + */ + void shutdownReceiver() throws JBIException; + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java new file mode 100644 index 000000000..25fc453b7 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/MessageExchangeSupport.java @@ -0,0 +1,167 @@ +/* + * MessageExchangeSupport.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.xml.namespace.QName; + +/** + * This class supports the registering and unregistering MessageExchangeListeners and the + * MessageExchangeHandlers that can be used to process the received message exchange from a + * delivery channel. A global reference to this class will be created in RuntimeContext object to + * provide access to this class from any where in the component runtime. + * + * A ProviderEndpoint or ConsumerEndpoint interested in a MessageExchange received from a delivery + * channel for a particular service endpoint will register the MessageExchangeListener with this + * class. The DefaultMessageExchangeReceiver when received a message exchange object from the delivery + * channel uses MessageExchangeSupport.processMessageExchange method to notify the registered listener. + * + * The MessageExchangeListener implementation ( ProviderEndpoint or ConsumerEndpoint ) while processing + * received message ( messageExchangeReceived()) will create and register the message exchange handlers + * to process the message exchange. + * + * @see RuntimeContext#getMessageExchangeSupport + * @see RuntimeHelper#getMessageExchangeSupport + * @see DefaultMessageExchangeReceiver#receiveAndProcessMessageExchange + * @see com.sun.jbi.sample.component.common.deployment.ProviderEndpoint + * @author chikkala + */ +public class MessageExchangeSupport { + /** listener map to notify a message exchange received event */ + private Map mListeners; + /** handlers that can process the message exchange */ + private Map mHandlers; + /** Creates a new instance of MessageExchangeSupport */ + public MessageExchangeSupport() { + this.mListeners = Collections.synchronizedMap(new HashMap()); + this.mHandlers = Collections.synchronizedMap(new HashMap()); + } + /** + * generates key that will be used to store the MessageExchangeListener objects. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public String createListenerKey(Role role, QName interfaceName, QName serviceName, String endpointName) { + + StringBuffer strBuff = new StringBuffer(); + strBuff.append(interfaceName).append("+"); + strBuff.append(serviceName).append("+"); + strBuff.append(endpointName).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(role) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(role) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + /** + * adds message exchange listener who are interested in receiving the notification when the + * message exchange is received from delivery channel. The listener can be registered with the + * following combination of the parameters: (role,interfaceName,serviceName, endpointName), + * (role,interfaceName,null, null), (role, null,serviceName, endpointName), (role, null,serviceName, null) + * + * @param role role of the message exchange listener PROVIDER or CONSUMER - can not be null. + * @param interfaceName QName of the interface ( protType ) - can be null if the serviceName is not null + * @param serviceName QName of the service - can be null if interfaceName is not null. + * @param endpointName endpoint name of the service. - can be null if the serviceName is not null. + * @param listener MessageExchangeListener object + */ + public synchronized void addMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName, MessageExchangeListener listener) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + this.mListeners.put(key, listener); + } + /** + * removes any message exchange listener registered for the service endpoint specified by the serviceName and + * endpoint name. + * @param serviceName QName of the service + * @param endpointName endpoint name of the service. + */ + public synchronized void removeMessageExchangeListener(Role role, QName interfaceName, QName serviceName, String endpointName) { + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + MessageExchangeListener listener = this.mListeners.remove(key); + if ( listener == null ) { + RuntimeHelper.getLogger().fine("No message exchange listener removed with key " + key); + } + } + /** + * finds the MessageExchangeListner registers for the endpoint for which the message exchange is + * received and call the method on the listener + */ + public boolean fireMessageExchangeReceived(ExchangeStatus status, MessageExchange me) { + boolean notified = false; + Role role = me.getRole(); + QName interfaceName = me.getInterfaceName(); + QName serviceName = me.getEndpoint().getServiceName(); + String endpointName = me.getEndpoint().getEndpointName(); + // lookup with complete service description ( role + interface + service + endpoint ) + String key = createListenerKey(role, interfaceName, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + MessageExchangeListener listener = this.mListeners.get(key); + + if ( listener == null ) { // lookup with role+interface name + key = createListenerKey(role, interfaceName, null, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with role + serviceName + endpointName + key = createListenerKey(role, null, serviceName, endpointName); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { // lookup with with role + serviceName + key = createListenerKey(role, null, serviceName, null); + RuntimeHelper.getLogger().fine("looking up for mx listener with key " + key); + listener = this.mListeners.get(key); + } + if ( listener == null ) { + RuntimeHelper.getLogger().fine("Could not find listener for message exchange" + me); + notified = false; + } else { + listener.messageExchangeReceived(status,me); + notified = true; + } + return notified; + } + /** + * registers the MessageExchangeHandler implementation against the message exchange id. + * @param me MessageExchange for which the handler need to be assigned + * @param handler MessageExchangeHandler implementation that will be registers. + */ + public synchronized void addMessageExchangeHandler(MessageExchange me, MessageExchangeHandler handler) { + this.mHandlers.put(me.getExchangeId(), handler); + } + /** + * removes the MessageExchangeHandler for the particular message exchange object + */ + public synchronized void removeMessageExchangeHandler(MessageExchange me) { + MessageExchangeHandler handler = this.mHandlers.remove(me.getExchangeId()); + if ( handler == null ) { + RuntimeHelper.getLogger().fine("No MessageExchangeHandler found for removing " + me.getExchangeId()); + } + } + /** + * looks up the registered message exchange handler for the message exchange object + * @param me MessageExchangeHandler. + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(MessageExchange me) { + return this.mHandlers.get(me.getExchangeId()); + } + /** + * looks up the registered message exchange handler for the message exchange object with Id + * @param exchangeId message exchange object's id + */ + public synchronized MessageExchangeHandler findMessageExchangeHandler(String exchangeId) { + return this.mHandlers.get(exchangeId); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/RuntimeContext.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/RuntimeContext.java new file mode 100644 index 000000000..814925367 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/RuntimeContext.java @@ -0,0 +1,173 @@ +/* + * RuntimeContext.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; + +/** + * This class is global context for all the component runtime to store and + * retrieve the information that should be available anywhere in the component runtime. + * + * Each instance variable of this class will be initialized at various points of the + * component runtime using setter methods on this class. + * + * The two important objects that will be initialized and available from this context are + * ComponentContext and the opened DeliveryChannel objects both of which will be set from the + * implementation {@link BasicComponentLifeCycle}. + * + * Note that the ComponentContext from this global context will not be available until + * the jbi framework calls the init method of the ComponentLifeCycle of the component and + * then intern the implementation of the init method sets the context. + * + * @see BasicComponentLifeCycle#initGlobalContext + * @see BasicComponentLifeCycle#openDeliveryChannel + * @see BasicComponentLifeCycle#closeDeliveryChannel + * @author chikkala + */ +public final class RuntimeContext { + /** RuntimeContext singleton instance */ + private static RuntimeContext sRuntimeContext; + /** default logger*/ + private Logger mDefLogger; + /** Logger object. */ + private Logger mLogger; + /** Holds value of property ComponentContext. */ + private ComponentContext mComponentContext; + /** Holds value of property DeliveryChannel. */ + private DeliveryChannel mDeliveryChannel; + /** MessageExchange processing support **/ + private MessageExchangeSupport mMESupport; + + /** outside code can not instantiate RuntimeContext */ + private RuntimeContext() { + } + /** + * @return RuntimeContext instance. + */ + public static RuntimeContext getInstance() { + if ( sRuntimeContext == null ) { + synchronized (RuntimeContext.class) { + if ( sRuntimeContext == null ) { + sRuntimeContext = new RuntimeContext(); + } + } + } + return sRuntimeContext; + } + /** + * Getter for to obtaining ComponentContext from any where in the component runtime. + * @return ComponentContext. + */ + public ComponentContext getComponentContext() { + return this.mComponentContext; + } + /** + * Sets the Component context reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle#initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle#initContext + * for details. + * @param componentContext New value of property ComponentContext. + * @see BasicComponentLifeCycle#initGlobalContext + */ + public void setComponentContext(ComponentContext componentContext) { + if ( this.mComponentContext != null ) { + (new IllegalStateException("Component Context already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mComponentContext = componentContext; + } + /** + * Getter for obtaining opened delivery channel from any where in the component runtime. + * @return DeliveryChannel. + */ + public DeliveryChannel getDeliveryChannel() { + return this.mDeliveryChannel; + } + /** + * Sets the opened delivery channel reference in Runtime context for global access + * any class in the component runtime. + * com.sun.jbi.sample.component.common.AbstractComponentLifeCycle#initContext + * method implementation should call this method to set the global context. + * see com.sun.jbi.sample.component.common.DefaultComponentLifeCycle#initContext + * for details. + * + * @param componentContext New value of property ComponentContext. + */ + public void setDeliveryChannel(DeliveryChannel deliveryChannel) { + if ( deliveryChannel != null && this.mDeliveryChannel != null ) { + (new IllegalStateException("Delivery Channel already " + + "initialized in RuntimeContext")).printStackTrace(); + } + this.mDeliveryChannel = deliveryChannel; + } + /** + * Sets the logger. + * + * @param name name for the Logger. + * @param resourceBundle resource bundle for the logger. can be null. + */ + public void setLogger(String name, String resourceBundle) { + + if (this.mComponentContext != null) { + // get the logger from component context if the component context is not null + try { + this.mLogger = this.mComponentContext.getLogger(name, resourceBundle); + } catch (Exception ex) { + ex.printStackTrace(); + } + } else { + this.mDefLogger = Logger.getLogger(name, resourceBundle); + } + } + /** + * Returns the logger. + * + * @return Logger + */ + public Logger getLogger() { + + // try init logger + if (this.mLogger == null && this.mComponentContext != null ) { + try { + this.mLogger = + this.mComponentContext.getLogger(this.getClass().getName(), null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + // init default logger if required + if ( this.mLogger == null && this.mDefLogger == null) { + this.mDefLogger = Logger.getLogger(this.getClass().getName(), null); + } + return (this.mLogger != null) ? this.mLogger : this.mDefLogger; + } + /** + * Returns the Component Name if the ComponentContext is set. else null + * @return component name + */ + public String getComponentName() { + String componentName = null; + if (this.mComponentContext != null) { + componentName = this.mComponentContext.getComponentName(); + } + return componentName; + } + /** + * Global MessageExchangeSupport reference. Various classes in the common + * component runtime would use this method to obtain the MessageExchangeSupport + * for processing message exchange objects received from delivery channel. + */ + public MessageExchangeSupport getMessageExchangeSupport() { + if ( this.mMESupport == null ) { + this.mMESupport = new MessageExchangeSupport(); + } + return this.mMESupport; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/RuntimeHelper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/RuntimeHelper.java new file mode 100644 index 000000000..4f0ed8617 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/RuntimeHelper.java @@ -0,0 +1,357 @@ +/* + * RuntimeHelper.java + */ + +package net.openesb.component.BindingComponent-archetype.common; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * This is a helper class that have bunch of methods for xml processing. + * @author chikkala + */ +public class RuntimeHelper { + + public static Logger getLogger() { + return RuntimeContext.getInstance().getLogger(); + } + + public static void logWarning(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.WARNING, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().warning(logObj.toString()); + } + } + + public static void logError(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.SEVERE, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().severe(logObj.toString()); + } + } + + public static void logDebug(Object logObj) { + if ( logObj instanceof Throwable) { + getLogger().log(Level.FINER, ((Throwable)logObj).getMessage(), (Throwable)logObj); + } else { + getLogger().finer(logObj.toString()); + } + } + + public static String getComponentName() { + return RuntimeContext.getInstance().getComponentName(); + } + public static ComponentContext getComponentContext() { + return RuntimeContext.getInstance().getComponentContext(); + } + public static DeliveryChannel getDeliveryChannel() { + return RuntimeContext.getInstance().getDeliveryChannel(); + } + + public static MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeContext.getInstance().getMessageExchangeSupport(); + } + + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(Reader xmlReader) throws Exception { + InputSource xmlSource = new InputSource(xmlReader); + return buildDOMDocument(xmlSource); + } + /** + * return the DOM Document + * @param xmlReader Reader + * @return dom document + * @throws Exception on parser exception or any other exception + */ + public static Document buildDOMDocument(InputSource xmlSource) throws Exception { + Document xmlDoc = null; + DocumentBuilderFactory docBuilderFactory = + DocumentBuilderFactory.newInstance(); + docBuilderFactory.setValidating(false); + docBuilderFactory.setNamespaceAware(true); + DocumentBuilder docBuilder = + docBuilderFactory.newDocumentBuilder(); + docBuilder.setErrorHandler( new DefaultHandler() { + public void fatalError(SAXParseException e) + throws SAXException { + throw new SAXException(e.getMessage()); + } + }); + + docBuilder.setEntityResolver(new EntityResolver() { + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + StringReader reader = + new StringReader(""); // NOI18N + InputSource source = new InputSource(reader); + source.setPublicId(publicId); + source.setSystemId(systemId); + return source; + } + }); + + xmlDoc = docBuilder.parse(xmlSource); + + return xmlDoc; + } + /** + * reads xml text from DOMSource to StringBuffer + */ + public static StringBuffer readFromDOMSource(DOMSource domSource) { + + StringWriter writer = new StringWriter(); + + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer trans = null; + try { + trans = tFactory.newTransformer(); + trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, + "yes"); + trans.setOutputProperty(OutputKeys.INDENT, "yes"); + StreamResult result = new StreamResult(writer); + trans.transform(domSource, result); + } catch (TransformerConfigurationException ex) { + ex.printStackTrace(); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads the xml text from InputSource into a StringBuffer + */ + public static StringBuffer readFromInputSource(InputSource inSource) { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + InputStream inStream = inSource.getByteStream(); + Reader reader = inSource.getCharacterStream(); + if ( reader == null ) { + reader = new InputStreamReader(inStream); + } + BufferedReader buff = new BufferedReader(reader); + try { + + for ( String line = null; (line = buff.readLine()) != null ; ) { + out.println(line); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + + return writer.getBuffer(); + } + /** + * reads xml from from DOM, SAX or Stream Source into a string buffer + */ + public static StringBuffer readFromSource(Source source) { + if ( source instanceof DOMSource ) { + return readFromDOMSource((DOMSource)source); + } else { + InputSource inSource = SAXSource.sourceToInputSource(source); + if ( inSource != null ) { + return readFromInputSource(inSource); + } else { + return null; + } + } + } + /** + * creates a DOMSource from the xml text read from the reader. + */ + public static DOMSource createDOMSource(Reader xmlReader) { + Document doc = null; + try { + doc = buildDOMDocument(xmlReader); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * creates a DOMSource from any source. If the source itself is DOMSource, + * the source is returned as it is as DOMSource. + */ + public static DOMSource sourceToDOMSource(Source source) { + if ( source instanceof DOMSource) { + return (DOMSource) source; + } + InputSource xmlSource = SAXSource.sourceToInputSource(source); + Document doc = null; + try { + doc = buildDOMDocument(xmlSource); + } catch (Exception ex) { + ex.printStackTrace(); + } + return new DOMSource(doc); + } + /** + * converts the ex stracktrace to string. + */ + public static StringBuffer getExceptionStackTrace(Exception ex) { + StringWriter strWriter = new StringWriter(); + if ( ex != null ) { + PrintWriter out = new PrintWriter(strWriter); + ex.printStackTrace(out); + } + return strWriter.getBuffer(); + } + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsXmlText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + String exXmlText = + "" + + "" + message + "" + + "" + stackTrace + "" + + "" ; + return exXmlText; + } + + /** + * may be used to set the exception as fault content. + */ + public static String getExceptionAsText(Exception ex) { + String message = replaceXmlEscapeCharsToEntityRefereces(ex.getMessage()); + String stackTrace = replaceXmlEscapeCharsToEntityRefereces( + getExceptionStackTrace(ex).toString()); + StringBuffer buff = new StringBuffer(); + buff.append(message); + buff.append(System.getProperty("line.separator", "\n")); + buff.append(stackTrace); + return buff.toString(); + } + + + /** + * For attribute values which denote a QName, i.e. include a namespace prefix, + * resolve the value into a QName. + * If a namespace can not be resolved, it is set to empty - it does not + * result in an exception + * @param attrValue the string value of the attribute + * @param element the element the attribute belongs to + */ + public static QName resolveAttrQName(String attrValue, Element element) { + int aColonLoc = attrValue.indexOf(":"); + String aLocalName = attrValue; + String aPrefix = null; + String aNS = null; + if (aColonLoc > -1) { + aPrefix = attrValue.substring(0, aColonLoc); + aLocalName = attrValue.substring(aColonLoc + 1); + + // Traverse up the hierarchy until a namespace definition is found + // or the top of the document is reached. + Node currNode = element; + while ((aNS == null || aNS.equals("")) && currNode != null) { + if (currNode.getNodeType() == Node.ELEMENT_NODE) { + aNS = ((Element) currNode).getAttribute("xmlns:" + aPrefix); + } + currNode = currNode.getParentNode(); + } + } + + QName qName = new QName(aNS, aLocalName, aPrefix); + + return qName; + } + + /** + * replaces the xml entity references with the xml escape chars + * @param xmlString Text with the xml escape chars + * @param Text with the xml entity references + */ + public static String replaceXmlEscapeCharsToEntityRefereces(String xmlString) { + if ( xmlString == null ) { + return xmlString; + } + + // just convert < , > and & only + StringBuffer sbuff = new StringBuffer(2 * xmlString.length()); + for ( int i = 0; i < xmlString.length(); ++i ) { + switch ( xmlString.charAt(i) ) { + case '&': sbuff.append("&"); + break; + case '<': sbuff.append("<"); + break; + case '>': sbuff.append(">"); + break; + default: sbuff.append( xmlString.charAt(i) ); + } + } + return sbuff.toString(); + } + + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + + public static Element getElement(DOMSource domSource) { + return getElement(domSource.getNode()); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java new file mode 100644 index 000000000..1ac6d629c --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/AbstractServiceUnitManager.java @@ -0,0 +1,309 @@ +/* + * AbstractServiceUnitManager.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common.deployment; + +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.component.ServiceUnitManager; +import javax.jbi.management.DeploymentException; + +/** + * This is an abstract class that implements {@link javax.jbi.component.ServiceUnitManager} to provide a + * service unit deployment support for the component. The implementation supported by this service + * unit manager and related classes in this package provides WSDL1.1 based service unit deployment + * in the component. + * + * @see javax.jbi.component.ServiceUnitManager + * @see ServiceUnit + * + * @author chikkala + */ +public abstract class AbstractServiceUnitManager implements ServiceUnitManager { + + /** Map of ServiceUnit Name to the ServiceUnit Object for all the service units + * deployed in the component */ + private Map mSUMap; + + /** Creates a new instance of AbstractSUManager */ + protected AbstractServiceUnitManager() { + this.mSUMap = Collections.synchronizedMap(new HashMap()); + } + /** returns the component name + * @return component name. + */ + protected abstract String getComponentName(); + /** + * @return Logger + */ + protected abstract Logger getLogger(); + /** + * returns the creation of the ServiceUnit implementation specific to the service unit deployment + * for the component. + * @param suName service unit name + * @param suRootPath service unit root path + * @param concrete implementation of the ServiceUnit class. + */ + protected abstract ServiceUnit createServiceUnit(String suName, String suRootPath) + throws DeploymentException; + /** + * returns the service unit object deployed by the specified name. or null if not deployed. + * @param suName service unit name to look for + * @param ServiceUnit object for the suName. or null if not present. + */ + private ServiceUnit getServiceUnit(String suName) { + return this.mSUMap.get(suName); + } + /** + * lookup for the deployed service unit. If not there, throws a deployment exception. + * @param suName service unit name + * @return ServiceUnit object + * @throws DeploymentException if the service unit is not present. + */ + private ServiceUnit findServiceUnit(String suName) throws DeploymentException { + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return serviceUnit; + } + /** + * add the service unit object to the list of deployed service units. if there is already a + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is added. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit addServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + this.mSUMap.put(suName, su); + return su; + } + /** + * removes service unit object from the list of deployed service units. if there is no + * service unit present with the name, throws a deployment exception. + * @param su service unit to add + * @return ServiceUnit object that is being removed. + * @throws DeploymentException if the service unit already present. + */ + private ServiceUnit removeServiceUnit(ServiceUnit su) throws DeploymentException { + String suName = su.getName(); + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU == null ) { + throw new DeploymentException("Service unit " + suName + " does not exist"); + } + return this.mSUMap.remove(suName); + } + /** + * creates the concrete service unit implementation and calls the load method on it to initialize + * the created service unit. + * @param suName service unit name to create + * @param suRootPath service unit root path. + * @return ServiceUnit that is created and loaded. + */ + private ServiceUnit loadServiceUnit(String suName, String suRootPath) throws DeploymentException { + ServiceUnit serviceUnit = createServiceUnit(suName, suRootPath); + serviceUnit.doLoad(); + return serviceUnit; + } + /** + * deploys a service unit. it creates and loads the service unit object for the suName and then call + * doDeploy on the service unit and adds it to the deployed service unit list + * @return result as jbi management xml + * @throws DeploymentException if there is an error deploying. + */ + private synchronized String deployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit oldSU = getServiceUnit(suName); + if ( oldSU != null ) { + throw new DeploymentException("Service unit " + suName + "already exists"); + } + ServiceUnit serviceUnit = loadServiceUnit(suName, suRootPath); + serviceUnit.doDeploy(); + addServiceUnit(serviceUnit); + return result; + } + /** + * Deploy a Service Unit to the component. + * @see javax.jbi.component.ServiceUnitManager#deploy(String, String); + */ + public final String deploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Deploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully deployed service unit " + suName; + Exception errEx = null; + try { + deployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to deploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, ex); + } + return createComponentTaskResultXML(compName, "deployTask", isSuccess, mainMsg, errEx); + } + + /** + * undeploys the service unit. it looks up the existing deployed service unit and call doUndeploy + * on it and then removes from the deployed service unit list. + */ + private synchronized String undeployServiceUnit(String suName, String suRootPath) throws DeploymentException { + String result = suName; + ServiceUnit serviceUnit = findServiceUnit(suName); + serviceUnit.doUndeploy(); + removeServiceUnit(serviceUnit); + return result; + } + /** + * Undeploy a service unit from the component. + * @see javax.jbi.component.ServiceUnitManager#undeploy(String, String); + */ + public final String undeploy(String suName, String suRootPath) throws DeploymentException { + this.getLogger().fine("Undeploying service unit " + suName + " with suRootPath " + suRootPath); + String compName = this.getComponentName(); + boolean isSuccess = true; + String mainMsg = "Successfully undeployed service unit " + suName; + Exception errEx = null; + try { + undeployServiceUnit(suName, suRootPath); + } catch (Exception ex) { + isSuccess = false; + errEx = ex; + mainMsg = "Failed to undeploy service unit " + suName ; + this.getLogger().log(Level.FINE, mainMsg, errEx); + } + return createComponentTaskResultXML(compName, "undeployTask", isSuccess, mainMsg, errEx); + } + /** + * Initialize the given deployed service unit. + * @see javax.jbi.component.ServiceUnitManager#init(String, String); */ + public final void init(String suName, String suRootPath) + throws DeploymentException { + this.getLogger().fine("Initializing service unit " + suName + " with suRootPath " + suRootPath); + String result = suName; + ServiceUnit serviceUnit = getServiceUnit(suName); + if ( serviceUnit == null ) { // if the service unit not exists, create and add + serviceUnit = loadServiceUnit(suName, suRootPath); // create and load service unit + addServiceUnit(serviceUnit); // add service unit to existing service units + } + serviceUnit.doInit(); // Do Service unit initialization tasks + this.getLogger().fine("Service unit initialized:" + suName); + } + /** + * Shut down the deployment. + * @see javax.jbi.component.ServiceUnitManager#shutdown(String); + */ + public final void shutDown(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doShutdown(); // Do Service unit shutdown tasks + this.getLogger().fine("Service unit shut down:" + suName); + } + /** + * Start the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager#start(String); + */ + public final void start(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStart(); // Do service unit start tasks. + this.getLogger().fine("Service unit started:" + suName ); + } + /** + * Stop the deployed service unit. + * @see javax.jbi.component.ServiceUnitManager#stop(String); + */ + public final void stop(String suName) throws DeploymentException { + ServiceUnit serviceUnit = findServiceUnit(suName); // find service unit + serviceUnit.doStop(); // do service unit stop tasks + this.getLogger().fine("Service unit stopped: " + suName + " stopped."); + } + + /** + * helper method to create result message as jbi management message xml. + * @param componentName name of the component for this xml. + * @param taskId task id + * @param isSuccess true to format a success result, false to format a failed result. + * @param mainMsg main result message + * @param errEx Exception, null if there is no exception in failure message. + * @return XML string. + */ + protected static String createComponentTaskResultXML( + String componentName, String taskId, boolean isSuccess, String mainMsg, Exception errEx ) { + + String exMsgXml = getComponentTaskResultExceptionXML(errEx); + String mainMsgXmlEsc = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces(mainMsg); + String taskResult = isSuccess ? "SUCCESS" : "FAILED"; + String msgType = isSuccess ? "INFO" : "ERROR"; + + String xmlResult = + "" + + " " + componentName + "" + + " " + + " " + + " " + taskId + "" + + " " + taskResult + "" + + " " + msgType + "" + + " " + + " " + + " SU_MGR_MSG_ID" + + " " + mainMsgXmlEsc + "" + + " " + + " " + + exMsgXml + + " " + + " " + + ""; + + return xmlResult; + } + /** + * converts the exception to the jbi management message xml chunk. + */ + private static String getComponentTaskResultExceptionXML(Exception errEx) { + StringBuffer exMsgBuff = new StringBuffer(); + if ( errEx == null ) { + return exMsgBuff.toString(); // empty string. + } + + List exList = new ArrayList(); + int exLevel = 0; + for ( Throwable cause = errEx ; cause != null ; cause = cause.getCause() ) { + String causeMsg = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + cause.getMessage()); + StringWriter stBuff = new StringWriter(); + PrintWriter stOut = new PrintWriter(stBuff); + StackTraceElement[] stList = cause.getStackTrace(); + for (StackTraceElement stEl : stList) { + stOut.println(stEl.toString()); + } + stOut.close(); + String causeStackTrace = RuntimeHelper.replaceXmlEscapeCharsToEntityRefereces( + stBuff.getBuffer().toString()); + + exMsgBuff.append(""); + exMsgBuff.append(" " + exLevel + ""); + exMsgBuff.append(" " + "SU_MGR_EXP_ID"); + exMsgBuff.append(" " + causeMsg + ""); + exMsgBuff.append(" "); + exMsgBuff.append(" " + causeStackTrace + ""); + exMsgBuff.append(""); + ++exLevel; + } + + return exMsgBuff.toString(); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java new file mode 100644 index 000000000..24ddf56df --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ConsumerEndpoint.java @@ -0,0 +1,205 @@ +/* + * ConsumerEndpoint.java + */ + +package net.openesb.component.BindingComponent-archetype.common.deployment; + +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.InOnly; +import javax.jbi.messaging.InOut; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.messaging.MessageExchangeFactory; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; +import javax.xml.namespace.QName; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service consumer. {@link ServiceUnit#createConsumerEndpoint} creates the object of this + * type to implement the service consumer functionality. + * + * @see ServiceUnit#createConsumerEndpoint + * @author chikkala + */ + +public class ConsumerEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with CONSUMER role and makes sure that the service + * description passed to it is of consumer description. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef, ServiceUnit su) { + super(Role.CONSUMER, consumes, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ConsumerEndpoint(SUDescriptor.Consumes consumes, Definition wsdlDef) { + this(consumes, wsdlDef, null); + } + public final void init() throws JBIException { + getLogger().fine("ConsumerEndpoint: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + public final void activate() throws JBIException { + getLogger().fine("ConsumerEndpoint: activate called"); + //1. do common ativation tasks. + doActivate(); //2. do any other activation related tasks. + } + + public final void deactivate() throws JBIException { + getLogger().fine("ConsumerEndpoint: deactivate called"); + //1. do common deactivation tasks. + doDeactivate(); //2. do any other deactivation related tasks. + } + + public final void clean() throws JBIException { + getLogger().fine("ConsumerEndpoint: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + + /** + * helper method to find the active ServiceEndpiont for the service described with the + * serviceDescriptor. This method looks for the Active ServiceEndpoint using interface or + * service name or service name and the endpoint name. + */ + public ServiceEndpoint findServiceEndpoint() { + + QName serviceType = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + + ServiceEndpoint [] refs = null; + ServiceEndpoint serviceEndpoint = null; + ComponentContext compContext = this.getComponentContext(); + + if ( compContext == null ) { + this.getLogger().info("Null Component context. Can not find ServiceEndpoint"); + return null; + } + // lookup ServiceEndpiont with concrete service(serice qname + endpoint name). + if ( serviceName != null && endpointName != null ) { + this.getLogger().info("Looking for ServiceEndpoint with:" + + " ServiceName: " + serviceName + " EndpointName: " + endpointName); + serviceEndpoint = compContext.getEndpoint(serviceName, endpointName); + } + // else lookup ServiceEndpiont with Service Name + if ( serviceEndpoint == null && serviceName != null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service name: " + serviceName); + refs = compContext.getEndpointsForService(serviceName); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + // else lookup ServiceEndpont with serviceType + if ( serviceEndpoint == null && serviceType != null && + serviceName == null && endpointName == null) { + this.getLogger().info("Looking for ServiceEndpoint with Service type: " + serviceType); + refs = compContext.getEndpoints(serviceType); + if ( refs != null && refs.length > 0 ) { + serviceEndpoint = refs[0]; + } + } + + return serviceEndpoint; + } + + /** + * this method creates a InOutMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOut createInOutMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for \n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOut inOutME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOutME = factory.createInOutExchange(); + // set operation + inOutME.setOperation(operation); + // set interface if that is not set + if ( inOutME.getInterfaceName() == null ) { + inOutME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOutME.createMessage(); + // set IN Normalized message on message exchange + inOutME.setInMessage(inMsg); + + return inOutME; + } + + /** + * this method creates a InOnlyMessageExchange Object and sets the required + * data on the MessageExchange object including the create and set the Normalized + * message object to hold the input message on the MessageExchange object. + */ + public InOnly createInOnlyMessageExchange(QName operation) + throws MessagingException, JBIException { + + ServiceEndpoint serviceEndpoint = null; + // find a ServiceEndpoint activated by the Service Providers for this service + serviceEndpoint = findServiceEndpoint(); + + if ( serviceEndpoint == null ) { + // if not found a activated ServiceEndpoint for this service, throw exception. + throw new JBIException("Can not find an Active ServiceEndpoint for \n" + this.getService()); + } else { + this.setServiceEndpoint(serviceEndpoint); + } + + InOnly inOnlyME = null; + DeliveryChannel channel = this.getDeliveryChannel(); + // create message exchange factory for the endpiont + MessageExchangeFactory factory = channel.createExchangeFactory(serviceEndpoint); + // create INOUT Message Exchange + inOnlyME = factory.createInOnlyExchange(); + // set operation + inOnlyME.setOperation(operation); + // set interface if that is not set + if ( inOnlyME.getInterfaceName() == null ) { + inOnlyME.setInterfaceName(this.getService().getInterface()); + } + // create IN Nomralized Message + NormalizedMessage inMsg = inOnlyME.createMessage(); + // set IN Normalized message on message exchange + inOnlyME.setInMessage(inMsg); + + return inOnlyME; + } + + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/Endpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/Endpoint.java new file mode 100644 index 000000000..1806dbf43 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/Endpoint.java @@ -0,0 +1,286 @@ +/* + * Endpoint.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common.deployment; + +import net.openesb.component.BindingComponent-archetype.common.MessageExchangeHandler; +import net.openesb.component.BindingComponent-archetype.common.MessageExchangeListener; +import net.openesb.component.BindingComponent-archetype.common.MessageExchangeSupport; +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import java.util.logging.Logger; +import javax.jbi.JBIException; +import javax.jbi.component.ComponentContext; +import javax.jbi.messaging.DeliveryChannel; +import javax.jbi.messaging.ExchangeStatus; +import javax.jbi.messaging.MessageExchange; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.xml.namespace.QName; + +/** + * This is an abstract class that represents the Endpoint defined for service provisioning or + * consumption in a jbi component. It stores the required service description ( wsdl definition, + * role, service unit to which it belongs etc) and defines the lifecycle operations {@link #init}, + * {@link #activate}, {@link #deactivate}, {@link #clean} to control a service endpoint that + * provides or consumes the service. + *

+ * Extended classes implement the abstract methods defined in this class to implement the endpoint + * functionality by providing the functionality to process the deployment artifacts specific to this + * endpoint, configure the endpoint to send/receive messages to/from delivery channel and process them + * according to the specific service implementation. + * + * @author chikkala + */ +public abstract class Endpoint { + /** Role of this endpoint. CONSUMER or PROVIDER */ + private Role mRole; + /** Service description from the SU descriptor for which this endpoint is configured */ + private SUDescriptor.Service mService; + /** WSDL definition corresponding to this endpoint */ + private Definition mWsdlDef; + /** service endpoint corresponding to this endpoint */ + private ServiceEndpoint mServiceEndpoint; + /** service unit from which this endpoint is created */ + private ServiceUnit mSU; // can be null + /** private constructor to force extended classes to use the parameterized constructor */ + private Endpoint() { + } + /** Creates a new instance of Endpoint + * @param role CONSUMER or PRVODER role. + * @param service service description from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + * @param su service unit object which created this endpoint. + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl, ServiceUnit su) { + this.mService = service; + this.mRole = role; + this.mWsdlDef = wsdl; + this.mSU = su; + } + /** Creates a new instance of Endpoint without service unit. may be useful for static endpoints that + * are not part of the deployment + * @param role CONSUMER or PRVODER role. + * @param service service info from the su descriptor + * @param wsdl wsdl definition corresponding to this endpoint + */ + protected Endpoint(Role role, SUDescriptor.Service service, Definition wsdl) { + this(role, service, wsdl, null); + } + /** + * should be called to initialize any resources related to this endpoint object + * throws JBIException + */ + public abstract void init() throws JBIException; + /** + * activates the endpoint to send/receive messages + * throws JBIException + */ + public abstract void activate() throws JBIException; + /** + * deactivates the endpoint + * throws JBIException + */ + public abstract void deactivate() throws JBIException; + /** + * clean endpoint + * throws JBIException + */ + public abstract void clean() throws JBIException; + + public final Role getRole() { + return this.mRole; + } + public final boolean isProvider() { + return (Role.PROVIDER.equals(this.getRole())); + } + public final boolean isConsumer() { + return (Role.CONSUMER.equals(this.getRole())); + } + public final Definition getWSDL() { + return this.mWsdlDef; + } + public final SUDescriptor.Service getService() { + return this.mService; + } + public final ServiceEndpoint getServiceEndpoint() { + return this.mServiceEndpoint; + } + protected final void setServiceEndpoint(ServiceEndpoint svcEP) { + this.mServiceEndpoint = svcEP; + } + public final ServiceUnit getServiceUnit() { + return this.mSU; + } + /** + * generates an ID that would uniquely identify this endpoint implementation. Use as a key to map + * any information to store that is related to this endpoint. + */ + public final String getID() { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(this.mService.getInterface()).append("+"); + strBuff.append(this.mService.getServiceName()).append("+"); + strBuff.append(this.mService.getEndpointName()).append("+"); + String roleType = null; + if ( Role.CONSUMER.equals(this.mRole) ) { + roleType = "CONSUMER"; + } else if ( Role.PROVIDER.equals(this.mRole) ) { + roleType = "PROVIDER"; + } + strBuff.append(roleType); + return strBuff.toString(); + } + + @Override + public String toString() { + return "Endpoint : " + "\n" + this.mService; + } + /** + * checks if this endpoint is configured for the binding component or service engine. + */ + public boolean isForBindingComponent-archetype() { + boolean isForBindingComponent-archetype = false; + if ( this.mSU != null ) { + try { + isForBindingComponent-archetype = this.mSU.getSUDescriptor().isForBindingComponent-archetype(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + return isForBindingComponent-archetype; + } + + public QName getOperationQName(String opName) { + return new QName(this.getService().getInterface().getNamespaceURI(), opName); + } + + public Operation getWSDLOperation(QName opQName) { + String opName = null; + if ( opQName != null ) { + opName = opQName.getLocalPart(); + } + Operation operation = WSDLProcessor.findOperation(this.getWSDL(), + this.getService().getInterface(), opName); + return operation; + } + + public Binding getWSDLBinding() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + if ( serviceName != null ) { + return WSDLProcessor.findServiceBinding(this.getWSDL(), serviceName, endpointName); + } else { + return WSDLProcessor.findInterfaceBinding(this.getWSDL(), interfaceName, null); + } + } + /** @return logger */ + public Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** @return ComponentContext */ + public ComponentContext getComponentContext() { + return RuntimeHelper.getComponentContext(); + } + /** @return DeliveryChannel */ + public DeliveryChannel getDeliveryChannel() { + return RuntimeHelper.getDeliveryChannel(); + } + /** + * helper function to get the MessageExchangeSupport object + */ + public MessageExchangeSupport getMessageExchangeSupport() { + return RuntimeHelper.getMessageExchangeSupport(); + } + + public MessageExchangeHandler createMessageExchangeHandler() { + return null; + } + /** + * creates the message exchange listener. Extended classes should return + * MessageExchangeListener implementation. + * @return MessageExchangeListener or null. + * + */ + protected MessageExchangeListener createMessageExchangeListener() { + return null; + } + /** + * Creates and adds message exchange listener to receive message exchange received notification. + */ + protected void addMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeListener meListener = createMessageExchangeListener(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null && meListener != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName, meListener); + if ( serviceName != null ) { + meListenerSupport.addMessageExchangeListener( + this.getRole(), null, serviceName, endpointName, meListener); + } + } + } + /** + * Removes message exchange listener from the MessageExchangeSupport. + */ + protected void removeMessageExchangeListener() { + QName interfaceName = this.getService().getInterface(); + QName serviceName = this.getService().getServiceName(); + String endpointName = this.getService().getEndpointName(); + MessageExchangeSupport meListenerSupport = getMessageExchangeSupport(); + if ( meListenerSupport != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), interfaceName, serviceName, endpointName); + if ( serviceName != null ) { + meListenerSupport.removeMessageExchangeListener( + this.getRole(), null, serviceName, endpointName); + } + } + } + + public final boolean processMessageExchangeWithHandler(ExchangeStatus status, MessageExchange me) { + + //1. lookup handler + //2. if not there create one and register + //3. call process message exchange on it + //4. check status. if that is the end, remove the handler + + MessageExchangeSupport support = this.getMessageExchangeSupport(); + if ( support == null ) { + getLogger().fine("No MessageExchangeSupport present"); + return false; + } + MessageExchangeHandler handler = support.findMessageExchangeHandler(me); + if ( handler == null ) { + handler = this.createMessageExchangeHandler(); + if ( handler == null ) { + getLogger().fine("MessageExchangeHandler not supported"); + return false; + } + support.addMessageExchangeHandler(me, handler); + } + + handler.processMessageExchange(status, me); + + getLogger().fine("XXX MX Handler processed ME with STATUS: " + status); + + if (!ExchangeStatus.ACTIVE.equals(status) ) { + // DONE or ERROR means done with the me. + getLogger().fine("End of ME processing. STATUS: " + status + + ". Removing the MX Handler ..."); + support.removeMessageExchangeHandler(me); + } + + return true; + } + +} + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java new file mode 100644 index 000000000..fa47fd306 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ProviderEndpoint.java @@ -0,0 +1,104 @@ +/* + * ProviderEndpoint.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common.deployment; + +import net.openesb.component.BindingComponent-archetype.common.deployment.SUDescriptor.Service; +import javax.jbi.JBIException; +import javax.jbi.messaging.MessageExchange.Role; +import javax.jbi.servicedesc.ServiceEndpoint; +import javax.wsdl.Definition; + +/** + * This class extends from Endpoint class and implements lifecycle methods functionality required for the + * endpoint for a service provider. {@link ServiceUnit#createProviderEndpoint} creates the object of this + * type to implement the service provider functionality. It makes sure that this class or the extended + * classes will activate or deactivate the ServiceEndpoint corresponding to the service + * provided by the endpoint is performed during the activate and deactivate method calls as part of the + * endpoint lifecycle. + * + * @see ServiceUnit#createProviderEndpoint + * @author chikkala + */ + +public class ProviderEndpoint extends Endpoint { + /** + * This constructor initializes the endpoint with PROVIDER role and makes sure that the service + * description passed to it is of provider description. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef, ServiceUnit su) { + super(Role.PROVIDER, provides, wsdlDef, su); + } + /** + * constructor that does not need service unit information. useful for creating the endpoint for + * static services provided by the component. + */ + protected ProviderEndpoint(SUDescriptor.Provides provides, Definition wsdlDef) { + this(provides, wsdlDef, null); + } + /** + * initializes the endpoint and creates and registers the MessageExchangeListener with + * MessageExchangeSupport. + */ + public final void init() throws JBIException { + getLogger().fine("ProviderEndpiont: init called"); + doInit(); //1. initialize the endpiont resources + addMessageExchangeListener(); //2. register message exchange linster. + } + /** + * calls activatesServiceEndpoint for the Provider. + */ + public final void activate() throws JBIException { + getLogger().fine("ProviderEndpiont: activate called"); + activateServiceEndpoint(); //1. activate service endpoint in NMR + doActivate(); //2. do any other activation related tasks. + } + /** + * calls deactivateServiceEndpoint for the Provider. + */ + public final void deactivate() throws JBIException { + getLogger().fine("ProviderEndpiont: deactivate called"); + deactivateServiceEndpoint(); //1. deactivates the service endpoint in NMR + doDeactivate(); //2. do any other deactivation related tasks. + } + /** + * removes the message exchange listener. cleans up other resources + */ + public final void clean() throws JBIException { + getLogger().fine("ProviderEndpiont: clean called"); + removeMessageExchangeListener(); //1. remove message exchange listener + doClean(); //2. clean up any other resources. + } + /** + * Activates the ServiceEndpoint with NMR + */ + private void activateServiceEndpoint() throws JBIException { + Service service = this.getService(); + ServiceEndpoint svcEP = this.getComponentContext().activateEndpoint( + service.getServiceName(), service.getEndpointName()); + this.setServiceEndpoint(svcEP); + } + /** + * Deactivates ServiceEndpoint in NMR + */ + private void deactivateServiceEndpoint() throws JBIException { + this.getComponentContext().deactivateEndpoint(this.getServiceEndpoint()); + this.setServiceEndpoint(null); + } + + protected void doInit() throws JBIException { + //NOOP + } + protected void doActivate() throws JBIException { + //NOOP + } + protected void doDeactivate() throws JBIException { + //NOOP + } + protected void doClean() throws JBIException { + //NOOP + } + +} \ No newline at end of file diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java new file mode 100644 index 000000000..070382b01 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/SUDescriptor.java @@ -0,0 +1,361 @@ +/* + * SUDescriptor.java + */ + +package net.openesb.component.BindingComponent-archetype.common.deployment; + +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import javax.jbi.management.DeploymentException; +import javax.xml.namespace.QName; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * This interface represent the service unit descriptor (jbi.xml) model. This will be used in + * ServiceUnit implementation to find the services provided and consumed by this service unit. + * {@link SUDescriptorFactory#getSUDescriptor} method reads the jbi.xml in the service unit to + * to the implementation of this interface. + * + * @see SUDescriptorFactory + * @see Consumes + * @see Provides + * @see ServiceUnit + * + * @author chikkala + */ +public interface SUDescriptor { + + Collection getProvidedServices(); + + Collection getConsumedServices(); + + boolean isForBindingComponent-archetype(); + + /** + * base interface that models the service information described in the service unit descriptor for + * consumed services and provided services. + */ + public interface Service { + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + QName getInterface(); + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + QName getServiceName(); + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + String getEndpointName(); + } + /** + * marker interface that represents the provided services in the service unit + */ + public interface Provides extends Service { + } + /** + * this interface represents the consumed service information in the su descriptor. + */ + public interface Consumes extends Service { + + public final static String STANDARD_LINK = "standard"; + public final static String SOFT_LINK = "soft"; + public final static String HARD_LINK = "hard"; + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + String getLinkType(); + } + /** + * This is a factory class that can build the Service Unit Descriptor model from the jbi.xml + */ + public static class SUDescriptorFactory { + + protected final static String JBI_TAG_NAME = "services"; + protected final static String SERVICES_TAG_NAME = "services"; + protected final static String BC_TAG_NAME = "binding-component"; + protected final static String PROVIDES_TAG_NAME = "provides"; + protected final static String CONSUMES_TAG_NAME = "consumes"; + protected final static String INTERFACE_TAG_NAME = "interface-name"; + protected final static String SERVICE_TAG_NAME = "service-name"; + protected final static String ENDPOINT_TAG_NAME = "endpoint-name"; + protected final static String LINK_TYPE_TAG_NAME = "link-type"; + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(String jbiXmlPath) throws Exception { + FileReader reader = null; + try { + reader = new FileReader(jbiXmlPath); + SUDescriptor suDesc = getSUDescriptor(reader); + return suDesc; + } finally { + if ( reader != null ) { + try { + reader.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + /** + * method that builds the Service unit descriptor model from the jbi.xml + */ + public static SUDescriptor getSUDescriptor(Reader reader) throws Exception { + SUDescriptor suDescriptor = null; + Document suDescDoc = RuntimeHelper.buildDOMDocument(reader); + Element jbiEl = suDescDoc.getDocumentElement(); + if (JBI_TAG_NAME.equals(jbiEl.getTagName())) { + throw new DeploymentException("Invalid service unit descriptor : no jbi root element"); + } + + NodeList servicesNL = jbiEl.getElementsByTagName(SERVICES_TAG_NAME); + if (servicesNL != null && servicesNL.getLength() == 1) { + Element servicesEl = (Element) servicesNL.item(0); + suDescriptor = SUDescriptorImpl.createSUDescriptor(servicesEl); + } else { + throw new DeploymentException("Invalid service unit descriptor : invalid services element"); + } + + return suDescriptor; + } + + } + /** + * This class implements SUDescriptor + */ + public static class SUDescriptorImpl implements SUDescriptor { + + private List mConsumedList; + private List mProvidedList; + private boolean mIsForBindingComponent-archetype; + + protected SUDescriptorImpl(boolean isForBindingComponent-archetype) { + this.mIsForBindingComponent-archetype = isForBindingComponent-archetype; + this.mConsumedList = new ArrayList(); + this.mProvidedList = new ArrayList(); + } + + protected void addProvidedService(Provides provides) { + this.mProvidedList.add(provides); + } + + protected void addConsumedService(Consumes consumes) { + this.mConsumedList.add(consumes); + } + + public Collection getProvidedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mProvidedList); + } + + public Collection getConsumedServices() { + // return unmodifiable collection + return Collections.unmodifiableCollection(this.mConsumedList); + } + + public boolean isForBindingComponent-archetype() { + return this.mIsForBindingComponent-archetype; + } + + protected static SUDescriptor createSUDescriptor(Element servicesEl) throws Exception { + boolean isForBC = false; + String bcTagString = servicesEl.getAttribute(SUDescriptorFactory.BC_TAG_NAME); + isForBC = Boolean.valueOf(bcTagString).booleanValue(); + SUDescriptorImpl suDesc = new SUDescriptorImpl(isForBC); + // add consumes + NodeList consumesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.CONSUMES_TAG_NAME); + for ( int i=0; i < consumesNL.getLength(); ++i) { + Element consumesEl = (Element) consumesNL.item(i); + Consumes consumes = ConsumedService.createConsumedService(consumesEl); + suDesc.addConsumedService(consumes); + } + // add provides + NodeList providesNL = servicesEl.getElementsByTagName(SUDescriptorFactory.PROVIDES_TAG_NAME); + for ( int i=0; i < providesNL.getLength(); ++i) { + Element providesEl = (Element) providesNL.item(i); + Provides provides = ProvidedService.createProvidedService(providesEl); + suDesc.addProvidedService(provides); + } + + return suDesc; + } + } + /** + * Base class that implements the Service interface + */ + public static abstract class AbstractService implements Service { + + private QName mInterface; + private QName mServiceName; + private String mEndpointName; + + private AbstractService() { + } + /** + * Getter for property interfaceQName. + * @return Value of property interfaceQName. + */ + public QName getInterface() { + return this.mInterface; + } + + /** + * Setter for property interfaceQName. + * @param interfaceQName New value of property interfaceQName. + */ + protected void setInterface(QName interfaceQName) { + this.mInterface = interfaceQName; + } + + /** + * Getter for property serviceName. + * @return Value of property serviceName. + */ + public QName getServiceName() { + return this.mServiceName; + } + + /** + * Setter for property serviceName. + * @param serviceName New value of property serviceName. + */ + protected void setServiceName(QName serviceName) { + this.mServiceName = serviceName; + } + + /** + * Getter for property endpointName. + * @return Value of property endpointName. + */ + public String getEndpointName() { + return this.mEndpointName; + } + + /** + * Setter for property endpointName. + * @param endpointName New value of property endpointName. + */ + protected void setEndpointName(String endpointName) { + this.mEndpointName = endpointName; + } + + } + /** + * This class implements the Provides interface + */ + public static class ProvidedService + extends AbstractService + implements Provides { + protected ProvidedService(QName interfaceQName, QName serviceName, String endpointName) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + } + + @Override + public String toString() { + return "Provides :" + + "\n\t interface-name= " + getInterface() + + "\n\t service-name= " + getServiceName() + + "\n\t endpont-name= " + getEndpointName(); + } + + protected static Provides createProvidedService(Element providesEl) throws Exception { + + String ifName = providesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = providesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = providesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + if ( ifName == null || serviceName == null || endpointName == null ) { + throw new Exception("Invalid provides element: missing " + SUDescriptorFactory.INTERFACE_TAG_NAME + + " or " + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, providesEl); + QName serviceQName = RuntimeHelper.resolveAttrQName(serviceName, providesEl); + + return new ProvidedService(ifQName, serviceQName, endpointName); + } + } + /** + * This class implements the Consumes interface. + */ + public static class ConsumedService + extends AbstractService + implements Consumes { + private String mLinkType; + protected ConsumedService(QName interfaceQName, + QName serviceName, String endpointName, String linkType) { + this.setInterface(interfaceQName); + this.setServiceName(serviceName); + this.setEndpointName(endpointName); + this.mLinkType = linkType; + } + + /** + * Getter for property linkType. + * @return Value of property linkType. + */ + public String getLinkType() { + return this.mLinkType; + } + + @Override + public String toString() { + return "Cosumes :" + + "\n\t interface-name= " + getInterface() + + "\n\t service-name= " + getServiceName() + + "\n\t endpont-name= " + getEndpointName() + + "\n\t link-type= " + getLinkType(); + } + + protected static Consumes createConsumedService(Element consumesEl) throws Exception { + + String ifName = consumesEl.getAttribute(SUDescriptorFactory.INTERFACE_TAG_NAME); + String serviceName = consumesEl.getAttribute(SUDescriptorFactory.SERVICE_TAG_NAME); + String endpointName = consumesEl.getAttribute(SUDescriptorFactory.ENDPOINT_TAG_NAME); + String linkType = consumesEl.getAttribute(SUDescriptorFactory.LINK_TYPE_TAG_NAME); + if ( linkType == null || linkType.trim().length() == 0 ) { + linkType = STANDARD_LINK; + } + + if ( ifName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.INTERFACE_TAG_NAME ); + } + if ( serviceName == null || endpointName == null ) { + throw new Exception("Invalid consumes element: missing " + + SUDescriptorFactory.SERVICE_TAG_NAME + " or " + + SUDescriptorFactory.ENDPOINT_TAG_NAME ); + } + + QName ifQName = RuntimeHelper.resolveAttrQName(ifName, consumesEl); + QName serviceQName = null; + if ( serviceName != null ) { + serviceQName = RuntimeHelper.resolveAttrQName(serviceName, consumesEl); + } + if ( serviceQName != null && endpointName != null && linkType != null ) { + if (!(STANDARD_LINK.equals(linkType) || + SOFT_LINK.equals(linkType) || HARD_LINK.equals(linkType)) ) { + throw new Exception("Invalid consumes attribute value" + + SUDescriptorFactory.LINK_TYPE_TAG_NAME + "=" + linkType); + } + } + return new ConsumedService(ifQName, serviceQName, endpointName, linkType); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java new file mode 100644 index 000000000..a51cae714 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/deployment/ServiceUnit.java @@ -0,0 +1,461 @@ +/* + * ServiceUnit.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common.deployment; + +import net.openesb.component.BindingComponent-archetype.common.RuntimeHelper; +import net.openesb.component.BindingComponent-archetype.common.deployment.SUDescriptor.Consumes; +import net.openesb.component.BindingComponent-archetype.common.deployment.SUDescriptor.Provides; +import net.openesb.component.BindingComponent-archetype.common.deployment.SUDescriptor.Service; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.jbi.management.DeploymentException; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; + +/** + * This is an abstract class that implements the service unit functionality in the component which + * processes the service unit artifacts and implement the actual service unit lifecycle functionality. + * The AbstractServiceUnitManager and its extended classes that implement the ServiceUnitManager + * functionality creates and maintains the reference to the concrete implementation of this class to + * invoke the functionality implemented by this class and its concrete implementation during the + * execution of the ServiceUnitMangers lifecycle methods by the jbi runtime. + *

+ * The main lifecycle methods of this class that will be called by the ServiceUnitManger implementation + * during the service unit deployment lifecycle are {@link #doload}, {@link #doDeploy}, {@link #doUndeploy}, + * {@link #doInit}, {@link #doStart}, {@link #doStop} and {@link #doShutdown} + *

+ * Service unit processing supported by this implementation is based on wsdl 1.1 deployments where the + * services provided and consumed in this service unit are described using wsdl 1.1 definitions. + *

+ * The main service unit artifacts that will be processed during deployment lifecycle of the service + * unit are 1.Service unit descriptor(jbi.xml) that describes the services provided and consumed by + * this service unit. 2.WSDL 1.1 document that describes the service definition 3.Component specific + * configurations related to services provided and consumed by this service unit. + *

+ * When the service unit is for Binding Component, the component specific configurations are read + * from the WSDL1.1 extensions defined in the WSDL document corresponding to the service provider + * or consumer deployed with this service unit. + *

+ * When the service unit is for Service Engine, the component specific configurations are read + * from the deployment artifacts such as xslt files and mapping files in the service unit zip file + * along with the WSDL document corresponding to the service provider or consumer deployed with this + * service unit. + * + * @see SUDescriptor + * @see Endpoint + * @see ProviderEndpoint + * @see ConsumerEndpoint + * @see WSDLProcessor + * @author chikkala + */ +public abstract class ServiceUnit { + /** Service Unit Name */ + private String mSUName; + /** Service Unit Root path passed by jbi runtime */ + private String mSURootPath; + /** service unit descriptor model unmarshalled from service unit jbi.xml */ + private SUDescriptor mSUDescriptor; + /** Map of Endpoint Key to ProviderEndpoint configurations in this service unit */ + private Map mProviderEndpointMap; + /** Map of Endpoint Key to ConsumerEndpoint configurations in this service unit */ + private Map mConsumerEndpointMap; + /** Map of Service Key to the WSDL Definition in this service unit */ + private Map mWSDLMap; + /** WSDLProcessor configured for this service unit to process wsdls in the service unit */ + private WSDLProcessor mWSDLProcessor; + /** + * + * @param suName + * @param suRootPath + */ + protected ServiceUnit(String suName, String suRootPath) { + this.mSUName = suName; + this.mSURootPath = suRootPath; + this.mSUDescriptor = null; + this.mWSDLMap = new HashMap(); + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + } + /** returns service unit name + * @return service unit name + */ + public String getName() { + return this.mSUName; + } + /** returns service unit root path where the su artifacts are unzipped by the jbi runtime + * @return path to the service unit root directory. + */ + public String getSURootPath() { + return this.mSURootPath; + } + protected SUDescriptor createSUDescriptor() throws Exception { + File jbiXmlFile = new File(this.getSURootPath(), "META-INF/jbi.xml"); + String jbiXmlPath = jbiXmlFile.getAbsolutePath(); + return SUDescriptor.SUDescriptorFactory.getSUDescriptor(jbiXmlPath); + } + /** return the Service unit descriptor model that was read from the jbi.xml + * @return SUDescriptor + */ + public SUDescriptor getSUDescriptor() throws Exception { + if ( this.mSUDescriptor == null ) { + this.mSUDescriptor = createSUDescriptor(); + } + return this.mSUDescriptor; + } + public ProviderEndpoint getProviderEndpoint(String providerID) { + return this.mProviderEndpointMap.get(providerID); + } + public Collection getProviderEndpoints() { + return Collections.unmodifiableCollection(this.mProviderEndpointMap.values()); + } + public ConsumerEndpoint getConsumerEndpoint(String cosumerID) { + return this.mConsumerEndpointMap.get(cosumerID); + } + + public Collection getConsumerEndpoints() { + return Collections.unmodifiableCollection(this.mConsumerEndpointMap.values()); + } + /** + * @return Logger + */ + protected Logger getLogger() { + return RuntimeHelper.getLogger(); + } + /** + * extended classes implement this method to create the su specific WSDLProcessor. for examples, + * a su supporting binding component may have wsdl extensions that it want to registry for reading + * the configurations from the wsdl file. + * @return WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.WSDLProcessor + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + */ + protected WSDLProcessor createWSDLProcessor() { + return new WSDLProcessor(this.getSURootPath()); + } + /** + * return the WSDLProcessor reference by creates if it is not yet created. + * @return WSDLProcessor. + */ + public final WSDLProcessor getWSDLProcessor() { + if ( this.mWSDLProcessor == null ) { + this.mWSDLProcessor = createWSDLProcessor(); + } + return this.mWSDLProcessor; + } + /** + * loads the service unit artifacts into the SU model. AbstractServiceUnitManager implementation + * calls this method during the during deploy and init lifecycle methods when the service unit + * object is newly created. + */ + public void doLoad() throws DeploymentException { + try { + SUDescriptor suDesc = getSUDescriptor(); // load jbi.xml + loadServiceDefinitions(); // check if the wsdls are valid for corresponding services. + loadOtherArtifacts(); // additional validations specific to component deployment features. + loadEndpoints(); // create endpoints + } catch ( DeploymentException jbiEx) { + throw jbiEx; + } catch (Exception ex) { + throw new DeploymentException(ex); + } + } + /** extended classes implement this method to perform the su specific deployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doDeploy() throws DeploymentException { + // NOOP. doLoad has done it all. + this.getLogger().fine("ServiceUnit.doDeploy"); + } + /** extended classes implement this method to perform the su specific undeployment related tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doUndeploy() throws DeploymentException { + //NOOP + this.getLogger().fine("ServiceUnit.doUndeploy"); + } + /** extended classes implement this method to perform the su specific initialization tasks in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doInit() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doInit"); + this.doInitEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on start in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStart() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStart"); + this.doActivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on stop in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doStop() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doStop"); + this.doDeactivateEndpoints(); + } + /** extended classes implement this method to perform the su specific tasks on shutdown in + * this method implementation. + * @throws DeploymentException on error. + */ + public void doShutdown() throws DeploymentException { + this.getLogger().fine("ServiceUnit.doShutdown"); + this.doCleanEndpoints(); + } + /** + * create the ProviderEndpoint that implement the service provider implementation specific to this su. + * @return ProviderEndpoint or null if the SU does not support the service provider access + */ + protected ProviderEndpoint createProviderEndpoint(Provides provides, Definition wsdlDef) { + return null; + } + /** + * create the ProviderEndpoint that implement the service consumer implementation specific to this su. + * @return ConsumerEndpoint or null if the SU does not support the service consumer access + */ + protected ConsumerEndpoint createConsumerEndpoint(Consumes consumes, Definition wsdlDef) { + return null; + } + /** + * generates the key based on the service to store the wsdl definitions . + */ + protected String getServiceKey(Service service) { + StringBuffer strBuff = new StringBuffer(); + strBuff.append(service.getInterface()).append("+"); + strBuff.append(service.getServiceName()).append("+"); + strBuff.append(service.getEndpointName()); + return strBuff.toString(); + } + /** + * looks up the wsdl definition loaded for this service. + */ + protected Definition findWSDLFor(Service service) throws WSDLException { + Definition wsdlDef = null; + String key = this.getServiceKey(service); + wsdlDef = this.mWSDLMap.get(key); + return wsdlDef; + } + + protected Definition findWSDL(List wsdlList, Service service, boolean ignoreEndpointLookup) { + Definition foundDef = null; + for ( Definition def : wsdlList ) { + if ( WSDLProcessor.isWSDLFor(def, service.getInterface(), service.getServiceName(), + ((ignoreEndpointLookup) ? null : service.getEndpointName()) ) ) { + foundDef = def; + break; + } + } + return foundDef; + } + /** + * loads the WSDL definitions corresponds to the service providers and consumers defined in the + * service unit descriptor. + */ + protected void loadServiceDefinitions() throws Exception { + + this.mWSDLMap = new HashMap(); + + WSDLProcessor wsdlProcessor = getWSDLProcessor(); + List wsdlList = wsdlProcessor.readWSDLs(this.getSURootPath()); + this.getLogger().fine("Number of wsdl definitions in service unit " + wsdlList.size()); + + List services = new ArrayList(); + services.addAll(this.getSUDescriptor().getProvidedServices()); + services.addAll(this.getSUDescriptor().getConsumedServices()); + + boolean isForBinding = this.getSUDescriptor().isForBindingComponent-archetype(); + this.getLogger().fine("Is this service unit for Binding? " + isForBinding); + + for ( Service service : services ) { + this.getLogger().fine("Looking up WSDL for service " + service); + boolean ignoreEndpointLookup = false; + boolean providerAtEngine = false; + if ( !isForBinding && service instanceof Provides ) { + ignoreEndpointLookup = true; + providerAtEngine = true; + } + Definition def = findWSDL(wsdlList, service, ignoreEndpointLookup); + if ( def == null ) { + throw new Exception("WSDL Definition not found for " + service); + } + this.mWSDLMap.put(getServiceKey(service), def); + if ( providerAtEngine ) { + // provider at engine. so add engine binding and endpoint to the wsdl + wsdlProcessor.createServiceEngineBinding(def, + service.getInterface(), service.getServiceName(), service.getEndpointName()); + } + } + } + /** extended classes implement this method to perform the su specific artifacts validation in + * this method implementation. + * @throws DeploymentException on error. + */ + protected void loadOtherArtifacts() throws DeploymentException { + // nothing to validate further. + this.getLogger().fine("ServiceUnit.loadOtherArtifacts"); + } + /** + * creates ProviderEndpoint and ConsumerEndpoint objects corresponding to the service providers + * and consumers described in the su descriptor ( jbi.xml ) + */ + protected void loadEndpoints() throws Exception { + + this.mProviderEndpointMap = new HashMap(); + this.mConsumerEndpointMap = new HashMap(); + + Collection providesList = this.getSUDescriptor().getProvidedServices(); + for ( Provides provides : providesList ) { + Definition wsdlDef = findWSDLFor(provides); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + provides); + } + ProviderEndpoint provider = createProviderEndpoint(provides, wsdlDef); + this.mProviderEndpointMap.put(provider.getID(), provider); + } + + Collection consumesList = this.getSUDescriptor().getConsumedServices(); + for ( Consumes consumes : consumesList ) { + Definition wsdlDef = findWSDLFor(consumes); + if ( wsdlDef == null ) { + throw new DeploymentException("WSDL Definitions not found for " + consumes); + } + ConsumerEndpoint consumer = createConsumerEndpoint(consumes, wsdlDef); + this.mConsumerEndpointMap.put(consumer.getID(), consumer); + } + } + /** + * initializes the Endpoint objects created corresponding to the consumer and providers defined + * in the su descriptor + */ + protected void doInitEndpoints() throws DeploymentException { + // init endpoints. if any initialization fails, rollback the already inited endpoints + List initedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.init(); + initedEndpoints.add(endpoint); + } catch ( Exception initEx) { + doCleanEndpoints(initedEndpoints); + throw new DeploymentException(initEx); + } + } + + } + /** + * invokes activates method of all provider and consumer endpoint object in this su. if there is + * and error activating any one the endpoints, it deactivates the already activated ones and throws + * the error + */ + protected void doActivateEndpoints() throws DeploymentException { + // activate providers first and then consumers + List activatedEndpoints = new ArrayList(); + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getProviderEndpoints()); + allEndpoints.addAll(this.getConsumerEndpoints()); + + for ( Endpoint endpoint : allEndpoints ) { + try { + endpoint.activate(); + activatedEndpoints.add(endpoint); + } catch ( Exception actEx) { + doDeactivateEndpoints(activatedEndpoints); + throw new DeploymentException(actEx); + } + } + } + /** + * invokes deactivate method on the list of Endpoint objects passed to this method + */ + protected void doDeactivateEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.deactivate(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes deactivate method on the all consumer and provider endpoint objects + */ + protected void doDeactivateEndpoints() { + // deactivate consumers first and then the providers + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doDeactivateEndpoints(allEndpoints); + } + /** + * invokes clean method on the list of endpoint objects + */ + protected void doCleanEndpoints(List endpoints) { + for ( Endpoint endpoint : endpoints ) { + try { + endpoint.clean(); + } catch(Exception ex) { + // ignore the exception and log it. + this.getLogger().log(Level.FINE, ex.getMessage(), ex); + } + } + } + /** + * invokes clean method on the all consumer and provider endpoint objects in this su. + */ + protected void doCleanEndpoints() { + + List allEndpoints = new ArrayList(); + allEndpoints.addAll(this.getConsumerEndpoints()); + allEndpoints.addAll(this.getProviderEndpoints()); + doCleanEndpoints(allEndpoints); + } + /** + * prints the service unit description + */ + protected final String printDetails() { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + + out.println("ServiceUnit Name : " + this.getName()); + out.println("ServiceUnit Root : " + this.getSURootPath()); + + SUDescriptor suDesc = null; + try { + suDesc = this.getSUDescriptor(); + for ( SUDescriptor.Consumes consumer : suDesc.getConsumedServices()) { + out.println(consumer); + } + for ( SUDescriptor.Provides provides : suDesc.getProvidedServices()) { + out.println(provides); + } + } catch (Exception ex) { + ex.printStackTrace(out); + } + return writer.getBuffer().toString(); + } + + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java new file mode 100644 index 000000000..e1c293183 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensibilityElement.java @@ -0,0 +1,41 @@ +/* + * AbstractExtensibilityElement.java + */ + +package net.openesb.component.BindingComponent-archetype.common.wsdl; + +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This is an abstract class which can be extended to create jwsdl (wsdl4j's) extension elements model to + * read/write the wsdl extension elements in wsdl 1.1 xml. + * + * @author chikkala + */ +public abstract class AbstractExtensibilityElement implements ExtensibilityElement, java.io.Serializable { + public static final long serialVersionUID = 1; + private QName mElementType; + private Boolean mRequired; + + /** Creates a new instance of AbstractExtensibilityElement */ + protected AbstractExtensibilityElement() { + } + + public void setElementType(QName elementType) { + this.mElementType = elementType; + } + + public QName getElementType() { + return this.mElementType; + } + + public void setRequired(Boolean required) { + this.mRequired = required; + } + + public Boolean getRequired() { + return this.mRequired; + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java new file mode 100644 index 000000000..8cb120d92 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionRegistry.java @@ -0,0 +1,42 @@ +/* + * AbstractExtensionRegistry.java + */ + +package net.openesb.component.BindingComponent-archetype.common.wsdl; + +import java.util.List; +import javax.wsdl.extensions.ExtensionRegistry; + +/** + * This is the abstract class used to add the wsdl extension serializers and deserializers to the + * wsdl extension registry configured to read/write wsdl extensions into a know java model. + * @see AbstractExtensionSerializer + * @see WSDLProcessor + * @author chikkala + */ +public abstract class AbstractExtensionRegistry extends ExtensionRegistry { + + /** Creates a new instance of AbstractSerializer + * it calls the createSerializers method to get the list of + * serializers and then call registerSerializer on each AbstractExtensionSerializer + * to register them with this registry. + * @see AbstractExtensionSerializer#registerSerializer + */ + protected AbstractExtensionRegistry() { + super(); + List list = createSerializers(); + for (AbstractExtensionSerializer ser : list ) { + ser.registerSerializer(this); + } + // register ServiceEngine Binding serializers + AbstractExtensionSerializer seBindingSer = new SEBindingExt.SEBindingExtSerializer(); + seBindingSer.registerSerializer(this); + } + /** + * create wsdl extension serializers for each extension element to register with the extension + * registry. + * @return List of AbstractExtensionSerializer objects for serializing/deserializing the wsdl extensions. + * @see AbstractExtensionSerializer + */ + protected abstract List createSerializers(); +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java new file mode 100644 index 000000000..1c531d1c4 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractExtensionSerializer.java @@ -0,0 +1,120 @@ +/* + * AbstractExtensionSerializer.java + */ + +package net.openesb.component.BindingComponent-archetype.common.wsdl; + +import java.io.PrintWriter; +import java.io.Serializable; +import java.util.Set; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionDeserializer; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.extensions.ExtensionSerializer; +import javax.xml.namespace.QName; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +/** + * This class is an abstract class that should be extended to implements extension serializer and + * deserializer. This class implements the code required for registering the serializer and deserializer + * implemented by this class. THe AbstractExtensionRegistry class calls the #registerSerializer method + * to register the concrete implementation of this class with extension registry. + * @see AbstractExtensionRegistry + * @author chikkala + */ +public abstract class AbstractExtensionSerializer + implements ExtensionSerializer, ExtensionDeserializer, Serializable { + + public static final long serialVersionUID = 1; + + private Class mParentType; + private Class mExtensionType; + private QName mElementType; + + /** Creates a new instance of AbstractSerializer */ + public AbstractExtensionSerializer(Class parentType, QName elementType, Class extensionType) { + this.mParentType = parentType; + this.mElementType = elementType; + this.mExtensionType = extensionType; + } + + public Class getParentType() { + return this.mParentType; + } + public QName getElementType() { + return this.mElementType; + } + public Class getExtensionType() { + return this.mExtensionType; + } + + public void registerSerializer(ExtensionRegistry extReg) { + extReg.registerSerializer(this.mParentType, this.mElementType, this); + extReg.registerDeserializer(this.mParentType, this.mElementType, this); + extReg.mapExtensionTypes(this.mParentType, this.mElementType, this.mExtensionType); + } + + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + // DO NOTHING. Binding component runtime does not need to serialize the wsdl extensions. + } + + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + return null; + } + + public static String getAttribute(Element el, String attrName) { + String attrValue = null; + Attr attr = el.getAttributeNode(attrName); + if ( attr != null ) { + attrValue = attr.getValue(); + } + return attrValue; + } + + protected String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + /** + * @return the name with the prefix defined for the namespaceURI in the wsdl definition. + * @throws WSDLException if the prefix not found in the wsdl definition. note that the + * default prefix is an empty string. + */ + protected String getQualifiedName(Definition def, + String namespaceURI, String localName) throws WSDLException { + String prefix = null; + if (namespaceURI != null && !namespaceURI.equals("")) { + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + throw new WSDLException(WSDLException.OTHER_ERROR, + "Can not find prefix in WSDL Definition for " + namespaceURI); + } + } + if ( prefix != null && !prefix.equals("")) { + return prefix + ":" + localName; + } else { + return localName; + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java new file mode 100644 index 000000000..f8c48f0a1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/AbstractNormalizer.java @@ -0,0 +1,226 @@ +/* + * AbstractNormalizer.java + */ + +package net.openesb.component.BindingComponent-archetype.common.wsdl; + +import java.util.ArrayList; +import java.util.List; +import javax.jbi.messaging.MessagingException; +import javax.jbi.messaging.NormalizedMessage; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Part; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * This is an abstract class that implements most of the functionality to normalize the binding protocol + * specific concrete message to jbi wrapper and and denormalize jbi wrapper to the concrete binding + * protocol specific message. + *

+ * The extended classes specific to particular binding protocol will be used when a jbi binding + * component is sending and receiving messages from the external service providers and consumers using + * a particular binding protocol known to this class. Extended implementation of this class should make + * use of the helper methods in this class in normalizing and denormalizing the messages. + * @see JMXBindingNormalizer + * @author chikkala + */ +public abstract class AbstractNormalizer { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + /** wsdl definition to use when normalizing and denormalizing */ + private Definition mWSDL; + /** Binding definition to use when normalizing and denormalizing */ + private Binding mBinding; + + private AbstractNormalizer() {} + /** Creates a new instance of JMXBCNormalizer */ + public AbstractNormalizer(Definition wsdl, Binding binding) { + this.mWSDL = wsdl; + this.mBinding = binding; + } + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete mssage of a particular binding protocol. + */ + public abstract void normalizeInput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeOutput(Operation operation, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * normalize the binding protocol specific concrete message to jbi wrapper. + * @param operation wsdl operation for which a concrete message should be normalized. + * @param normMsg NoramalizedMessage which will be configurate with normalized data from + * the concrete message + * @param msgSource concrete message of a particular binding protocol. + */ + public abstract void normalizeFault(Operation operation, String faultName, NormalizedMessage normMsg, DOMSource msgSource) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be de-normalized. + * @param normMsg NormalizedMessage which should be used to create de-normalized message. + */ + public abstract DOMSource denormalizeInput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + /** + * denormalize the normalized message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeOutput(Operation operation, NormalizedMessage normMsg) + throws MessagingException; + + /** + * denormalized the normalized fault message into a concrete message for a particular binding protocol + * @param operation wsdl operation for which a concrete message should be denormalized. + * @param normMsg NormalizedMessage which should be used to create denormalized message. + */ + public abstract DOMSource denormalizeFault(Operation operation, String faultName, NormalizedMessage normMsg) + throws MessagingException; + /** + * @return the wsdl definition to use in normalizing and denormalizing the message + */ + protected Definition getWSDL() { + return this.mWSDL; + } + /** + * @return the wsdl binding definition to use in normalizing and denormalizing the message + */ + protected Binding getBinding() { + return this.mBinding; + } + /** + * create and add message parts to the jbiWrapper according to the abstract message model. This + * method assumes that the each element in the msgParts list passed to it is mapped to the part + * of the abstract wsdl message and uses the type or element attribute of the abstract message to + * determine whether the element is actual part element or a wrapped part type. + * Use this method in normalizing the concrete protocol specific message to jbi wrapper message. + * @param jbiWrapper object that holds the jbi wrapper information. + * @param wsdlMsg abstract message from the wsdl definition + * @param msgParts actual message parts from the concrete message + */ + protected void addMessagePartsToJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg, List msgParts) throws MessagingException { + List wsdlParts = wsdlMsg.getOrderedParts(null); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= msgParts.size() ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + Element msgPart = msgParts.get(i); + if ( wsdlPart.getElementName() != null ) { + jbiWrapper.appendPart(msgPart); + } else { + // it is type. + // check the element name is same as part + if ( !wsdlPart.getName().equals(msgPart.getLocalName()) ) { + throw new MessagingException("mismatched message content for part " + wsdlPart.getName()); + } + if ( !wsdlMsg.getQName().getNamespaceURI().equals(msgPart.getNamespaceURI()) ) { + throw new MessagingException("mismatched message content namespace for part " + wsdlPart.getName()); + } + // check the content is text or element. + List partContent = getChildElements(msgPart); + if ( partContent.size() > 0 ) { + // add content as part elements + jbiWrapper.appendPart(partContent); + } else { + // add the content as text + jbiWrapper.appendPart(msgPart.getTextContent()); + } + } + } + } + /** + * extracts the message parts from the jbiWrapper according to the abstract wsdl message + * definition passed to it. Use this method in denormalizing the jbi wrapper message into the + * binding protocol specific concrete message. + * @param jbiWrapper jbi wrapper object that contains message parts and the message type information. + * @param wsdlMsg abstract wsdl message definition to use in constructing the part elements. + */ + protected List getMessagePartsFromJBIWrapper(WSDL11JBIWrapper jbiWrapper, Message wsdlMsg) + throws MessagingException, ParserConfigurationException { + + List msgParts = new ArrayList(); + int jbiPartCount = jbiWrapper.getPartCount(); + List wsdlParts = wsdlMsg.getOrderedParts(null); + QName msgType = jbiWrapper.getType(); + if (!wsdlMsg.getQName().getNamespaceURI().equals(msgType.getNamespaceURI())) { + throw new MessagingException("Namespace mismatch between jbi wrapper message type and wsdl message"); + } + Document newDoc = jbiWrapper.getDocumentBuilder().newDocument(); + for ( int i=0; i < wsdlParts.size(); ++i ) { + Part wsdlPart = (Part) wsdlParts.get(i); + if ( i >= jbiPartCount ) { + throw new MessagingException("missing message content for part " + wsdlPart.getName()); + } + if ( wsdlPart.getElementName() != null ) { + msgParts.add(jbiWrapper.getPartAsElement(i)); + } else { + // it is type. create a new element for a typed part + // check the element name is same as part + String prefix = msgType.getPrefix(); + String nsURI = msgType.getNamespaceURI(); + String localName = wsdlPart.getName(); + Element partEl = newDoc.createElementNS(nsURI, prefix + ":" + localName); + partEl.setAttributeNS(XMLNS_NS, "xmlns:"+prefix, nsURI); + NodeList partContent = jbiWrapper.getPart(i); + appendChildren(partEl, partContent, newDoc, true); + msgParts.add(partEl); + } + } + return msgParts; + } + /** + * utility method that can append the nodeList passed to it to the element children. + * @param el element node to which the nodeList should be appended + * @param doc the document object that should be used to import the nodeList + * @param importNode true if the nodeList should be imported while appending the nodeList to the + * element children. false if no import is necessary. + */ + protected void appendChildren(Element el, NodeList nodeList, Document doc, boolean importNode) { + + for ( int pIdx = 0; pIdx < nodeList.getLength(); ++pIdx) { + Node node = nodeList.item(pIdx); + if ( importNode ) { + node = doc.importNode(node, true); + } + el.appendChild(node); + } + } + /** + * @param el element from which to extract the child elements + * @return List list of child Element nodes. + */ + protected List getChildElements(Element el) { + List list = new ArrayList(); + NodeList nodeList = el.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if (!(node instanceof Element) ){ + continue; + } + list.add((Element)node); + } + return list; + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java new file mode 100644 index 000000000..7455a5707 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/SEBindingExt.java @@ -0,0 +1,96 @@ +/* + * SEBindingExt.java + */ + +package net.openesb.component.BindingComponent-archetype.common.wsdl; + +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation classes implement wsdl 1.1 extension model for the + * jbi service engine binding that is defined in jsr 208(sec. 5.5.6.1). to read/write concrete binding + * element in the wsdl definition for the service endpoint binding provided by the service engine. + * The wsdl definition with this binding information can be used in providing the service provider + * metadata returned by the service engine in Component.getServiceDescription. + *

+ * AbstractExtensionRegistry by default include this extension serializers in the + * registry to read/write this service engine binding type in the wsdl definition. + *

+ * During a service unit deployment/initialization in the service engine, the deployed wsdl definition + * is loaded and modified to provide this binding for the service provided by the engine. + * + * @see WSDLProcessor#createServiceEngineBinding + * @see AbstractExtensionRegistry + * @see com.sun.jbi.sample.component.common.deployment.ServiceUnit#loadServiceDefinitions + * @author chikkala + */ +public interface SEBindingExt extends ExtensibilityElement, java.io.Serializable { + + public static final String NS_URI = "http://java.sun.com/xml/ns/jbi/binding/service+engine"; + public static final String NS_DEF_PREFIX = "jbise"; + /** Element names. */ + public static final String EL_BINDING_EXT = "binding"; + /**Qualified element names.*/ + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + + public static class SEBindingExtImpl extends AbstractExtensibilityElement implements SEBindingExt { + + public SEBindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + @Override + public String toString() { + StringBuffer buff = new StringBuffer(); + buff.append("<"+NS_DEF_PREFIX+":"+EL_BINDING_EXT); + buff.append("/>"); + return buff.toString(); + } + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static SEBindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + SEBindingExtImpl bindingExt = new SEBindingExt.SEBindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, SEBindingExt.NS_DEF_PREFIX); + return bindingExt; + } + } + /** + * serializer and descrializer implementation for the binding extension element. + */ + public static class SEBindingExtSerializer extends AbstractExtensionSerializer { + + public SEBindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, SEBindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + SEBindingExt extObj = (SEBindingExt)extReg.createExtension(parentType, elementType); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg ) throws WSDLException { + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + + SEBindingExt extObj = (SEBindingExt)extension; + + StringBuffer buff = new StringBuffer(); + buff.append("<" + elName ); + buff.append("/>"); + pw.println(buff.toString()); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java new file mode 100644 index 000000000..8ef35eb17 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDL11JBIWrapper.java @@ -0,0 +1,468 @@ +/* + * WSDL11JBIWrapper.java + * + */ + +package net.openesb.component.BindingComponent-archetype.common.wsdl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.wsdl.Fault; +import javax.wsdl.Input; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Output; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +/** + * This class wraps the wsdl11 messages to the jbi wrapper message suitable for + * processing in the wsdl2.0 model of the normalized message in jbi as defined in jsr208 like + * + * + * + * + * + * + * + * + * + * + * @author chikkala + */ +public class WSDL11JBIWrapper { + + public static final String XMLNS_NS = "http://www.w3.org/2000/xmlns/"; + public static final String WRAPPER_NAMESPACE = "http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"; + public static final String DEF_NS_PREFIX = "jbiwrp"; + public static final String DEF_MESSAGE_NS_PREFIX = "msgns"; + public static final String JBI_MESSAGE_EL = "message"; + public static final String JBI_PART_EL = "part"; + public static final String VERSION_ATTR = "version"; + public static final String VERSION_ATTR_VALUE = "1.0"; + public static final String TYPE_ATTR = "type"; + public static final String NAME_ATTR = "name"; + + private static DocumentBuilder sDocBuilder = null; + /** qname of message attribute from wsdl:input, wsdl:output or wsdl:fault */ + private QName mType; + /** optional name attribute from wsdl:input, wsdl:output or wsdl:fault */ + private String mName; + /** each parts contents as node list */ + List mPartConentList = new ArrayList(); + + /** Creates a new instance of WSDL11JBIWrapper */ + public WSDL11JBIWrapper() { + } + /** creates the namespace aware document builder. extended classes can override this method + * to return the doc builder created else where. + */ + protected DocumentBuilder createDocumentBuilder() throws ParserConfigurationException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + return factory.newDocumentBuilder(); + } + /** return the document builder + * @return DocumentBuilder + */ + public final DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { + if ( WSDL11JBIWrapper.sDocBuilder == null ) { + WSDL11JBIWrapper.sDocBuilder = createDocumentBuilder(); + } + return WSDL11JBIWrapper.sDocBuilder; + } + /** + * @return type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public QName getType() { + return this.mType; + } + /** + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + */ + public void setType(QName type) { + this.mType = type; + } + /** @return name attribute from wsdl:input, wsdl:output or wsdl:fault. or null if not set. */ + public String getName() { + return this.mName; + } + /** + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault. can be null. + */ + public void setName(String name) { + this.mName = name; + } + /** + * appends part content as node list + */ + public void appendPart(NodeList partContent) { + this.mPartConentList.add(partContent); + } + /** + * append part content from the List of nodes + */ + public void appendPart(List partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content as element + */ + public void appendPart(Element partContent) { + this.mPartConentList.add(new NodeListImpl(partContent)); + } + /** + * append part content from DOMSource + */ + public void appendPart(DOMSource partContent) { + Element partConentEl = getElement(partContent.getNode()); + this.mPartConentList.add(new NodeListImpl(partConentEl)); + } + /** + * append part content as text node. + */ + public void appendPart(String partContent) { + Text textContent = null; + try { + textContent = this.getDocumentBuilder().newDocument().createTextNode(partContent); + } catch (ParserConfigurationException ex) { + ex.printStackTrace(); + } + if ( textContent != null ) { + this.mPartConentList.add(new NodeListImpl(textContent)); + } + } + /** + * append list of part contents each is a NodeList to the parts + */ + public void appendParts(List partContentList) { + this.mPartConentList.addAll(partContentList); + } + /** + * returned the ordered list of part contents. + */ + public List getParts() { + return Collections.unmodifiableList(this.mPartConentList); + } + /** + * return the number of parts + */ + public int getPartCount() { + return this.mPartConentList.size(); + } + /** + * return the part content at a particular index as NodeList. + */ + public NodeList getPart(int idx) { + return this.mPartConentList.get(idx); + } + /** + * return part context at a particular index as text + */ + public String getPartAsText(int idx) { + NodeList partNodes = getPart(idx); + Document doc; + try { + doc = this.getDocumentBuilder().newDocument(); + Element el = doc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + for ( int i=0; i < partNodes.getLength(); ++i) { + el.appendChild(partNodes.item(i)); + } + return el.getTextContent(); + } catch (ParserConfigurationException ex) { + return null; + } + } + /** + * return part context at a particular index as Element + */ + public Element getPartAsElement(int idx) { + Element contentEl = null; + NodeList partNodes = getPart(idx); + for ( int i=0; i < partNodes.getLength(); ++i) { + Node node = partNodes.item(i); + if ( node instanceof Element) { + contentEl = (Element)node; + break; + } + } + return contentEl; + } + /** + * creates Document from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return Document containing the wsdl 11 wrapper xml + */ + public Document toDocument() throws ParserConfigurationException { + + Document wrapperDoc = getDocumentBuilder().newDocument(); + Element jbiMessage = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_MESSAGE_EL); + jbiMessage.setAttribute(VERSION_ATTR, VERSION_ATTR_VALUE); + wrapperDoc.appendChild(jbiMessage); + + QName type = this.getType(); + if ( type == null ) { + type = new QName("", "", DEF_MESSAGE_NS_PREFIX); + } + // set the jbiMessage attributes + String prefix = type.getPrefix(); + if (prefix == null || prefix.length() == 0) { + prefix = DEF_MESSAGE_NS_PREFIX; + } + jbiMessage.setAttribute(TYPE_ATTR, prefix + ":" + type.getLocalPart()); + jbiMessage.setAttributeNS( XMLNS_NS, "xmlns:" + prefix, type.getNamespaceURI()); + + String name = this.getName(); + if (name != null && name.trim().length() > 0 ) { + jbiMessage.setAttribute(NAME_ATTR, name); + } + + List partContentList = this.getParts(); + for ( NodeList nodeList : partContentList ) { + // set jbi part message + Element jbiPart = wrapperDoc.createElementNS(WRAPPER_NAMESPACE, DEF_NS_PREFIX + ":" + JBI_PART_EL); + jbiMessage.appendChild(jbiPart); + for ( int i =0; i < nodeList.getLength(); ++i ) { + Node importedMsgNode = wrapperDoc.importNode(nodeList.item(i), true); + jbiPart.appendChild(importedMsgNode); + } + } + + return wrapperDoc; + + } + /** + * creates DOMSource from this wrapper object. Before calling this method, + * the type, name (optional) and parts contents should be set. + * @return DOMSource containing the wsdl 11 wrapper xml + */ + public DOMSource toDOMSource() throws ParserConfigurationException { + DOMSource wrappedSource = new DOMSource(); + wrappedSource.setNode(toDocument()); + return wrappedSource; + } + /** + * return Element node from a document node or non document. Use to extract + * the message root element. + * @root node from which the Element node will be extracted. + * @return Element node. + */ + public static Element getElement(Node root) { + Element msgEl = null; + if ( root instanceof Document) { + msgEl = ((Document)root).getDocumentElement(); + } else if (root instanceof Element) { + msgEl = (Element)root; + } else { + NodeList nodeList = root.getChildNodes(); + for ( int i=0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + if ( node instanceof Element ) { + msgEl = (Element) node; + break; + } + } + } + return msgEl; + } + /** + * creates wrapper object from the DOMSource that has wsdl 11 wrapper xml. + * @param wrappedMsg wsdl 11 wrapper xml as DOMSource + * @return WSDL11JBIWrapper representing the wrapper xml. + */ + public static WSDL11JBIWrapper sourceToWrapper(DOMSource wrappedMsg) { + Element jbiMessage = getElement(wrappedMsg.getNode()); + if ( jbiMessage == null ) { + return null; + } + String nsURI = jbiMessage.getNamespaceURI(); + String tagName = jbiMessage.getLocalName(); + if (!WRAPPER_NAMESPACE.equals(nsURI) || !JBI_MESSAGE_EL.equals(tagName)) { + return null; + } + String name = jbiMessage.getAttribute(NAME_ATTR); + String typeQN = jbiMessage.getAttribute(TYPE_ATTR); + String typePrefix = ""; + String typeName = ""; + if ( typeQN != null && typeQN.trim().length() > 0 ) { + int idx = typeQN.indexOf(':'); + if ( idx >= 0 ) { + typePrefix = typeQN.substring(0, idx); + if ( typeQN.length() > idx ) { + typeName = typeQN.substring(idx+1); + } + } else { + typePrefix = ""; + typeName = typeQN; + } + } + String typeURI = jbiMessage.getAttribute("xmlns:" + typePrefix); + QName typeQName = new QName(typeURI, typeName, typePrefix); + + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(typeQName); + NodeList jbiPartList = jbiMessage.getElementsByTagNameNS(WRAPPER_NAMESPACE, JBI_PART_EL); + for ( int i=0; i < jbiPartList.getLength(); ++i) { + Node jbiPart = jbiPartList.item(i); + wrapper.appendPart(jbiPart.getChildNodes()); + } + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object and sets the type and name of the object + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name ) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = new WSDL11JBIWrapper(); + wrapper.setName(name); + wrapper.setType(type); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content has multiple child element. + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, NodeList partContent) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + wrapper.appendPart(partContent); + return wrapper; + } + /** + * creates the WSDL11JBIWrapper object. useful when the message has one part and the + * part content is a single element + * @param type qname of message attribute from wsdl:input, wsdl:output or wsdl:fault + * @param name optional name attribute from wsdl:input, wsdl:output or wsdl:fault + * @param partContent part content as node list + * @return the jbi message wrapper object + */ + public static WSDL11JBIWrapper createWrapper(QName type, String name, Element msgEl) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name, new WSDL11JBIWrapper.NodeListImpl(msgEl)); + return wrapper; + } + + public static WSDL11JBIWrapper createWrapper(QName type, String name, DOMSource inputSource) throws ParserConfigurationException { + WSDL11JBIWrapper wrapper = createWrapper(type, name); + Node msgNode = getElement(inputSource.getNode()); + NodeList nodeList = new WSDL11JBIWrapper.NodeListImpl(msgNode); + wrapper.appendPart(nodeList); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations input element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createInputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Input input = operation.getInput(); + if ( input == null ) { + return null; + } + name = input.getName(); + Message wsdlMsg = input.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createOutputWrapper(Operation operation) throws ParserConfigurationException { + QName type = null; + String name = null; + + Output output = operation.getOutput(); + if ( output == null) { + return null; + } + name = output.getName(); + Message wsdlMsg = output.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * creates the wrapped message using the wsdl4j operations output element for type and name. + * @param msg DOMSource for the unwrapped message + * @param operation wsdl4j operation object representing the operation of the PortType + * @param faultName fault name, can be null to look for the fault with no name. + * @return DOMSource wrapped message as DOMSource + */ + public static WSDL11JBIWrapper createFaultWrapper(Operation operation, String faultName) throws ParserConfigurationException { + QName type = null; + String name = null; + @SuppressWarnings("unchecked") + Map faultMap = operation.getFaults(); + Fault fault = faultMap.get(faultName); + + if ( fault == null ) { + return null; + } + name = fault.getName(); + Message wsdlMsg = fault.getMessage(); + type = wsdlMsg.getQName(); + + WSDL11JBIWrapper wrapper = createWrapper(type, name); + return wrapper; + } + /** + * NodeList implementation. + */ + public static class NodeListImpl extends ArrayList implements NodeList { + + public NodeListImpl() { + super(); + } + + public NodeListImpl(Node aNode) { + super(); + if (aNode != null) { + this.add(aNode); + } + } + + public NodeListImpl(List nodes) { + if (nodes != null) { + this.addAll(nodes); + } + } + + public int getLength() { + return this.size(); + } + + public Node item(int idx) { + return this.get(idx); + } + + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java new file mode 100644 index 000000000..494234431 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/common/wsdl/WSDLProcessor.java @@ -0,0 +1,416 @@ +/* + * WSDLProcessor.java + */ + +package net.openesb.component.BindingComponent-archetype.common.wsdl; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.Operation; +import javax.wsdl.Port; +import javax.wsdl.PortType; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ElementExtensible; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.wsdl.xml.WSDLWriter; +import javax.xml.namespace.QName; + +/** + * This class is used to configure jwsdl(wsdl4j) to read and process wsdl documents with wsdl extensions. + * It provides set of helper methods to read and process the wsdl definitions from files with .wsdl + * extension from a specified directory. + *

+ * A Binding Component that is processing the wsdl extensions for its deployment configuration would + * extend this class and provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + *

+ * A Service Engine that is processing the wsdl during deployment can directly use this class + * to process the wsdl as the default implementation returned by this class configures the wsdl extension + * registry to read/write the service engine binding extensions. + * + * @see AbstractExtensionRegistry + * @see SEBindingExt + * @author chikkala + */ +public class WSDLProcessor { + + private String mXmlCatalogPath = "xml-catalog.xml"; + private String mWsdlDirPath = ""; + private WSDLReader mReader; + + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir) { + this(wsdlDir, null); + } + /** Creates a new instance of WSDLProcessor + */ + public WSDLProcessor(String wsdlDir, String xmlCatPath) { + if ( wsdlDir != null ) { + this.mWsdlDirPath = wsdlDir; + } + if ( xmlCatPath != null ) { + this.mXmlCatalogPath = xmlCatPath; + } + } + /** @return directory path from which this class reads the wsdl files with .wsdl as file extension. */ + public String getWSDLDirectory() { + return this.mWsdlDirPath; + } + /** path to the xml catalog file in the service unit which can be used for Catalog-based entity + * and URI resolution. + */ + public String getXmlCatelogPath() { + return this.mXmlCatalogPath; + } + /** wsdl extension registry required for processing the wsdl extensions in the wsdl definition to + * java model. Binding component that is processing the wsdl extensions for its deployment + * configuration would provide the required ExtensionRegistry that will have the extension serializers + * and deserializers configured to read/write the extensions from/to the java model. + * @return ExtensionSerializer + * @see AbstractExtensionSerializer + */ + protected ExtensionRegistry getExtensionRegistry() { + return new AbstractExtensionRegistry() { + protected List createSerializers() { + return new ArrayList(); + } + }; + } + /** + * @return the WSDLReader configured with extension registry to process the wsdl extensions. + */ + public final WSDLReader getWSDLReader() throws WSDLException { + if ( this.mReader == null ) { + WSDLFactory factory = WSDLFactory.newInstance(); + this.mReader = factory.newWSDLReader(); + // reader.setFeature("javax.wsdl.verbose", true); + // reader.setFeature("javax.wsdl.importDocuments", true); + this.mReader.setExtensionRegistry(getExtensionRegistry()); + } + return this.mReader; + } + /** + * reads the wsdl file and returns the wsdl definition jwsdl model. + * @param wsldFilePath relative path to wsdl file from the the root wsdl directory returns from + * #getWSDLDirectory in the service unit or or absolute path . + * @return Definition + */ + public Definition readWSDL(String wsdlFilePath) throws WSDLException { + File wsdlFile = new File(wsdlFilePath); + if ( !wsdlFile.isAbsolute() ) { + wsdlFile = new File(this.mWsdlDirPath, wsdlFilePath); + } + return getWSDLReader().readWSDL(wsdlFile.getAbsolutePath()); + } + /** + * reads the files with .wsdl file extension in a directory. If the directory should + * be searched recursively, it searches this directory, all child directories of this + * directory and then to their child directories recursively. + * @param dir directory file to search for .wsdl files + * @param rec if set to true, it recursively searches the directory. if set to false, only + * this directory is searched. + * @return List of Files with .wsdl extension. + */ + public List listWSDLFiles(File dir, final boolean rec) throws IOException { + if ( dir == null || !dir.isDirectory()) { + throw new IOException(dir + " is not a directory for looking up wsdl files"); + } + List wsdlList = new ArrayList(); + File[] files = dir.listFiles(new FileFilter() { + public boolean accept(File pathname) { + if ( rec && pathname.isDirectory()) { + return true; + } else { + String name = pathname.getName(); + int idx = name.lastIndexOf('.'); + if ( idx < 0 ) { + return false; + } + String ext = name.substring(idx); + return ".wsdl".equalsIgnoreCase(ext); + } + } + }); + for ( File file : files ) { + if ( rec && file.isDirectory()) { + List wsdlFiles = listWSDLFiles(file, rec); + wsdlList.addAll(wsdlFiles); + } else { + wsdlList.add(file); + } + } + return wsdlList; + } + /** + * reads the files with .wsdl file extension in a directory fromDir and return the list of + * wsdl definitions corresponding to them. + * @param fromDir path to the directory relative to the root wsdl directory returns from + * #getWSDLDirectory or the absolute path to the directory. + */ + public List readWSDLs(String fromDir) throws WSDLException { + if ( fromDir == null ) { fromDir = ""; } + File wsdlDir = new File(fromDir); + if (!wsdlDir.isAbsolute()) { + wsdlDir = new File(this.mWsdlDirPath, fromDir); + } + + List wsdlFiles = new ArrayList(); + try { + wsdlFiles = listWSDLFiles(wsdlDir, true); + } catch (IOException ioEx) { + throw new WSDLException("WSDLFileReadError", ioEx.getMessage(),ioEx); + } + + List wsdlPaths = new ArrayList(); + for ( File wsdlFile : wsdlFiles) { + wsdlPaths.add(wsdlFile.getAbsolutePath()); + } + Collections.sort(wsdlPaths); + + List wsdlList = new ArrayList(); + for ( String wsdlPath : wsdlPaths ) { + Definition wsdlDef = readWSDL(wsdlPath); + wsdlList.add(wsdlDef); + } + return wsdlList; + } + /** + * finds PortType using port type ( interface ) qname. + */ + public static PortType findInterface(Definition wsdlDef, QName interfaceName) { + return wsdlDef.getPortType(interfaceName); + } + /** finds the Service using service qname */ + public static Service findService(Definition wsdlDef, QName serviceName) { + return wsdlDef.getService(serviceName); + } + /** finds the wsdl port using service qname and endpoint name */ + public static Port findServiceEndpoint(Definition wsdlDef, QName serviceName, String endpointName) { + Service service = null; + Port port = null; + service = findService(wsdlDef, serviceName); + if ( service != null ) { + port = service.getPort(endpointName); + } + return port; + } + /** + * finds the binding definition to which the service with serviceName and endpointName was bound. + */ + public static Binding findServiceBinding(Definition wsdlDef, QName serviceName, String endpointName) { + Binding binding = null; + Port port = findServiceEndpoint(wsdlDef, serviceName, endpointName); + if ( port != null ) { + binding = port.getBinding(); + } + return binding; + } + /** + * finds the binding definition using the interface(portType) qname with a + */ + public static Binding findInterfaceBinding(Definition wsdlDef, + QName interfaceQName, QName extQName) { + Map bindingMap = wsdlDef.getBindings(); + @SuppressWarnings("unchecked") + Collection bindings = bindingMap.values(); + for ( Binding binding : bindings ) { + if ( binding.getPortType().getQName().equals(interfaceQName)) { + return binding; + } + } + return null; + } + + /** + * find the wsdl4j operation corresponds to the interface+operation. + * @param wsdlDef wsdl definition + * @param portTypeQName portType QName + * @param opName operation name. if null, first operation in the portType + * is returned. + * @return Operation corresponding to the portType+opName + */ + public static Operation findOperation(Definition wsdlDef, + QName portTypeQName, String opName) { + Operation operation = null; + PortType portType = wsdlDef.getPortType(portTypeQName); + if ( portType != null ) { + if ( opName != null ) { + operation = portType.getOperation(opName, null, null); + } else { + @SuppressWarnings("unchecked") + List list = portType.getOperations(); + if ( list != null && list.size() > 0 ) { + operation = list.get(0); + } + } + } + return operation; + } + /** + * verifies whether the wsdl definition contains the specified service descriptions or not. Used + * to locate the wsdl definition for the services describes in service unit deployment + * descriptor(jbi.xm). + * @param interfaceName portType qname to find in the definition. can be null if you are trying to + * find only service endpoint description. + * @param serviceName qname for the service to find in this wsdl. can be null if + * you are trying to find only portType (abstract service) description. + * @param endpointName port name to find in the service definition. null if only + * service with any port should be looked up. + * + * @return true if the wsdl definition contains the specified service description. + */ + public static boolean isWSDLFor(Definition wsdlDef, + QName interfaceName, QName serviceName, String endpointName) { + PortType portType = null; + Service service = null; + Port port = null; + if ( interfaceName != null ) { + portType = findInterface(wsdlDef, interfaceName); + } + + if ( serviceName != null ) { + service = findService(wsdlDef, serviceName); + } + + if ( endpointName != null && service != null ) { + port = service.getPort(endpointName); + } + + boolean isWSDL = true; + + if ( (interfaceName != null && portType == null) || + ( serviceName != null && service == null ) || + ( endpointName != null && (service == null || port == null)) ) { + isWSDL = false; + } + + return isWSDL; + } + /** + * creates a binding definition that contains a service engine binding elements in the specified + * wsdl definition for a portType. It will try to find/create the binding element with interface + * local name with a "_JBISEBinding" suffix and add service engine binding element to it if it + * is not present. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding createServiceEngineBinding(Definition wsdl, QName interfaceName) { + QName bindingQName = new QName(wsdl.getQName().getNamespaceURI(), + interfaceName.getLocalPart() + "_JBISEBinding"); + Binding binding = wsdl.getBinding(bindingQName); + if ( binding == null ) { + binding = wsdl.createBinding(); + binding.setQName(bindingQName); + binding.setPortType(wsdl.getPortType(interfaceName)); + binding.setUndefined(false); + + ExtensibilityElement bindingExt = + SEBindingExt.SEBindingExtImpl.addExtensibilityElement(wsdl, binding); + + wsdl.addBinding(binding); + } + return binding; + } + /** + * creates port and binding elements that provide the the service engine binding for a service. + * @param wsdl wsdl definition + * @param interfaceName portType qname to which the binding is created. + * @param serviceName service under which the port definition bound to the service engine binding + * should be created. + * @param endpointName port name. + * @return a Binding contains service engine binding that is created for the portType. + */ + public Binding createServiceEngineBinding(Definition wsdl, QName interfaceName, QName serviceName, String endpointName ) { + Binding binding = null; + Service service = findService(wsdl, serviceName); + if ( service == null ) { + return null; + } + Port port = service.getPort(endpointName); + if ( port != null ) { + binding = port.getBinding(); + } else { + // create port + port = wsdl.createPort(); + port.setName(endpointName); + binding = createServiceEngineBinding(wsdl, interfaceName); + port.setBinding(binding); + service.addPort(port); + } + return binding; + } + /** prints the wsdl to text from the wsdl definition */ + public static void printWSDL(PrintWriter out, Definition def) { + try { + WSDLFactory factory = WSDLFactory.newInstance(); + WSDLWriter wsdlWriter = factory.newWSDLWriter(); + wsdlWriter.writeWSDL(def, out); + } catch (WSDLException ex) { + ex.printStackTrace(out); + } + } + /** prints the wsdl to text from the wsdl definition */ + public static String printWSDLToString(Definition def) { + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + printWSDL(out, def); + out.close(); + return writer.getBuffer().toString(); + } + /** returns an existing namespace prefix or create one if not exists for the corresponding namespaceURI */ + public static String getNamespacePrefix(Definition def, String namespaceURI, String defPrefix) { + String prefix = null; + prefix = def.getPrefix(namespaceURI); + if ( prefix == null ) { + Set keySet = def.getNamespaces().keySet(); + String newPrefix = "ns"; + if ( defPrefix != null && defPrefix.trim().length() > 0 ){ + newPrefix = defPrefix; + } + prefix = newPrefix; + for ( int i=0; i < Integer.MAX_VALUE; ++i) { + if (!keySet.contains(prefix)) { + break; + } else { + prefix = newPrefix + i; + } + } + } + return prefix; + } + + /** + * creates and adds the jbi service engine binding extensibility element to the wsdl definition + * under specified binding definition. + */ + public static void addExtensibilityElement(Definition wsdlDef, + ElementExtensible extensibleEl, ExtensibilityElement extEl, String defPrefix) { + QName elementType = extEl.getElementType(); + String namespaceURI = elementType.getNamespaceURI(); + String prefix = wsdlDef.getPrefix(namespaceURI); + if ( prefix == null ) { + // no namespace prefix defined. create one. + prefix = WSDLProcessor.getNamespacePrefix(wsdlDef, namespaceURI, defPrefix); + wsdlDef.addNamespace(prefix, namespaceURI); + } + extensibleEl.addExtensibilityElement(extEl); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/BindingExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/BindingExt.java new file mode 100644 index 000000000..a2c60c2ae --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/BindingExt.java @@ -0,0 +1,98 @@ +/* + * BindingExt.java + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.Binding; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * extension element. The inner classes BindingExtImpl implements the interface + * and the BindingExtSerializer provides the serializer and deserializer + * implementation. The implementation and serializer classes will be registered + * with the ExtensionRegistry to process the binding extension element in the + * wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface BindingExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + //TODO: define get/set methods for properties for BindingExt if the extension element has attributes. + + /** + * This class is an implementation of BindingExt interface that provides + * java model for binding extensibility element. + */ + public static class BindingExtImpl extends AbstractExtensibilityElement implements BindingExt { + + public BindingExtImpl() { + setElementType(QN_BINDING_EXT); + } + + /** + * creates and adds the binding extensibility element to the wsdl + * definition + */ + public static BindingExtImpl addExtensibilityElement(Definition wsdlDef, Binding binding) { + BindingExtImpl bindingExt = new BindingExt.BindingExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, binding, bindingExt, NS_DEF_PREFIX); + return bindingExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding extensibility element. + */ + public static class BindingExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public BindingExtSerializer() { + super(Binding.class, QN_BINDING_EXT, BindingExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + BindingExt extObj = (BindingExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + BindingExt extObj = (BindingExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_BINDING_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=\"" + myAttr + "\""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java new file mode 100644 index 000000000..2ac3598e7 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/ExtConstants.java @@ -0,0 +1,49 @@ +/* + * ExtConstants.java + * + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import javax.xml.namespace.QName; + +/** + * This interface defines the constants for the namespace, elements, attributes + * and qnames corresponding to the wsdl extensions that this component + * processes. These constants will be used in the wsdl extension model used to + * process a particular wsdl extensions. + * + * @see WSDLExtensionRegistry + * @see PortExt + * @see BindingExt + * @author chikkala + */ +public interface ExtConstants { + + public static final String NS_URI_WSDL = "http://schemas.xmlsoap.org/wsdl/"; + public static final String NS_URI_XMLNS = "http://www.w3.org/2000/xmlns/"; + /** + * wsdl extension namespace processed by this wsdl extension model + */ + public static final String NS_URI = "http://java.sun.com/jbi/wsdl-extensions/sample/jmx-bc/"; + public static final String NS_DEF_PREFIX = "jmxbc"; + // wsdl extension element names. + public static final String EL_BINDING_EXT = "binding"; + public static final String EL_OPERATION_EXT = "operation"; + public static final String EL_INPUT_EXT = "input"; + public static final String EL_OUTPUT_EXT = "output"; + public static final String EL_FAULT_EXT = "fault"; + public static final String EL_PORT_EXT = "address"; + // Qualified wsdl extension element names. + public static final QName QN_BINDING_EXT = new QName(NS_URI, EL_BINDING_EXT); + public static final QName QN_OPERATION_EXT = new QName(NS_URI, EL_OPERATION_EXT); + public static final QName QN_INPUT_EXT = new QName(NS_URI, EL_INPUT_EXT); + public static final QName QN_OUTPUT_EXT = new QName(NS_URI, EL_OUTPUT_EXT); + public static final QName QN_FAULT_EXT = new QName(NS_URI, EL_FAULT_EXT); + public static final QName QN_PORT_EXT = new QName(NS_URI, EL_PORT_EXT); + // wsdl extension elements attribute names. + public static final String ATTR_ACTION = "action"; + public static final String ATTR_SERVICE_URL = "serviceURL"; + public static final String ATTR_USERNAME = "username"; + public static final String ATTR_PASSWORD = "password"; + public static final String ATTR_MBEAN = "mbean"; +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/FaultExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/FaultExt.java new file mode 100644 index 000000000..5ad2b4d8b --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/FaultExt.java @@ -0,0 +1,98 @@ +/* + * FaultExt.java + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingFault; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation fault extension element. The inner classes FaultExtImpl implements + * the interface and the FaultExtSerializer provides the serializer and + * deserializer implementation. The implemenation and serializer classes will be + * registered with the ExtensionRegistry to process the binding operation fault + * extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface FaultExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define getter methods for properties for FaultExt if the extension element has attributes. + /** + * This class is an implementation of FaultExt interface that provides java + * model for binding operation fault extensibility element. + */ + public static class FaultExtImpl extends AbstractExtensibilityElement implements FaultExt { + + public FaultExtImpl() { + setElementType(QN_FAULT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static FaultExtImpl addExtensibilityElement(Definition wsdlDef, BindingFault fault) { + FaultExtImpl faultExt = new FaultExt.FaultExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, fault, faultExt, NS_DEF_PREFIX); + return faultExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation fault extensibility element. + */ + public static class FaultExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public FaultExtSerializer() { + super(BindingFault.class, QN_FAULT_EXT, FaultExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + FaultExt extObj = (FaultExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + FaultExt extObj = (FaultExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_FAULT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=\"" + myAttr + "\""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/InputExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/InputExt.java new file mode 100644 index 000000000..0a8c15af8 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/InputExt.java @@ -0,0 +1,98 @@ +/* + * InputExt.java + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingInput; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation input extension element. The inner classes InputExtImpl implements + * the interface and the InputExtSerializer provides the serislizer and + * deserializer implementation. The implementation and serializer classes will + * be registered with the ExtensionRegistry to process the binding operation + * input extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface InputExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define get/set methods for properties for InputExt if the extension element has attributes. + /** + * This class is an implementation of InputExt interface that provides java + * model for binding operation input extensibility element. + */ + public static class InputExtImpl extends AbstractExtensibilityElement implements InputExt { + + public InputExtImpl() { + setElementType(QN_INPUT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static InputExtImpl addExtensibilityElement(Definition wsdlDef, BindingInput input) { + InputExtImpl inputExt = new InputExt.InputExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, input, inputExt, NS_DEF_PREFIX); + return inputExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation input extensibility element. + */ + public static class InputExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public InputExtSerializer() { + super(BindingInput.class, QN_INPUT_EXT, InputExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + InputExt extObj = (InputExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + InputExt extObj = (InputExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_INPUT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=\"" + myAttr + "\""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/OperationExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/OperationExt.java new file mode 100644 index 000000000..354f70fcb --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/OperationExt.java @@ -0,0 +1,118 @@ +/* + * OperationExt.java + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingOperation; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation extension element. The inner classes OperationImpl implements the + * interface and the OperationExtSerializer provides the serilizer and + * deserializer implementation. The implementation and serializer classes will + * be registered with the ExtensionRegistry to process the binding operation + * extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface OperationExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + /** + * Getter for property action. + * + * @return Value of property action. + */ + public String getAction(); + + /** + * Setter for property action. + * + * @param action New value of property action. + */ + public void setAction(String action); + + /** + * This class is an implementation of OperationExt interface that provides + * java model for binding operation extensibility element. + */ + public static class OperationExtImpl extends AbstractExtensibilityElement implements OperationExt { + + private String mAction; + + public OperationExtImpl() { + setElementType(QN_OPERATION_EXT); + } + + public String getAction() { + return this.mAction; + } + + public void setAction(String action) { + this.mAction = action; + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static OperationExtImpl addExtensibilityElement(Definition wsdlDef, BindingOperation operation) { + OperationExtImpl operationExt = new OperationExt.OperationExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, operation, operationExt, NS_DEF_PREFIX); + return operationExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation extensibility element. + */ + public static class OperationExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public OperationExtSerializer() { + super(BindingOperation.class, QN_OPERATION_EXT, OperationExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + OperationExt extObj = (OperationExt) extReg.createExtension(parentType, elementType); + String action = el.getAttribute(ATTR_ACTION); + extObj.setAction(action); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + OperationExt extObj = (OperationExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_OPERATION_EXT); + buff.append("<" + elName); + + String action = extObj.getAction(); + if (action != null && action.trim().length() > 0) { + buff.append(" " + ATTR_ACTION + "=\"" + action + "\""); + } + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/OutputExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/OutputExt.java new file mode 100644 index 000000000..4a7ddc5f5 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/OutputExt.java @@ -0,0 +1,98 @@ +/* + * OutputExt.java + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.BindingOutput; +import javax.wsdl.Definition; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for binding + * operation output extension element. The inner classes OutputExtImpl + * implements the interface and the OutputExtSerializer provides the serilizer + * and deserializer implementation. The implementation and serializer classes + * will be registered with the ExtensionRegistry to process the binding + * operation output extension element in the wsdl definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface OutputExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + //TODO: define get/set methods for properties for OutputExt if the extension element has attributes. + /** + * This class is an implementation of OutputExt interface that provides java + * model for binding operation output extensibility element. + */ + public static class OutputExtImpl extends AbstractExtensibilityElement implements OutputExt { + + public OutputExtImpl() { + setElementType(QN_OUTPUT_EXT); + } + + /** + * creates and adds the binding operation fault extensibility element to + * the wsdl definition + */ + public static OutputExtImpl addExtensibilityElement(Definition wsdlDef, BindingOutput output) { + OutputExtImpl OutputExt = new OutputExt.OutputExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, output, OutputExt, NS_DEF_PREFIX); + return OutputExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * binding operation output extensibility element. + */ + public static class OutputExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public OutputExtSerializer() { + super(BindingOutput.class, QN_OUTPUT_EXT, OutputExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + OutputExt extObj = (OutputExt) extReg.createExtension(parentType, elementType); + //TODO: set any attributes from the el to extension object + // String myAttr = el.getAttribute(ATTR_MY_ATTR); + // extObj.setMyAttr(myAttr); + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + OutputExt extObj = (OutputExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_OUTPUT_EXT); + buff.append("<" + elName); + + //TODO: append any attributes from extension obj to the element + // String myAttr = extObj.getMyAttr(); + // if ( myAttr != null && myAttr.trim().length() > 0 ) { + // buff.append(" myAttr=\"" + myAttr + "\""); + // } + // + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/PortExt.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/PortExt.java new file mode 100644 index 000000000..16736a13e --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/PortExt.java @@ -0,0 +1,214 @@ +/* + * PortExt.java + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensibilityElement; +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensionSerializer; +import net.openesb.component.BindingComponent-archetype.common.wsdl.WSDLProcessor; +import java.io.PrintWriter; +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.ExtensionRegistry; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + +/** + * This interface and its implementation represents the java model for port + * extension element. The inner classes PortExtImpl implements the interface and + * the PortExtSerializer provides the serializer and deserializer implemenation. + * The implementation and serializer classes will be registered with the + * ExtensionRegistry to process the port extension element in the wsdl + * definition. + * + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensibilityElement + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionSerializer + * @see com.sun.jbi.sample.component.common.wsdl.AbstractExtensionRegistry + * @author chikkala + */ +public interface PortExt extends ExtConstants, ExtensibilityElement, java.io.Serializable { + + /** + * Getter for property serviceURL. + * + * @return Value of property serviceURL. + */ + public String getServiceURL(); + + /** + * Setter for property serviceURL. + * + * @param serviceURL New value of property serviceURL. + */ + public void setServiceURL(String serviceURL); + + /** + * Getter for property username. + * + * @return Value of property username. + */ + public String getUsername(); + + /** + * Setter for property username. + * + * @param username New value of property username. + */ + public void setUsername(String username); + + /** + * Getter for property password. + * + * @return Value of property password. + */ + public String getPassword(); + + /** + * Setter for property password. + * + * @param password New value of property password. + */ + public void setPassword(String password); + + /** + * Getter for property name. + * + * @return Value of property name. + */ + public String getMBean(); + + /** + * Setter for property mbean. + * + * @param name New value of property mbean. + */ + public void setMBean(String mbean); + + /** + * This class is an implementation of PortExt interface that provides java + * model for port extensibility element. + */ + public static class PortExtImpl + extends AbstractExtensibilityElement implements PortExt { + + private String mServiceURL; + private String mUsername; + private String mPassword; + private String mMBean; + + public PortExtImpl() { + setElementType(QN_PORT_EXT); + } + + public String getServiceURL() { + return this.mServiceURL; + } + + public void setServiceURL(String serviceURL) { + this.mServiceURL = serviceURL; + } + + public String getUsername() { + return this.mUsername; + } + + public void setUsername(String username) { + this.mUsername = username; + } + + public String getPassword() { + return this.mPassword; + } + + public void setPassword(String password) { + this.mPassword = password; + } + + public String getMBean() { + return this.mMBean; + } + + public void setMBean(String mbean) { + this.mMBean = mbean; + } + + /** + * creates and adds the port extensibility element to the wsdl + * definition + */ + public static PortExtImpl addExtensibilityElement(Definition wsdlDef, Port port) { + PortExtImpl portExt = new PortExt.PortExtImpl(); + WSDLProcessor.addExtensibilityElement(wsdlDef, port, portExt, NS_DEF_PREFIX); + return portExt; + } + } + + /** + * This class provides the serializer and deserializer implementation for + * port extensibility element. + */ + public static class PortExtSerializer extends AbstractExtensionSerializer implements ExtConstants { + + public PortExtSerializer() { + super(Port.class, QN_PORT_EXT, PortExtImpl.class); + } + + @Override + public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, + Definition def, ExtensionRegistry extReg) throws WSDLException { + + PortExt extObj = (PortExt) extReg.createExtension(parentType, elementType); + + String serviceURL = el.getAttribute(ATTR_SERVICE_URL); + extObj.setServiceURL(serviceURL); + + String mbean = el.getAttribute(ATTR_MBEAN); + extObj.setMBean(mbean); + + String username = el.getAttribute(ATTR_USERNAME); + extObj.setUsername(username); + + String password = el.getAttribute(ATTR_PASSWORD); + extObj.setPassword(password); + + return extObj; + } + + @Override + public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, + PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { + + PortExt extObj = (PortExt) extension; + StringBuffer buff = new StringBuffer(); + + String elName = getQualifiedName(def, NS_URI, EL_PORT_EXT); + buff.append("<" + elName); + + String serviceURL = extObj.getServiceURL(); + if (serviceURL != null && serviceURL.trim().length() > 0) { + buff.append(" " + ATTR_SERVICE_URL + "=\"" + serviceURL + "\""); + } + + String mbean = extObj.getMBean(); + if (mbean != null && mbean.trim().length() > 0) { + buff.append(" " + ATTR_MBEAN + "=\"" + mbean + "\""); + } + + String username = extObj.getUsername(); + if (username != null && username.trim().length() > 0) { + buff.append(" " + ATTR_USERNAME + "=\"" + username + "\""); + } + + String password = extObj.getUsername(); + if (password != null && password.trim().length() > 0) { + buff.append(" " + ATTR_PASSWORD + "=\"" + password + "\""); + } + + buff.append("/>"); + pw.println(buff.toString()); + + } + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java new file mode 100644 index 000000000..a4adafe4f --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtHelper.java @@ -0,0 +1,220 @@ +/* + * WSDLExtHelper.java + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import java.util.List; +import javax.wsdl.Binding; +import javax.wsdl.BindingFault; +import javax.wsdl.BindingInput; +import javax.wsdl.BindingOperation; +import javax.wsdl.BindingOutput; +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.xml.namespace.QName; + +/** + * This class is a helper class for processing the wsdl extensions. It has + * methods that help locate the extension elements and return the java models + * corresponds to the extension elements. + * + * @author chikkala + */ +public final class WSDLExtHelper { + + /** + * creates the java object for the port extension element. + * + * @param def wsdl definition + * @param serviceName QName of the service + * @param endpointName name of the port under which to lookup for the port + * extension. + * @return java object for the port extension element + */ + public static PortExt getPortExt(Definition def, QName serviceName, String endpointName) { + PortExt portExt = null; + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + @SuppressWarnings("unchecked") + List extElList = port.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof PortExt) { + portExt = (PortExt) extEl; + break; + } + } + return portExt; + } + + /** + * creates the java object for the binding extension element. + * + * @param def wsdl definition + * @param binding binding under which to lookup for the binding extension. + * @return java object for the port extension element + */ + public static BindingExt getBindingExt(Definition def, Binding binding) { + BindingExt bindingExt = null; + @SuppressWarnings("unchecked") + List extElList = binding.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof BindingExt) { + bindingExt = (BindingExt) extEl; + break; + } + } + return bindingExt; + } + + /** + * creates the java object for the binding extension element. + * + * @param def wsdl definition + * @param serviceName QName of the service + * @param endpointName name of the port that references the binding. + * @return java object for the port extension element + */ + public static BindingExt getBindingExt(Definition def, QName serviceName, String endpointName) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getBindingExt(def, binding); + } + + /** + * @return OperationExt java object corresponding to the operation extension + * element under binding + */ + public static OperationExt getOperationExt(Definition def, Binding binding, String operation) { + OperationExt operationExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, null); + if (bindingOp != null) { + @SuppressWarnings("unchecked") + List extElList = bindingOp.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof OperationExt) { + operationExt = (OperationExt) extEl; + break; + } + } + } + return operationExt; + } + + /** + * @return OperationExt java object corresponding to the operation extension + * element under binding + */ + public static OperationExt getOperationExt(Definition def, QName serviceName, String endpointName, String operation) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getOperationExt(def, binding, operation); + } + + /** + * @return InputExt java object corresponding to input extension element of + * the the binding operation under binding + */ + public static InputExt getInputExt(Definition def, Binding binding, + String operation, String input) { + InputExt inputExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, input, null); + if (bindingOp != null) { + BindingInput bindingInput = bindingOp.getBindingInput(); + @SuppressWarnings("unchecked") + List extElList = bindingInput.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof InputExt) { + inputExt = (InputExt) extEl; + break; + } + } + } + return inputExt; + } + + /** + * @return InputExt java object corresponding to input extension element of + * the the binding operation under binding + */ + public static InputExt getInputExt(Definition def, + QName serviceName, String endpointName, String operation, String input) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getInputExt(def, binding, operation, input); + } + + /** + * @return OutputExt java object corresponding to output extension element + * of the the binding operation under binding + */ + public static OutputExt getOutputExt(Definition def, Binding binding, + String operation, String output) { + OutputExt outputExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, output); + if (bindingOp != null) { + BindingOutput bindingOutput = bindingOp.getBindingOutput(); + @SuppressWarnings("unchecked") + List extElList = bindingOutput.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof OutputExt) { + outputExt = (OutputExt) extEl; + break; + } + } + } + return outputExt; + } + + /** + * @return OutputExt java object corresponding to output extension element + * of the the binding operation under binding + */ + public static OutputExt getOutputExt(Definition def, + QName serviceName, String endpointName, String operation, String output) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getOutputExt(def, binding, operation, output); + } + + /** + * @return FaultExt java object corresponding to fault extension element of + * the the binding operation under binding + */ + public static FaultExt getFaultExt(Definition def, Binding binding, + String operation, String faultName) { + FaultExt faultExt = null; + BindingOperation bindingOp = binding.getBindingOperation(operation, null, null); + if (bindingOp != null) { + BindingFault bindingFault = bindingOp.getBindingFault(faultName); + if (bindingFault != null) { + @SuppressWarnings("unchecked") + List extElList = bindingFault.getExtensibilityElements(); + for (ExtensibilityElement extEl : extElList) { + if (extEl instanceof FaultExt) { + faultExt = (FaultExt) extEl; + break; + } + } + } + } + return faultExt; + } + + /** + * @return FaultExt java object corresponding to fault extension element of + * the the binding operation under binding + */ + public static FaultExt getFaultExt(Definition def, + QName serviceName, String endpointName, String operation, String faultName) { + Service wsdlService = def.getService(serviceName); + Port port = wsdlService.getPort(endpointName); + Binding binding = port.getBinding(); + return getFaultExt(def, binding, operation, faultName); + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd new file mode 100644 index 000000000..1311a03c9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtension.xsd @@ -0,0 +1,98 @@ + + + + + + + + + "binding" defines a protocol based binding details. + + + + + + + + + + + + + + "operation" defines the protocol based binding operation details. + + + + + + + + + + + + + + + "input" defines the protocol based binding input details. + + + + + + + + + + + + + + "output" defines the protocol based binding output details. + + + + + + + + + + + + + + "fault" defines the protocol based binding fault details. + + + + + + + + + + + + + + "address" indicates protocol based binding port details. + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java new file mode 100644 index 000000000..3405bdd3c --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/src/java/net/openesb/component/cname/wsdlext/WSDLExtensionRegistry.java @@ -0,0 +1,43 @@ +/* + * WSDLExtensionRegistry.java + */ +package net.openesb.component.BindingComponent-archetype.wsdlext; + +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensionRegistry; +import net.openesb.component.BindingComponent-archetype.common.wsdl.AbstractExtensionSerializer; +import java.util.ArrayList; +import java.util.List; + +/** + * This class extends + * AbstractExtensionRegistry to create the serializers and deserializers + * for processing wsdl extensions. + * + * @see AbstractExtensionRegistry + * @author chikkala + */ +public class WSDLExtensionRegistry extends AbstractExtensionRegistry { + + /** + * Creates a new instance of JMXBindingExtensionRegistry + */ + public WSDLExtensionRegistry() { + super(); + } + + /** + * creates serializers and deserializers for all the extension elements + */ + protected List createSerializers() { + List list = new ArrayList(); + + list.add(new BindingExt.BindingExtSerializer()); + list.add(new OperationExt.OperationExtSerializer()); + list.add(new InputExt.InputExtSerializer()); + list.add(new OutputExt.OutputExtSerializer()); + list.add(new FaultExt.FaultExtSerializer()); + list.add(new PortExt.PortExtSerializer()); + + return list; + } +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/BindingComponentTest.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/BindingComponentTest.java new file mode 100644 index 000000000..d61cd6a06 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/BindingComponentTest.java @@ -0,0 +1,52 @@ +/* + * BindingComponent-archetypeTest.java + */ +package bindingtest; +import net.openesb.component.BindingComponent-archetype.test.JBIComponentTestClient; +import net.openesb.component.BindingComponent-archetype.test.JMXBindingTestClient; +import java.util.Properties; + import junit.framework.TestCase; + +/** + * The test method in this testcase uses the JMXBindingTestClient to send the + * input document to the echo service provided by service engine via the binding + * component by sending the input to the binding using jmx interface. The output + * received from the service invocation will be placed in test results directory + * under the same package as this test case. + * @see com.sun.jbi.sample.component.test.JMXBindingTestClinet + * + * @author chikkala + */ +public class BindingComponentTest + extends TestCase +{ + + public BindingComponentTest(String testName) { + super(testName); + } + + public void test1() throws Exception { + String testPropertiesPath = "test1.properties"; + JBIComponentTestClient testClient = new JMXBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public void test2() throws Exception { + String testPropertiesPath = "test2.properties"; + JBIComponentTestClient testClient = new JMXBindingTestClient(); + Properties testProps = testClient.loadTestProperties(this.getClass(), testPropertiesPath); + testClient.testService(testProps); + } + + public static void main(String[] args) { + try { + BindingComponentTest compTest = new BindingComponentTest("BindingComponentTest"); + compTest.test1(); + compTest.test2(); + } catch(Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test1.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test1.properties new file mode 100644 index 000000000..f883e1000 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test1.properties @@ -0,0 +1,13 @@ +# Sample ResourceBundle properties file + +#### test properties for testing the binding component +input.file=test1Input.xml +#exptected.file=Expected.xml +output.file=test1Output.xml + +consumer.jmx.bc.ep.operation=sayHello +consumer.jmx.bc.ep.address.mbean=com.sun.jbi.sample.jmxbc:jmxbc-ep-address=BindingComponent/greetings +consumer.jmx.bc.ep.address.serviceURL=service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi +consumer.jmx.bc.ep.address.username=admin +consumer.jmx.bc.ep.address.password=this really long string is used to identify a password that has been stored in the Keyring + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test1Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test1Input.xml new file mode 100644 index 000000000..cc869a4d2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test1Input.xml @@ -0,0 +1,9 @@ + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test2.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test2.properties new file mode 100644 index 000000000..446c4b1ec --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test2.properties @@ -0,0 +1,12 @@ +# Sample ResourceBundle properties file + +#### test properties for testing the binding component +input.file=test2Input.xml +#exptected.file=Expected.xml +output.file=test2Output.xml + +consumer.jmx.bc.ep.operation=sayGoodbye +consumer.jmx.bc.ep.address.mbean=com.sun.jbi.sample.jmxbc:jmxbc-ep-address=BindingComponent/greetings +consumer.jmx.bc.ep.address.serviceURL=service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi +consumer.jmx.bc.ep.address.username=admin +consumer.jmx.bc.ep.address.password=this really long string is used to identify a password that has been stored in the Keyring diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test2Input.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test2Input.xml new file mode 100644 index 000000000..a4f7ed4d2 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/bindingtest/test2Input.xml @@ -0,0 +1,9 @@ + + + + Srinivasan + Chikkala + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java new file mode 100644 index 000000000..1875cc924 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/JBIComponentTestClient.java @@ -0,0 +1,295 @@ +/* + * JBIComponentTestClient.java + */ + +package net.openesb.component.BindingComponent-archetype.test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Properties; + +/** + * This class implements the base framework for the testing the JBI components. + * Testing the JBI component involves may require deploying a service to the + * component(s) to enable the service provided by the test component and then + * invoking the service provided by the test component. If the test component is + * a binding component, then a service provider component such as sample service + * engine is required to test the component end to end. If the test component is a + * service engine, then the service on the test component can be invoked via + * soap/http binding component. + * + * This class provides the utilites to read the test properties, read the input + * message from the file and save the output to the file. The testService + * method implemented here can be executed as the test for the component. The + * testService method calls the invokeService method with the input document and + * expects a output document or error that will be saved to the output file. + * The method invokeService should be implemented by the extended test classes to + * inplement a suitable service consumer implemenation for the test compoent. + * See JMXBindingTestClient.java or SOAPBidningTestClient.java for more details + * on how to implement a partucular test service consumer. + * + * @author chikkala + */ +public abstract class JBIComponentTestClient { + + public static final String TEST_PROPS_FILE_PROP = "test.properties.file"; + public static final String TEST_RESULTS_DIR_PROP = "test.results.dir"; + public static final String TEST_SRC_DIR_PROP = "test.src.dir"; + + public static final String TEST_PACKAGE_PROP = "test.package.name"; + + public static final String INPUT_FILE_PROP = "input.file"; + public static final String EXPECTED_FILE_PROP = "expected.file"; + public static final String OUTPUT_FILE_PROP = "output.file"; + + public static final String DEF_TEST_PROP_FILE = "test.properties"; + public static final String DEF_INPUT_FILE = "Input.xml"; + public static final String DEF_OUTPUT_FILE = "Output.xml"; + public static final String DEF_TEST_RESULTS_DIR = "test-results"; + + public JBIComponentTestClient() { + } + /** + * returns the absolute resource path w.r.t. the packagePath if the resource name + * is relative else return the resourceName as it is. + * @param package name ( dot separated ) + * @param resourcName dot separated name or a absolute resource path + * @return abosolute resource path with path separator + */ + public static String resolveResourcePath(String packageName, String resourceName) { + String resourcePath = resourceName; + if ( !resourceName.startsWith("/")) { + // it is relative resource file. resolve it w.r.t. testPackage + String pkgDir = packageName.trim().replace('.', '/'); + if ( pkgDir.length() != 0 ) { + pkgDir += "/"; + } + resourcePath = "/" + pkgDir + resourceName; + } + return resourcePath; + } + /** + * loads the resource file as properties. + * @param testPackage package name where this test belongs + * @param testPropPath resource path relative to testPackage or absolute resource path + */ + public Properties loadTestProperties(String testPackage, String testPropPath) throws IOException { + String propsResourcePath = resolveResourcePath(testPackage, testPropPath); + + InputStream testPropIS = null; + try { + testPropIS = this.getClass().getResourceAsStream(propsResourcePath); + Properties testProps = new Properties(); + testProps.load(testPropIS); + testProps.setProperty(TEST_PACKAGE_PROP, testPackage); + return testProps; + } finally { + if ( testPropIS != null ) { + try { + testPropIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @param testPropPath resource path relative to testPackage or absolute resource path + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass, String testPropPath) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), testPropPath ); + } + /** + * load default test properties file in the testClass package. + * @param testClass Class where to look for the default test properties + * @return Properties test properties + */ + public Properties loadTestProperties(Class testClass) throws IOException { + return loadTestProperties(testClass.getPackage().getName(), DEF_TEST_PROP_FILE ); + } + /** + * loads the resource file to string bugger + * @param inputFile resource file path + */ + public StringBuffer loadResourceFile(String resourcePath) throws FileNotFoundException, IOException { + + InputStream inputIS = null; + InputStreamReader inputReader = null; + BufferedReader reader = null; + StringWriter strWriter = null; + PrintWriter writer = null; + try { + inputIS = this.getClass().getResourceAsStream(resourcePath); + inputReader = new InputStreamReader(inputIS); + reader = new BufferedReader(inputReader); + strWriter = new StringWriter(); + writer = new PrintWriter(strWriter); + for ( String line = null; (line = reader.readLine()) != null ; ) { + writer.println(line); + } + writer.close(); + strWriter.close(); + return strWriter.getBuffer(); + } finally { + if ( inputIS != null ) { + try { + inputIS.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + + /** + * reads data from the reader and saves to file + * @param reader reader from which to read the data and save to file + * @param outputFilePath absolute file path + */ + public void saveOutputToFile(Reader reader, String outputFilePath) throws IOException { + + BufferedReader buff = null; + FileWriter fileWriter = null; + PrintWriter writer = null; + try { + buff = new BufferedReader(reader); + fileWriter = new FileWriter(outputFilePath); + writer = new PrintWriter(fileWriter); + for ( String line = null; (line = buff.readLine()) != null ; ) { + writer.println(line); + } + } finally { + if ( writer != null ) { + writer.close(); + } + if ( fileWriter != null ) { + fileWriter.close(); + } + } + } + + /** + * resource path. + */ + public String getInputFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String inputFile = testProps.getProperty(INPUT_FILE_PROP, DEF_INPUT_FILE); + String resourcePath = resolveResourcePath(testPkg, inputFile); + return resourcePath; + } + /** + * return resource path + */ + public String getExpectedFileResourcePath(Properties testProps) { + + String testPkg = testProps.getProperty(TEST_PACKAGE_PROP, ""); + String resourcePath = null; + String expFile = testProps.getProperty(EXPECTED_FILE_PROP, null); + if ( expFile != null ) { + resourcePath = resolveResourcePath(testPkg, expFile); + } + return resourcePath; + } + /** + * return the absolute path to the output file + */ + public String getOutputFilePath(Properties testProps) { + + String defPackage = this.getClass().getPackage().getName(); + String testPackage = testProps.getProperty(TEST_PACKAGE_PROP, defPackage); + String testPackageDir = testPackage.replace('.','/'); + String outputFile = testProps.getProperty(OUTPUT_FILE_PROP, DEF_OUTPUT_FILE); + + String userHomeDir = System.getProperty("user.home", ""); + String userDir = System.getProperty("user.dir", userHomeDir); + String defResultsDir = userDir + "/" + DEF_TEST_RESULTS_DIR; + String sysResultDir = System.getProperty(TEST_RESULTS_DIR_PROP, defResultsDir); + String resultDir = testProps.getProperty(TEST_RESULTS_DIR_PROP, sysResultDir); + + File outputDir = new File(resultDir, testPackageDir); + // System.out.println("Creating the test results output dir " + outputDir); + outputDir.mkdirs(); + return (new File(outputDir, outputFile)).getAbsolutePath(); + } + + /** + * This is the method where the actual service invocation code based on the + * type of client will be implemented. testService method calls this method + * after preparing the test input and then processes the output returned by + * this method to complte the test. + * @param inputDoc + * @param testProps + * @throws java.lang.Exception + * @return + */ + public abstract StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception; + + /** + * abstract method implemented by the extended classes to compare the output + * document with the expected output to determine the test is a failure or + * success. + * @param outputDoc + * @param expectedDoc + * @param testProps + * @throws java.lang.Exception + */ + public abstract void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, Properties testProps) throws Exception; + + /** + * This is the main test method that a test case will call to test the + * service. The standard steps that required to invoke the service and + * process the output will be done in this method. Each test case creates + * the test Properties required for that test and executes this method for + * testing the service by passing the test properties to it. This method + * prepares the input and executes the invokeService method to invoke a + * service with the prepared input. It then processes the return value from + * the invokeService to complete the test. + * + * @param testProps + * @throws java.lang.Exception + */ + public void testService(Properties testProps) throws Exception { + + String inFilePath = getInputFileResourcePath(testProps); + String outFilePath = getOutputFilePath(testProps); + String expFilePath = getExpectedFileResourcePath(testProps); + File outDir = (new File(outFilePath)).getParentFile(); + outDir.mkdirs(); + + StringBuffer outputDoc = new StringBuffer(); + + try { + StringBuffer inputDoc = loadResourceFile(inFilePath); + outputDoc = invokeService(inputDoc, testProps); + if ( expFilePath != null ) { + StringBuffer expOutputDoc = loadResourceFile(expFilePath); + compareWithExpectedOutput(inputDoc, expOutputDoc, testProps); + } + } catch (Exception ex) { + StringWriter out = new StringWriter(); + ex.printStackTrace(new PrintWriter(out)); + outputDoc.append(out.getBuffer()); + throw ex; + } finally { + if ( outputDoc != null ) { + System.out.println(outputDoc); + this.saveOutputToFile(new StringReader(outputDoc.toString()), outFilePath); + } + } + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java new file mode 100644 index 000000000..784c90970 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/JMXBindingTestClient.java @@ -0,0 +1,133 @@ +/* + * JMXBindingTestClient.java + */ + +package net.openesb.component.BindingComponent-archetype.test; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the proxy service consumer implementation by a binding component + * that can communicate with the external service consumers using JMX interface. + * @author chikkala + */ +public class JMXBindingTestClient extends JBIComponentTestClient { + + public static final String CONSUMER_EP_INBOUND_OPERATION_PROP = "consumer.jmx.bc.ep.operation"; + public static final String CONSUMER_EP_ADDRESS_MBEAN_PROP = "consumer.jmx.bc.ep.address.mbean"; + public static final String CONSUMER_EP_ADDRESS_URL_PROP = "consumer.jmx.bc.ep.address.serviceURL"; + public static final String CONSUMER_EP_ADDRESS_USERNAME_PROP = "consumer.jmx.bc.ep.address.username"; + public static final String CONSUMER_EP_ADDRESS_PASSWORD_PROP = "consumer.jmx.bc.ep.address.password"; + + public static final String PROVIDER_EP_INBOUND_OPERATION_PROP = "provider.jmx.bc.ep.operation"; + public static final String PROVIDER_EP_ADDRESS_MBEAN_PROP = "provider.jmx.bc.ep.address.mbean"; + public static final String PROVIDER_EP_ADDRESS_URL_PROP = "provider.jmx.bc.ep.address.serviceURL"; + public static final String PROVIDER_EP_ADDRESS_USERNAME_PROP = "provider.jmx.bc.ep.address.username"; + public static final String PROVIDER_EP_ADDRESS_PASSWORD_PROP = "provider.jmx.bc.ep.address.password"; + + + /** + * Creates a new instance of JMXBindingTestClient + */ + public JMXBindingTestClient() { + super(); + } + /** + * creates jmx connection to send the input message to the binding component. + */ + public static MBeanServerConnection getJMXConnection(Properties testProps) + throws MalformedURLException, IOException { + + String jmxUrl = testProps.getProperty(CONSUMER_EP_ADDRESS_URL_PROP); + String username = testProps.getProperty(CONSUMER_EP_ADDRESS_USERNAME_PROP); + String password = testProps.getProperty(CONSUMER_EP_ADDRESS_PASSWORD_PROP); + + Map env = new HashMap(); + if ( username != null ) { + String [] credentials = new String [] {username, password}; + env.put("jmx.remote.credentials", credentials); + env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, JMXBindingTestClient.class.getClassLoader()); + } + JMXServiceURL serviceURL = new JMXServiceURL(jmxUrl); + JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, env); + MBeanServerConnection mbeanServerConnection = jmxConnector.getMBeanServerConnection(); + return mbeanServerConnection; + } + /** + * constructs the jmx mbean objectname + */ + public static ObjectName createJMXEndpointMBeanObjectName(String endpointAddressMBean) throws MalformedObjectNameException { + // String objectName = JMX_DOMAIN + ":" + JMX_ENDPOINT_ADDRESS_KEY + "=" + endpointAddressMBean; + return new ObjectName(endpointAddressMBean); + } + /** + * invokes a jmx mbean to send message. + */ + public static StringBuffer invokeSendMessage(MBeanServerConnection jmxConn, ObjectName epAddressName, + String operation, StringBuffer inputDoc) + throws MalformedObjectNameException, InstanceNotFoundException, + MBeanException, ReflectionException, IOException { + StringBuffer outDoc = null; + + Object result = null; + String mbeanOperation = "sendMessage"; + + Object[] params = new Object[2]; + params[0] = operation; + params[1] = inputDoc; + + String[] signature = new String[2]; + signature[0] = "java.lang.String"; + signature[1] = "java.lang.StringBuffer"; + + result = jmxConn.invoke(epAddressName, mbeanOperation, params, signature); + if ( result != null ) { + outDoc = (StringBuffer)result; + } + + return outDoc; + } + /** + * invokes the service via jmx interface. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + ObjectName epAddressName = new ObjectName(testProps.getProperty(CONSUMER_EP_ADDRESS_MBEAN_PROP)); + String operation = testProps.getProperty(CONSUMER_EP_INBOUND_OPERATION_PROP); + + MBeanServerConnection jmxConn = getJMXConnection(testProps); + StringBuffer outputDoc = null; + try { + outputDoc = invokeSendMessage(jmxConn, epAddressName, operation, inputDoc); + } catch (MBeanException ex) { + Exception targetEx = ex.getTargetException(); + if ( targetEx != null ) { + throw targetEx; + } else { + throw ex; + } + } + return outputDoc; + } + /** no expected output comparison implemented */ + public void compareWithExpectedOutput(StringBuffer inputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java new file mode 100644 index 000000000..e33be0bed --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/java/net/openesb/component/cname/test/SOAPBindingTestClient.java @@ -0,0 +1,156 @@ +/* + * SOAPBindingTestClient.java + */ + +package net.openesb.component.BindingComponent-archetype.test; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.util.Properties; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPConnection; +import javax.xml.soap.SOAPConnectionFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPFault; +import javax.xml.soap.SOAPMessage; +import javax.xml.soap.SOAPPart; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +/** + * This class extends the JBIComponentTestClient and implements the invokeService + * method to test the Service Engine via SOAP Binding by invoking the service using + * SOAP Client that sends the message to the service provider via soaphttp binding. + * + * @author chikkala + */ +public class SOAPBindingTestClient extends JBIComponentTestClient { + + private static final String ADDRESS_PROP = "soap.binding.inbound.endpoint.address.location"; + private static final String SOAP_ACTION_PROP = "soap.binding.soapaction"; + private static final String FAIL_ON_SOAP_FAULT_PROP = "fail.on.soap.fault"; + + private static MessageFactory messageFactory; + private static SOAPConnectionFactory soapConnFactory; + private static SOAPConnection connection; + + public SOAPBindingTestClient() throws SOAPException { + init(); + } + /** initializes SOAP client */ + private synchronized void init() throws SOAPException { + if ( messageFactory == null ) { + messageFactory = MessageFactory.newInstance(); + } + if ( soapConnFactory == null ) { + soapConnFactory = SOAPConnectionFactory.newInstance(); + } + if ( connection == null ) { + connection = soapConnFactory.createConnection(); + } + } + + /** + * read in a soap message from the given input file + */ + private static SOAPMessage loadMessage(Reader inReader) throws SOAPException, IOException { + //Create and populate the message from a file + SOAPMessage message = messageFactory.createMessage(); + SOAPPart soapPart = message.getSOAPPart(); + StreamSource preppedMsgSrc = new StreamSource(inReader); + soapPart.setContent(preppedMsgSrc); + message.saveChanges(); + return message; + } + /** saves the SOAP message as xml text to a writer */ + private static void saveMessage(SOAPMessage response, Writer outWriter) + throws TransformerConfigurationException, SOAPException, TransformerException { + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute("indent-number", new Integer(2)); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + SOAPPart replySOAPPart = response.getSOAPPart(); + Source sourceContent = replySOAPPart.getContent(); + StreamResult result = new StreamResult(outWriter); + try { + transformer.transform(sourceContent, result); + } catch (TransformerException ex) { + ex.printStackTrace(); + } + } + /** + * Send a soap message + * @param destination URL to send to + * @param message message to send + * @param expectedHttpStatus expected http status code or null if success is expected + * @return reply soap message + */ + private static SOAPMessage sendMessage(String destination, SOAPMessage message, String soapAction) throws SOAPException { + + // Add soapAction if not null + if (soapAction != null) { + MimeHeaders hd = message.getMimeHeaders(); + hd.setHeader("SOAPAction", soapAction); + } + // Send the message and get a reply + SOAPMessage reply = null; + reply = connection.call(message, destination); + return reply; + } + /** check the xml text in the StringBuffer passed contains SOAP Fault. */ + public boolean isSOAPFault(StringBuffer msgBuff) { + SOAPFault soapFault = null; + try { + SOAPMessage inMsg = loadMessage(new StringReader(msgBuff.toString())); + soapFault = inMsg.getSOAPBody().getFault(); + } catch (Exception ex) { + // any exception, means either no fault elem or invalid xml + } + return (soapFault != null); + } + /** + * invokes the service ny sending the input message and return the output + * message returned by the service. + */ + public StringBuffer invokeService(StringBuffer inputDoc, Properties testProps) throws Exception { + + String soapAction = testProps.getProperty(SOAP_ACTION_PROP); + String destination = testProps.getProperty(ADDRESS_PROP); + SOAPMessage inMsg = loadMessage(new StringReader(inputDoc.toString())); + SOAPMessage outMsg = sendMessage(destination, inMsg, soapAction); + StringWriter out = new StringWriter(); + saveMessage(outMsg, out); + StringBuffer outDoc = out.getBuffer(); + Boolean failOnSoapFault = Boolean.valueOf(testProps.getProperty(FAIL_ON_SOAP_FAULT_PROP, "false")); + if ( failOnSoapFault ) { + if (isSOAPFault(outDoc)) { + StringBuffer errBuff = new StringBuffer("########## SOAP FAULT ############ \n"); + errBuff.append(outDoc); + throw new Exception(errBuff.toString()); + } + } + return outDoc; + } + /** comparing the received output document with the expected document. throw + * exception if the docs are not same. throwing the exception in this method + * fails the test. + */ + public void compareWithExpectedOutput(StringBuffer outputDoc, + StringBuffer expectedDoc, + Properties testProps) throws Exception { + // throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/build.properties new file mode 100644 index 000000000..8770a8330 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/build.properties @@ -0,0 +1,19 @@ +# Build properties for the service assembly builds +# user.properties.file=../../user.properties +src.dir=src +# This directory is removed when the project is cleaned: +build.dir=build +service.assembly.name=testSA + +#no.deps=true set the no.deps property if there are no SUs to build +# for each testSU define the properties here. +# dependent BC SU projects dependency +# service unit name +service.unit.name.testSUBC=testSUBC +# service unit project directory +project.testSUBC=testSUBC + +# service unit name +service.unit.name.testSUSE=testSUSE +# service unit project directory +project.testSUSE=testSUSE diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/build.xml new file mode 100644 index 000000000..12d519c6a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/build.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.assembly.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/src/META-INF/jbi.xml new file mode 100644 index 000000000..3e03318dc --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/src/META-INF/jbi.xml @@ -0,0 +1,41 @@ + + + + + BindingComponent-archetype_TestSA + This is a test Service Assembly to test Binding + + + + + BindingComponent-archetype_TestSUBC + This service unit enables inbound endpoint in the JMXBinding for a service in service engine + + + testSUBC.zip + BindingComponent-archetype + + + + + BindingComponent-archetype_TestSUSE + This service unit enables greetings service provider in the service engine + + + testSUSE.zip + ServiceEngine + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/build.properties new file mode 100644 index 000000000..cf9b455e9 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/build.properties @@ -0,0 +1,7 @@ +# Build properties for the service unit builds +src.dir=src +# This directory is removed when the project is cleaned: +#build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUBC + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/build.xml new file mode 100644 index 000000000..4c4b3d9a1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/src/Greetings.wsdl b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/src/Greetings.wsdl new file mode 100644 index 000000000..cf1d4ccc3 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/src/Greetings.wsdl @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/src/META-INF/jbi.xml new file mode 100644 index 000000000..e3e5435c1 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUBC/src/META-INF/jbi.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/build.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/build.properties new file mode 100644 index 000000000..387359c01 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/build.properties @@ -0,0 +1,7 @@ +# Build properties for the service unit builds +src.dir=src +# This directory is removed when the project is cleaned: +#build.dir=../../../build/test/testSU/build +build.dir=build +service.unit.name=testSUSE + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/build.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/build.xml new file mode 100644 index 000000000..38fc64f50 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set service.unit.name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/Greetings.wsdl b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/Greetings.wsdl new file mode 100644 index 000000000..9c6322558 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/Greetings.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/META-INF/jbi.xml b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/META-INF/jbi.xml new file mode 100644 index 000000000..62253668a --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/META-INF/jbi.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/goodbye.xsl b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/goodbye.xsl new file mode 100644 index 000000000..c60e39b73 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/goodbye.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + Goodbye ! Have a great time. + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/hello.xsl b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/hello.xsl new file mode 100644 index 000000000..994b66f98 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/hello.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + Hello ! + + + + + diff --git a/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/xsltmap.properties b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/xsltmap.properties new file mode 100644 index 000000000..06e4b6631 --- /dev/null +++ b/maven-archtype-v2/maven-archtype-binding-component-v2/target/test-classes/projects/basic/project/BindingComponent-archetype/test/testSA/testSUSE/src/xsltmap.properties @@ -0,0 +1,28 @@ +# properties will be used to find the xslt file that will be used for invoking a +# service operation. +# The "xsltmap.properties" file should contain two types of properties +# 1. for namespace prefix to namespaceURI map that starts with "xmlns." prefix like +# "xmlns.tns-prefix=http://www.sun.com/jbi/examples/sample-service/echo" +# 2. a service description to xslt file properties with syntax like +# "{tns-prefix}service-name=xslt_file_name" and +# "{tns-prefix}service-name.{tns-prefix}operation-name=xslt_file_name" and +# "{tns-prefix}service-name.{tns-prefix}interface-name.operation-name=xslt_file_name" . +# the service description property is a "." delimited tokens that represents +# a serive or interface qname and a operation name. To locate xslt file either with +# service qname or service qname and operaton or serivice qname and interface qname +# and operation, all the three properties specified above should be there for each xslt file. +# + +xmlns.greet1=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greet2=http://www.sun.com/jbi/examples/sample-service/greetings/ +xmlns.greettypes=http://www.sun.com/jbi/examples/sample-service/greetings/types +# just service level default settings +{greet2}greetService=hello.xsl +# service and operation +{greet2}greetService.{greet1}sayHello=hello.xsl +# service, interface, operation +{greet2}greetService.{greet1}greetings.sayHello=hello.xsl +# service and operation +{greet2}greetService.{greet1}sayGoodbye=goodbye.xsl +# service, interface, operation +{greet2}greetService.{greet1}greetings.sayGoodbye=goodbye.xsl