[jboss-svn-commits] JBL Code SVN: r23437 - in labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA: product/docs and 58 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Oct 13 08:25:48 EDT 2008
Author: kevin.conner at jboss.com
Date: 2008-10-13 08:25:47 -0400 (Mon, 13 Oct 2008)
New Revision: 23437
Added:
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractScheduledManagedLifecycle.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/message/ByReferenceMessage.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJobListener.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerResource.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_UnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_action.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_service.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ContextUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/HttpClient.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/jboss-service.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java
Removed:
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/security/CertCallbackHandler.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/actions/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/auth/http/HttpSecurityInfoExtractor.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/BaseWebServiceUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/cert-example.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/no-security-properties.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/publicKeyStore
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/security-properties.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/soap-keys-example.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/soap-userpass-example.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/actions/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/http/HttpSecurityInfoExtractorUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/lib/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejb/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/publicKeyStore
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/HttpClient.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/webservice_producer_secured/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/jboss-service.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java
Modified:
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/build-distr.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/docs/AdministrationGuide.odt
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/docs/ProgrammersGuide.odt
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/docs/ServicesGuide.odt
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/docs/ServicesGuide.pdf
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/etc/schemas/xml/jbossesb-1.0.1.xsd
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/ivy.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/resources/META-INF/jboss-aop.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/security/UserPassCallbackHandler.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecyclePriorities.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/ScheduleListener.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ScheduleMapper.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/LifecycleController.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/DeliveryObservableLogger.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounter.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterMBean.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounter.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/message/Context.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/ScheduleProvider.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/quartz.properties
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityServiceFactory.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/auth/ws/WSSecurityInfoExtractor.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/principals/User.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ScheduledListenerUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerIntegrationTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/scheduled-listener-config-configtree.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/schedule/expected-config-01-listener.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityContextUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/LoadUtil.groovy
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/load.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/jbossesb-properties.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/readme.txt
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/jboss-esb.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/readme.txt
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/SendEsbMessage.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/rules/DroolsRuleService.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksTransformer.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/soap/base-project-build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/console/management/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/DeploymentComponent.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBComponent.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/build.xml
Log:
Pull over CR1 release of JBESB_4_4_GA_CP1
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/build-distr.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/build-distr.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/build-distr.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -111,7 +111,11 @@
<fileset dir="${lib.dir}" includes="xbean*.jar"/>
<fileset dir="${lib.dir}" includes="stax-api-*.jar"/>
<!-- jUDDI Registry, we're one -->
+ <!-- We use AOP on juddi to get around an issue, use the modified jar for now
<fileset dir="${lib.dir}" includes="juddi-*.jar"/>
+ -->
+ <fileset dir="${aoplib.dir}" includes="juddi-*.jar"/>
+ <fileset dir="${lib.dir}" includes="juddi-client*.jar"/>
<!-- ftp -->
<fileset dir="${lib.ext.dir}" includes="commons-net-*.jar"/>
<fileset dir="${lib.dir}" includes="commons-io-*.jar,jsch-*.jar"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/docs/AdministrationGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/docs/ServicesGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/docs/ServicesGuide.pdf
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-10-13 12:25:47 UTC (rev 23437)
@@ -352,16 +352,6 @@
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="webserviceType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="disabled" />
- <xsd:enumeration value="none" />
- <xsd:enumeration value="addressing" />
- <xsd:enumeration value="security" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
-
<xsd:element name="actions">
<xsd:annotation>
<xsd:documentation xml:lang="en">
@@ -377,8 +367,8 @@
<xsd:attribute name="inXsd" type="xsd:string" />
<xsd:attribute name="outXsd" type="xsd:string" />
<xsd:attribute name="faultXsd" type="xsd:string" />
- <xsd:attribute name="webservice" type="jesb:webserviceType" />
- <xsd:attribute name="validate" type="xsd:boolean" />
+ <xsd:attribute name="webservice" type="xsd:boolean" default="true"/>
+ <xsd:attribute name="validate" type="xsd:boolean" default="false"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="action">
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/ivy.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/ivy.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/ivy.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -67,5 +67,10 @@
<dependency org="milyn" name="milyn-smooks-javabean" rev="1.0.1"/>
<dependency org="javax.jcr" name="jcr" rev="1.0"/>
+
+ <!-- soap dependencies -->
+ <dependency org="sun-jaxws" name="jaxws-tools" rev="2.1.1"/>
+ <dependency org="sun-jaxws" name="jaxws-rt" rev="2.1.1"/>
+ <dependency org="sun-jaxb" name="jaxb-xjc" rev="2.1.4"/>
</dependencies>
</ivy-module>
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.services.registry.aspect;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Aspect used to support CDATA sections from within jUDDI.
+ *
+ * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
+ */
+public class JUDDIAspect
+{
+ public Object getText(final MethodInvocation invocation)
+ throws Throwable
+ {
+ final Object[] args = invocation.getArguments() ;
+ final Element element = (Element)args[0] ;
+ final StringBuffer sb = new StringBuffer();
+
+ final NodeList nodeList = element.getChildNodes() ;
+ final int numNodes = nodeList.getLength() ;
+ for(int count = 0 ; count < numNodes ; count++)
+ {
+ final Node node = nodeList.item(count) ;
+ final short type = node.getNodeType() ;
+ if ((type == Element.TEXT_NODE) || (type == Element.CDATA_SECTION_NODE))
+ {
+ sb.append(node.getNodeValue()) ;
+ }
+ }
+
+ return sb.toString().trim();
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/resources/META-INF/jboss-aop.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/resources/META-INF/jboss-aop.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/resources/META-INF/jboss-aop.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -5,9 +5,14 @@
<aop>
<aspect class="org.jboss.internal.soa.esb.services.registry.aspect.ScoutAspect" scope="PER_VM"/>
+ <aspect class="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect" scope="PER_VM"/>
<bind pointcut="withincode(* org.apache.ws.scout.registry.BusinessQueryManagerImpl->findServiceBindings(..)) AND call(* org.apache.ws.scout.registry.BusinessQueryManagerImpl->getRegistryObject(..))">
<advice name="getRegistryObject" aspect="org.jboss.internal.soa.esb.services.registry.aspect.ScoutAspect"/>
</bind>
+
+ <bind pointcut="execution(* org.apache.juddi.util.xml.XMLUtils->getText(..))">
+ <advice name="getText" aspect="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect"/>
+ </bind>
</aop>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -5,7 +5,8 @@
<property name="org.jboss.esb.rosetta.distrib.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
<property name="org.jboss.esb.rosetta.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
<property name="org.jboss.esb.rosetta.aop.classes.dir" location="${org.jboss.esb.rosetta.classes.dir}-aop"/>
- <property name="org.jboss.esb.rosetta.aopc.classes.dir" location="${org.jboss.esb.rosetta.classes.dir}-aopc"/>
+ <property name="org.jboss.esb.rosetta.aopc.scout.classes.dir" location="${org.jboss.esb.rosetta.classes.dir}-scout-aopc"/>
+ <property name="org.jboss.esb.rosetta.aopc.juddi.classes.dir" location="${org.jboss.esb.rosetta.classes.dir}-juddi-aopc"/>
<property name="org.jboss.esb.rosetta.src.dir" location="src"/>
<property name="org.jboss.esb.root.dir" location="../"/>
<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
@@ -174,19 +175,30 @@
<target name="aop" depends="aop-jar">
<taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="aop-classpath"/>
- <delete dir="${org.jboss.esb.rosetta.aopc.classes.dir}" quiet="true"/>
- <mkdir dir="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+ <delete dir="${org.jboss.esb.rosetta.aopc.scout.classes.dir}" quiet="true"/>
+ <delete dir="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}" quiet="true"/>
+ <mkdir dir="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
+ <mkdir dir="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
- <unzip src="${org.jboss.esb.lib.dir}/scout-1.0rc2.jar" dest="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+ <unzip src="${org.jboss.esb.lib.dir}/scout-1.0rc2.jar" dest="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
+ <unzip src="${org.jboss.esb.lib.dir}/juddi-2.0rc5.jar" dest="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
+
<aopc compilerclasspathref="aop-classpath">
- <classpath path="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
- <src path="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+ <classpath path="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
+ <src path="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
<include name="org/apache/ws/scout/registry/BusinessQueryManagerImpl.class"/>
-
<aoppath path="aop/resources/META-INF/jboss-aop.xml"/>
<aopclasspath path="${org.jboss.esb.rosetta.aop.classes.dir}"/>
</aopc>
- <zip destfile="${org.jboss.esb.aoplib.dir}/scout-1.0rc2.aop.jar" basedir="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+ <aopc compilerclasspathref="aop-classpath">
+ <classpath path="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
+ <src path="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
+ <include name="org/apache/juddi/util/xml/XMLUtils.class"/>
+ <aoppath path="aop/resources/META-INF/jboss-aop.xml"/>
+ <aopclasspath path="${org.jboss.esb.rosetta.aop.classes.dir}"/>
+ </aopc>
+ <zip destfile="${org.jboss.esb.aoplib.dir}/scout-1.0rc2.aop.jar" basedir="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
+ <zip destfile="${org.jboss.esb.aoplib.dir}/juddi-2.0rc5.aop.jar" basedir="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
</target>
<target name="aop-jar" depends="aop-compile">
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -29,6 +29,7 @@
import org.jboss.soa.esb.common.TransactionStrategy;
import org.jboss.soa.esb.common.TransactionStrategyException;
import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.message.ByReferenceMessage;
import org.jboss.soa.esb.message.Message;
import java.io.IOException;
@@ -105,10 +106,8 @@
* if problems were encountered
*/
- public boolean deliver(Message message) {
- if (!isCourierActive()) {
- return false;
- }
+ public boolean deliver(Message message) throws CourierException {
+ isCourierActive() ;
if (message == null) {
return false;
@@ -162,6 +161,8 @@
logger.warn("Could not serialize message to pass by value.", ex);
return false;
}
+ } else if (message instanceof ByReferenceMessage){
+ addedObject = ((ByReferenceMessage)message).reference() ;
} else {
addedObject = message;
}
@@ -241,10 +242,8 @@
// see associated test
- public Message pickup(long millis) {
- if (!isCourierActive()) {
- return null;
- }
+ public Message pickup(long millis) throws CourierException {
+ isCourierActive() ;
Message message = null;
@@ -307,12 +306,10 @@
public void cleanup() {
}
- private boolean isCourierActive() {
+ private void isCourierActive() throws CourierException {
if (!isActive) {
- logger.debug("InVMCourier for EPR '" + epr.getAddr().getAddress() + "' is not active. Cannot pickup/deliver on this courier.", new Exception());
- return false;
+ throw new CourierException("InVMCourier for EPR '" + epr.getAddr().getAddress() + "' is not active. Cannot pickup/deliver on this courier.");
}
- return true;
}
public void setActive(boolean active) {
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,5 +1,12 @@
package org.jboss.internal.soa.esb.message.format.serialized;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.soa.esb.message.Context;
/*
@@ -25,10 +32,89 @@
public class ContextImpl implements Context, java.io.Serializable
{
+ /**
+ * The context variables.
+ */
+ private Map<String, Serializable> context = new HashMap<String, Serializable>() ;
+
+ /**
+ * Default constructor for the context.
+ */
+ public ContextImpl()
+ {
+ }
+
+ /**
+ * Create a copy of the context.
+ * @param copy The context to copy.
+ */
+ ContextImpl(final ContextImpl copy)
+ {
+ context.putAll(copy.context) ;
+ }
+
private static final long serialVersionUID = 0x0;
public String toString ()
{
- return "context: [ ]";
+ return "context: " + context ;
}
+
+ /**
+ * Set the context value, replacing existing value if present.
+ * @param key The context key.
+ * @param value The context value.
+ * @return the previous value of the context or null if not set.
+ */
+ public Object setContext(final String key, final Object value)
+ {
+ AssertArgument.isNotNull(key, "key");
+ AssertArgument.isNotNull(value, "value");
+
+ if (value instanceof Serializable)
+ {
+ return context.put(key, (Serializable)value) ;
+ }
+ else
+ {
+ throw new IllegalArgumentException("value must be serializable");
+ }
+ }
+
+ /**
+ * Retrieves the context value.
+ * @param key The context key.
+ * @return The value or null if not present.
+ */
+ public Object getContext(final String key)
+ {
+ return context.get(key) ;
+ }
+
+ /**
+ * Remove the context value.
+ * @param key The context key.
+ * @return The value of the context, or null if not present.
+ */
+ public Object removeContext(final String key)
+ {
+ return context.remove(key) ;
+ }
+
+ /**
+ * Get the keys in the context.
+ * @return the context keys.
+ */
+ public Set<String> getContextKeys()
+ {
+ return Collections.unmodifiableSet(context.keySet()) ;
+ }
+
+ /**
+ * Clear the context.
+ */
+ public void clearContext()
+ {
+ context = new HashMap<String, Serializable>() ;
+ }
}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -30,8 +30,10 @@
import java.io.ObjectOutputStream;
import java.net.URI;
+import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.message.Attachment;
import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.ByReferenceMessage;
import org.jboss.soa.esb.message.Context;
import org.jboss.soa.esb.message.Fault;
import org.jboss.soa.esb.message.Header;
@@ -61,7 +63,7 @@
*
*/
-public class MessageImpl implements Message, Externalizable
+public class MessageImpl implements ByReferenceMessage, Externalizable
{
private static final long serialVersionUID = 0x0;
@@ -75,6 +77,27 @@
_theProperties = new PropertiesImpl();
}
+ private MessageImpl(final MessageImpl message)
+ {
+ // Header and context are not by reference.
+ _theHeader = new HeaderImpl() ;
+ final Call origCall = message._theHeader.getCall() ;
+ final Call call = new Call(origCall.getTo()) ;
+ call.setAction(origCall.getAction()) ;
+ call.setFaultTo(origCall.getFaultTo()) ;
+ call.setFrom(origCall.getFrom()) ;
+ call.setMessageID(origCall.getMessageID()) ;
+ call.setRelatesTo(origCall.getRelatesTo()) ;
+ call.setReplyTo(origCall.getReplyTo()) ;
+ _theHeader.setCall(call) ;
+ _theContext = new ContextImpl(message._theContext) ;
+
+ _theBody = message._theBody ;
+ _theFault = message._theFault ;
+ _theAttachment = message._theAttachment ;
+ _theProperties = message._theProperties ;
+ }
+
/**
* @return get the header component of the message.
*/
@@ -202,6 +225,16 @@
}
}
+
+ /**
+ * Create the message used for pass by reference semantics.
+ * @return the referencable message.
+ */
+ public Message reference()
+ {
+ return new MessageImpl(this) ;
+ }
+
// should be a capability on the base interface, but no changes for 4.2
// ...
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/CallImpl.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -21,7 +21,6 @@
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.PortReference;
import org.jboss.soa.esb.addressing.XMLUtil;
-import org.jboss.soa.esb.message.Context;
/*
* JBoss, Home of Professional Open Source
* Copyright 2006, JBoss Inc., and others contributors as indicated
@@ -42,7 +41,7 @@
* (C) 2005-2006,
*/
-public class CallImpl extends ElementContent implements Context
+public class CallImpl extends ElementContent
{
/**
* The call object associated with this type.
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,10 +1,22 @@
package org.jboss.internal.soa.esb.message.format.xml;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.internal.soa.esb.util.Encoding;
import org.jboss.internal.soa.esb.util.stax.ElementContent;
+import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.internal.soa.esb.util.stax.TextElement;
import org.jboss.soa.esb.message.Context;
/*
@@ -31,6 +43,11 @@
public class ContextImpl extends ElementContent implements Context
{
/**
+ * The context variables.
+ */
+ private Map<String, SerializedValueImpl> context = new HashMap<String, SerializedValueImpl>() ;
+
+ /**
* Default constructor for the context.
*/
public ContextImpl()
@@ -38,6 +55,15 @@
}
/**
+ * Create a copy of the context.
+ * @param copy The context to copy.
+ */
+ ContextImpl(final ContextImpl copy)
+ {
+ context.putAll(copy.context) ;
+ }
+
+ /**
* Construct a context from the input stream.
*
* @param in The input stream.
@@ -51,17 +77,129 @@
public String toString ()
{
- return "context: [ ]";
+ return "context: " + context ;
}
/**
+ * Set the context value, replacing existing value if present.
+ * @param key The context key.
+ * @param value The context value.
+ * @return the previous value of the context or null if not set.
+ */
+ public Object setContext(final String key, final Object value)
+ {
+ AssertArgument.isNotNull(key, "key");
+ AssertArgument.isNotNull(value, "value");
+
+ if (value instanceof Serializable)
+ {
+ return unwrap(context.put(key, new SerializedValueImpl((Serializable)value))) ;
+ }
+ else
+ {
+ throw new IllegalArgumentException("value must be serializable");
+ }
+ }
+
+ /**
+ * Retrieves the context value.
+ * @param key The context key.
+ * @return The value or null if not present.
+ */
+ public Object getContext(final String key)
+ {
+ return unwrap(context.get(key)) ;
+ }
+
+ /**
+ * Remove the context value.
+ * @param key The context key.
+ * @return The value of the context, or null if not present.
+ */
+ public Object removeContext(final String key)
+ {
+ return unwrap(context.remove(key)) ;
+ }
+
+ /**
+ * Get the keys in the context.
+ * @return the context keys.
+ */
+ public Set<String> getContextKeys()
+ {
+ return Collections.unmodifiableSet(context.keySet()) ;
+ }
+
+ /**
+ * Clear the context.
+ */
+ public void clearContext()
+ {
+ context = new HashMap<String, SerializedValueImpl>() ;
+ }
+
+ /**
+ * Write the child content of the element.
+ * @param out The output stream.
+ * @throws XMLStreamException For errors during output.
+ */
+ @Override
+ protected void writeChildContent(XMLStreamWriter out)
+ throws XMLStreamException
+ {
+ for (Entry<String, SerializedValueImpl> entry: context.entrySet())
+ {
+ final String origPropertyURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_CONTEXT_ENTRY) ;
+
+ final TextElement keyElement = new TextElement(Encoding.encodeBytes(entry.getKey().getBytes())) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_CONTEXT_ENTRY_KEY, keyElement) ;
+
+ final String value = entry.getValue().getSerialisedForm() ;
+ final TextElement valueElement = new TextElement(value) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_CONTEXT_ENTRY_VALUE, valueElement) ;
+
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_CONTEXT_ENTRY.getPrefix(), origPropertyURI) ;
+ }
+ }
+
+ /**
* Add the element.
* @param in The current input stream.
* @param elementName The qualified element name.
+ * @throws XMLStreamException For errors during parsing.
*/
- protected void putElement(final XMLStreamReader in, final QName elementName)
+ @Override
+ protected void putElement(final XMLStreamReader in,
+ final QName elementName)
throws XMLStreamException
{
- throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ if (XMLUtil.ESB_QNAME_CONTEXT_ENTRY.equals(elementName))
+ {
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_CONTEXT_ENTRY_KEY) ;
+ final TextElement keyElement = new TextElement(in) ;
+ final String key = new String(Encoding.decodeToBytes(keyElement.getText())) ;
+
+ StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_CONTEXT_ENTRY_VALUE) ;
+ final TextElement valueElement = new TextElement(in) ;
+ final SerializedValueImpl value = new SerializedValueImpl(valueElement.getText()) ;
+
+ StreamHelper.checkParentFinished(in) ;
+
+ context.put(key, value) ;
+ }
+ else
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
}
+
+ /**
+ * Unwrap the serialised value.
+ * @param value The serialised value.
+ * @return The unwrapped value.
+ */
+ private Object unwrap(final SerializedValueImpl value)
+ {
+ return (value == null ? null : value.getValue()) ;
+ }
}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -31,8 +31,10 @@
import org.jboss.internal.soa.esb.util.stax.ElementContent;
import org.jboss.internal.soa.esb.util.stax.StreamHelper;
+import org.jboss.soa.esb.addressing.Call;
import org.jboss.soa.esb.message.Attachment;
import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.ByReferenceMessage;
import org.jboss.soa.esb.message.Context;
import org.jboss.soa.esb.message.Fault;
import org.jboss.soa.esb.message.Header;
@@ -65,7 +67,7 @@
*
*/
-public class MessageImpl extends ElementContent implements Message
+public class MessageImpl extends ElementContent implements ByReferenceMessage
{
public MessageImpl()
{
@@ -77,6 +79,26 @@
_theProperties = new PropertiesImpl();
}
+ private MessageImpl(final MessageImpl message)
+ {
+ // Header and context are not by reference.
+ _theHeader = new HeaderImpl() ;
+ final Call origCall = message._theHeader.getCall() ;
+ final Call call = new Call(origCall.getTo()) ;
+ call.setAction(origCall.getAction()) ;
+ call.setFaultTo(origCall.getFaultTo()) ;
+ call.setFrom(origCall.getFrom()) ;
+ call.setMessageID(origCall.getMessageID()) ;
+ call.setRelatesTo(origCall.getRelatesTo()) ;
+ call.setReplyTo(origCall.getReplyTo()) ;
+ _theHeader.setCall(call) ;
+ _theContext = new ContextImpl(message._theContext) ;
+
+ _theBody = message._theBody ;
+ _theFault = message._theFault ;
+ _theAttachment = message._theAttachment ;
+ _theProperties = message._theProperties ;
+ }
/**
* Construct a message from the input stream.
*
@@ -244,6 +266,15 @@
}
}
+ /**
+ * Create the message used for pass by reference semantics.
+ * @return the referencable message.
+ */
+ public Message reference()
+ {
+ return new MessageImpl(this) ;
+ }
+
// should be a capability on the base interface, but no changes for 4.2
// ...
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -60,6 +60,30 @@
*/
public static final QName ESB_QNAME_CONTEXT = new QName(ESB_ELEMENT_CONTEXT) ;
/**
+ * The name of the context entry element.
+ */
+ public static final String ESB_ELEMENT_CONTEXT_ENTRY = "ContextEntry" ;
+ /**
+ * The qualified name of the context entry element.
+ */
+ public static final QName ESB_QNAME_CONTEXT_ENTRY = new QName(ESB_ELEMENT_CONTEXT_ENTRY) ;
+ /**
+ * The name of the context entry key element.
+ */
+ public static final String ESB_ELEMENT_CONTEXT_ENTRY_KEY = "ContextKey" ;
+ /**
+ * The qualified name of the context entry key element.
+ */
+ public static final QName ESB_QNAME_CONTEXT_ENTRY_KEY = new QName(ESB_ELEMENT_CONTEXT_ENTRY_KEY) ;
+ /**
+ * The name of the context entry value element.
+ */
+ public static final String ESB_ELEMENT_CONTEXT_ENTRY_VALUE = "ContextValue" ;
+ /**
+ * The qualified name of the context entry value element.
+ */
+ public static final QName ESB_QNAME_CONTEXT_ENTRY_VALUE = new QName(ESB_ELEMENT_CONTEXT_ENTRY_VALUE) ;
+ /**
* The name of the body element.
*/
public static final String ESB_ELEMENT_BODY = "Body" ;
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/security/CertCallbackHandler.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/security/CertCallbackHandler.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/security/CertCallbackHandler.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.internal.soa.esb.services.security;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.ConfirmationCallback;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.jboss.soa.esb.services.security.SecurityConfig;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-
-/**
- *
- * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
- *
- */
-public class CertCallbackHandler implements EsbCallbackHandler
-{
- private String keyStoreAlias;
- private char[] keyPassword;
-
- public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- if (callbacks[i] instanceof NameCallback)
- {
- NameCallback nc = (NameCallback) callbacks[i];
- nc.setName(keyStoreAlias);
- }
- if ( callbacks[i] instanceof ConfirmationCallback )
- {
- ConfirmationCallback cb = (ConfirmationCallback) callbacks[i];
- cb.setSelectedIndex(ConfirmationCallback.OK);
- }
- else if (callbacks[i] instanceof PasswordCallback)
- {
- PasswordCallback passcb = (PasswordCallback) callbacks[i];
- passcb.setPassword(keyPassword);
- }
- }
- }
-
- public void setAuthenticationRequest(AuthenticationRequest authRequest) { }
-
- public void setSecurityConfig(final SecurityConfig config)
- {
- if ( config != null )
- {
- Map<String, String> properties = config.getProperties();
- // get the alias for the certificate to look for.
- this.keyStoreAlias = properties.get("alias");
-
- // get password for key in keystore(this is the keys password, not the keystores.
- String keyPass = properties.get("keyPassword");
- if ( keyPass != null )
- this.keyPassword = keyPass.toCharArray();
-
- keyPass = null;
- }
- }
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/security/UserPassCallbackHandler.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/security/UserPassCallbackHandler.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/security/UserPassCallbackHandler.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -47,10 +47,10 @@
if ( authRequest == null )
throw new IllegalStateException("No AuthenticationRequest has been set");
- log.debug("Nr of callback to handle : " + callbacks.length);
+ if (log.isDebugEnabled()) log.debug("Nr of callback to handle : " + callbacks.length);
for (int i = 0; i < callbacks.length; i++)
{
- log.debug("Callback" + callbacks[i].getClass().getName());
+ if (log.isDebugEnabled()) log.debug("Callback" + callbacks[i].getClass().getName());
if (callbacks[i] instanceof NameCallback)
{
NameCallback nc = (NameCallback) callbacks[i];
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -24,7 +24,6 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
-import java.io.Serializable;
import java.io.StringWriter;
import java.util.Iterator;
@@ -51,11 +50,6 @@
import org.jboss.soa.esb.message.Fault;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.security.PublicCryptoUtil;
-import org.jboss.soa.esb.services.security.SecurityService;
-import org.jboss.soa.esb.services.security.SecurityServiceException;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-import org.jboss.soa.esb.services.security.auth.ws.WSSecuritySoapExtractor;
import org.w3c.dom.Document;
import com.arjuna.common.util.propertyservice.PropertyManager;
@@ -74,13 +68,10 @@
protected final ServiceInvoker serviceInvoker ;
- private final WSSecuritySoapExtractor securityExtractor;
-
protected BaseWebService(final String category, final String name)
throws MessageDeliverException
{
serviceInvoker = new ServiceInvoker(category, name) ;
- securityExtractor = new WSSecuritySoapExtractor();
}
public SOAPMessage invoke(final SOAPMessage request)
@@ -118,9 +109,6 @@
throw new SOAPException("Could not find SOAPElement in SOAPBody") ;
}
- // extract security information from SOAP and set on esb message
- addAuthRequestToMessage(request, esbReq);
-
final Message esbRes = deliverMessage(esbReq) ;
if (esbRes != null)
{
@@ -223,23 +211,6 @@
return faultMsg ;
}
- private void addAuthRequestToMessage(final SOAPMessage from, final Message to) throws SecurityServiceException
- {
- final AuthenticationRequest authRequest = securityExtractor.extractSecurityInfo(from);
- if (authRequest != null)
- {
- byte[] encrypted = PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest);
- if (encrypted != null)
- {
- to.getProperties().setProperty(SecurityService.AUTH_REQUEST, encrypted);
- }
- else
- {
- LOGGER.warn("No public keystore has been configured which means that the authentication request cannot be encrypted. Please configure jbossesb-properties.xml with a publickey store.");
- }
- }
- }
-
protected abstract Message deliverMessage(final Message request)
throws Exception ;
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -52,7 +52,7 @@
}
}
- public byte[] generate(final String category, final String service, final ESBServiceEndpointInfo epInfo, final boolean includeHandlers)
+ public byte[] generate(final String category, final String service, final ESBServiceEndpointInfo epInfo)
throws WebServicePublishException {
try {
pool.get(epInfo.getClassName());
@@ -100,15 +100,6 @@
annotation2.addMemberValue("value", enumValue);
attribute.addAnnotation(annotation2);
- if (includeHandlers)
- {
- final Annotation handlerChainAnnotation = new Annotation("javax.jws.HandlerChain", constantPool) ;
- final StringMemberValue handlerValue = new StringMemberValue(constantPool) ;
- handlerValue.setValue("esb-jaxws-handlers.xml") ;
- handlerChainAnnotation.addMemberValue("file", handlerValue) ;
- attribute.addAnnotation(handlerChainAnnotation) ;
- }
-
seiClass.getClassFile().addAttribute(attribute);
final String constructorStr = "super(\"" + category + "\"," + "\"" + service + "\");";
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -330,7 +330,7 @@
try
{
byte[] encrypted = PrivateCryptoUtil.INSTANCE.encrypt(new SecurityContext(subject));
- message.getProperties().setProperty(SecurityService.CONTEXT, encrypted);
+ message.getContext().setContext(SecurityService.CONTEXT, encrypted);
}
catch (final SecurityServiceException e)
{
@@ -340,9 +340,13 @@
replyMessage = eprInvoker.attemptDelivery(message, epr);
if (replyMessage != null) {
+ // remove the security context so that it is not exposed to the action pipeline.
+ replyMessage.getContext().removeContext(SecurityService.CONTEXT);
+
if (Type.isFaultMessage(replyMessage)) {
Factory.createExceptionFromFault(replyMessage) ;
}
+
// We've delivered it, we're done!
return replyMessage;
} else {
@@ -377,6 +381,7 @@
* DO NOT remove from the registry - it is not dead!!
*/
}
+
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecyclePriorities.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecyclePriorities.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecyclePriorities.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -37,6 +37,11 @@
public static final int RULE_BASE_PRIORITY = 50000;
/**
+ * The scheduler priority.
+ */
+ public static final int SCHEDULE_RESOURCE_PRIORITY = 70000 ;
+
+ /**
* The service message counter priority.
*/
public static final int SERVICE_MESSAGE_COUNTER_PRIORITY = 75000 ;
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -26,6 +26,8 @@
package org.jboss.soa.esb.listeners;
import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.listeners.config.ScheduleProviderFactory;
+import org.jboss.soa.esb.schedule.ScheduleProvider;
public class ListenerTagNames
{
@@ -147,4 +149,14 @@
/** Reply Listener */
public static final String REPLY_LISTENER_TIMEOUT_TAG = "replyListenerTimeout";
+
+ /** Scheduled listeners */
+ public static final String SCHEDULE_ID_REF = "scheduleidref" ; // taken from ScheduleProviderFactory
+ public static final String SCHEDULE_FREQUENCY = "schedule-frequency" ; // taken from ScheduleProviderFactory
+ public static final String SCHEDULE_START_DATE = "scheduleStartDate" ;
+ public static final String SCHEDULE_END_DATE = "scheduleEndDate" ;
+ public static final String SCHEDULE_SIMPLE_FREQUENCY = "scheduleSimpleFrequency" ;
+ public static final String SCHEDULE_SIMPLE_EXEC = "scheduleSimpleExec" ;
+ public static final String SCHEDULE_CRON_EXPRESSION = "scheduleCronExpression" ;
+ public static final String SCHEDULE_PROPERTIES = "ScheduleProperties" ;
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/ScheduleListener.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/ScheduleListener.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/ScheduleListener.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -19,25 +19,25 @@
*/
package org.jboss.soa.esb.listeners;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.Initializable;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractScheduledManagedLifecycle;
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
import org.jboss.soa.esb.listeners.message.ActionProcessingPipeline;
+import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.schedule.ScheduledEventListener;
import org.jboss.soa.esb.schedule.SchedulingException;
-import org.jboss.soa.esb.common.TransactionStrategy;
-import org.jboss.soa.esb.common.TransactionStrategyException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.Initializable;
import org.jboss.soa.esb.util.ClassUtil;
-import org.jboss.soa.esb.message.Message;
/**
* ESB Schedule listener.
*
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
-public class ScheduleListener extends AbstractManagedLifecycle implements ScheduledEventListener {
+public class ScheduleListener extends AbstractScheduledManagedLifecycle {
/**
*
@@ -136,23 +136,8 @@
}
}
- protected void doInitialise() throws ManagedLifecycleException {
- }
-
- public void initialize(ConfigTree config) throws ConfigurationException {
- // TODO Convert lifecycle code to use the Initializable interface.
- }
-
- public void uninitialize() {
- }
-
- protected void doStart() throws ManagedLifecycleException {
- }
-
- protected void doStop() throws ManagedLifecycleException {
- }
-
- protected void doDestroy() throws ManagedLifecycleException {
+ @Override
+ protected void doScheduledDestroy() throws ManagedLifecycleException {
eventProcessor.uninitialize();
if(pipeline != null) {
pipeline.destroy() ;
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -39,7 +39,6 @@
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
import org.jboss.soa.esb.util.ClassUtil;
-import org.jboss.soa.esb.schedule.ScheduleProvider;
import org.xml.sax.InputSource;
/**
@@ -119,8 +118,6 @@
instances.addAll(LifecycleUtil.getGateways(gatewayConfig));
ManagedLifecycleController controller = new ManagedLifecycleController(instances);
- ScheduleProvider scheduleProvider = ScheduleProviderFactory.createInstance(instances, generator.getModel().getScheduleProvider());
- controller.setScheduleProvider(scheduleProvider);
// In parallel, create a map of the contract publication info...
ServicePublisher.addServicePublishers(controller, generator.getModel());
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -46,7 +46,6 @@
import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
import org.jboss.soa.esb.parameters.ParamRepositoryException;
import org.jboss.soa.esb.util.ClassUtil;
-import org.jboss.soa.esb.schedule.ScheduleProvider;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.xml.sax.InputSource;
@@ -359,8 +358,6 @@
instances.addAll(LifecycleUtil.getGateways(gatewayConfig));
ManagedLifecycleController lifecycleController = new ManagedLifecycleController(instances);
- ScheduleProvider scheduleProvider = ScheduleProviderFactory.createInstance(instances, configModel.getScheduleProvider());
- lifecycleController.setScheduleProvider(scheduleProvider);
try {
lifecycleController.start();
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -209,7 +209,7 @@
}
if (listener instanceof AbstractScheduledListener) {
- ScheduleMapper.map(listenerConfigTree, (AbstractScheduledListener) listener);
+ ScheduleMapper.map(listenerConfigTree, (AbstractScheduledListener) listener, model);
}
// Locate the Service to which the listener is bound...
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -143,7 +143,7 @@
}
if (gateway instanceof AbstractScheduledListener) {
- ScheduleMapper.map(listenerConfig, (AbstractScheduledListener) gateway);
+ ScheduleMapper.map(listenerConfig, (AbstractScheduledListener) gateway, model);
}
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -349,6 +349,28 @@
throw new IllegalStateException("No Provider instance found for the supplied Bus config instance. This should not be possible if the Bus instance was provided by this configuration. Where has this Bus instance come from?");
}
+ public Schedule getSchedule(final String id) {
+ if((id == null) || (jbossesb.getProviders() == null)) {
+ return null;
+ }
+
+ List<Provider> providers = jbossesb.getProviders().getProviderList();
+
+ for(Provider provider : providers) {
+ if(provider instanceof ScheduleProvider) {
+ final ScheduleProvider scheduleProvider = (ScheduleProvider)provider ;
+ final List<Schedule> schedules = scheduleProvider.getScheduleList() ;
+ for(Schedule schedule: schedules) {
+ if (id.equals(schedule.getScheduleid())) {
+ return schedule ;
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
public ScheduleProvider getScheduleProvider() {
if(jbossesb.getProviders() == null) {
return null;
@@ -364,6 +386,24 @@
return null;
}
+
+ public int getScheduledListenerCount() {
+ int count = 0 ;
+ if (jbossesb.getServices() != null) {
+ final List<Service> services = getServices() ;
+ for(Service service: services) {
+ final ListenersDocument.Listeners listeners = service.getListeners() ;
+ if (listeners != null) {
+ for (Listener listener: listeners.getListenerList()) {
+ if (listener instanceof AbstractScheduledListener) {
+ count++ ;
+ }
+ }
+ }
+ }
+ }
+ return count ;
+ }
private boolean isGateway(Listener listener)
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -61,13 +61,11 @@
import org.jboss.mx.util.ObjectNameConverter;
import org.jboss.soa.esb.lifecycle.LifecycleResourceManager;
import org.jboss.soa.esb.listeners.config.xbeanmodel.JbossesbDocument;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.WebserviceType;
import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionDocument.Action;
import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionsDocument.Actions;
import org.jboss.soa.esb.listeners.config.xbeanmodel.JbossesbDocument.Jbossesb;
import org.jboss.soa.esb.listeners.config.xbeanmodel.ServiceDocument.Service;
import org.jboss.soa.esb.listeners.config.xbeanmodel.ServicesDocument.Services;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.WebserviceType.Enum;
import org.jboss.soa.esb.util.ClassUtil;
import org.jboss.system.ServiceControllerMBean;
import org.jboss.system.server.ServerConfig;
@@ -94,21 +92,6 @@
private static final String PREFIX_CANONICAL_NAME = "jboss.esb:deployment=" ;
private static final String ESB_ARTIFACT_NAME = "jbossesb.esb" ;
- private final String HANDLER_CHAIN_PREFIX = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
- "<handler-chains xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" +
- " xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd\">" +
- "<handler-chain><protocol-bindings>##SOAP11_HTTP</protocol-bindings>" ;
- private final String HANDLER_CHAIN_POSTFIX = "</handler-chain></handler-chains>" ;
- private final String HANDLER_PREFIX = "<handler><handler-name>" ;
- private final String HANDLER_MIDDLE = "</handler-name><handler-class>" ;
- private final String HANDLER_POSTFIX = "</handler-class></handler>" ;
-
- private final String WSADDR_NAME = "WSAddressing Handler" ;
- private final String WSADDR_HANDLER = "org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler" ;
-
- private final String WSSEC_NAME = "WSSecurity Handler" ;
- private final String WSSEC_HANDLER = "org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer" ;
-
/**
* Default CTOR used to set default values to the Suffixes and RelativeOrder
* attributes. Those are read at subdeployer registration time by the MainDeployer
@@ -493,7 +476,7 @@
final Actions actions = service.getActions() ;
if (actions != null)
{
- if (!WebserviceType.DISABLED.equals(actions.getWebservice()))
+ if (!actions.isSetWebservice() || actions.getWebservice())
{
final String inXsd = actions.getInXsd() ;
if (inXsd != null)
@@ -522,16 +505,8 @@
final String wsdl = ESBContractGenerator.generateWSDL(service, serviceInfo) ;
addFile(zos, serviceInfo.getWSDLFileName(), wsdl) ;
- final String handlers = getHandlers(service.getActions().getWebservice()) ;
- final boolean includeHandlers = (handlers != null) ;
- if (includeHandlers)
- {
- final String wsHandlerName = "WEB-INF/classes/" + serviceInfo.getPackageName().replace('.', '/') + "/esb-jaxws-handlers.xml" ;
- addFile(zos, wsHandlerName, handlers) ;
- }
-
final byte[] wsClass = generator.generate(service.getCategory(),
- service.getName(), serviceInfo, includeHandlers) ;
+ service.getName(), serviceInfo) ;
final String wsClassName = serviceInfo.getClassName().replace('.', '/') + ".class" ;
addFile(zos, "WEB-INF/classes/" + wsClassName, wsClass) ;
@@ -697,35 +672,4 @@
{
esbNames.remove(deploymentName) ;
}
-
- private String getHandlers(final Enum webservice)
- {
- final int type = (webservice == null ? WebserviceType.INT_NONE : webservice.intValue()) ;
- final String result ;
-
- if ((type == WebserviceType.INT_DISABLED) || (type == WebserviceType.INT_NONE))
- {
- result = null ;
- }
- else
- {
- final StringBuilder sb = new StringBuilder(HANDLER_CHAIN_PREFIX) ;
- switch (type)
- {
- case WebserviceType.INT_ALL:
- sb.append(HANDLER_PREFIX).append(WSADDR_NAME).append(HANDLER_MIDDLE).append(WSADDR_HANDLER).append(HANDLER_POSTFIX) ;
- sb.append(HANDLER_PREFIX).append(WSSEC_NAME).append(HANDLER_MIDDLE).append(WSSEC_HANDLER).append(HANDLER_POSTFIX) ;
- break ;
- case WebserviceType.INT_ADDRESSING:
- sb.append(HANDLER_PREFIX).append(WSADDR_NAME).append(HANDLER_MIDDLE).append(WSADDR_HANDLER).append(HANDLER_POSTFIX) ;
- break ;
- case WebserviceType.INT_SECURITY:
- sb.append(HANDLER_PREFIX).append(WSSEC_NAME).append(HANDLER_MIDDLE).append(WSSEC_HANDLER).append(HANDLER_POSTFIX) ;
- break ;
- }
- sb.append(HANDLER_CHAIN_POSTFIX) ;
- result = sb.toString() ;
- }
- return result ;
- }
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -29,7 +29,6 @@
import org.jboss.soa.esb.dom.YADOMUtil;
import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.listeners.config.xbeanmodel.MepType;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.WebserviceType;
import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionDocument.Action;
import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionsDocument.Actions;
import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
@@ -84,29 +83,20 @@
{
listenerConfigTree.setAttribute(ListenerTagNames.VALIDATE_ATTRIBUTE_TAG, Boolean.toString(actions.getValidate())) ;
}
- final WebserviceType.Enum webservice = actions.getWebservice() ;
- if (webservice != null)
- {
- listenerConfigTree.setAttribute(ListenerTagNames.WEBSERVICE_ATTRIBUTE_TAG, webservice.toString()) ;
- }
SecurityMapper.map(listenerConfigTree, listenerService);
List<Action> actionList = actions.getActionList();
- try {
- HashMap<String,String> hm = new HashMap<String,String>();
- for(Action action : actionList) {
- mapAction(listenerConfigTree, action);
- if (hm.containsKey(action.getName())) {
- throw new ConfigurationException("Tried to register a duplicate action name. Service "
- + listenerService.getName() + " already contains an action named "
- + action.getName() + ". Action names must be unique per service.");
- } else {
- hm.put(action.getName(), action.getName());
- }
+ HashMap<String,String> hm = new HashMap<String,String>();
+ for(Action action : actionList) {
+ mapAction(listenerConfigTree, action);
+ if (hm.containsKey(action.getName())) {
+ throw new ConfigurationException("Tried to register a duplicate action name. Service "
+ + listenerService.getName() + " already contains an action named "
+ + action.getName() + ". Action names must be unique per service.");
+ } else {
+ hm.put(action.getName(), action.getName());
}
- } catch (ConfigurationException ce) {
- logger.error("", ce);
}
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ScheduleMapper.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ScheduleMapper.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ScheduleMapper.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -19,11 +19,23 @@
*/
package org.jboss.soa.esb.listeners.config.mappers;
+import java.util.List;
+
import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.listeners.config.Generator;
import org.jboss.soa.esb.listeners.config.ScheduleProviderFactory;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
import org.jboss.soa.esb.listeners.config.xbeanmodel.AbstractScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.FrequencyUnit;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.PropertyDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.Schedule;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.CronScheduleDocument.CronSchedule;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.ScheduleProviderDocument.ScheduleProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.SimpleScheduleDocument.SimpleSchedule;
+import org.jboss.soa.esb.schedule.SchedulerResource;
import org.w3c.dom.Element;
/**
@@ -39,20 +51,51 @@
private static Logger logger = Logger.getLogger(ScheduleMapper.class);
- public static void map(Element listenerConfig, AbstractScheduledListener scheduledListener) throws ConfigurationException {
+ public static void map(Element listenerConfig, AbstractScheduledListener scheduledListener, final XMLBeansModel model) throws ConfigurationException {
String scheduleIdRef = scheduledListener.getScheduleidref();
Element domElement = (Element) scheduledListener.getDomNode();
- int frequency = scheduledListener.getScheduleFrequency();
+ int scheduleFrequency = scheduledListener.getScheduleFrequency();
int pollFrequency = scheduledListener.getPollFrequencySeconds();
int pollLatency = getPollLatencySeconds(scheduledListener);
if(scheduleIdRef != null) {
- listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_SCHEDULE_ID_REF, scheduleIdRef);
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_ID_REF, scheduleIdRef);
+ final Schedule schedule = model.getSchedule(scheduleIdRef) ;
+ if (schedule.isSetStartDate()) {
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_START_DATE, Long.toString(schedule.getStartDate().getTimeInMillis())) ;
+ }
+ if (schedule.isSetEndDate()) {
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_END_DATE, Long.toString(schedule.getEndDate().getTimeInMillis())) ;
+ }
+ if (schedule instanceof SimpleSchedule) {
+ final SimpleSchedule simpleSchedule = (SimpleSchedule)schedule ;
+ final long simpleFrequency = simpleSchedule.getFrequency() ;
+ final FrequencyUnit.Enum unit = simpleSchedule.getFrequencyUnits() ;
+ final String frequencyVal ;
+ if (unit.equals(FrequencyUnit.SECONDS)) {
+ frequencyVal = Long.toString(simpleFrequency * 1000) ;
+ } else {
+ frequencyVal = Long.toString(simpleFrequency) ;
+ }
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_SIMPLE_FREQUENCY, frequencyVal) ;
+ if (simpleSchedule.isSetExecCount()) {
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_SIMPLE_EXEC, Integer.toString(simpleSchedule.getExecCount())) ;
+ }
+ } else if (schedule instanceof CronSchedule) {
+ final String cronExpression = ((CronSchedule)schedule).getCronExpression() ;
+ if (cronExpression == null) {
+ throw new ConfigurationException("Missing cron expression from configuration") ;
+ }
+ listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_CRON_EXPRESSION, cronExpression) ;
+ } else {
+ throw new ConfigurationException("Unknown schedule type specified in configuration: " + schedule.getClass().getName()) ;
+ }
+
if(domElement.hasAttribute("poll-frequency-seconds") || domElement.hasAttribute("schedule-frequency") ) {
logger.warn("Schedule Listener '" + listenerConfig.getTagName() + "' defines both 'scheduleidref' and frequency attributes. Using the 'scheduleidref'.");
}
- } else if(frequency > -1) {
- listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_FREQUENCY, Integer.toString(frequency));
+ } else if(scheduleFrequency > -1) {
+ listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_FREQUENCY, Integer.toString(scheduleFrequency));
} else if(pollFrequency > -1) {
listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_FREQUENCY, Integer.toString(pollFrequency));
} else if(pollLatency > -1) {
@@ -61,6 +104,12 @@
listenerConfig.setAttribute(ScheduleProviderFactory.ATTR_FREQUENCY, "10");
}
+ final ScheduleProvider scheduleProvider = model.getScheduleProvider() ;
+ if (scheduleProvider != null) {
+ // There is only one schedule provider allowed in the configuration at present
+ copyProperties(listenerConfig, model.getScheduleProvider().getPropertyList(), model.getScheduledListenerCount()) ;
+ }
+
if(domElement.hasAttribute("poll-frequency-seconds")) {
logger.warn("Attrubute 'poll-frequency-seconds' is DEPRECATED. Please change your configuration to use 'schedule-frequency'.");
}
@@ -69,6 +118,17 @@
}
}
+ private static void copyProperties(final Element listenerConfig, final List<PropertyDocument.Property> properties, final int numScheduledListeners)
+ {
+ final Element schedulePropertyElement = YADOMUtil.addElement(listenerConfig, ListenerTagNames.SCHEDULE_PROPERTIES) ;
+ schedulePropertyElement.setAttribute(SchedulerResource.THREAD_COUNT, Integer.toString(numScheduledListeners)) ;
+
+ if ((properties != null) && (properties.size() > 0))
+ {
+ MapperUtil.mapProperties(properties, schedulePropertyElement) ;
+ }
+ }
+
private static int getPollLatencySeconds(AbstractScheduledListener scheduledListener) {
String value = Generator.XMLBeansModel.getProperty(scheduledListener.getPropertyList(), "pollLatencySeconds", "-1");
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -34,7 +34,6 @@
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.schedule.ScheduledEventListener;
import org.jboss.soa.esb.schedule.SchedulingException;
import org.jboss.soa.esb.common.Environment;
import org.jboss.soa.esb.couriers.CourierException;
@@ -58,7 +57,7 @@
* @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
* @since Version 4.0
*/
-public abstract class AbstractFileGateway extends AbstractManagedLifecycle implements ScheduledEventListener {
+public abstract class AbstractFileGateway extends AbstractScheduledManagedLifecycle {
protected final static Logger _logger = Logger
.getLogger(AbstractFileGateway.class);
@@ -102,22 +101,6 @@
}
}
- public void initialize(ConfigTree config) throws ConfigurationException {
- // TODO Convert lifecycle code to use the Initializable interface.
- }
-
- public void uninitialize() {
- }
-
- protected void doStart() throws ManagedLifecycleException {
- }
-
- protected void doStop() throws ManagedLifecycleException {
- }
-
- protected void doDestroy() throws ManagedLifecycleException {
- }
-
/**
* Execute on trigger from the scheduler.
*/
@@ -270,14 +253,6 @@
return new File(fileIn.toString() + _workingSuffix);
}
- /**
- * Handle the threaded destroy of the managed instance.
- *
- * @throws ManagedLifecycleException for errors while destroying.
- */
- protected void doThreadedDestroy() throws ManagedLifecycleException {
- }
-
/*
* Is the input suffix valid for this type of gateway?
*/
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -143,11 +143,6 @@
@Override
boolean renameFile(File from, File to) throws GatewayException {
- if (to.exists() && !to.delete()) {
- throw new GatewayException("Cannot delete target file: "
- + to.getAbsolutePath());
- }
-
return FileUtil.renameTo(from, to);
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -54,6 +54,8 @@
protected String _composerName;
protected String m_targetServiceCategory, m_targetServiceName;
+ private HibernateInterceptor interceptor ;
+
protected Collection<EPR> m_targetEprs;
private static final String MESSAGE_FILTER = "messagefilter";
@@ -119,7 +121,8 @@
// we need to close the SessionFactory so that the old interceptors don't get
// in the way.
if (eventList.size() != 0) {
- cfg.setInterceptor(new HibernateInterceptor(m_config, eventList));
+ interceptor = new HibernateInterceptor(m_config, eventList) ;
+ cfg.setInterceptor(interceptor);
}
// We're suppressing warnings here - we need to initialize the
@@ -137,9 +140,15 @@
@Override
protected void doStart() throws ManagedLifecycleException {
+ if (interceptor != null) {
+ interceptor.enable() ;
+ }
}
@Override
protected void doStop() throws ManagedLifecycleException {
+ if (interceptor != null) {
+ interceptor.disable() ;
+ }
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -36,12 +36,7 @@
import org.hibernate.type.Type;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
import org.jboss.soa.esb.client.ServiceInvoker;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.listeners.ListenerUtil;
@@ -74,6 +69,8 @@
protected Object m_composer;
protected String m_composerName;
protected ConfigTree m_config;
+
+ private boolean enabled ;
protected ServiceInvoker m_serviceInvoker;
protected String m_targetServiceCategory, m_targetServiceName;
@@ -267,68 +264,84 @@
}
public void afterTransactionBegin(Transaction arg0) {
- m_logger.debug("afterTransactionBegin");
+ if (isEnabled()) {
+ m_logger.debug("afterTransactionBegin");
+ }
}
public void afterTransactionCompletion(Transaction arg0) {
- m_logger.debug("afterTransactionCompletion");
+ if (isEnabled()) {
+ m_logger.debug("afterTransactionCompletion");
+ }
}
public void beforeTransactionCompletion(Transaction arg0) {
- m_logger.debug("beforeTransactionCompletion");
+ if (isEnabled()) {
+ m_logger.debug("beforeTransactionCompletion");
+ }
}
public void onCollectionRecreate(Object entity, Serializable id) throws CallbackException {
- m_logger.debug("onCollectionRecreate");
+ if (isEnabled()) {
+ m_logger.debug("onCollectionRecreate");
+ }
}
public void onCollectionRemove(Object entity, Serializable id) throws CallbackException {
- System.out.println("onCollectionRemove");
- for (HibernateEventBean heb: m_events) {
- if (heb.getEvent().equals(COLLECTION_REMOVE_EVENT)) {
- if (entity.getClass().getName().equals(heb.getClassname())) {
- Message message = createMessage(entity);
- message.getProperties().setProperty(ListenerTagNames.HIBERNATE_INTERCEPTOR_ID, id);
- deliverMessage(message);
+ if (isEnabled()) {
+ m_logger.debug("onCollectionRemove");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(COLLECTION_REMOVE_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ message.getProperties().setProperty(ListenerTagNames.HIBERNATE_INTERCEPTOR_ID, id);
+ deliverMessage(message);
+ }
}
}
}
}
public void onCollectionUpdate(Object entity, Serializable id) throws CallbackException {
- System.out.println("onCollectionUpdate");
- for (HibernateEventBean heb: m_events) {
- if (heb.getEvent().equals(COLLECTION_UPDATE_EVENT)) {
- if (entity.getClass().getName().equals(heb.getClassname())) {
- Message message = createMessage(entity);
- message.getProperties().setProperty(ListenerTagNames.HIBERNATE_INTERCEPTOR_ID, id);
- deliverMessage(message);
+ if (isEnabled()) {
+ m_logger.debug("onCollectionUpdate");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(COLLECTION_UPDATE_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ message.getProperties().setProperty(ListenerTagNames.HIBERNATE_INTERCEPTOR_ID, id);
+ deliverMessage(message);
+ }
}
}
}
}
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
- System.out.println("onDelete");
- for (HibernateEventBean heb: m_events) {
- if (heb.getEvent().equals(DELETE_EVENT)) {
- if (entity.getClass().getName().equals(heb.getClassname())) {
- Message message = createMessage(entity);
- addMessageInfo(message, id, state, propertyNames, types);
- deliverMessage(message);
+ if (isEnabled()) {
+ m_logger.debug("onDelete");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(DELETE_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ addMessageInfo(message, id, state, propertyNames, types);
+ deliverMessage(message);
+ }
}
}
}
}
public boolean onFlushDirty(Object entity, Serializable id, Object[] newValues, Object[] oldValues, String[] propertyNames, Type[] types) throws CallbackException {
- m_logger.debug("onFlushDirty");
- for (HibernateEventBean heb: m_events) {
- if (heb.getEvent().equals(FLUSH_DIRTY_EVENT)) {
- if (entity.getClass().getName().equals(heb.getClassname())) {
- Message message = createMessage(entity);
- addMessageInfo(message, id, newValues, oldValues, propertyNames, types);
- deliverMessage(message);
+ if (isEnabled()) {
+ m_logger.debug("onFlushDirty");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(FLUSH_DIRTY_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ addMessageInfo(message, id, newValues, oldValues, propertyNames, types);
+ deliverMessage(message);
+ }
}
}
}
@@ -336,13 +349,15 @@
}
public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
- System.out.println("onLoad");
- for (HibernateEventBean heb: m_events) {
- if (heb.getEvent().equals(LOAD_EVENT)) {
- if (entity.getClass().getName().equals(heb.getClassname())) {
- Message message = createMessage(entity);
- addMessageInfo(message, id, state, propertyNames, types);
- deliverMessage(message);
+ if (isEnabled()) {
+ m_logger.debug("onLoad");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(LOAD_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ addMessageInfo(message, id, state, propertyNames, types);
+ deliverMessage(message);
+ }
}
}
}
@@ -351,13 +366,15 @@
public boolean onSave(Object entity, Serializable id, Object[] state,
String[] propertyNames, Type[] types) throws CallbackException {
- System.out.println("onSave");
- for (HibernateEventBean heb: m_events) {
- if (heb.getEvent().equals(SAVE_EVENT)) {
- if (entity.getClass().getName().equals(heb.getClassname())) {
- Message message = createMessage(entity);
- addMessageInfo(message, id, state, propertyNames, types);
- deliverMessage(message);
+ if (isEnabled()) {
+ m_logger.debug("onSave");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(SAVE_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ addMessageInfo(message, id, state, propertyNames, types);
+ deliverMessage(message);
+ }
}
}
}
@@ -365,10 +382,26 @@
}
public void postFlush(Iterator arg0) throws CallbackException {
- m_logger.debug("postFlush");
+ if (isEnabled()) {
+ m_logger.debug("postFlush");
+ }
}
public void preFlush(Iterator arg0) throws CallbackException {
- m_logger.debug("preFlush");
- }
+ if (isEnabled()) {
+ m_logger.debug("preFlush");
+ }
+ }
+
+ public synchronized boolean isEnabled() {
+ return enabled ;
+ }
+
+ public synchronized void enable() {
+ enabled = true ;
+ }
+
+ public synchronized void disable() {
+ enabled = false ;
+ }
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -527,7 +527,7 @@
try {
byte[] encrypted = PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest);
if (encrypted != null) {
- message.getProperties().setProperty(SecurityService.AUTH_REQUEST, encrypted);
+ message.getContext().setContext(SecurityService.AUTH_REQUEST, encrypted);
} else {
logger.warn("No public keystore has been configured which means that the authentication request cannot be encrypted. Please configure jbossesb-properties.xml with a publickey store.");
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -173,20 +173,22 @@
* Stop the service and also after that stop the
* remotefileSystemStrategy in use
*/
+ @Override
protected void doStop() throws ManagedLifecycleException
{
+ super.doStop();
remotefileSystemStrategy.stop();
- super.doStop();
}
/**
* Destroys the service and also after that stop the
* remotefileSystemStrategy in use
*/
- protected void doThreadedDestroy() throws ManagedLifecycleException
+ @Override
+ protected void doScheduledDestroy() throws ManagedLifecycleException
{
+ super.doScheduledDestroy();
remotefileSystemStrategy.destroy();
- super.doDestroy();
}
private void createRemoteFileSystemStrategy() throws ConfigurationException
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -755,6 +755,16 @@
_logger.warn("Cannot change row state from " + fromState
+ " to " + toState + ". Number of rows in state "
+ fromState + " = " + count);
+
+ if (count == 0) // the execute affected zero rows!
+ {
+ // https://jira.jboss.org/jira/browse/SOA-642
+
+ _logger.warn("No rows affected by update statement. Check listener/gateway/notifier table definitions are correct.");
+ }
+ else
+ _logger.warn("Curent implementation expected only one row to be applicable to update request.");
+
return false;
}
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractScheduledManagedLifecycle.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractScheduledManagedLifecycle.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractScheduledManagedLifecycle.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractScheduledManagedLifecycle.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,340 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.lifecycle;
+
+import java.text.ParseException;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.schedule.SchedulerJob;
+import org.jboss.soa.esb.schedule.SchedulerJobListener;
+import org.jboss.soa.esb.schedule.SchedulingException;
+
+
+/**
+ * This class provides threaded support for a managed instance.
+ *
+ * @author kevin
+ */
+public abstract class AbstractScheduledManagedLifecycle extends AbstractManagedLifecycle
+{
+ /**
+ * The job associated with the scheduler.
+ */
+ private final SchedulerJob job ;
+ /**
+ * The logger for this class.
+ */
+ private static final Logger logger = Logger.getLogger(AbstractScheduledManagedLifecycle.class) ;
+
+ /**
+ * Construct the threaded managed lifecycle.
+ * @param config The configuration associated with this instance.
+ * @throws ConfigurationException for configuration errors during initialisation.
+ */
+ protected AbstractScheduledManagedLifecycle(final ConfigTree config)
+ throws ConfigurationException
+ {
+ super(config) ;
+
+ final Properties properties = extractProperties(config) ;
+ final SchedulerJobListener listener = new SchedulerJobListener() {
+ public void onSchedule() throws SchedulingException {
+ AbstractScheduledManagedLifecycle.this.onSchedule() ;
+ }
+ } ;
+ final String scheduleIdRef = config.getAttribute(ListenerTagNames.SCHEDULE_ID_REF) ;
+ if (scheduleIdRef == null)
+ {
+ final String intervalVal = config.getAttribute(ListenerTagNames.SCHEDULE_FREQUENCY) ;
+ final long interval ;
+ if (intervalVal != null)
+ {
+ interval = parseInt(ListenerTagNames.SCHEDULE_FREQUENCY, intervalVal) ;
+ }
+ else
+ {
+ interval = 10 ;
+ }
+
+ job = SchedulerJob.createIntervalSchedulerJob(null, listener, interval*1000, properties) ;
+ }
+ else
+ {
+ final Date scheduleStartDate = getDate(config.getAttribute(ListenerTagNames.SCHEDULE_START_DATE)) ;
+ final Date scheduleEndDate = getDate(config.getAttribute(ListenerTagNames.SCHEDULE_END_DATE)) ;
+ final String simpleFrequency = config.getAttribute(ListenerTagNames.SCHEDULE_SIMPLE_FREQUENCY) ;
+ if (simpleFrequency != null)
+ {
+ final long frequency = parseLong(ListenerTagNames.SCHEDULE_SIMPLE_FREQUENCY, simpleFrequency) ;
+ if (frequency <= 0)
+ {
+ throw new ConfigurationException("Invalid " + ListenerTagNames.SCHEDULE_SIMPLE_FREQUENCY + " value, must be greate than zero: " + simpleFrequency) ;
+ }
+ final String simpleExecCount = config.getAttribute(ListenerTagNames.SCHEDULE_SIMPLE_EXEC) ;
+ if (simpleExecCount != null)
+ {
+ final int execCount = parseInt(ListenerTagNames.SCHEDULE_SIMPLE_EXEC, simpleExecCount) ;
+ if (execCount < 0)
+ {
+ job = SchedulerJob.createIntervalSchedulerJob(scheduleIdRef, listener, frequency, scheduleStartDate, scheduleEndDate, properties) ;
+ }
+ else if (execCount == 0)
+ {
+ logger.warn("<simple-schedule> '" + scheduleIdRef + "' has an execCount of 0 configured. This schedule will not fire!");
+ job = null ;
+ }
+ else
+ {
+ job = SchedulerJob.createIntervalSchedulerJob(scheduleIdRef, listener, frequency, execCount, scheduleStartDate, scheduleEndDate, properties) ;
+ }
+ }
+ else
+ {
+ job = SchedulerJob.createIntervalSchedulerJob(scheduleIdRef, listener, frequency, scheduleStartDate, scheduleEndDate, properties) ;
+ }
+ }
+ else
+ {
+ final String cronExpression = config.getAttribute(ListenerTagNames.SCHEDULE_CRON_EXPRESSION) ;
+ if (cronExpression == null)
+ {
+ throw new ConfigurationException("Missing cron expression") ;
+ }
+ try
+ {
+ job = SchedulerJob.createCronSchedulerJob(scheduleIdRef, listener, cronExpression, scheduleStartDate, scheduleEndDate, properties) ;
+ }
+ catch (final ParseException pe)
+ {
+ throw new ConfigurationException("Invalid cron expression", pe) ;
+ }
+ }
+ }
+ }
+
+ /**
+ * Handle the initialisation of the managed instance.
+ *
+ * @throws ManagedLifecycleException for errors while initialisation.
+ */
+ @Override
+ protected void doInitialise()
+ throws ManagedLifecycleException
+ {
+ }
+
+ /**
+ * Handle the start of the managed instance.
+ *
+ * @throws ManagedLifecycleException for errors while starting.
+ */
+ @Override
+ protected void doStart()
+ throws ManagedLifecycleException
+ {
+ if (job != null)
+ {
+ try
+ {
+ job.start() ;
+ }
+ catch (final SchedulingException se)
+ {
+ throw new ManagedLifecycleException("Failed to start the scheduling job", se) ;
+ }
+ }
+ }
+
+ /**
+ * Execute the scheduled event.
+ */
+ protected abstract void onSchedule()
+ throws SchedulingException ;
+
+ /**
+ * Handle the stop of the managed instance.
+ *
+ * @throws ManagedLifecycleException for errors while stopping.
+ */
+ @Override
+ protected void doStop()
+ throws ManagedLifecycleException
+ {
+ if (job != null)
+ {
+ try
+ {
+ job.pause() ;
+ }
+ catch (final SchedulingException se)
+ {
+ throw new ManagedLifecycleException("Failed to pause the scheduling job", se) ;
+ }
+ }
+ }
+
+ /**
+ * Handle the destroy of the managed instance.
+ *
+ * @throws ManagedLifecycleException for errors while destroying.
+ */
+ @Override
+ protected final void doDestroy()
+ throws ManagedLifecycleException
+ {
+ try
+ {
+ doScheduledDestroy() ;
+ }
+ finally
+ {
+ if (job != null)
+ {
+ try
+ {
+ job.destroy() ;
+ }
+ catch (final SchedulingException se)
+ {
+ throw new ManagedLifecycleException("Failed to destroy the scheduling job", se) ;
+ }
+ }
+ }
+ }
+
+ /**
+ * Handle the scheduled destroy of the managed instance.
+ *
+ * @throws ManagedLifecycleException for errors while destroying.
+ */
+ protected void doScheduledDestroy()
+ throws ManagedLifecycleException
+ {
+ }
+
+ /**
+ * Parse the value as an integer.
+ * @param propertyName The property name.
+ * @param value The string representation.
+ * @return the integer value.
+ * @throws ConfigurationException For failures in parsing the integer.
+ */
+ private int parseInt(final String propertyName, final String value)
+ throws ConfigurationException
+ {
+ try
+ {
+ return Integer.parseInt(value) ;
+ }
+ catch (final NumberFormatException nfe)
+ {
+ throw new ConfigurationException("Failed to parse " + propertyName + " as integer: " + value) ;
+ }
+ }
+
+ /**
+ * Parse the value as a long.
+ * @param propertyName The property name.
+ * @param value The string representation.
+ * @return the long value.
+ * @throws ConfigurationException For failures in parsing the long.
+ */
+ private long parseLong(final String propertyName, final String value)
+ throws ConfigurationException
+ {
+ try
+ {
+ return Long.parseLong(value) ;
+ }
+ catch (final NumberFormatException nfe)
+ {
+ throw new ConfigurationException("Failed to parse " + propertyName + " as long: " + value) ;
+ }
+ }
+
+ /**
+ * Extract any scheduler properties from the configuration.
+ * @param config The current configuration.
+ * @return The scheduler properties or null if none present.
+ * @throws ConfigurationException for errors in configuration
+ */
+ private Properties extractProperties(final ConfigTree config)
+ throws ConfigurationException
+ {
+ final ConfigTree[] children = config.getChildren(ListenerTagNames.SCHEDULE_PROPERTIES) ;
+ final int numChildren = (children == null ? 0 : children.length) ;
+ if (numChildren == 0)
+ {
+ return null ;
+ }
+ else if (numChildren > 1)
+ {
+ throw new ConfigurationException("Only one " + ListenerTagNames.SCHEDULE_PROPERTIES + " element allowed within the configuration") ;
+ }
+
+ final List<KeyValuePair> attributeList = children[0].attributesAsList() ;
+ if ((attributeList == null) || attributeList.isEmpty())
+ {
+ return null ;
+ }
+
+ final Properties properties = new Properties() ;
+ for(KeyValuePair pair: attributeList)
+ {
+ properties.put(pair.getKey(), pair.getValue()) ;
+ }
+ return properties ;
+ }
+
+ /**
+ * Create a date object from the time value.
+ * @param time The time value.
+ * @return The date instance.
+ * @throws ConfigurationException for parsing errors.
+ */
+ private Date getDate(final String time)
+ throws ConfigurationException
+ {
+ if (time == null)
+ {
+ return null ;
+ }
+
+ final long timeval ;
+ try
+ {
+ timeval = Long.parseLong(time) ;
+ }
+ catch (final NumberFormatException nfe)
+ {
+ throw new ConfigurationException("Could not create date from millisecond value: " + time) ;
+ }
+ return new Date(timeval) ;
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/LifecycleController.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/LifecycleController.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/LifecycleController.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -60,6 +60,7 @@
private ManagedLifecycleAdapter m_lifecycle;
private String m_startTime;
private final ObjectName listObjectName ;
+ private final ClassLoader tccl ;
private static final Logger logger = Logger.getLogger(LifecycleController.class);
@@ -79,6 +80,7 @@
m_lifecycle = f_lifecycle;
m_startTime = "";
listObjectName = getObjectName() ;
+ tccl = Thread.currentThread().getContextClassLoader() ;
}
/**
@@ -267,24 +269,30 @@
* an exception.
*/
public Object invoke(String method, Object[] arg1, String[] arg2) throws ReflectionException {
- if (method.equalsIgnoreCase(START_ACTION)) {
- try {
- start();
- } catch (ManagedLifecycleException e) {
- logger.error("", e);
- return "Error invoking " + method + ": " + e.toString();
+ final ClassLoader current = Thread.currentThread().getContextClassLoader() ;
+ Thread.currentThread().setContextClassLoader(tccl) ;
+ try {
+ if (method.equalsIgnoreCase(START_ACTION)) {
+ try {
+ start();
+ } catch (ManagedLifecycleException e) {
+ logger.error("", e);
+ return "Error invoking " + method + ": " + e.toString();
+ }
+ return "Invoking the " + method + " on the lifecycle.";
+ } else if (method.equalsIgnoreCase(STOP_ACTION)) {
+ try {
+ stop();
+ } catch (ManagedLifecycleException e) {
+ logger.error("", e);
+ return "Error invoking " + method + ": " + e.toString();
+ }
+ return "Invoking the " + method + " on the lifecycle.";
+ } else {
+ throw new ReflectionException(new NoSuchMethodException(method));
}
- return "Invoking the " + method + " on the lifecycle.";
- } else if (method.equalsIgnoreCase(STOP_ACTION)) {
- try {
- stop();
- } catch (ManagedLifecycleException e) {
- logger.error("", e);
- return "Error invoking " + method + ": " + e.toString();
- }
- return "Invoking the " + method + " on the lifecycle.";
- } else {
- throw new ReflectionException(new NoSuchMethodException(method));
+ } finally {
+ Thread.currentThread().setContextClassLoader(current) ;
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -23,10 +23,6 @@
import java.util.Collection;
-import org.jboss.soa.esb.schedule.ScheduleProvider;
-import org.jboss.soa.esb.schedule.SchedulingException;
-import org.apache.log4j.Logger;
-
/**
* Controller class to manage the lifecycles of a set of managed instances.
*
@@ -34,13 +30,10 @@
*/
public class ManagedLifecycleController
{
- private static Logger logger = Logger.getLogger(ManagedLifecycleController.class);
-
/**
* The managed lifecycle instances.
*/
private final ManagedLifecycle[] instances;
- private ScheduleProvider scheduleProvider;
/**
* Construct the controller to manage the specified managed lifecycle instances.
@@ -68,14 +61,6 @@
{
initialiseInstances();
startInstances();
- try {
- if(scheduleProvider != null) {
- scheduleProvider.start();
- }
- } catch (SchedulingException e) {
- stopAndDestroy(false);
- throw new ManagedLifecycleException("Failed to start schedule provider.", e);
- }
}
/**
@@ -87,25 +72,8 @@
*/
public void restart() throws ManagedLifecycleException
{
- try
- {
- if(scheduleProvider != null) {
- scheduleProvider.stop();
- }
- } catch (SchedulingException e) {
- stopAndDestroy(false);
- throw new ManagedLifecycleException("Failed to put schedule provider into standby.", e);
- }
stopInstances();
startInstances();
- try {
- if(scheduleProvider != null) {
- scheduleProvider.start();
- }
- } catch (SchedulingException e) {
- stopAndDestroy(false);
- throw new ManagedLifecycleException("Failed to restart schedule provider.", e);
- }
}
/**
@@ -117,20 +85,7 @@
*/
public void stop() throws ManagedLifecycleException
{
- try
- {
- stopAndDestroy(true) ;
- }
- finally
- {
- if(scheduleProvider != null) {
- try {
- scheduleProvider.stop();
- } catch (SchedulingException e) {
- logger.error("Failed to stop scheduling.", e);
- }
- }
- }
+ stopAndDestroy(true) ;
}
/**
@@ -302,8 +257,4 @@
destroyInstances(numInstances-1) ;
}
}
-
- public void setScheduleProvider(ScheduleProvider scheduleProvider) {
- this.scheduleProvider = scheduleProvider;
- }
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -48,7 +48,7 @@
{
CONSTRUCTED { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == INITIALISING) ;}} ,
INITIALISING { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == INITIALISED) || (newState == DESTROYED)) ;}} ,
- INITIALISED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTING) || (newState == DESTROYED)) ;}} ,
+ INITIALISED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTING) || (newState == DESTROYING)) ;}} ,
STARTING { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTED) || (newState == STOPPED)) ;}} ,
STARTED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == RUNNING) || (newState == STOPPING)) ;}} ,
RUNNING { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == STOPPING) ;}} ,
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -22,7 +22,6 @@
package org.jboss.soa.esb.listeners.message;
-import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -375,11 +374,11 @@
try
{
// Check if a encrypted SecurityContext was passed with the Message to this service.
- securityContext = SecurityContext.decryptContext((byte[])message.getProperties().getProperty(SecurityService.CONTEXT));
+ securityContext = SecurityContext.decryptContext((byte[])message.getContext().getContext(SecurityService.CONTEXT));
}
catch (final SecurityServiceException e)
{
- LOGGER.error("Security exception: ", e);
+ LOGGER.debug("Security exception: ", e);
// just make sure the securityContext is null. This will trigger a new auth if security is enabled.
securityContext = null;
}
@@ -401,7 +400,7 @@
faultTo(callDetails, Factory.createErrorMessage(Factory.NOT_ENABLED, message, null));
long procTime = System.nanoTime() - start;
- DeliveryObservableLogger.getInstance().logMessage(new MessageStatusBean(procTime, message,
+ MessageCounterStatistics.getMessageCounterStatistics().update(new MessageStatusBean(procTime, message,
MessageStatusBean.MESSAGE_FAILED));
return false;
@@ -424,7 +423,11 @@
securityContext = new SecurityContext();
// get the authentication request from the message
- byte[] encrypted = (byte[]) message.getProperties().getProperty(SecurityService.AUTH_REQUEST);
+ byte[] encrypted = (byte[]) message.getContext().getContext(SecurityService.AUTH_REQUEST);
+ if (encrypted == null)
+ {
+ throw new SecurityServiceException("Missing AuthenticationRequest. Cannot be authenticated.");
+ }
AuthenticationRequest authRequest = (AuthenticationRequest) PublicCryptoUtil.INSTANCE.decrypt(encrypted);
// authenticate the caller
@@ -445,21 +448,21 @@
}
catch (final SecurityServiceException e)
{
- LOGGER.error( "SecurityService exception : ", e);
+ LOGGER.debug( "SecurityService exception : ", e);
faultTo(callDetails, Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, e));
return false;
}
catch (final ConfigurationException e)
{
- LOGGER.error( "SecurityService exception : ", e);
+ LOGGER.debug( "SecurityService exception : ", e);
faultTo(callDetails, Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, e));
return false;
}
finally
{
// always remove the security context
- message.getProperties().remove(SecurityService.CONTEXT);
- message.getProperties().remove(SecurityService.AUTH_REQUEST);
+ message.getContext().removeContext(SecurityService.CONTEXT);
+ message.getContext().removeContext(SecurityService.AUTH_REQUEST);
}
// the work to be performed in the context of the authenticated caller
@@ -478,7 +481,7 @@
private boolean processPipeline(final Message message)
{
- long start = System.nanoTime();
+ final long start = System.nanoTime();
final Call callDetails = new Call() ;
callDetails.copy(message.getHeader().getCall()) ;
@@ -509,19 +512,16 @@
final ActionPipelineProcessor processor = processors[count];
messages[count] = currentMessage;
+ final long actionStart = System.nanoTime();
try
{
LOGGER.debug("executing processor " + count+ " "+processor+" "+message.getHeader());
currentMessage = processor.process(currentMessage);
-
- if (currentMessage == null)
- {
- break;
- }
}
catch (final Exception ex)
{
+ final long procTime = System.nanoTime() - actionStart;
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("Unexpected exception caught while processing the action pipeline: "+message.getHeader(),ex);
@@ -552,10 +552,10 @@
faultTo(callDetails, Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, ex));
}
- long procTime = System.nanoTime() - start;
+ final long totalProcTime = System.nanoTime() - start;
serviceMessageCounter.update(new ActionStatusBean(procTime, count, message,
ActionStatusBean.ACTION_FAILED));
- DeliveryObservableLogger.getInstance().logMessage(new MessageStatusBean(procTime, message,
+ MessageCounterStatistics.getMessageCounterStatistics().update(new MessageStatusBean(totalProcTime, message,
MessageStatusBean.MESSAGE_FAILED));
if (throwRuntime)
@@ -564,8 +564,14 @@
}
return false;
}
- serviceMessageCounter.update(new ActionStatusBean((System.nanoTime() - start), count, message,
+ final long procTime = System.nanoTime() - actionStart;
+ serviceMessageCounter.update(new ActionStatusBean(procTime, count, message,
ActionStatusBean.ACTION_SENT));
+
+ if (currentMessage == null)
+ {
+ break;
+ }
}
// Reply...
@@ -596,7 +602,7 @@
{
notifySuccess(messages);
long procTime = System.nanoTime() - start;
- DeliveryObservableLogger.getInstance().logMessage(new MessageStatusBean(procTime, message,
+ MessageCounterStatistics.getMessageCounterStatistics().update(new MessageStatusBean(procTime, message,
MessageStatusBean.MESSAGE_SENT));
result = true;
}
@@ -607,7 +613,7 @@
final MessageValidationException mve = new MessageValidationException(validationFailure) ;
faultTo(callDetails, Factory.createErrorMessage(Factory.VALIDATION_FAILURE, message, mve));
long procTime = System.nanoTime() - start;
- DeliveryObservableLogger.getInstance().logMessage(new MessageStatusBean(procTime, message,
+ MessageCounterStatistics.getMessageCounterStatistics().update(new MessageStatusBean(procTime, message,
MessageStatusBean.MESSAGE_FAILED));
}
return result ;
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/DeliveryObservableLogger.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/DeliveryObservableLogger.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/DeliveryObservableLogger.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -25,6 +25,7 @@
* DeliveryObservableLogger is an observable which reports out to Observers.
*
* @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @deprecated No longer used
*/
public class DeliveryObservableLogger extends Observable {
private static DeliveryObservableLogger ref = null;
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounter.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounter.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounter.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -20,12 +20,6 @@
package org.jboss.soa.esb.listeners.message;
-import java.sql.Timestamp;
-import java.util.Observable;
-import java.util.Observer;
-
-import org.jboss.system.ServiceMBeanSupport;
-
/**
* MessageCounter is a MBean implementation which keeps track of message data and
* metadata.
@@ -33,30 +27,14 @@
* @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
*
*/
-public class MessageCounter extends ServiceMBeanSupport implements MessageCounterMBean, Observer {
+public class MessageCounter implements MessageCounterMBean {
- private String lastSuccessfulMessageDate;
- private String lastFailedMessageDate;
- private int failedMessageCount;
- private int successMessageCount;
- private long totalProcessTime;
- private int bytesProcessed;
- private int bytesFailed;
-
/**
- * Constructor.
- */
- public MessageCounter () {
- DeliveryObservableLogger.getInstance().addObserver(this);
- resetCounts();
- }
-
- /**
* Get the total number of failed messages.
* @return total number of failed messages
*/
public int getFailedMessageCount() {
- return failedMessageCount;
+ return MessageCounterStatistics.getMessageCounterStatistics().getFailedMessageCount();
}
/**
@@ -64,7 +42,7 @@
* @return time the last message was processed at
*/
public String getLastSuccessfulMessageDate() {
- return lastSuccessfulMessageDate;
+ return MessageCounterStatistics.getMessageCounterStatistics().getLastSuccessfulMessageDate();
}
/**
@@ -72,7 +50,7 @@
* @return time the last message was processed at
*/
public String getLastFailedMessageDate() {
- return lastFailedMessageDate;
+ return MessageCounterStatistics.getMessageCounterStatistics().getLastFailedMessageDate();
}
/**
@@ -80,7 +58,7 @@
* @return total number of processed messages
*/
public int getTotalMessageCount() {
- return (failedMessageCount + successMessageCount);
+ return MessageCounterStatistics.getMessageCounterStatistics().getTotalMessageCount();
}
/**
@@ -88,64 +66,29 @@
* @return total number of successfully processed messages
*/
public int getSuccessfulMessageCount() {
- return successMessageCount;
+ return MessageCounterStatistics.getMessageCounterStatistics().getSuccessfulMessageCount();
}
public int getProcessedBytes() {
- return bytesProcessed;
+ return MessageCounterStatistics.getMessageCounterStatistics().getProcessedBytes();
}
public int getFailedBytes() {
- return bytesFailed;
+ return MessageCounterStatistics.getMessageCounterStatistics().getFailedBytes();
}
-
- /**
- * Update the message counter based on the MessageStatusBean that is returned
- * from the observable.
- * @param o the observable object
- * @param arg the MessageStatusBean
- */
- public void update(Observable o, Object arg) {
- MessageStatusBean msb = (MessageStatusBean) arg;
-
- if (msb.getMessageStatus().equals(MessageStatusBean.MESSAGE_SENT)) {
- successMessageCount++;
- Timestamp ts = new Timestamp(msb.getMessageTime());
- lastSuccessfulMessageDate = ts.toString();
- bytesProcessed += msb.getMessageBytes();
- } else if (msb.getMessageStatus().equals(MessageStatusBean.MESSAGE_FAILED)) {
- failedMessageCount++;
- Timestamp ts = new Timestamp(msb.getMessageTime());
- lastFailedMessageDate = ts.toString();
- bytesFailed += msb.getMessageBytes();
- }
-
- totalProcessTime += msb.getProcessTime();
- }
/**
* Get the average time to process a message.
* @return average time to process a message
*/
public Double getAverageSuccessTime() {
- if ((successMessageCount) > 0) {
- double ms = (double) totalProcessTime / (1000000 * successMessageCount);
- return new Double(ms);
- } else {
- return null;
- }
+ return MessageCounterStatistics.getMessageCounterStatistics().getAverageSuccessTime();
}
/**
* Reset the counts - this resets the totals and the last message time.
*/
public void resetCounts() {
- lastSuccessfulMessageDate = "---";
- lastFailedMessageDate = "---";
- successMessageCount = 0;
- failedMessageCount = 0;
- totalProcessTime = 0;
- bytesProcessed = 0;
- bytesFailed = 0;
+ MessageCounterStatistics.getMessageCounterStatistics().resetCounts();
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterMBean.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterMBean.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterMBean.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -19,7 +19,6 @@
*/
package org.jboss.soa.esb.listeners.message;
-import org.jboss.system.ServiceMBean;
/**
* MBean to represent simple message counting. Stores the number of succesful and
@@ -29,7 +28,7 @@
* @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
*
*/
-public interface MessageCounterMBean extends ServiceMBean {
+public interface MessageCounterMBean {
public int getTotalMessageCount();
public int getSuccessfulMessageCount();
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,170 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.message;
+
+import java.sql.Timestamp;
+import java.util.Observable;
+
+/**
+ * Extraction of core from MessageCounter bean.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ *
+ */
+public class MessageCounterStatistics {
+
+
+ private static final MessageCounterStatistics SINGLETON = new MessageCounterStatistics() ;
+
+ private long lastSuccessfulMessageDate;
+ private long lastFailedMessageDate;
+ private int failedMessageCount;
+ private int successMessageCount;
+ private long totalProcessTime;
+ private int bytesProcessed;
+ private int bytesFailed;
+
+ /**
+ * Constructor.
+ */
+ public MessageCounterStatistics() {
+ resetCounts();
+ }
+
+ /**
+ * Get the total number of failed messages.
+ * @return total number of failed messages
+ */
+ public synchronized int getFailedMessageCount() {
+ return failedMessageCount;
+ }
+
+ /**
+ * Get the time the last message was processed at.
+ * @return time the last message was processed at
+ */
+ public synchronized String getLastSuccessfulMessageDate() {
+ return getDate(lastSuccessfulMessageDate);
+ }
+
+ /**
+ * Get the time the last message was processed at.
+ * @return time the last message was processed at
+ */
+ public synchronized String getLastFailedMessageDate() {
+ return getDate(lastFailedMessageDate);
+ }
+
+ /**
+ * Get the total number of processed messages, both successful and failed.
+ * @return total number of processed messages
+ */
+ public synchronized int getTotalMessageCount() {
+ return (failedMessageCount + successMessageCount);
+ }
+
+ /**
+ * Get the total number of successfully processed messages.
+ * @return total number of successfully processed messages
+ */
+ public synchronized int getSuccessfulMessageCount() {
+ return successMessageCount;
+ }
+
+ public synchronized int getProcessedBytes() {
+ return bytesProcessed;
+ }
+
+ public synchronized int getFailedBytes() {
+ return bytesFailed;
+ }
+
+ /**
+ * Update the message counter based on the MessageStatusBean that is returned
+ * from the observable.
+ * @param o the observable object
+ * @param arg the MessageStatusBean
+ */
+ public synchronized void update(MessageStatusBean msb) {
+ if (msb.getMessageStatus().equals(MessageStatusBean.MESSAGE_SENT)) {
+ successMessageCount++;
+ Timestamp ts = new Timestamp(msb.getMessageTime());
+ if (msb.getMessageTime() > lastSuccessfulMessageDate) {
+ lastSuccessfulMessageDate = msb.getMessageTime();
+ }
+ bytesProcessed += msb.getMessageBytes();
+ } else if (msb.getMessageStatus().equals(MessageStatusBean.MESSAGE_FAILED)) {
+ failedMessageCount++;
+ Timestamp ts = new Timestamp(msb.getMessageTime());
+ if (msb.getMessageTime() > lastFailedMessageDate) {
+ lastFailedMessageDate = msb.getMessageTime();
+ }
+ bytesFailed += msb.getMessageBytes();
+ }
+
+ totalProcessTime += msb.getProcessTime();
+ }
+
+ /**
+ * Get the average time to process a message.
+ * @return average time to process a message
+ */
+ public synchronized Double getAverageSuccessTime() {
+ if ((successMessageCount) > 0) {
+ double ms = (double) totalProcessTime / (1000000 * successMessageCount);
+ return new Double(ms);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Reset the counts - this resets the totals and the last message time.
+ */
+ public synchronized void resetCounts() {
+ lastSuccessfulMessageDate = 0;
+ lastFailedMessageDate = 0;
+ successMessageCount = 0;
+ failedMessageCount = 0;
+ totalProcessTime = 0;
+ bytesProcessed = 0;
+ bytesFailed = 0;
+ }
+
+ /**
+ * Get the string representation of the time.
+ * @param time The time.
+ * @return The string representation.
+ */
+ private static String getDate(final long time) {
+ if (time <= 0) {
+ return "---" ;
+ } else {
+ // not sure why timestamp is being used.
+ final Timestamp ts = new Timestamp(time) ;
+ return ts.toString() ;
+ }
+ }
+
+ public static MessageCounterStatistics getMessageCounterStatistics() {
+ return SINGLETON ;
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounter.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounter.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/listeners/message/ServiceMessageCounter.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -55,18 +55,18 @@
* @since Version 4.2
*/
public class ServiceMessageCounter implements DynamicMBean {
- private Hashtable<String, Integer> actionCounterHash;
- private Hashtable<String, Integer> actionFailedCounterHash;
- private Hashtable<String, Long> actionProcessTimeHash;
- private Hashtable<String, Integer> actionBytesProcessedHash;
- private Hashtable<String, Integer> actionBytesFailedHash;
+ private Hashtable<String, IntHolder> actionCounterHash;
+ private Hashtable<String, IntHolder> actionFailedCounterHash;
+ private Hashtable<String, LongHolder> actionProcessTimeHash;
+ private Hashtable<String, IntHolder> actionBytesProcessedHash;
+ private Hashtable<String, IntHolder> actionBytesFailedHash;
private String[] actionNames;
private final ObjectName listObjectName ;
- private Integer serviceCount;
- private Integer bytesFailed;
- private Integer bytesProcessed;
+ private int serviceCount;
+ private long bytesFailed;
+ private long bytesProcessed;
public static final String RESET_COUNTER = "resetCounter";
private static final String MESSAGE_COUNTER = "messages successfully processed count";
@@ -88,16 +88,12 @@
* @param objectName The name to use as the MBean.
*/
public ServiceMessageCounter(ConfigTree f_config, final String objectName) {
- actionCounterHash = new Hashtable<String, Integer>();
- actionFailedCounterHash = new Hashtable<String, Integer>();
- actionProcessTimeHash = new Hashtable<String, Long>();
- actionBytesProcessedHash = new Hashtable<String, Integer>();
- actionBytesFailedHash = new Hashtable<String, Integer>();
+ actionCounterHash = new Hashtable<String, IntHolder>();
+ actionFailedCounterHash = new Hashtable<String, IntHolder>();
+ actionProcessTimeHash = new Hashtable<String, LongHolder>();
+ actionBytesProcessedHash = new Hashtable<String, IntHolder>();
+ actionBytesFailedHash = new Hashtable<String, IntHolder>();
- serviceCount = new Integer(0);
- bytesProcessed = new Integer(0);
- bytesFailed = new Integer(0);
-
init(f_config);
ObjectName listObjectName = null ;
try
@@ -130,7 +126,7 @@
* Increment the total message count of this service.
*/
public synchronized void incrementTotalCount() {
- serviceCount = new Integer(serviceCount.intValue() + 1);
+ serviceCount += 1 ;
}
/**
@@ -145,11 +141,11 @@
for (int count = 0 ; count < numActions ; count++) {
final ConfigTree actionConfig = actionList[count] ;
String actionId = getActionId(actionConfig);
- actionCounterHash.put(actionId + " " + MESSAGE_COUNTER, new Integer(0));
- actionFailedCounterHash.put(actionId + " " + FAILED_MESSAGE_COUNTER, new Integer(0));
- actionProcessTimeHash.put(actionId + " " + PROCESSING_TIME, new Long(0));
- actionBytesFailedHash.put(actionId + " " + BYTES_FAILED, new Integer(0));
- actionBytesProcessedHash.put(actionId + " " + BYTES_PROCESSED, new Integer(0));
+ actionCounterHash.put(actionId + " " + MESSAGE_COUNTER, new IntHolder());
+ actionFailedCounterHash.put(actionId + " " + FAILED_MESSAGE_COUNTER, new IntHolder());
+ actionProcessTimeHash.put(actionId + " " + PROCESSING_TIME, new LongHolder());
+ actionBytesFailedHash.put(actionId + " " + BYTES_FAILED, new IntHolder());
+ actionBytesProcessedHash.put(actionId + " " + BYTES_PROCESSED, new IntHolder());
actionNames[count] = actionId ;
}
serviceCount = new Integer(0);
@@ -162,28 +158,28 @@
* and in the action process time hash to zero.
*/
public synchronized void resetCounter() {
- serviceCount = new Integer(0);
- bytesProcessed = new Integer(0);
- bytesFailed = new Integer(0);
+ serviceCount = 0 ;
+ bytesProcessed = 0 ;
+ bytesFailed = 0 ;
for (String key : actionCounterHash.keySet()) {
- actionCounterHash.put(key, new Integer(0));
+ actionCounterHash.put(key, new IntHolder());
}
for (String key : actionFailedCounterHash.keySet()) {
- actionFailedCounterHash.put(key, new Integer(0));
+ actionFailedCounterHash.put(key, new IntHolder());
}
for (String key : actionProcessTimeHash.keySet()) {
- actionProcessTimeHash.put(key, new Long(0));
+ actionProcessTimeHash.put(key, new LongHolder());
}
for (String key : actionBytesFailedHash.keySet()) {
- actionBytesFailedHash.put(key, new Integer(0));
+ actionBytesFailedHash.put(key, new IntHolder());
}
for (String key : actionBytesProcessedHash.keySet()) {
- actionBytesProcessedHash.put(key, new Integer(0));
+ actionBytesProcessedHash.put(key, new IntHolder());
}
}
@@ -262,30 +258,25 @@
*/
public synchronized Object getAttribute(String key) throws AttributeNotFoundException, MBeanException, ReflectionException {
if (actionCounterHash.containsKey(key)) {
- Integer value = null;
- value = actionCounterHash.get(key);
- return value;
+ return actionCounterHash.get(key).value;
} else if (actionProcessTimeHash.containsKey(key)) {
- Long processTotal = actionProcessTimeHash.get(key);
+ long processTotal = actionProcessTimeHash.get(key).value;
String actionId = key.substring(0, key.indexOf(PROCESSING_TIME)-1);
- Integer successCount = actionCounterHash.get(actionId + " " + MESSAGE_COUNTER);
+ int successCount = actionCounterHash.get(actionId + " " + MESSAGE_COUNTER).value;
Double value = null;
- if (successCount.intValue() > 0) {
- value = ((double) processTotal / successCount.intValue());
+ if (successCount > 0) {
+ value = ((double) processTotal / successCount);
} else {
value = null;
}
return value;
} else if (actionFailedCounterHash.containsKey(key)) {
- Integer value = actionFailedCounterHash.get(key);
- return value;
+ return actionFailedCounterHash.get(key).value;
} else if (actionBytesFailedHash.containsKey(key)) {
- Integer value = actionBytesFailedHash.get(key);
- return value;
+ return actionBytesFailedHash.get(key).value;
} else if (actionBytesProcessedHash.containsKey(key)) {
- Integer value = actionBytesProcessedHash.get(key);
- return value;
+ return actionBytesProcessedHash.get(key).value;
} else if (OVERALL_SERVICE_COUNT.equals(key)) {
return serviceCount;
} else if (OVERALL_BYTES_PROCESSED.equals(key)) {
@@ -310,12 +301,12 @@
attributeList.add(overallCount);
for (String key : actionProcessTimeHash.keySet()) {
- Long processTotal = actionProcessTimeHash.get(key);
+ long processTotal = actionProcessTimeHash.get(key).value;
String actionId = key.substring(0, key.indexOf(PROCESSING_TIME));
- Integer successCount = actionCounterHash.get(actionId + " " + MESSAGE_COUNTER);
+ int successCount = actionCounterHash.get(actionId + " " + MESSAGE_COUNTER).value;
String avgTime = null;
- if (successCount.intValue() > 0) {
- avgTime = ((double) processTotal / successCount.intValue()) + " ns";
+ if (successCount > 0) {
+ avgTime = ((double) processTotal / successCount) + " ns";
}
Attribute at = new Attribute(key, avgTime);
attributeList.add(at);
@@ -424,29 +415,45 @@
String actionName = actionNames[asb.getProcCount()];
if (ActionStatusBean.ACTION_SENT.equals(asb.getStatus())) {
- Integer count = actionCounterHash.get(actionName + " " + MESSAGE_COUNTER);
- count = count.intValue() + 1;
- actionCounterHash.put(actionName + " " + MESSAGE_COUNTER, count);
- Long time = actionProcessTimeHash.get(actionName + " " + PROCESSING_TIME);
- time = time.longValue() + asb.getProcTime();
- actionProcessTimeHash.put(actionName + " " + PROCESSING_TIME, time);
- Integer bProcessed = actionBytesProcessedHash.get(actionName + " " + BYTES_PROCESSED);
- bProcessed = bProcessed.intValue() + asb.getBytesProcessed();
- actionBytesProcessedHash.put(actionName + " " + BYTES_PROCESSED, bProcessed);
+ IntHolder count = actionCounterHash.get(actionName + " " + MESSAGE_COUNTER);
+ count.value++ ;
+ LongHolder time = actionProcessTimeHash.get(actionName + " " + PROCESSING_TIME);
+ time.value += asb.getProcTime();
+ IntHolder bProcessed = actionBytesProcessedHash.get(actionName + " " + BYTES_PROCESSED);
+ bProcessed.value += asb.getBytesProcessed();
bytesProcessed += asb.getBytesProcessed();
} else if (ActionStatusBean.ACTION_FAILED.equals(asb.getStatus())) {
- Integer count = actionFailedCounterHash.get(actionName + " " + FAILED_MESSAGE_COUNTER);
- count = count.intValue() + 1;
- actionFailedCounterHash.put(actionName + " " + FAILED_MESSAGE_COUNTER, count);
+ IntHolder count = actionFailedCounterHash.get(actionName + " " + FAILED_MESSAGE_COUNTER);
+ count.value++ ;
+ LongHolder time = actionProcessTimeHash.get(actionName + " " + PROCESSING_TIME);
+ time.value += asb.getProcTime();
+ IntHolder bFailed = actionBytesFailedHash.get(actionName + " " + BYTES_FAILED);
+ bFailed.value += asb.getBytesProcessed();
bytesFailed += asb.getBytesProcessed();
- Integer bFailed = actionBytesFailedHash.get(actionName + " " + BYTES_FAILED);
- bFailed = bFailed.intValue() + asb.getBytesProcessed();
- actionBytesProcessedHash.put(actionName + " " + BYTES_FAILED, bFailed);
- }
+ }
}
protected ObjectName getObjectName()
{
return listObjectName;
}
+
+ // Very basic holder classes
+ private static final class IntHolder
+ {
+ int value ;
+ @Override
+ public String toString() {
+ return Integer.toString(value);
+ }
+ }
+
+ private static final class LongHolder
+ {
+ long value ;
+ @Override
+ public String toString() {
+ return Long.toString(value);
+ }
+ }
}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/message/ByReferenceMessage.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/src/org/jboss/soa/esb/message/ByReferenceMessage.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/message/ByReferenceMessage.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/message/ByReferenceMessage.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,41 @@
+package org.jboss.soa.esb.message;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+
+/**
+ * This interface extends the generic Message interface to provide a mechanism
+ * whereby implementations can take control over pass by value messaging.
+ * The implementation will be provided with an opportunity to create the
+ * reference message.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+
+public interface ByReferenceMessage extends Message
+{
+ /**
+ * Create the message used for pass by reference semantics.
+ * @return the referencable message.
+ */
+ public Message reference() ;
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/message/Context.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/message/Context.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/message/Context.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,5 +1,7 @@
package org.jboss.soa.esb.message;
+import java.util.Set;
+
/*
* JBoss, Home of Professional Open Source
* Copyright 2006, JBoss Inc., and others contributors as indicated
@@ -25,9 +27,42 @@
* The context is the section of the message containing information such as session
* management, transaction information, security data etc. Entries in the context
* may be ordered.
+ *
+ * This section should never be passed by reference.
*/
public interface Context
{
- // TODO add some methods!
+ /**
+ * Set the context value, replacing existing value if present.
+ * @param key The context key.
+ * @param value The context value.
+ * @return the previous value of the context or null if not set.
+ */
+ public Object setContext(final String key, final Object value) ;
+
+ /**
+ * Retrieves the context value.
+ * @param key The context key.
+ * @return The value or null if not present.
+ */
+ public Object getContext(final String key) ;
+
+ /**
+ * Remove the context value.
+ * @param key The context key.
+ * @return The value of the context, or null if not present.
+ */
+ public Object removeContext(final String key) ;
+
+ /**
+ * Get the keys in the context.
+ * @return the context keys.
+ */
+ public Set<String> getContextKeys() ;
+
+ /**
+ * Clear the context.
+ */
+ public void clearContext() ;
}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -167,6 +167,7 @@
oConn = createJdbcCleanConnection();
ps = oConn.prepareStatement(getInsertStmt());
oConn.execUpdWait(ps, 3);
+ // TODO the executeUpdate routine doesn't check return code, which could mask a problem https://jira.jboss.org/jira/browse/SOA-642
oConn.commit();
}
catch( SQLException e)
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/ScheduleProvider.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/ScheduleProvider.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/ScheduleProvider.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -41,6 +41,7 @@
*
* @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @deprecated {@link ScheduleResource}
*/
public class ScheduleProvider {
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,309 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.schedule;
+
+import java.text.ParseException;
+import java.util.Date;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.quartz.CronTrigger;
+import org.quartz.JobDataMap;
+import org.quartz.JobDetail;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.quartz.SimpleTrigger;
+import org.quartz.StatefulJob;
+import org.quartz.Trigger;
+
+/**
+ * Scheduler job tied to the lifecycle.
+ */
+public class SchedulerJob
+{
+ /**
+ * The logger for this class.
+ */
+ private static Logger LOGGER = Logger.getLogger(SchedulerJob.class);
+
+ /**
+ * The job group used by scheduled jobs.
+ */
+ private static final String JOB_GROUP = "ESBScheduler" ;
+
+ /**
+ * The base job name used by scheduled jobs.
+ */
+ private static final String JOB_NAME = "ESBJob" ;
+
+ /**
+ * The job counter.
+ */
+ private static long jobCounter ;
+
+ /**
+ * The name associated with this scheduler.
+ */
+ private final String name ;
+ /**
+ * The job details.
+ */
+ private final JobDetail jobDetail ;
+ /**
+ * The trigger associated with this job.
+ */
+ private final Trigger trigger ;
+ /**
+ * The scheduler properties.
+ */
+ private final Properties properties ;
+
+ /**
+ * Construct the job with the specified listener, trigger and properties.
+ * @param listener The job listener.
+ * @param trigger The associated trigger.
+ * @param properties Scheduler properties.
+ */
+ private SchedulerJob(final String name, final SchedulerJobListener listener,
+ final Trigger trigger, final Properties properties)
+ {
+ this.name = name ;
+ this.jobDetail = new JobDetail(trigger.getName(), JOB_GROUP, ESBScheduledJob.class) ;
+
+ final JobDataMap jobDataMap = new JobDataMap() ;
+ jobDataMap.put(SchedulerJobListener.class.getName(), listener) ;
+ jobDataMap.put(ClassLoader.class.getName(), Thread.currentThread().getContextClassLoader()) ;
+ jobDetail.setJobDataMap(jobDataMap) ;
+
+ this.trigger = trigger ;
+ this.properties = properties ;
+ }
+
+ /**
+ * Start or resume the operation of the trigger.
+ * @throws SchedulingException for errors during the operation.
+ */
+ public void start()
+ throws SchedulingException
+ {
+ if (LOGGER.isDebugEnabled())
+ {
+ LOGGER.debug("Starting SchedulerJob " + getName()) ;
+ }
+ SchedulerResource.getSchedulerResource().start(trigger, jobDetail, properties) ;
+ }
+
+ /**
+ * Pause the operation of the trigger.
+ * @throws SchedulingException for errors during the operation.
+ */
+ public void pause()
+ throws SchedulingException
+ {
+ if (LOGGER.isDebugEnabled())
+ {
+ LOGGER.debug("Pausing SchedulerJob " + getName()) ;
+ }
+ SchedulerResource.getSchedulerResource().pause(trigger) ;
+ }
+
+ /**
+ * Destroy the trigger.
+ * @throws SchedulingException for errors during the operation.
+ */
+ public void destroy()
+ throws SchedulingException
+ {
+ if (LOGGER.isDebugEnabled())
+ {
+ LOGGER.debug("Destroying SchedulerJob " + getName()) ;
+ }
+ SchedulerResource.getSchedulerResource().destroy(trigger) ;
+ }
+
+ /**
+ * Get a name associated with this schedule.
+ * @return a name for this schedule.
+ */
+ private String getName()
+ {
+ if (name != null)
+ {
+ return name + '/' + trigger.getName();
+ }
+ else
+ {
+ return trigger.getName() ;
+ }
+ }
+
+ /**
+ * Create a job based on an interval.
+ * @param name The name for the job.
+ * @param listener The listener to fire on schedule.
+ * @param interval The specified interval.
+ * @param properties Any scheduler properties that may be required.
+ * @return The Scheduler Job managing the schedule.
+ */
+ public static SchedulerJob createIntervalSchedulerJob(final String name, final SchedulerJobListener listener,
+ final long interval, final Properties properties)
+ {
+ final SimpleTrigger trigger = new SimpleTrigger(getJobName(), JOB_GROUP, SimpleTrigger.REPEAT_INDEFINITELY, interval) ;
+ trigger.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT) ;
+ return new SchedulerJob(name, listener, trigger, properties) ;
+ }
+
+ /**
+ * Create a job based on an interval.
+ * @param name The name for the job.
+ * @param listener The listener to fire on schedule.
+ * @param interval The specified interval.
+ * @param startDate The start date of the trigger or null if not constrained.
+ * @param endDate The end date of the trigger or null if not constrained.
+ * @param properties Any scheduler properties that may be required.
+ * @return The Scheduler Job managing the schedule.
+ */
+ public static SchedulerJob createIntervalSchedulerJob(final String name, final SchedulerJobListener listener,
+ final long interval, final Date startDate, final Date endDate, final Properties properties)
+ {
+ final SimpleTrigger trigger = new SimpleTrigger(getJobName(), JOB_GROUP, SimpleTrigger.REPEAT_INDEFINITELY, interval) ;
+ trigger.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT) ;
+ if (startDate != null)
+ {
+ trigger.setStartTime(startDate) ;
+ }
+ if (endDate != null)
+ {
+ trigger.setEndTime(endDate) ;
+ }
+ return new SchedulerJob(name, listener, trigger, properties) ;
+ }
+
+ /**
+ * Create a job based on an interval.
+ * @param name The name for the job.
+ * @param listener The listener to fire on schedule.
+ * @param interval The specified interval.
+ * #param execCount The execution count.
+ * @param startDate The start date of the trigger or null if not constrained.
+ * @param endDate The end date of the trigger or null if not constrained.
+ * @param properties Any scheduler properties that may be required.
+ * @return The Scheduler Job managing the schedule.
+ */
+ public static SchedulerJob createIntervalSchedulerJob(final String name, final SchedulerJobListener listener,
+ final long interval, final int execCount, final Date startDate, final Date endDate, final Properties properties)
+ {
+ final SimpleTrigger trigger = new SimpleTrigger(getJobName(), JOB_GROUP, execCount-1, interval) ;
+ trigger.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT) ;
+ if (startDate != null)
+ {
+ trigger.setStartTime(startDate) ;
+ }
+ if (endDate != null)
+ {
+ trigger.setEndTime(endDate) ;
+ }
+ return new SchedulerJob(name, listener, trigger, properties) ;
+ }
+
+ /**
+ * Create a job based on cron.
+ * @param name The name for the job.
+ * @param listener The listener to fire on schedule.
+ * @param cronExpression The cron expression.
+ * @param startDate The start date of the trigger or null if not constrained.
+ * @param endDate The end date of the trigger or null if not constrained.
+ * @param properties Any scheduler properties that may be required.
+ * @return The Scheduler Job managing the schedule.
+ * @throws ParseException for errors in the cron expression.
+ */
+ public static SchedulerJob createCronSchedulerJob(final String name, final SchedulerJobListener listener,
+ final String cronExpression, final Date startDate, final Date endDate, final Properties properties)
+ throws ParseException
+ {
+ final CronTrigger trigger = new CronTrigger(getJobName(), JOB_GROUP, cronExpression) ;
+ trigger.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING) ;
+ if (startDate != null)
+ {
+ trigger.setStartTime(startDate) ;
+ }
+ if (endDate != null)
+ {
+ trigger.setEndTime(endDate) ;
+ }
+ return new SchedulerJob(name, listener, trigger, properties) ;
+ }
+
+ /**
+ * Get the name of the next job.
+ * @return The job name.
+ */
+ private static String getJobName()
+ {
+ final long id ;
+ synchronized(SchedulerJob.class)
+ {
+ id = ++jobCounter ;
+ }
+ return JOB_NAME + id ;
+ }
+
+ /**
+ * The scheduled job for executing the listener.
+ * @author kevin
+ */
+ public static class ESBScheduledJob implements StatefulJob
+ {
+ /**
+ * Execute the current job.
+ */
+ public void execute(final JobExecutionContext jobExecutionContext)
+ throws JobExecutionException
+ {
+ final JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap() ;
+ final SchedulerJobListener listener = (SchedulerJobListener) jobDataMap.get(SchedulerJobListener.class.getName()) ;
+ final ClassLoader tcc = (ClassLoader)jobDataMap.get(ClassLoader.class.getName()) ;
+
+ final Thread thread = Thread.currentThread() ;
+ final ClassLoader currentClassLoader = thread.getContextClassLoader() ;
+ thread.setContextClassLoader(tcc) ;
+ try
+ {
+ listener.onSchedule() ;
+ }
+ catch (final SchedulingException se)
+ {
+ final JobExecutionException jobException = new JobExecutionException("Scheduling exception on " + jobExecutionContext.getTrigger().getName()) ;
+ jobException.initCause(se) ;
+ throw jobException ;
+ }
+ catch (final Throwable th)
+ {
+ final JobExecutionException jobException = new JobExecutionException("Unexpected exception on " + jobExecutionContext.getTrigger().getName()) ;
+ jobException.initCause(th) ;
+ throw jobException ;
+ }
+ finally
+ {
+ thread.setContextClassLoader(currentClassLoader) ;
+ }
+ }
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJobListener.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJobListener.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJobListener.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJobListener.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.schedule;
+
+/**
+ * Interface used to register scheduled resource listeners with the lifecycle.
+ *
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ */
+public interface SchedulerJobListener
+{
+ /**
+ * Handle the scheduled event.
+ *
+ * @throws SchedulingException For any errors occurring during the scheduled event.
+ */
+ public void onSchedule()
+ throws SchedulingException ;
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerResource.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerResource.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerResource.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerResource.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,316 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.schedule;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.lifecycle.LifecyclePriorities;
+import org.jboss.soa.esb.lifecycle.LifecycleResource;
+import org.jboss.soa.esb.lifecycle.LifecycleResourceException;
+import org.jboss.soa.esb.lifecycle.LifecycleResourceFactory;
+import org.jboss.soa.esb.lifecycle.LifecycleResourceManager;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.quartz.JobDetail;
+import org.quartz.ObjectAlreadyExistsException;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.Trigger;
+import org.quartz.impl.StdSchedulerFactory;
+
+/**
+ * Scheduler resource tied to the lifecycle.
+ */
+public class SchedulerResource
+{
+ /**
+ * The logger for this class.
+ */
+ private static Logger LOGGER = Logger.getLogger(SchedulerResource.class);
+
+ /**
+ * The lifecycle resource factory.
+ */
+ private static final LifecycleResourceFactory<SchedulerResource> lifecycleSchedulerFactory = new SchedulerFactory() ;
+ /**
+ * Lifecycle schedulers.
+ */
+ private static final LifecycleResource<SchedulerResource> lifecycleSchedulerResource =
+ new LifecycleResource<SchedulerResource>(lifecycleSchedulerFactory, LifecyclePriorities.SCHEDULE_RESOURCE_PRIORITY) ;
+
+ /**
+ * The instance name property.
+ */
+ public static final String INSTANCE_NAME = "org.quartz.scheduler.instanceName" ;
+ /**
+ * The thread name property.
+ */
+ public static final String THREAD_NAME = "org.quartz.scheduler.threadName" ;
+ /**
+ * The thread count property.
+ */
+ public static final String THREAD_COUNT = "org.quartz.threadPool.threadCount" ;
+
+ /**
+ * The quartz scheduler associated with this resource.
+ */
+ private Scheduler scheduler ;
+
+ private SchedulerResource()
+ {
+ }
+
+ /**
+ * Start a trigger on the contextualised resource.
+ * @param trigger The trigger to enable.
+ * @param jobDetail The details of the job.
+ * @param properties The properties for the scheduler.
+ * @throws SchedulingException For any errors.
+ *
+ * Note that there is only one scheduler in force per scheduled esb artifact and, therefore,
+ * the first invocation will create the scheduler. We may support multiple schedulers at a later
+ * point in time.
+ */
+ synchronized void start(final Trigger trigger, final JobDetail jobDetail, final Properties properties)
+ throws SchedulingException
+ {
+ initScheduler(properties) ;
+ try
+ {
+ try
+ {
+ scheduler.scheduleJob(jobDetail, trigger) ;
+ }
+ catch (final ObjectAlreadyExistsException oaee)
+ {
+ scheduler.resumeTrigger(trigger.getName(), trigger.getGroup()) ;
+ }
+ }
+ catch (final SchedulerException se)
+ {
+ throw new SchedulingException("Failed to start scheduled job", se) ;
+ }
+ }
+
+ /**
+ * Pause a trigger on the contextualised resource.
+ * @param trigger The trigger to pause.
+ * @throws SchedulingException For any errors.
+ */
+ synchronized void pause(final Trigger trigger)
+ throws SchedulingException
+ {
+ if (scheduler != null)
+ {
+ try
+ {
+ if (scheduler.isShutdown())
+ {
+ throw new SchedulingException("Scheduler has been shutdown") ;
+ }
+ scheduler.pauseTrigger(trigger.getName(), trigger.getGroup()) ;
+ }
+ catch (final SchedulerException se)
+ {
+ throw new SchedulingException("Failed to pause scheduled job", se) ;
+ }
+ }
+ }
+
+ /**
+ * Destroy a trigger on the contextualised resource.
+ * @param trigger The trigger to destroy.
+ * @throws SchedulingException For any errors.
+ */
+ synchronized void destroy(final Trigger trigger)
+ throws SchedulingException
+ {
+ if (scheduler != null)
+ {
+ try
+ {
+ if (scheduler.isShutdown())
+ {
+ throw new SchedulingException("Scheduler has been shutdown") ;
+ }
+ scheduler.unscheduleJob(trigger.getName(), trigger.getGroup()) ;
+ }
+ catch (final SchedulerException se)
+ {
+ throw new SchedulingException("Failed to destroy scheduled job", se) ;
+ }
+ }
+ }
+
+ /**
+ * Shutdown the contextualised resource.
+ * @throws SchedulingException For any errors.
+ */
+ synchronized void shutdown()
+ throws SchedulingException
+ {
+ if (scheduler != null)
+ {
+ try
+ {
+ if (!scheduler.isShutdown())
+ {
+ scheduler.shutdown() ;
+ }
+ }
+ catch (final SchedulerException se)
+ {
+ throw new SchedulingException("Failed to shutdown scheduler", se) ;
+ }
+ }
+ }
+
+ /**
+ * Initialise the scheduler if necessary.
+ * @param properties The properties used to create a scheduler.
+ */
+ private void initScheduler(final Properties properties)
+ throws SchedulingException
+ {
+ if (scheduler == null)
+ {
+ final InputStream quartzProperties = ClassUtil.getResourceAsStream("quartz.properties", SchedulerResource.class) ;
+
+ if(quartzProperties == null)
+ {
+ throw new SchedulingException("Failed to locate the default scheduling properties") ;
+ }
+
+ final Properties defaultProperties = new Properties();
+ try
+ {
+ defaultProperties.load(quartzProperties) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new SchedulingException("Failed to load the default scheduling properties") ;
+ }
+
+ if(properties != null)
+ {
+ defaultProperties.putAll(properties) ;
+ }
+
+ final String name = "ESBScheduler:" + getDeploymentName() ;
+ defaultProperties.put(INSTANCE_NAME, name) ;
+ defaultProperties.put(THREAD_NAME, name) ;
+ if (!defaultProperties.containsKey(THREAD_COUNT))
+ {
+ defaultProperties.put(THREAD_COUNT, "1") ;
+ }
+ final Scheduler scheduler ;
+ try
+ {
+ scheduler = new StdSchedulerFactory(defaultProperties).getScheduler();
+ scheduler.start() ;
+ }
+ catch (final SchedulerException se)
+ {
+ throw new SchedulingException("Failed to initialise the scheduler", se) ;
+ }
+ this.scheduler = scheduler ;
+ }
+ }
+
+ /**
+ * Create a name associated with this deployment.
+ * @return The deployment name.
+ */
+ private String getDeploymentName()
+ {
+ final LifecycleResourceManager lifecycleResourceManager = LifecycleResourceManager.getSingleton() ;
+ final String[] associatedDeployments = lifecycleResourceManager.getAssociatedDeployments() ;
+ final String deployment ;
+ if ((associatedDeployments != null) && (associatedDeployments.length == 1))
+ {
+ deployment = associatedDeployments[0] ;
+ }
+ else
+ {
+ deployment = lifecycleResourceManager.getIdentity() ;
+ }
+ return deployment ;
+ }
+
+ /**
+ * Get the scheduler resource.
+ * @return The scheduler resource.
+ * @throws LifecycleResourceException for errors acquiring the resource.
+ */
+ static SchedulerResource getSchedulerResource()
+ throws SchedulingException
+ {
+ try
+ {
+ return lifecycleSchedulerResource.getLifecycleResource() ;
+ }
+ catch (final LifecycleResourceException lre)
+ {
+ throw new SchedulingException("Failed to obtain the contextualised scheduler resource", lre) ;
+ }
+ }
+
+ /**
+ * The lifecycle resource factory
+ * @author kevin
+ */
+ private static class SchedulerFactory implements LifecycleResourceFactory<SchedulerResource>
+ {
+ /**
+ * Create a resource object which will be associated with the specified lifecycle identity.
+ * @param lifecycleIdentity The associated lifecycle identity.
+ * @return The lifecycle resource
+ * @throws LifecycleResourceException for errors during construction.
+ */
+ public SchedulerResource createLifecycleResource(final String lifecycleIdentity)
+ throws LifecycleResourceException
+ {
+ return new SchedulerResource() ;
+ }
+
+ /**
+ * Destroy a resource object which is associated with the specified lifecycle identity.
+ * @param resource The lifecycle resource.
+ * @param lifecycleIdentity The associated lifecycle identity.
+ * @return The lifecycle resource.
+ * @throws LifecycleResourceException for errors during destroy.
+ */
+ public void destroyLifecycleResource(final SchedulerResource resource, final String lifecycleIdentity)
+ throws LifecycleResourceException
+ {
+ LOGGER.debug("Shutting down scheduler for identity " + lifecycleIdentity) ;
+ try
+ {
+ resource.shutdown() ;
+ }
+ catch (final SchedulingException se)
+ {
+ throw new LifecycleResourceException("Failed to shutdown the contextualised scheduler resource") ;
+ }
+ }
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/quartz.properties
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/quartz.properties 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/schedule/quartz.properties 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,17 +1,14 @@
# Default ESB Quartz Properties file.
#
-org.quartz.scheduler.instanceName = ScheduleProviderScheduler
org.quartz.scheduler.rmi.export = false
org.quartz.scheduler.rmi.proxy = false
org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
-org.quartz.threadPool.threadCount = 20
org.quartz.threadPool.threadPriority = 5
-org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
-org.quartz.jobStore.misfireThreshold = 60000
+org.quartz.jobStore.misfireThreshold = 1
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityServiceFactory.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityServiceFactory.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityServiceFactory.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -33,7 +33,7 @@
private SecurityServiceFactory() { }
- public static SecurityService getSecurityService() throws ConfigurationException
+ public static synchronized SecurityService getSecurityService() throws ConfigurationException
{
if (instance != null)
{
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/auth/http/HttpSecurityInfoExtractor.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/auth/http/HttpSecurityInfoExtractor.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/auth/http/HttpSecurityInfoExtractor.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.services.security.auth.http;
-
-import java.util.HashSet;
-import java.util.Set;
-import javax.servlet.http.HttpServletRequest;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
-import org.jboss.soa.esb.services.security.auth.SecurityInfoExtractor;
-import org.jboss.soa.esb.services.security.principals.User;
-import org.jboss.util.Base64;
-
-/**
- * Extracts secuirty information from a HttpServletRequest
- * </p>
- * Supports BASIC authentication.
- *
- * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
- *
- */
-public class HttpSecurityInfoExtractor implements SecurityInfoExtractor<HttpServletRequest>
-{
-
- public AuthenticationRequest extractSecurityInfo(HttpServletRequest httpRequest)
- {
- final String authType = httpRequest.getAuthType();
- if ( authType == null )
- return null;
-
- Set<Object> credentials = new HashSet<Object>();
- if ( authType.equals("BASIC"))
- {
- String auth = httpRequest.getHeader("Authorization");
- auth = auth.substring(auth.indexOf(" "));
- // decode the Base64 encoded username:password
- String decoded = new String( Base64.decode(auth) );
- final int separator = decoded.indexOf(":");
- final String username = decoded.substring(0,separator);
- String pwd = decoded.substring(separator+1,decoded.length());
- credentials.add( pwd.toCharArray() );
- pwd = null;
- decoded = null;
- return new AuthenticationRequestImpl.Builder(new User(username), credentials ).build();
- }
- if ( authType.equals("DIGEST"))
- {
- // not supported yet.
- }
-
- return null;
- }
-
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/auth/ws/WSSecurityInfoExtractor.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/auth/ws/WSSecurityInfoExtractor.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/auth/ws/WSSecurityInfoExtractor.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -110,6 +110,10 @@
{
credentials.add(binaryToken.getKey());
}
+ if (credentials.isEmpty())
+ {
+ return null ;
+ }
return new AuthenticationRequestImpl.Builder(user, credentials ).build();
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/principals/User.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/principals/User.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/soa/esb/services/security/principals/User.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -50,7 +50,7 @@
public String toString()
{
- return "User [roleName=" + name + "]";
+ return "User [userName=" + name + "]";
}
@Override
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -135,6 +135,7 @@
<pathelement location="${basedir}/resources/etc"/>
<!-- using instrumented code for code coverage -->
<pathelement location="${org.jboss.esb.module.classes.instr.dir}"/>
+ <pathelement location="${org.jboss.esb.module.src.dir}"/>
<pathelement location="${org.jboss.esb.tests.classes.dir}"/>
<!-- Need the tests src folder because there may be non-compiled test resources -->
<pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
@@ -221,6 +222,7 @@
<classpath>
<!-- using instrumented code for code coverage -->
<pathelement location="${org.jboss.esb.module.classes.instr.dir}"/>
+ <pathelement location="${org.jboss.esb.module.src.dir}"/>
<pathelement location="${org.jboss.esb.tests.classes.dir}"/>
<!-- Need the tests src folder because there may be non-compiled test resources -->
<pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/BaseWebServiceUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/BaseWebServiceUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/BaseWebServiceUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,165 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.internal.soa.esb.webservice;
-
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.cert.X509Certificate;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.internal.soa.esb.couriers.MockCourier;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.security.PublicCryptoUtil;
-import org.jboss.soa.esb.services.security.SecurityService;
-import org.jboss.soa.esb.services.security.SecurityServiceException;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-import org.jboss.soa.esb.services.security.auth.ws.WSTestUtil;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.xml.sax.SAXException;
-
-/**
- * Unittest for {@link BaseWebService}
- *
- * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
- *
- */
-public class BaseWebServiceUnitTest
-{
- private static String serviceCategory = "cat";
- private static String serviceName = "name";
- private static MockCourier mockCourier;
- private String jbossEsbProperties;
-
- @Test
- public void invokeWithBinarySecurityTokenHeader() throws ParserConfigurationException, SAXException, IOException, SOAPException, MessageDeliverException, SecurityServiceException
- {
- SOAPMessage soap = WSTestUtil.createMessage("soap-keys-example.xml", BaseWebServiceUnitTest.class);
- MockBaseWebService service = new MockBaseWebService(serviceCategory, serviceName);
- service.invoke(soap);
-
- Message esbMessage = service.getEsbMessage();
- byte[] encrypted = (byte[]) esbMessage.getProperties().getProperty( SecurityService.AUTH_REQUEST );
- assertNotNull("AuthRequest should have been encrypted", encrypted );
-
- AuthenticationRequest authRequest = (AuthenticationRequest) PublicCryptoUtil.INSTANCE.decrypt(encrypted);
- assertNotNull( authRequest );
- assertTrue(authRequest.getCredentials().size() == 1 );
- assertTrue(authRequest.getCredentials().iterator().next() instanceof X509Certificate );
- }
-
- @Test
- public void invokeWithUsernameTokenHeader() throws ParserConfigurationException, SAXException, IOException, SOAPException, MessageDeliverException, SecurityServiceException
- {
- SOAPMessage soap = WSTestUtil.createMessage("soap-userpass-example.xml", BaseWebServiceUnitTest.class);
- MockBaseWebService service = new MockBaseWebService(serviceCategory, serviceName);
- service.invoke(soap);
-
- Message esbMessage = service.getEsbMessage();
- byte[] encrypted = (byte[]) esbMessage.getProperties().getProperty( SecurityService.AUTH_REQUEST );
- assertNotNull("AuthRequest should have been encrypted", encrypted );
-
- AuthenticationRequest authRequest = (AuthenticationRequest) PublicCryptoUtil.INSTANCE.decrypt(encrypted);
- assertNotNull( authRequest );
- assertEquals("Clark", authRequest.getPrincipal().getName());
- assertTrue(authRequest.getCredentials().size() == 1 );
- assertTrue(authRequest.getCredentials().iterator().next() instanceof char[] );
- }
-
- @BeforeClass
- public static void classSetup() throws ConfigurationException, URISyntaxException
- {
- MockCourierFactory.install();
- MockRegistry.install();
- EPR epr = new EPR(new URI("test1"));
- mockCourier = new MockCourier(true);
- MockRegistry.register(serviceCategory, serviceName, epr, mockCourier);
- }
-
- @AfterClass
- public static void classTearDown()
- {
- MockRegistry.uninstall();
- MockCourierFactory.uninstall();
- }
-
- @Before
- public void setup() throws ConfigurationException
- {
- jbossEsbProperties = System.getProperty(Environment.PROPERTIES_FILE);
- URL resource = ClassUtil.getResource("security-properties.xml", getClass());
- System.setProperty(Environment.PROPERTIES_FILE, "abs://" + resource.getFile());
- }
-
- @After
- public void tearDown()
- {
- if ( jbossEsbProperties != null )
- System.setProperty(Environment.PROPERTIES_FILE, jbossEsbProperties);
- }
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(BaseWebServiceUnitTest.class);
- }
-
- private class MockBaseWebService extends BaseWebService
- {
- private Message esbMessage;
-
- public Message getEsbMessage()
- {
- return esbMessage;
- }
-
- protected MockBaseWebService(String category, String name) throws MessageDeliverException
- {
- super(category, name);
- }
-
- @Override
- protected Message deliverMessage(Message request) throws Exception
- {
- this.esbMessage = request;
-
- return request;
- }
- }
-}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/cert-example.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/cert-example.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/cert-example.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,11 +0,0 @@
-MIICQjCCAasCBEif0tUwDQYJKoZIhvcNAQEEBQAwaDELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0
-b2NraG9sbTESMBAGA1UEBxMJU3RvY2tob2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVK
-Qm9zczEPMA0GA1UEAxMGRGFuaWVsMB4XDTA4MDgxMTA1NDkwOVoXDTA4MTEwOTA1NDkwOVowaDEL
-MAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0b2NraG9sbTESMBAGA1UEBxMJU3RvY2tob2xtMRAwDgYD
-VQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVKQm9zczEPMA0GA1UEAxMGRGFuaWVsMIGfMA0GCSqGSIb3
-DQEBAQUAA4GNADCBiQKBgQCdSh96Xyt4LeZbXz9pk4eaHrj2sGFmI9lkLQiW/DbF9ETXFvWYCS4N
-lsONmPx63KSbzJZQZRlJSAW2y6hQO18G9NMFQpn2W/jtPSw61kH3dXDQ+kZ2UMk9K93nt4XLvGm6
-dMQAGZAjzpz4lzhcYrDJI4NMw5LpeljDawkradtuiwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAHi2
-S1zC8jIqncSeMRwOvPOEQIcsZJELYFUCiTwPrAg5hNkp/oewm6uCkgqmry09+3+ZXg2KLQ+RgeuV
-8yfeBvk7TFjtOWeHWnBOaxKiAyLibxGchVfMPl847MZ2w4d6vu776cqb1NKghAE53dn9AzUHIWwx
-OizXyDaDiBMj5xgs
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/no-security-properties.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/no-security-properties.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/no-security-properties.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- JBoss, Home of Professional Open Source
- Copyright 2006, JBoss Inc., and others contributors as indicated
- by the @authors tag. All rights reserved.
- See the copyright.txt in the distribution for a
- full listing of individual contributors.
- This copyrighted material is made available to anyone wishing to use,
- modify, copy, or redistribute it subject to the terms and conditions
- of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License,
- v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
- (C) 2005-2006,
- @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
- These options are described in the JBossESB manual.
- Defaults are provided here for convenience only.
-
- Please read through this file prior to using the system, and consider
- updating the specified entries.
--->
-<esb
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
- <properties name="core">
- <property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="${jboss.esb.bind.address}:1099"/>
- <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
- <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
- <property name="jboss.esb.invm.scope.default" value="NONE"/>
- </properties>
- <properties name="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#publish"/>
- <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
- <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
- <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.registry.password" value="password"/>
- <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
- <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
- </properties>
- <properties name="transports" depends="core">
- <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
- <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
- <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
- <property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
- <property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
- <property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
- <property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
- <property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
- </properties>
- <properties name="connection">
- <property name="min-pool-size" value="5"/>
- <property name="max-pool=size" value="10"/>
- <property name="blocking-timeout-millis" value="5000"/>
- <property name="abandoned-connection-timeout" value="10000"/>
- <property name="abandoned-connection-time-interval" value="30000"/>
- </properties>
- <properties name="dbstore">
-
- <!-- connection manager type -->
- <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/> -->
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
-
- <!-- this property is only used if using the j2ee connection manager -->
- <property name="org.jboss.soa.esb.persistence.db.datasource.name" value="java:/JBossESBDS"/>
-
- <!-- standalone connection pooling settings -->
- <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
- <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
- <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
- <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
- <!--table managed by pool to test for valid connections - created by pool automatically -->
- <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
-
- </properties>
- <properties name="filters">
- <property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
- <property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
- </properties>
-</esb>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/publicKeyStore
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/security-properties.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/security-properties.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/security-properties.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- JBoss, Home of Professional Open Source
- Copyright 2006, JBoss Inc., and others contributors as indicated
- by the @authors tag. All rights reserved.
- See the copyright.txt in the distribution for a
- full listing of individual contributors.
- This copyrighted material is made available to anyone wishing to use,
- modify, copy, or redistribute it subject to the terms and conditions
- of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License,
- v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
- (C) 2005-2006,
- @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
- These options are described in the JBossESB manual.
- Defaults are provided here for convenience only.
-
- Please read through this file prior to using the system, and consider
- updating the specified entries.
--->
-<esb
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
- <properties name="core">
- <property name="org.jboss.soa.esb.jndi.server.context.factory" value="org.jnp.interfaces.NamingContextFactory"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="${jboss.esb.bind.address}:1099"/>
- <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
- <property name="org.jboss.soa.esb.loadbalancer.policy" value="org.jboss.soa.esb.listeners.ha.RoundRobin"/>
- <property name="jboss.esb.invm.scope.default" value="NONE"/>
- </properties>
- <properties name="security">
- <property name="org.jboss.soa.esb.services.security.implementationClass" value="org.jboss.internal.soa.esb.services.security.JaasSecurityService"/>
- <property name="org.jboss.soa.esb.services.security.callbackHandler" value="org.jboss.internal.soa.esb.services.security.UserPassCallbackHandler"/>
- <property name="org.jboss.soa.esb.services.security.configUrl" value="jaas.login"/>
-
- <property name="org.jboss.soa.esb.services.security.publicKeystore" value="publicKeyStore"/>
- <property name="org.jboss.soa.esb.services.security.publicKeystorePassword" value="testKeystorePassword"/>
- <property name="org.jboss.soa.esb.services.security.publicKeyAlias" value="testAlias"/>
- <property name="org.jboss.soa.esb.services.security.publicKeyPassword" value="testPassword"/>
- <property name="org.jboss.soa.esb.services.security.publicKeyTransformation" value="RSA/ECB/PKCS1Padding"/>
- </properties>
- <properties name="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#publish"/>
- <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
- <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
- <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.registry.password" value="password"/>
- <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
- <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
- </properties>
- <properties name="transports" depends="core">
- <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
- <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
- <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
- <property name="org.jboss.soa.esb.mail.smtp.auth" value="true"/>
- <property name="org.jboss.soa.esb.ftp.localdir" value="/tmp"/>
- <property name="org.jboss.soa.esb.ftp.remotedir" value="/tmp"/>
- <property name="org.jboss.soa.esb.jms.connectionPool" value="20"/>
- <property name="org.jboss.soa.esb.jms.sessionSleep" value="30"/>
- </properties>
- <properties name="connection">
- <property name="min-pool-size" value="5"/>
- <property name="max-pool=size" value="10"/>
- <property name="blocking-timeout-millis" value="5000"/>
- <property name="abandoned-connection-timeout" value="10000"/>
- <property name="abandoned-connection-time-interval" value="30000"/>
- </properties>
- <properties name="dbstore">
-
- <!-- connection manager type -->
- <!-- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/> -->
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.J2eeConnectionManager"/>
-
- <!-- this property is only used if using the j2ee connection manager -->
- <property name="org.jboss.soa.esb.persistence.db.datasource.name" value="java:/JBossESBDS"/>
-
- <!-- standalone connection pooling settings -->
- <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
- <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
- <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
- <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
- <!--table managed by pool to test for valid connections - created by pool automatically -->
- <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
-
- </properties>
- <properties name="filters">
- <property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
- <property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
- </properties>
-</esb>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/soap-keys-example.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/soap-keys-example.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/soap-keys-example.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,21 +0,0 @@
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Header>
- <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
- <wsse:BinarySecurityToken EncodingType="wsse:Base64Binary" ValueType="wsse:X509v3">MIICVDCCAb0CBEii4NgwDQYJKoZIhvcNAQEEBQAwcTELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0
-b2NraG9sbTESMBAGA1UEBxMJU3RvY2tob2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVK
-Qm9zczEYMBYGA1UEAxMPRGFuaWVsIEJldmVuaXVzMB4XDTA4MDgxMzEzMjU0NFoXDTM1MTIyOTEz
-MjU0NFowcTELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0b2NraG9sbTESMBAGA1UEBxMJU3RvY2to
-b2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVKQm9zczEYMBYGA1UEAxMPRGFuaWVsIEJl
-dmVuaXVzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCJRSE6wHkF5DK6DkHTMPnP4dNZXeon
-cCP7Ufn5hjXWLdsq9dAEbuiRLAE4HoNxxqgCHdoKjMO9N1/CIn5dmWw4DBWLp8OHx8Wnyp0MYmCz
-B31jHJpuXkkRq50vRYtKN0NIOyw7eF+XWf4u0dXNgFtXHuUxhAyEm/kTxO1SNVUTwwIDAQABMA0G
-CSqGSIb3DQEBBAUAA4GBADCzl0gXAY0xysdHkKNdwaBDzlibLPz2zmaHcit841qVn05p/I1gsbUV
-vEPh6i/Dj57vdE+X66sPbI36uZiqyWqEr6wvCJDtaTbhSLmckk7ioXwLvdKEQ150MPBsjWRRnFGN
-tZhrQfjo0q8seLh0kgconbfN4pHllfNkJPcdSBvi</wsse:BinarySecurityToken>
- </wsse:Security>
- </soap:Header>
- <soap:Body>
- <dummyBody>hello</dummyBody>
- </soap:Body>
-</soap:Envelope>
-
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/soap-userpass-example.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/soap-userpass-example.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/soap-userpass-example.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,19 +0,0 @@
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <soap:Header>
- <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
- <wsse:UsernameToken>
- <wsse:Username>Clark</wsse:Username>
- <wsse:Password>griswald</wsse:Password>
- </wsse:UsernameToken>
- </wsse:Security>
- </soap:Header>
-
- <soap:Body>
- <dummyBody>some content...</dummyBody>
- </soap:Body>
-
-</soap:Envelope>
-
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/InVMListenerUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -65,7 +65,7 @@
invoker.deliverAsync(message);
waitForMockSet(message);
- assertTrue(message == MockAction.message);
+ assertTrue("Message equality", checkMessageEquality(message, MockAction.message));
}
}.setServiceConfig("in-listener-config-01.xml");
@@ -104,8 +104,8 @@
message.getBody().add("Hi there!");
Message response = invoker.deliverSync(message, 2000);
- assertTrue(message == MockAction.message);
- assertTrue(message == response);
+ assertTrue("Message equality", checkMessageEquality(message, MockAction.message));
+ assertTrue("Message equality", checkMessageEquality(message, response));
}
}.setServiceConfig("in-listener-config-01.xml");
@@ -229,7 +229,7 @@
} catch (Exception e) {
fail("Error delivering message: " + e.getMessage());
}
- assertTrue(message == response);
+ assertTrue("Message equality", checkMessageEquality(message, response));
assertEquals("Tom Fennelly", response.getBody().get());
InVMListenerUnitTest.sleep(10);
@@ -252,14 +252,14 @@
invoker.deliverAsync(message);
waitForMockSet(message);
- assertTrue(message == MockAction.message);
+ assertTrue("Message equality", checkMessageEquality(message, MockAction.message));
}
private void waitForMockSet(Message message) {
long start = System.currentTimeMillis();
while(System.currentTimeMillis() - start < 5000) {
- if(message == MockAction.message) {
+ if(checkMessageEquality(message, MockAction.message)) {
return;
}
sleep(50);
@@ -273,4 +273,12 @@
fail("Unexpected InterruptedException exception.");
}
}
+
+ private static boolean checkMessageEquality(final Message expected, final Message actual) {
+ return (actual != null) && (expected.getAttachment().equals(actual.getAttachment())) &&
+ (expected.getBody().equals(actual.getBody())) &&
+ (expected.getFault().equals(actual.getFault())) &&
+ (expected.getProperties().equals(actual.getProperties())) &&
+ (expected.getType().equals(actual.getType())) ;
+ }
}
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ScheduledListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ScheduledListenerUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ScheduledListenerUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -75,6 +75,7 @@
tree.setAttribute("listenerClass", listenerClass );
tree.setAttribute("my-prop", "1");
tree.setAttribute("scheduleidref", "1-sec-trigger");
+ tree.setAttribute("scheduleSimpleFrequency", "1000") ;
final ConfigTree action = new ConfigTree("action", tree);
action.setAttribute("action", "action");
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_UnitTest.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_UnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_UnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_UnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import org.jboss.soa.esb.ConfigurationException;
+
+import junit.framework.TestCase;
+
+/**
+ * Test for bug http://jira.jboss.com/jira/browse/JBESB-1993.
+ *
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ */
+public class JBESB_1993_UnitTest extends TestCase
+{
+ public void testActionNames()
+ throws Exception
+ {
+ runTest("JBESB_1993_action.xml", "Tried to register a duplicate action name.") ;
+ }
+
+ public void testServiceNames()
+ throws Exception
+ {
+ runTest("JBESB_1993_service.xml", "Service names must be unique within a category.") ;
+ }
+
+ private void runTest(final String resource, final String expected)
+ throws Exception
+ {
+ final InputStream resourceIs = getClass().getResourceAsStream(resource) ;
+ final ByteArrayOutputStream listenerBAOS = new ByteArrayOutputStream() ;
+ final ByteArrayOutputStream gatewayBAOS = new ByteArrayOutputStream() ;
+ final Generator generator = new Generator(resourceIs, listenerBAOS, gatewayBAOS) ;
+ try
+ {
+ generator.generate();
+ }
+ catch (final ConfigurationException ce)
+ {
+ if (!ce.getMessage().startsWith(expected))
+ {
+ throw ce ;
+ }
+ }
+ }
+}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_action.xml (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_action.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_action.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_action.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,22 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+ <providers>
+ <jms-provider name="jms" connection-factory="ConnectionFactory">
+ <jms-bus busid="testBus">
+ <jms-message-filter dest-type="QUEUE" dest-name="XXX"/>
+ </jms-bus>
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service category="TestESB" name="TestService" description="Test Service">
+ <listeners>
+ <jms-listener name="testListener" busidref="testBus"/>
+ </listeners>
+ <actions>
+ <action name="testAction" class="org.jboss.soa.esb.actions.SystemPrintln"/>
+ <action name="testAction" class="org.jboss.soa.esb.actions.SystemPrintln"/>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_service.xml (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_service.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_service.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBESB_1993_service.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,29 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+ <providers>
+ <jms-provider name="jms" connection-factory="ConnectionFactory">
+ <jms-bus busid="testBus">
+ <jms-message-filter dest-type="QUEUE" dest-name="XXX"/>
+ </jms-bus>
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service category="TestESB" name="TestService" description="Test Service">
+ <listeners>
+ <jms-listener name="testListener" busidref="testBus"/>
+ </listeners>
+ <actions>
+ <action name="testAction" class="org.jboss.soa.esb.actions.SystemPrintln"/>
+ </actions>
+ </service>
+ <service category="TestESB" name="TestService" description="Test Service">
+ <listeners>
+ <jms-listener name="testListener" busidref="testBus"/>
+ </listeners>
+ <actions>
+ <action name="testAction" class="org.jboss.soa.esb.actions.SystemPrintln"/>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -63,20 +63,27 @@
config.setAttribute("script", "/org/jboss/soa/esb/listeners/gateway/testgateway.groovy");
groovyGateway = new MockGroovyGateway(config);
- groovyGateway.doInitialise();
- Thread thread = new Thread(new Runnable() {
- public void run() {
- groovyGateway.doRun();
- }
- });
- thread.start();
-
- Thread.sleep(2000);
- assertTrue("Is already stopped", (courier1.message == null));
- groovyGateway.stopped = true;
- Thread.sleep(2000);
- assertTrue("Is not stopped", (courier1.message != null));
- assertEquals("Hi there!", (String) courier1.message.getBody().get());
+ groovyGateway.initialise();
+ try
+ {
+ Thread thread = new Thread(new Runnable() {
+ public void run() {
+ groovyGateway.doRun();
+ }
+ });
+ thread.start();
+
+ Thread.sleep(2000);
+ assertTrue("Is already stopped", (courier1.message == null));
+ groovyGateway.stopped = true;
+ Thread.sleep(2000);
+ assertTrue("Is not stopped", (courier1.message != null));
+ assertEquals("Hi there!", (String) courier1.message.getBody().get());
+ }
+ finally
+ {
+ groovyGateway.destroy() ;
+ }
}
// TODO: Fix build such that it can pick up the scripts from the src folder.
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -100,13 +100,10 @@
} catch(ManagedLifecycleException e) {}
// Initialise...
- listener.doInitialise();
+ listener.initialise();
// try initialising again...
- try {
- listener.doInitialise();
- fail("Expected ManagedLifecycleException");
- } catch(ManagedLifecycleException e) {}
+ listener.initialise();
// try stopping without starting...
try {
@@ -115,22 +112,16 @@
} catch(ManagedLifecycleException e) {}
// Start...
- listener.doStart();
+ listener.start();
// try starting again...
- try {
- listener.start();
- fail("Expected ManagedLifecycleException");
- } catch(ManagedLifecycleException e) {}
+ listener.start();
// Stop...
- listener.doStop();
+ listener.stop();
// try stopping again...
- try {
- listener.doStop();
- fail("Expected ManagedLifecycleException");
- } catch(ManagedLifecycleException e) {}
+ listener.stop();
}
@Test
public void test_http_async() throws Throwable {
@@ -188,8 +179,8 @@
listener = new JBossRemotingGatewayListener(config);
}
- listener.doInitialise();
- listener.doStart();
+ listener.initialise();
+ listener.start();
}
private void sendMessageToServer(String protocol, Object messagePayload, final String port) throws Throwable {
@@ -223,9 +214,9 @@
private void stopServer() throws ManagedLifecycleException {
if(listener != null && listener.isStarted()) {
try {
- listener.doStop();
+ listener.stop();
} finally {
- listener.doDestroy();
+ listener.destroy();
}
}
}
@@ -246,7 +237,7 @@
try {
listener = new JBossRemotingGatewayListener(config);
- listener.doInitialise();
+ listener.initialise();
fail("Expected a ManagedLifecycleException.");
} catch (ConfigurationException e) {
log.error(e);
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerIntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerIntegrationTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerIntegrationTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -115,26 +115,30 @@
RemoteGatewayListenerMock mock = createAndStartListener ( configTree, getCourierReturnValue );
- File inputDir = ftpServer.getLocalInputDir();
- String doneFileName = testFile.getName();
-
- //waitForFile( inputDir, doneFileName );
- //stopdoRun( mock );
- try {
- mock.onSchedule();
- } catch (SchedulingException e) {
- fail(e.getMessage());
- }
-
- File processedFile = new File ( inputDir, doneFileName );
- try
- {
- assertTrue ( processedFile.exists() );
+ try {
+ File inputDir = ftpServer.getLocalInputDir();
+ String doneFileName = testFile.getName();
+
+ //waitForFile( inputDir, doneFileName );
+ //stopdoRun( mock );
+ try {
+ mock.onSchedule();
+ } catch (SchedulingException e) {
+ fail(e.getMessage());
+ }
+
+ File processedFile = new File ( inputDir, doneFileName );
+ try
+ {
+ assertTrue ( processedFile.exists() );
+ }
+ finally
+ {
+ FtpTestUtil.deleteFile( processedFile );
+ }
+ } finally {
+ mock.destroy();
}
- finally
- {
- FtpTestUtil.deleteFile( processedFile );
- }
}
/**
@@ -238,7 +242,7 @@
{
final RemoteGatewayListenerMock mock = new RemoteGatewayListenerMock( configTree );
try {
- mock.doInitialise();
+ mock.initialise();
} catch (ManagedLifecycleException e) {
fail(e.getMessage());
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -79,7 +79,6 @@
boolean exception = false;
gateway.initialise();
- gateway.start();
try {
try
@@ -142,7 +141,6 @@
{
}
} finally {
- gateway.stop();
gateway.destroy();
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -182,7 +182,7 @@
* postDir="/upload"
*/
@Test //( timeout=3000 )
- public void doRun_PostDir_Different_From_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
+ public void doRun_PostDir_Different_From_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException, SchedulingException
{
setAbsoluteInputDir();
setAbsolutePostDirToUploadDir();
@@ -195,11 +195,7 @@
try {
mock.onSchedule();
- } catch (SchedulingException e) {
- fail(e.getMessage());
- }
- try {
File processedFile = new File ( done, doneFileName );
try
{
@@ -221,7 +217,7 @@
* postDir="/input"
*/
@Test ( timeout=3000 )
- public void doRun_PostDir_Same_As_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
+ public void doRun_PostDir_Same_As_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException, SchedulingException
{
setAbsoluteInputDir();
setAbsolutePostDirToInputDir();
@@ -234,11 +230,7 @@
try {
mock.onSchedule();
- } catch (SchedulingException e) {
- fail(e.getMessage());
- }
- try {
File processedFile = new File ( inputDir, doneFileName );
try
{
@@ -263,7 +255,7 @@
* Note. when this test runs a stacktrace will be displayed. This is expected.
*/
@Test ( timeout = 2000 )
- public void doRun_Negative() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
+ public void doRun_Negative() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException, SchedulingException
{
setAbsoluteInputDir();
setAbsoluteErrorDir();
@@ -271,30 +263,26 @@
log.error( "The following exceptions are expected: " );
RemoteGatewayListenerMock mock = createAndStartListener ( configTree, getCourierReturnValue );
- File errorDir = ftpServer.getLocalErrorDir();
- String errorFileName = testFile.getName() + POST_ERROR_SUFFIX;
+ try {
+ File errorDir = ftpServer.getLocalErrorDir();
+ String errorFileName = testFile.getName() + POST_ERROR_SUFFIX;
- try {
- mock.onSchedule();
- } catch (SchedulingException e) {
- fail(e.getMessage());
- }
+ mock.onSchedule();
- try {
- File errorFile = new File ( errorDir, errorFileName );
- try
- {
- assertTrue ( errorFile.exists() );
- }
- finally
- {
- FtpTestUtil.deleteFile( errorFile );
- }
- } finally {
- mock.stop();
- mock.destroy();
- }
- }
+ File errorFile = new File ( errorDir, errorFileName );
+ try
+ {
+ assertTrue ( errorFile.exists() );
+ }
+ finally
+ {
+ FtpTestUtil.deleteFile( errorFile );
+ }
+ } finally {
+ mock.stop();
+ mock.destroy();
+ }
+ }
@Test
public void renameFile_In_Same_Directory() throws GatewayException
@@ -400,7 +388,11 @@
/* post error attributes */
configTree.setAttribute( ListenerTagNames.FILE_ERROR_DIR_TAG, remoteErrorDirName );
configTree.setAttribute( ListenerTagNames.FILE_ERROR_SFX_TAG, POST_ERROR_SUFFIX);
-
+ // Do not allow the background scheduler to fire before we run the tests.
+ // We should really be allowing it to fire so that we can test the normal operation.
+ configTree.setAttribute( ListenerTagNames.SCHEDULE_ID_REF, "idref") ;
+ configTree.setAttribute( ListenerTagNames.SCHEDULE_SIMPLE_FREQUENCY, "1000000000") ;
+ configTree.setAttribute( ListenerTagNames.SCHEDULE_SIMPLE_EXEC, "0") ;
return configTree;
}
@@ -431,15 +423,11 @@
* @param returnValueForCourier the return value for the getCourier method of the RemoteGatewayListenerMock object
* @return RemoteGatewayListenerMock Mock impl of a RemoteGatewayListener.
*/
- private RemoteGatewayListenerMock createAndStartListener ( ConfigTree configTree, boolean returnValueForCourier ) throws ConfigurationException, GatewayException, RegistryException
+ private RemoteGatewayListenerMock createAndStartListener ( ConfigTree configTree, boolean returnValueForCourier ) throws ConfigurationException, GatewayException, RegistryException, ManagedLifecycleException
{
final RemoteGatewayListenerMock mock = new RemoteGatewayListenerMock( configTree );
- try {
- mock.initialise();
- mock.start();
- } catch (ManagedLifecycleException e) {
- fail(e.getMessage());
- }
+ mock.initialise();
+ mock.start();
if(returnValueForCourier) {
MockCourierFactory.courierException = null;
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -465,7 +465,7 @@
// create an AuthenticationRequest which is needed to authenticate if the security
AuthenticationRequest build = new AuthenticationRequestImpl.Builder().build();
- message.getProperties().setProperty(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) build));
+ message.getContext().setContext(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) build));
final boolean result = pipeline.process(message);
assertTrue(result);
@@ -475,6 +475,35 @@
checkOrder(MockActionInfo.getDestroyList()) ;
}
+ public void testSecuredServiceWithoutAutenticationRequest() throws Exception
+ {
+ final ConfigTree configTree = new ConfigTree("parent") ;
+
+ // added the security configuration
+ addSecurityConfig(configTree, "adminRole", null, "SuccessfulLogin", null);
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG, ListenerTagNames.MEP_ONE_WAY) ;
+
+ addAction(configTree, MockSecuredActionProcessor.class.getName(), "process", null, null) ;
+
+ final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+ pipeline.initialise() ;
+ checkOrder(MockActionInfo.getInitialiseList()) ;
+
+ Message message = MessageFactory.getInstance().getMessage();
+
+ try
+ {
+ pipeline.process(message);
+ }
+ catch(final Exception e)
+ {
+ assertTrue(e instanceof SecurityServiceException);
+ }
+
+ pipeline.destroy() ;
+ checkOrder(MockActionInfo.getDestroyList()) ;
+ }
+
public void testSecuredServiceWithPreExistingSecurityContext() throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
@@ -505,13 +534,15 @@
SecurityContext securityContext = new SecurityContext(subject);
byte[] encrypt = SecurityContext.encryptContext(securityContext);
- message.getProperties().setProperty(SecurityService.CONTEXT, encrypt);
+ message.getContext().setContext(SecurityService.CONTEXT, encrypt);
final boolean result = pipeline.process(message);
assertTrue(result);
assertEquals(user, MockSecuredActionProcessor.getSubject().getPrincipals().iterator().next());
+ assertNull(message.getContext().getContext(SecurityService.CONTEXT));
+
pipeline.destroy() ;
checkOrder(MockActionInfo.getDestroyList()) ;
}
@@ -540,7 +571,7 @@
SecurityContext securityContext = new SecurityContext(subject);
byte[] encrypt = SecurityContext.encryptContext(securityContext);
- message.getProperties().setProperty(SecurityService.CONTEXT, encrypt);
+ message.getContext().setContext(SecurityService.CONTEXT, encrypt);
try
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/scheduled-listener-config-configtree.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/scheduled-listener-config-configtree.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/listeners/scheduled-listener-config-configtree.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,3 +1,6 @@
-<listener event-processor="org.jboss.soa.esb.schedule.MockScheduledEventMessageComposer" listenerClass="org.jboss.soa.esb.listeners.ScheduleListener" my-prop="1" name="simple-schedule-listener" scheduleidref="1-sec-trigger" service-category="ServiceCat" service-description="Test Service" service-name="ServiceName">
+<listener event-processor="org.jboss.soa.esb.schedule.MockScheduledEventMessageComposer" listenerClass="org.jboss.soa.esb.listeners.ScheduleListener" my-prop="1"
+ name="simple-schedule-listener" scheduleSimpleFrequency="1000" scheduleidref="1-sec-trigger" service-category="ServiceCat" service-description="Test Service"
+ service-name="ServiceName">
+<ScheduleProperties org.quartz.threadPool.threadCount="1"/>
<action action="action" class="org.jboss.soa.esb.mock.MockAction"/>
-</listener>
\ No newline at end of file
+</listener>
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ContextUnitTest.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ContextUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ContextUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ContextUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.message.tests;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.net.URI;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.message.ByReferenceMessage;
+import org.jboss.soa.esb.message.Context;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * Unit tests for the Context class.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+
+public class ContextUnitTest extends TestCase
+{
+ public void testSerializeMessage()
+ throws Exception
+ {
+ execute(MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED)) ;
+ }
+
+ public void testXMLMessage()
+ throws Exception
+ {
+ execute(MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML)) ;
+ }
+
+ private void execute(final Message message)
+ throws Exception
+ {
+ assertNotNull("Created message", message) ;
+ message.getHeader().getCall().setTo(new EPR(new URI("test:to_uri"))) ;
+
+ final Context context = message.getContext() ;
+ assertNotNull("Context", context) ;
+
+ final Object result1 = context.setContext("foo", "bar") ;
+ assertNull("First setter result", result1) ;
+
+ assertEquals("Getting context", "bar", context.getContext("foo")) ;
+
+ final Set<String> keys = context.getContextKeys() ;
+ assertNotNull("Context keys", keys) ;
+ assertEquals("Context key count", 1, keys.size()) ;
+ assertTrue("Contains key", keys.contains("foo")) ;
+
+ final Object result2 = context.setContext("foo", "bar2") ;
+ assertEquals("Second setter result", "bar", result2) ;
+
+ assertEquals("Getting context", "bar2", context.getContext("foo")) ;
+
+ final Set<String> keys2 = context.getContextKeys() ;
+ assertNotNull("Context keys2", keys2) ;
+ assertEquals("Context key count", 1, keys2.size()) ;
+ assertTrue("Contains key", keys2.contains("foo")) ;
+
+ context.clearContext() ;
+
+ final Set<String> keys3 = context.getContextKeys() ;
+ assertNotNull("Context keys3", keys3) ;
+ assertEquals("Context key count", 0, keys3.size()) ;
+
+ try
+ {
+ context.setContext("non-serializable", new Object()) ;
+ fail("Non serializable object set on context");
+ }
+ catch (IllegalArgumentException ex) {} // expected
+
+ context.setContext("skey", "svalue") ;
+ final Serializable serializable = Util.serialize(message) ;
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream() ;
+ final ObjectOutputStream oos = new ObjectOutputStream(baos) ;
+
+ oos.writeObject(serializable);
+ oos.close();
+
+ final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()) ;
+ final ObjectInputStream ois = new ObjectInputStream(bais) ;
+
+ final Serializable newSerializable = (Serializable)ois.readObject() ;
+ final Message newMessage = Util.deserialize(newSerializable) ;
+ assertEquals("Serialized context", "svalue", newMessage.getContext().getContext("skey")) ;
+
+ assertTrue("Implements ByReferenceMessage", (message instanceof ByReferenceMessage)) ;
+
+ final Message referencedMessage = ((ByReferenceMessage)message).reference() ;
+ assertSame("Attachment is same", message.getAttachment(), referencedMessage.getAttachment()) ;
+ assertSame("Body is same", message.getBody(), referencedMessage.getBody()) ;
+ assertSame("Fault is same", message.getFault(), referencedMessage.getFault()) ;
+ assertSame("Properties are same", message.getProperties(), referencedMessage.getProperties()) ;
+ assertSame("type is same", message.getType(), referencedMessage.getType()) ;
+
+ assertNotSame("header is not same", message.getHeader(), referencedMessage.getHeader()) ;
+ assertNotSame("Context is not same", context, referencedMessage.getContext()) ;
+
+ assertEquals("Header equals", message.getHeader().getCall().getTo(), referencedMessage.getHeader().getCall().getTo()) ;
+ message.getHeader().getCall().setTo(new EPR(new URI("test:to_uri2"))) ;
+ assertFalse("Header not equals", message.getHeader().getCall().getTo().equals(referencedMessage.getHeader().getCall().getTo())) ;
+
+ assertEquals("Context equals", context.getContext("skey"), referencedMessage.getContext().getContext("skey")) ;
+ context.setContext("skey", "other value") ;
+ assertFalse("Context not equals", context.getContext("skey").equals(referencedMessage.getContext().getContext("skey"))) ;
+ assertEquals("Referenced Context unchanged", "svalue", referencedMessage.getContext().getContext("skey")) ;
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/schedule/expected-config-01-listener.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/schedule/expected-config-01-listener.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/schedule/expected-config-01-listener.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,3 +1,4 @@
-<listener event-processor="org.jboss.soa.esb.schedule.MockScheduledEventMessageComposer" listenerClass="org.jboss.soa.esb.listeners.ScheduleListener" name="simple-schedule-listener" scheduleidref="1-sec-trigger" service-category="ServiceCat" service-description="Test Service" service-name="ServiceName-01">
+<listener event-processor="org.jboss.soa.esb.schedule.MockScheduledEventMessageComposer" listenerClass="org.jboss.soa.esb.listeners.ScheduleListener" name="simple-schedule-listener" scheduleSimpleExec="2" scheduleSimpleFrequency="1000" scheduleidref="1-sec-trigger" service-category="ServiceCat" service-description="Test Service" service-name="ServiceName-01">
+<ScheduleProperties org.quartz.threadPool.threadCount="2"/>
<action action="action" class="org.jboss.soa.esb.mock.MockAction"/>
-</listener>
\ No newline at end of file
+</listener>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityContextUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityContextUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityContextUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -117,7 +117,7 @@
SecurityContext securityContext = new SecurityContext(subject);
Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
byte[] encryptContext = SecurityContext.encryptContext(securityContext);
- message.getProperties().setProperty(SecurityService.CONTEXT, encryptContext);
+ message.getContext().setContext(SecurityService.CONTEXT, encryptContext);
// serialize object
@@ -133,7 +133,7 @@
// assert that the content is still matches.
assertTrue (readObject instanceof Message);
Message deserializedMsg = (Message) readObject;
- SecurityContext deserialized = SecurityContext.decryptContext((byte[]) deserializedMsg.getProperties().getProperty(SecurityService.CONTEXT));
+ SecurityContext deserialized = SecurityContext.decryptContext((byte[]) deserializedMsg.getContext().getContext(SecurityService.CONTEXT));
assertEquals( user, deserialized.getSubject().getPrincipals().iterator().next() );
//assertEquals( new String(publicCred), new String((byte[])deserialized.getPubCredentials().iterator().next()));
assertEquals( new String(publicCred), new String((byte[])deserialized.getSubject().getPublicCredentials().iterator().next()));
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/http/HttpSecurityInfoExtractorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/http/HttpSecurityInfoExtractorUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/http/HttpSecurityInfoExtractorUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,373 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.services.security.auth.http;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-import org.jboss.util.Base64;
-import org.junit.Test;
-
-/**
- * Unit test for {@link HttpSecurityInfoExtractor}
- * <p>
- *
- * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
- * @since 4.4
- */
-public class HttpSecurityInfoExtractorUnitTest
-{
- private String username = "Bob";
- private String password = "Kelso";
-
- @Test
- public void extractSecurityInfo() throws IOException
- {
- HttpSecurityInfoExtractor extractor = new HttpSecurityInfoExtractor();
- MockHttpServletRequest httpRequest = new MockHttpServletRequest();
- httpRequest.setAuthType("BASIC");
- String userNamePassword= username + ":" + password;
- String base64Userpass = Base64.encodeBytes(userNamePassword.getBytes());
- final String authString = "Basic " + base64Userpass;
-
- httpRequest.addHeader("Authorization", authString);
- AuthenticationRequest authRequest = extractor.extractSecurityInfo(httpRequest);
-
- assertNotNull(authRequest);
- char[] passwd = (char[]) authRequest.getCredentials().iterator().next();
- assertEquals(password, new String(passwd));
- assertEquals(username, authRequest.getPrincipal().getName());
- }
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(HttpSecurityInfoExtractorUnitTest.class);
- }
-
- private static class MockHttpServletRequest implements HttpServletRequest
- {
- private String authType;
- private Map<String,String> headers = new HashMap<String,String>();
-
- public void setAuthType(String authType)
- {
- this.authType = authType;
- }
-
- public String getAuthType()
- {
- return authType;
- }
-
- public String getContextPath()
- {
- return null;
- }
-
- public Cookie[] getCookies()
- {
- return null;
- }
-
- public long getDateHeader(String arg0)
- {
- return 0;
- }
-
- public String getHeader(String header)
- {
- return headers.get(header);
- }
- public void addHeader(final String headerName, final String object)
- {
- headers.put(headerName, object);
- }
-
- public Enumeration getHeaderNames()
- {
- return null;
- }
-
- public Enumeration getHeaders(String arg0)
- {
- return null;
- }
-
- public int getIntHeader(String arg0)
- {
- return 0;
- }
-
- public String getMethod()
- {
- return null;
- }
-
- public String getPathInfo()
- {
- return null;
- }
-
- public String getPathTranslated()
- {
- return null;
- }
-
- public String getQueryString()
- {
- return null;
- }
-
- public String getRemoteUser()
- {
- return null;
- }
-
- public String getRequestURI()
- {
- return null;
- }
-
- public StringBuffer getRequestURL()
- {
- return null;
- }
-
- public String getRequestedSessionId()
- {
- return null;
- }
-
- public String getServletPath()
- {
- return null;
- }
-
- public HttpSession getSession()
- {
- return null;
- }
-
- public HttpSession getSession(boolean arg0)
- {
- return null;
- }
-
- private Principal userPrincipal;
-
- public void setUserPrincipal(Principal userPrincipal)
- {
- this.userPrincipal = userPrincipal;
- }
-
- public Principal getUserPrincipal()
- {
- return this.userPrincipal;
- }
-
- public boolean isRequestedSessionIdFromCookie()
- {
- return false;
- }
-
- public boolean isRequestedSessionIdFromURL()
- {
- return false;
- }
-
- public boolean isRequestedSessionIdFromUrl()
- {
- return false;
- }
-
- public boolean isRequestedSessionIdValid()
- {
- return false;
- }
-
- public boolean isUserInRole(String arg0)
- {
- return false;
- }
-
- public Object getAttribute(String arg0)
- {
- return null;
- }
-
- public Enumeration getAttributeNames()
- {
- return null;
- }
-
- public String getCharacterEncoding()
- {
- return null;
- }
-
- public int getContentLength()
- {
- return 0;
- }
-
- public String getContentType()
- {
- return null;
- }
-
- public ServletInputStream getInputStream() throws IOException
- {
- return null;
- }
-
- public String getLocalAddr()
- {
- return null;
- }
-
- public String getLocalName()
- {
- return null;
- }
-
- public int getLocalPort()
- {
- return 0;
- }
-
- public Locale getLocale()
- {
- return null;
- }
-
- public Enumeration getLocales()
- {
- return null;
- }
-
- public String getParameter(String arg0)
- {
- return null;
- }
-
- public Map getParameterMap()
- {
- return null;
- }
-
- public Enumeration getParameterNames()
- {
- return null;
- }
-
- public String[] getParameterValues(String arg0)
- {
- return null;
- }
-
- public String getProtocol()
- {
- return null;
- }
-
- public BufferedReader getReader() throws IOException
- {
- return null;
- }
-
- public String getRealPath(String arg0)
- {
- return null;
- }
-
- public String getRemoteAddr()
- {
- return null;
- }
-
- public String getRemoteHost()
- {
- return null;
- }
-
- public int getRemotePort()
- {
- return 0;
- }
-
- public RequestDispatcher getRequestDispatcher(String arg0)
- {
- return null;
- }
-
- public String getScheme()
- {
- return null;
- }
-
- public String getServerName()
- {
- return null;
- }
-
- public int getServerPort()
- {
- return 0;
- }
-
- public boolean isSecure()
- {
- return false;
- }
-
- public void removeAttribute(String arg0)
- {
- }
-
- public void setAttribute(String arg0, Object arg1)
- {
- }
-
- public void setCharacterEncoding(String arg0) throws UnsupportedEncodingException
- {
- }
-
- }
-
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -5,25 +5,8 @@
${line.separator}
</description>
- <target name="quickstart-specific-dependencies">
- <path id="quickstart-lib-classpath">
- <fileset dir="${basedir}/lib">
- <include name="*.jar"/>
- </fileset>
- <fileset dir="${basedir}/ejb/build">
- <include name="SimpleSLSBInterfaces.jar"/>
- </fileset>
- </path>
- <antcall target="build-ejb-jar"/>
- <copy todir="${basedir}/lib" overwrite="true" file="${basedir}/ejb/build/SimpleSLSBInterfaces.jar"/>
- </target>
+ <property name="ejb.jar" value="SimpleSLSB.jar"/>
- <path id="quickstart-dependencies-classpath" >
- <fileset dir="${basedir}/ejb/build">
- <include name="SimpleSLSB.jar"/>
- </fileset>
- </path>
-
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
@@ -46,28 +29,20 @@
</java>
</target>
-
-
- <target name="build-ejb-jar" description="Packages the EJB files into a EJB JAR file">
- <ant dir="${basedir}/ejb" target="jar"/>
- </target>
-
<target name="quickstart-specific-checks">
<antcall target="assert-ejb3-available"/>
</target>
- <target name="quickstart-specific-deploys">
- <copy todir="${org.jboss.esb.server.deploy.dir}/" overwrite="true" file="${basedir}/ejb/build/SimpleSLSB.jar"/>
- </target>
- <target name="quickstart-specific-undeploys">
- <delete file="${org.jboss.esb.server.deploy.dir}/SimpleSLSB.jar"/>
- </target>
+ <target name="quickstart-specific-assemblies">
+ <property name="ejb.classes" location="${build.dir}/ejbclasses"/>
+ <delete dir="${ejb.classes}" quiet="true"/>
+ <mkdir dir="${ejb.classes}"/>
+ <javac srcdir="${basedir}/ejb/src" destdir="${ejb.classes}" debug="true" deprecation="true">
+ <classpath refid="compile-classpath" />
+ </javac>
-
- <!--
- <target name="deploy-ejb" depends="dependencies,assert-ejb3-available,build-ejb-jar" description="deploy ejb">
- <copy todir="${org.jboss.esb.server.deploy.dir}/" overwrite="true" file="${basedir}/ejb/build/SimpleSLSB.jar"/>
+ <jar destfile="${build.dir}/${ejb.jar}">
+ <fileset dir="${ejb.classes}"/>
+ </jar>
</target>
- -->
-
</project>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,32 +0,0 @@
-<project name="SimpleEJB" default="jar" basedir=".">
-
- <dirname property="pwd.dir" file="${ant.file.SimpleEJB}"/>
- <echo message="${pwd.dir}"/>
-
- <property name="this.build.dir" value="${pwd.dir}/build"/>
-
- <property name="src.dir" value="${pwd.dir}/src"/>
- <property name="classes.dir" value="${this.build.dir}/classes"/>
- <property name="lib.dir" value="${pwd.dir}/lib"/>
-
- <path id="classpath">
- <fileset dir="${lib.dir}" includes="*.jar"/>
- </path>
-
- <target name="compile" description="Compiles java sources">
- <mkdir dir="${classes.dir}"/>
- <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" deprecation="true">
- <classpath refid="classpath" />
- </javac>
- </target>
-
- <target name="jar" depends="compile" description="builds jar">
- <jar destfile="${this.build.dir}/SimpleSLSB.jar" basedir="${classes.dir}" includes="**/*.class"/>
- <jar destfile="${this.build.dir}/SimpleSLSBInterfaces.jar" basedir="${classes.dir}" excludes="**/SimpleSLSB.class"/>
- </target>
-
- <target name="clean">
- <delete dir="${this.build.dir}"/>
- </target>
-
-</project>
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.samples.quickstart.ejbprocessor;
-
-import javax.ejb.Local;
-
- at Local
-public interface Simple
-{
- void printMessage(final String message);
-
- String getMessage();
-
-}
-
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/Simple.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.samples.quickstart.ejbprocessor;
+
+import javax.ejb.Local;
+
+ at Local
+public interface Simple
+{
+ void printMessage(final String message);
+
+ String getMessage();
+
+}
+
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.samples.quickstart.ejbprocessor;
-
-import javax.ejb.Remote;
-
- at Remote
-public interface SimpleRemote
-{
- void printMessage(final String message);
-
- String getMessage();
-
-}
-
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleRemote.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.samples.quickstart.ejbprocessor;
+
+import javax.ejb.Remote;
+
+ at Remote
+public interface SimpleRemote
+{
+ void printMessage(final String message);
+
+ String getMessage();
+
+}
+
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.samples.quickstart.ejbprocessor;
-
-import java.security.Principal;
-
-import javax.ejb.*;
-import javax.annotation.*;
-
- at Stateless
-public class SimpleSLSB implements SimpleRemote
-{
- public static final String RemoteJNDIName = SimpleSLSB.class.getSimpleName() + "/remote";
-
- public void printMessage(final String message)
- {
- System.out.println("SimpleSLSB printMessage : " + message);
- }
-
- public String getMessage()
- {
- return "Some text from SimpleSLSB";
- }
-}
-
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/ejbprocessor/ejb/src/org/jboss/soa/esb/samples/quickstart/ejbprocessor/SimpleSLSB.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.samples.quickstart.ejbprocessor;
+
+import java.security.Principal;
+
+import javax.ejb.*;
+import javax.annotation.*;
+
+ at Stateless
+public class SimpleSLSB implements SimpleRemote
+{
+ public static final String RemoteJNDIName = SimpleSLSB.class.getSimpleName() + "/remote";
+
+ public void printMessage(final String message)
+ {
+ System.out.println("SimpleSLSB printMessage : " + message);
+ }
+
+ public String getMessage()
+ {
+ return "Some text from SimpleSLSB";
+ }
+}
+
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -35,6 +35,9 @@
<include name="*.xml" />
<include name="*.properties" />
</fileset>
+ <fileset dir="${basedir}">
+ <include name="log4j.xml" />
+ </fileset>
</copy>
<groovyc destdir="load_generator_classes" srcdir="${basedir}/scripts" includes="*.groovy" classpathref="groovy.classpath" />
</target>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy 2008-10-13 12:25:47 UTC (rev 23437)
@@ -37,6 +37,7 @@
class ServiceReporterBean extends ReporterBean
{
+ def serviceCategory
def serviceName
def esbArchiveName
}
@@ -103,6 +104,7 @@
serviceReporter ->
ServiceMetricsBean svcMetricsBean = new ServiceMetricsBean()
ServiceReporterBean svcReportBean = new ServiceReporterBean()
+ svcReportBean.serviceCategory = serviceReporter.'@service-category'
svcReportBean.serviceName = serviceReporter.'@service-name'
svcReportBean.esbArchiveName = serviceReporter.'@esb-archive-name'
@@ -184,4 +186,4 @@
-
\ No newline at end of file
+
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/LoadUtil.groovy
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/LoadUtil.groovy 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/LoadUtil.groovy 2008-10-13 12:25:47 UTC (rev 23437)
@@ -46,7 +46,7 @@
public float getEsbServiceTps(serviceReportBean)
{
def serviceMessageCount = {
- getLongAttribute(new ObjectName("jboss.esb:service-name=$serviceReportBean.serviceName,deployment=$serviceReportBean.esbArchiveName,category=MessageCounter"), "overall service message count")
+ getLongAttribute(new ObjectName("jboss.esb:service-category=$serviceReportBean.serviceCategory,service-name=$serviceReportBean.serviceName,deployment=$serviceReportBean.esbArchiveName,category=MessageCounter"), "overall service message count")
}
def processedMsgsBefore = serviceMessageCount()
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/load.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/load.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/load_generator/scripts/load.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -22,11 +22,13 @@
</jms-reporters>
<service-reporters>
<service-reporter
+ service-category="LoadServiceCategory"
service-name="DummyJMSLoad"
esb-archive-name="Quickstart_load_generator.esb" />
<service-reporter
+ service-category="LoadServiceCategory"
service-name="DummyJMSLoad2"
esb-archive-name="Quickstart_load_generator.esb" />
</service-reporters>
</reporters>
-</load-script>
\ No newline at end of file
+</load-script>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -31,8 +31,6 @@
<arg value="ESBServiceSample"/> <!-- service category -->
<arg value="HelloWorldPubService"/> <!-- service name -->
<arg value="HelloWorld"/> <!-- Message text -->
- <arg value="esbuser"/> <!-- username text -->
- <arg value="esbpassword"/> <!-- password text -->
<classpath refid="exec-classpath"/>
</java>
<echo>Send esb message to esb service and get error</echo>
@@ -40,8 +38,6 @@
<arg value="ESBServiceSample"/> <!-- service category -->
<arg value="HelloWorldPubService"/> <!-- service name -->
<arg value="Error"/> <!-- Message text -->
- <arg value="esbuser"/> <!-- username text -->
- <arg value="esbpassword"/> <!-- password text -->
<classpath refid="exec-classpath"/>
</java>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -2,18 +2,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:say="http://www.jboss.org/sayHi">
-
- <soap:Header>
- <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
- <wsse:UsernameToken>
- <wsse:Username>esbuser</wsse:Username>
- <wsse:Password>esbpassword</wsse:Password>
- </wsse:UsernameToken>
- </wsse:Security>
- </soap:Header>
-
<soap:Body>
- <say:sayHi><say:Error>Error</say:Error></say:sayHi>
+ <say:sayHi><say:arg0>Error</say:arg0></say:sayHi>
</soap:Body>
</soap:Envelope>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -19,15 +19,13 @@
category="ESBServiceSample"
name="HelloWorldPubService"
description="Hello world ESB Service">
- <security moduleName="messaging" rolesAllowed="adminRole,esbrole" />
-
<listeners>
<jms-listener name="helloWorld"
busidref="quickstartEsbChannel"
maxThreads="1"
/>
</listeners>
- <actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd" webservice="none">
+ <actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd">
<action name="action" class="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.ESBWSListenerAction" process="displayMessage"/>
</actions>
</service>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/jbossesb-properties.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/jbossesb-properties.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -36,13 +36,6 @@
<property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
<property name="jboss.esb.invm.scope.default" value="NONE"/>
</properties>
- <properties name="security">
- <property name="org.jboss.soa.esb.services.security.publicKeystore" value="/publicKeyStore"/>
- <property name="org.jboss.soa.esb.services.security.publicKeystorePassword" value="testKeystorePassword"/>
- <property name="org.jboss.soa.esb.services.security.publicKeyAlias" value="testAlias"/>
- <property name="org.jboss.soa.esb.services.security.publicKeyPassword" value="testPassword"/>
- <property name="org.jboss.soa.esb.services.security.publicKeyTransformation" value="RSA/ECB/PKCS1Padding"/>
- </properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI"
value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/publicKeyStore
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/readme.txt
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/readme.txt 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/readme.txt 2008-10-13 12:25:47 UTC (rev 23437)
@@ -2,8 +2,6 @@
=========
The purpose of the publish_as_webservice quickstart sample is to demonstrate how to
publish a esb service as a web service.
- This quickstart also demonstrates web service security using a UsernameToken in the
- SOAP header.
Running this quickstart:
========================
@@ -26,43 +24,10 @@
3. Exceute the web service call from soapui.
======================================
- 1. soap-userpass-message.xml
- This is the SOAP Envelope that is sent to the Web Service.
- Take a look at the header:
- <soap:Header>
- <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
- <wsse:UsernameToken>
- <wsse:Username>esbuser</wsse:Username>
- <wsse:Password>esbpassword</wsse:Password>
- </wsse:UsernameToken>
- </wsse:Security>
- </soap:Header>
- The above is using the UsernameToken element to specify a username and password.
- Try changing the username or password to se what happens. Notice the response you
- get when incorrect username or password is specified.
-
- 2. jboss-esb.xml
- First we'll take a look at the service security configuration:
- <service category="ESBServiceSample" name="HelloWorldPubService" description="Hello world ESB Service">
- <security moduleName="messaging" />
- ...
- </service>
- This is simply specifying that we want to use the 'messaging' login module. This is defined in conf/login-config.xml
- of the jbossesb-server. You can see that this definition point to two files:
- * conf/props/messaging-users.properties - username and password are specified here
- * conf/props/messaging-roles.properties
- Also notice how the the actions element contains additional attributes:
- <actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd" webservice="security">
-
- 3. runtest ant target
+ 1. runtest ant target
This target will call the SOAPTest client twice, first call will be with a valid SOAP message
and the second call will generate a SOAPFault to be retured.
- 4. sendesb ant target
+ 2. sendesb ant target
This target will call the SendEsbMessage twice. The first call will be with a valid message body content
and the second will generate a FaultMessageException.
- In this case the username and password are being passed to the SendEsbMessage's main method. The username
- and password are set in build.xml.
-
-
-
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -2,19 +2,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:say="http://www.jboss.org/sayHi">
-
- <soap:Header>
- <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
- <wsse:UsernameToken>
- <wsse:Username>esbuser</wsse:Username>
- <wsse:Password>esbpassword</wsse:Password>
- </wsse:UsernameToken>
- </wsse:Security>
- </soap:Header>
-
<soap:Body>
<say:sayHi>
- <say:HelloWorld>HelloWorld</say:HelloWorld>
+ <say:arg0>HelloWorld</say:arg0>
</say:sayHi>"
</soap:Body>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/publish_as_webservice/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -40,8 +40,6 @@
* <p/> arg0 - service category
* <br/>arg1 - service name
* <br/>arg2 - Text of message to send
- * <br/>arg3 - username
- * <br/>arg4 - password
*
* @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
* @since Version 4.0
@@ -54,18 +52,12 @@
// Setting the ConnectionFactory such that it will use scout
System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
- if (args.length < 5)
+ if (args.length < 3)
{
- System.out.println("Usage SendEsbMessage <category> <name> <text to send> <username> <password>");
+ System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
}
Message esbMessage = MessageFactory.getInstance().getMessage();
- // create an AuthenticationRequest
- AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder().username(args[3]).password(args[4].toCharArray()).build();
-
- // set the authentication request on the message
- esbMessage.getProperties().setProperty(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest));
-
final String message = "<say:sayHi xmlns:say=\"http://www.jboss.org/sayHi\"><say:arg0>" + args[2] + "</say:arg0></say:sayHi>" ;
esbMessage.getBody().add(message);
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -14,7 +14,7 @@
<target name="runtest" depends="compile"
description="sends a HTTP request to the JBossRemoting gateway">
<echo>Http Client</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitybasic.HttpClient" failonerror="true">
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitybasic.test.HttpClient" failonerror="true">
<arg value="http"/>
<arg value="localhost"/>
<arg value="9888"/>
@@ -30,8 +30,8 @@
<arg value="Security"/> <!-- service category -->
<arg value="SimpleListenerSecured"/> <!-- service name -->
<arg value="Hello Secured World"/> <!-- Message text -->
- <arg value="esbuser"/> <!-- username text -->
- <arg value="esbpassword"/> <!-- password text -->
+ <arg value="${username}"/> <!-- username text -->
+ <arg value="${password}"/> <!-- password text -->
<classpath refid="exec-classpath"/>
</java>
</target>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/jboss-esb.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/jboss-esb.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -63,30 +63,12 @@
<property name="printfull" value="false"/>
<property name="message" value="In Service2"/>
</action>
+
<action name="action2" class="org.jboss.soa.esb.samples.quickstart.securitybasic.MyListenerAction" process="displayMessage"/>
- <!-- Route to the "Service 3"
- <action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="Security" service-name="Service3"/>
- </property>
- </action> -->
</actions>
</service>
- <service category="Security" name="Service3" description="Service 3" invmScope="GLOBAL">
- <security moduleName="messaging" runAs="adminRole"/>
- <actions mep="OneWay">
-
- <action name="propagate" class="org.jboss.soa.esb.services.security.actions.JBossSecurityPropagator">
- <property name="runAs" value="adminRole"/>
- </action>
-
- </actions>
-
- </service>
-
-
</services>
</jbossesb>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/readme.txt
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/readme.txt 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/readme.txt 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,9 +1,11 @@
Overview:
=========
- This quickstart demonstrates basic security in JBossESB.
- 1. 'ant runtest' will send a HTTP request to a JBossRemoting Gatway
- 2. 'ant sendesb' will invoke the Service directly using the ServiceInvoker
-
+ This quickstart demonstrates basic security in JBossESB. The following will be demonstrated by this quickstart:
+ * Per service authentication configuration
+ * Configuring the roles allowed to execute the service
+ * Invoking a service via a gateway
+ * Invoking a service directly (using the ServiceInvoker)
+
Running this quickstart:
========================
Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
@@ -12,9 +14,30 @@
To Run '.esb' archive mode with JBossAS-server:
===========================
1. Type 'ant deploy'.
- 2. Type 'ant runtest'
- 3. Type 'ant sendesb'
+ 2. 'ant runtest' will send a HTTP request to a JBossRemoting Gatway
+ 2. 'ant sendesb' will invoke the Service directly using the ServiceInvoker
What to look for in this quickstart
===================================
+ # Security configuration
+ <service category="Security" name="SimpleListenerSecured" description="Hello World">
+ <security moduleName="messaging" rolesAllowed="esbrole"/>
+ The security element declares that this service requires authentication to be executed and that the
+ authenticated users be a member in the role 'esbrole'. The role is determined by the JAAS login
+ module being used, in this case by the 'messaging' module specified in login-config.xml.
+ # src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/HttpClient.java
+ This is a JBossRemoting client that uses http to invoke the JBossRemoting gateway.
+
+ # src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/SendEsbMessage.java
+ This class uses the ServiceInvoker to invoke the ESB service directly, by-passing the gateway.
+ You can see how an AuthenticationRequest is created then encrypted, and passed to the ESB
+ by attaching the authentication request to the ESB Message object.
+
+ # src/org/jboss/soa/esb/samples/quickstart/securitybasic/MyListenerAction.java
+ This ESB Action show how the currently autenticated JAAS Subject can be accessed:
+ System.out.println("Subject in MyListenerAction : " + Subject.getSubject(AccessController.getContext()));
+
+ # Please refer to the "Security" section of the ServiceGuide.pdf for more details on the security features of JBossESB.
+
+
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/HttpClient.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/HttpClient.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/HttpClient.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
- * LLC, and individual contributors by the @authors tag. See the copyright.txt
- * in the distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.samples.quickstart.securitybasic;
-
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class HttpClient
-{
- // Default locator values
- private static String transport = "http";
- private static String host = "localhost";
- private static int port = 5400;
- private static String username;
- private static String password;
-
- public void makeInvocation(String locatorURI) throws Throwable
- {
- InvokerLocator locator = new InvokerLocator(locatorURI);
- System.out.println("Calling remoting server with locator uri of: " + locatorURI);
-
- Client remotingClient = new Client(locator);
- remotingClient.connect();
-
- Map metadata = new HashMap();
- metadata.put("TYPE", "POST");
- metadata.put("http.basic.username", username);
- metadata.put("http.basic.password", password);
- remotingClient.invokeOneway( "Message payload example(just a String) ", metadata );
-
- System.out.println("Sent http post to server.");
- Integer responseCode = (Integer) metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
- String responseMessage = (String) metadata.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
- System.out.println("Response code from server: " + responseCode);
- System.out.println("Response message from server: " + responseMessage);
- remotingClient.disconnect();
-
- }
-
- public static void main(String[] args)
- {
- if(args != null && args.length == 5)
- {
- transport = args[0];
- host = args[1];
- port = Integer.parseInt(args[2]);
- username = args[3];
- password = args[4];
- }
- String locatorURI = transport + "://" + host + ":" + port;
- HttpClient client = new HttpClient();
- try
- {
- client.makeInvocation(locatorURI);
- }
- catch(Throwable e)
- {
- e.printStackTrace();
- }
- }
-}
-
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/HttpClient.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/HttpClient.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/HttpClient.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/HttpClient.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.samples.quickstart.securitybasic.test;
+
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class HttpClient
+{
+ // Default locator values
+ private static String transport = "http";
+ private static String host = "localhost";
+ private static int port = 5400;
+ private static String username;
+ private static String password;
+
+ public void makeInvocation(String locatorURI) throws Throwable
+ {
+ InvokerLocator locator = new InvokerLocator(locatorURI);
+ System.out.println("Calling remoting server with locator uri of: " + locatorURI);
+
+ Client remotingClient = new Client(locator);
+ remotingClient.connect();
+
+ Map metadata = new HashMap();
+ metadata.put("TYPE", "POST");
+ metadata.put("http.basic.username", username);
+ metadata.put("http.basic.password", password);
+ remotingClient.invokeOneway( "Message payload example(just a String) ", metadata );
+
+ System.out.println("Sent http post to server.");
+ Integer responseCode = (Integer) metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
+ String responseMessage = (String) metadata.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
+ System.out.println("Response code from server: " + responseCode);
+ System.out.println("Response message from server: " + responseMessage);
+ remotingClient.disconnect();
+
+ }
+
+ public static void main(String[] args)
+ {
+ if(args != null && args.length == 5)
+ {
+ transport = args[0];
+ host = args[1];
+ port = Integer.parseInt(args[2]);
+ username = args[3];
+ password = args[4];
+ }
+ String locatorURI = transport + "://" + host + ":" + port;
+ HttpClient client = new HttpClient();
+ try
+ {
+ client.makeInvocation(locatorURI);
+ }
+ catch(Throwable e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
+
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/SendEsbMessage.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/samples/quickstarts/security_basic/src/org/jboss/soa/esb/samples/quickstart/securitybasic/test/SendEsbMessage.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -63,7 +63,7 @@
AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder().username(args[3]).password(args[4].toCharArray()).build();
// set the authentication request on the message
- esbMessage.getProperties().setProperty(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest));
+ esbMessage.getContext().setContext(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest));
final String message = args[2];
esbMessage.getBody().add(message);
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/rules/DroolsRuleService.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/rules/DroolsRuleService.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/rules/DroolsRuleService.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -36,7 +36,6 @@
import org.drools.agent.RuleAgent;
import org.drools.compiler.DroolsParserException;
import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.internal.soa.esb.services.routing.cbr.JBRulesCounter;
import org.jboss.internal.soa.esb.services.rules.util.RulesContext;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.lifecycle.LifecyclePriorities;
@@ -83,11 +82,6 @@
lifecycleRuleSetFactory, LifecyclePriorities.RULE_BASE_PRIORITY);
/**
- * See {@link JBRulesCounter}
- */
- private JBRulesCounter rulesCounter = null;
-
- /**
* Execute rules using a certain ruleSet and domain specific language using
* the Stateless rule engine API
*
@@ -119,21 +113,8 @@
{
AssertArgument.isNotNullAndNotEmpty( ruleSet, "ruleSet" );
- final long startTime = System.nanoTime();
-
- try
- {
- RuleBase ruleBase = getRuleBaseForFileBasedRules(ruleSet, dsl, ruleReload);
- message = executeStatelessRules(ruleBase, message, globals, objectList);
-
- updateJBRulesCounter( startTime, ruleSet, JBRulesCounter.RULES_SUCCEED );
- }
- catch (RuleServiceException e)
- {
- updateJBRulesCounter( startTime, ruleSet, JBRulesCounter.RULES_FAILED );
- throw e;
- }
- return message;
+ RuleBase ruleBase = getRuleBaseForFileBasedRules(ruleSet, dsl, ruleReload);
+ return executeStatelessRules(ruleBase, message, globals, objectList);
}
/**
@@ -162,21 +143,8 @@
{
AssertArgument.isNotNullAndNotEmpty( decisionTable, "decisionTable" );
- final long startTime = System.nanoTime();
-
- try
- {
- RuleBase ruleBase = getRuleBaseForDecisionTable( decisionTable, ruleReload );
- message = executeStatelessRules( ruleBase, message, globals, objectList );
-
- updateJBRulesCounter( startTime, decisionTable, JBRulesCounter.RULES_SUCCEED );
- }
- catch (RuleServiceException e)
- {
- updateJBRulesCounter( startTime, decisionTable, JBRulesCounter.RULES_FAILED );
- throw e;
- }
- return message;
+ RuleBase ruleBase = getRuleBaseForDecisionTable( decisionTable, ruleReload );
+ return executeStatelessRules( ruleBase, message, globals, objectList );
}
/**
@@ -202,29 +170,23 @@
{
AssertArgument.isNotNullAndNotEmpty( ruleAgentProperties, "ruleAgentProperties" );
- final long startTime = System.nanoTime();
try
{
final RuleBase ruleBase = getRuleBaseForRuleAgent( ruleAgentProperties ) ;
- message = executeStatelessRules(ruleBase, message, globals, objectList);
- updateJBRulesCounter( startTime, ruleAgentProperties, JBRulesCounter.RULES_SUCCEED );
+ return executeStatelessRules(ruleBase, message, globals, objectList);
}
catch ( final IOException e)
{
- updateJBRulesCounter( startTime, ruleAgentProperties, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException( "Could not read the ruleAgentProperties file [" + ruleAgentProperties + "]", e);
}
catch ( final RuleServiceException e)
{
- updateJBRulesCounter( startTime, ruleAgentProperties, JBRulesCounter.RULES_FAILED );
throw e;
}
catch ( final Exception e)
{
- updateJBRulesCounter( startTime, ruleAgentProperties, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException( "RuleAgent could not get the RuleBase. " + e.getMessage(), e);
}
- return message;
}
/**
@@ -257,21 +219,8 @@
{
AssertArgument.isNotNullAndNotEmpty( ruleSet, "ruleSet" );
- final long startTime = System.nanoTime();
-
- try
- {
- RuleBase ruleBase = getRuleBaseForFileBasedRules( ruleSet, dsl, ruleReload );
- message = executeStatefulRules( ruleBase, false, message, globals, objectList );
-
- updateJBRulesCounter( startTime, ruleSet, JBRulesCounter.RULES_SUCCEED);
- }
- catch (final RuleServiceException e)
- {
- updateJBRulesCounter( startTime, ruleSet, JBRulesCounter.RULES_FAILED );
- throw e;
- }
- return message;
+ RuleBase ruleBase = getRuleBaseForFileBasedRules( ruleSet, dsl, ruleReload );
+ return executeStatefulRules( ruleBase, false, message, globals, objectList );
}
/**
@@ -300,22 +249,9 @@
{
AssertArgument.isNotNullAndNotEmpty( decisionTable, "decisionTable" );
- final long startTime = System.nanoTime();
-
- try
- {
- final RuleBase ruleBase = getRuleBaseForDecisionTable(decisionTable, ruleReload);
-
- message = executeStatefulRules(ruleBase, false, message, globals, objectList);
-
- updateJBRulesCounter( startTime, decisionTable, JBRulesCounter.RULES_SUCCEED );
- }
- catch (RuleServiceException e)
- {
- updateJBRulesCounter( startTime, decisionTable, JBRulesCounter.RULES_FAILED );
- throw e;
- }
- return message;
+ final RuleBase ruleBase = getRuleBaseForDecisionTable(decisionTable, ruleReload);
+
+ return executeStatefulRules(ruleBase, false, message, globals, objectList);
}
/**
@@ -341,31 +277,24 @@
{
AssertArgument.isNotNullAndNotEmpty( ruleAgentProperties, "ruleAgentProperties" );
- final long startTime = System.nanoTime();
try
{
final RuleBase ruleBase = getRuleBaseForRuleAgent( ruleAgentProperties ) ;
- message = executeStatefulRules(ruleBase, false, message, globals, objectList);
-
- updateJBRulesCounter( startTime, ruleAgentProperties, JBRulesCounter.RULES_SUCCEED );
+ return executeStatefulRules(ruleBase, false, message, globals, objectList);
}
catch (IOException e)
{
- updateJBRulesCounter( startTime, ruleAgentProperties, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException( "Could not read the ruleAgentProperties. " + e.getMessage(), e);
}
catch (RuleServiceException e)
{
- updateJBRulesCounter( startTime, ruleAgentProperties, JBRulesCounter.RULES_FAILED );
throw e;
}
catch (Exception e)
{
- updateJBRulesCounter( startTime, ruleAgentProperties, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException( "RuleAgent could not get the RuleBase. " + e.getMessage(), e);
}
- return message;
}
/**
@@ -394,42 +323,23 @@
{
AssertArgument.isNotNullAndNotEmpty( rules, "rules" );
- final long startTime = System.nanoTime();
-
try
{
final Map<String, RuleBase> ruleBases = lifecycleRuleBases.getLifecycleResource();
final RuleBase ruleBase = ruleBases.get( rules );
- message = executeStatefulRules( ruleBase, dispose, message, globals, objectList );
-
- updateJBRulesCounter( startTime, rules, JBRulesCounter.RULES_SUCCEED );
+ return executeStatefulRules( ruleBase, dispose, message, globals, objectList );
}
catch (Exception e)
{
- updateJBRulesCounter( startTime, rules, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException( "Could not continue rule execution. " + e.getMessage(), e);
}
- return message;
}
public void setConfigTree( final ConfigTree configTree )
{
- rulesCounter = new JBRulesCounter( configTree );
- rulesCounter.registerMBean();
}
- // private methods
-
- private void updateJBRulesCounter( final long startTime , final String rules, final String result )
- {
- if (rulesCounter != null)
- {
- long procTime = System.nanoTime() - startTime;
- rulesCounter.update(procTime, rules, result );
- }
- }
-
// package protected methods
/**
@@ -451,8 +361,6 @@
final String dsl,
final boolean ruleReload) throws RuleServiceException
{
- final long startTime = System.nanoTime();
-
try
{
final DroolsRuleBaseHelper rbHelper = DroolsRuleBaseHelper.getInstance();
@@ -490,24 +398,16 @@
}
catch (final LifecycleResourceException e)
{
- updateJBRulesCounter( startTime, ruleSet, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException("Could not load lifecycle data. " + e.getMessage(), e);
}
catch (final IOException e)
{
- updateJBRulesCounter( startTime, ruleSet, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException("Could not read the rules. " + e.getMessage(), e);
}
catch (final DroolsParserException e)
{
- updateJBRulesCounter( startTime, ruleSet, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException("Could not parse the rules. " + e.getMessage(), e);
}
- catch (final RuleServiceException e)
- {
- updateJBRulesCounter( startTime, ruleSet, JBRulesCounter.RULES_FAILED );
- throw e;
- }
}
/**
@@ -542,22 +442,14 @@
}
catch (final IOException e)
{
- updateJBRulesCounter( startTime, decisionTable, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException("Could not read the rules from [" + decisionTable + "]", e);
}
catch (final DroolsParserException e)
{
- updateJBRulesCounter( startTime, decisionTable, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException("Could not parse the rules in [" + decisionTable + "]", e);
}
- catch (final RuleServiceException e)
- {
- updateJBRulesCounter( startTime, decisionTable, JBRulesCounter.RULES_FAILED );
- throw e;
- }
catch (final LifecycleResourceException e)
{
- updateJBRulesCounter( startTime, decisionTable, JBRulesCounter.RULES_FAILED );
throw new RuleServiceException("Caught a LifecycleResourceException :", e);
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksTransformer.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksTransformer.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/smooks/src/main/java/org/jboss/soa/esb/actions/converters/SmooksTransformer.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -168,8 +168,6 @@
private String defaultMessageToType;
private String defaultMessageTo;
- private SmooksMessageCounter smooksMessageCounter;
-
/**
* Public constructor.
* @param propertiesTree Action Properties.
@@ -201,8 +199,6 @@
if(defaultMessageTo != null && defaultMessageTo.trim().equals("")) {
throw new ConfigurationException("Empty '" + TO + "' config attribute supplied.");
}
- smooksMessageCounter = new SmooksMessageCounter(propertiesTree);
- smooksMessageCounter.registerMBean();
actionConfig = propertiesTree;
}
@@ -344,17 +340,8 @@
logger.warn("Only java.lang.String payload types supported. Input message was of type [" + payload.getClass().getName() + "]. Returning message untransformed.");
}
- long procTime = System.nanoTime() - startTime;
- smooksMessageCounter.update(procTime, messageProfile, SmooksMessageCounter.TRANSFORM_SUCCEED);
-
} catch(Throwable thrown) {
- long procTime = System.nanoTime() - startTime;
- smooksMessageCounter.update(procTime, messageProfile, SmooksMessageCounter.TRANSFORM_FAILED);
-
- thrown.printStackTrace();
throw new ActionProcessingException("Message transformation failed.", thrown);
- } finally {
- smooksMessageCounter.incrementTotalCount();
}
// TODO: Cater for more message input types e.g. InputStream, DOM Document...
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/soap/base-project-build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/soap/base-project-build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/services/soap/base-project-build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -81,6 +81,8 @@
<fileset dir="lib/ext" includes="*.jar"/>
<fileset dir="src/main/resources/"/>
<fileset dir="build" includes="*.jar"/>
+ <fileset dir="${esb.root.dir}/build/lib"
+ includes="jaxws-tools*.jar jaxws-rt*.jar jaxb-xjc*.jar"/>
</copy>
</target>
@@ -121,4 +123,4 @@
</target>
-</project>
\ No newline at end of file
+</project>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/console/management/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/console/management/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/console/management/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -25,14 +25,19 @@
<target name="dependencies" depends="dependencies.source, dependencies.jbossesb"/>
<target name="dependencies.jbossesb" if="hierarchy.jbossesb">
- <property name="lib.dir" location="${mgmt.dir}/../../../lib"/>
+ <path id="lib.jars">
+ <fileset dir="${mgmt.dir}/../../../lib" includes="*.jar"/>
+ </path>
</target>
<target name="dependencies.source" if="hierarchy.source">
<available file="${esb.root.dir}/build/jbossesb" property="dist.exists"/>
<fail unless="dist.exists"
message="JBossESB must be built. Please run 'ant dist' in ${esb.root.dir}"/>
- <property name="lib.dir" location="${mgmt.dir}/../../../build/lib"/>
+ <path id="lib.jars">
+ <fileset dir="${mgmt.dir}/../../../build/lib" includes="*.jar"/>
+ <fileset dir="${mgmt.dir}/../../../build/jbossesb/lib" includes="*.jar"/>
+ </path>
</target>
<target name="define-lib">
@@ -61,7 +66,7 @@
<fileset dir="${mgmt.dir}/lib">
<include name="*.jar"/>
</fileset>
- <fileset refid="lib"/>
+ <path refid="lib.jars"/>
</path>
<condition property="lib.dir.path"
@@ -73,10 +78,6 @@
<available type="dir" file="${mgmt.dir}/./lib"/>
</condition>
- <fileset id="lib" dir="${lib.dir}">
- <include name="*.jar"/>
- </fileset>
-
<condition property="rosetta.src" value="${esb.root.dir}/rosetta/src">
<available type="dir" file="${esb.root.dir}/rosetta/src"/>
</condition>
@@ -94,17 +95,25 @@
<target name="compile" depends="init"
description="Build the management war">
<echo>${esb.root.dir}</echo>
+
+ <delete dir="${mgmt.build.dir}/src" quiet="true"/>
+ <mkdir dir="${mgmt.build.dir}/src"/>
+ <copy todir="${mgmt.build.dir}/src">
+ <fileset dir="${rosetta.src}">
+ <include name="org/jboss/soa/esb/monitoring/**"/>
+ </fileset>
+ </copy>
+
<mkdir dir="${mgmt.build.dir}/classes"/>
<javac classpathref="build.classpath"
destdir="${mgmt.build.dir}/classes"
debug="on"
- includes="org/jboss/soa/esb/monitoring/**"
source="1.5"
target="1.5"
deprecation="${javac.deprecation}"
nowarn="on">
- <src path="${rosetta.src}"/>
<src path="${src.java.dir}"/>
+ <src path="${mgmt.build.dir}/src"/>
</javac>
<copy file="${mgmt.dir}/src/main/resources/${db}/monitoring-mappings.hbm.xml"
todir="build/classes/org/jboss/soa/esb/monitoring">
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -45,14 +45,20 @@
private static final String PROCESSING_TIME = "processing time";
private static final String OVERALL_BYTES_PROCESSED = "processed bytes";
private static final String OVERALL_BYTES_FAILED = "failed bytes";
-
+
private static final String OVERALL_METRIC_NAME = "overallMessagesCount";
private static final String SUCCESS_METRIC_NAME = "successProcessedCount";
private static final String FAILED_METRIC_NAME = "failedProcessedCount";
+
private static final String PROCESSINGTIME_METRIC_NAME = "processingTime";
- private static final String BYTESPROCESSED_METRIC_NAME = "overallBytesProcessed";
+ private static final String OVERALL_BYTES_METRIC_NAME = "overallBytesProcessed";
+ private static final String BYTESPROCESSED_METRIC_NAME = "bytesSuccessful";
private static final String BYTESFAILED_METRIC_NAME = "overallBytesFailed";
+ private static final String OVERALL_MINUTE_METRIC_NAME = "overallMessagesCountMinute";
+ private static final String SUCCESS_MINUTE_METRIC_NAME = "successProcessedCountMinute";
+ private static final String FAILED_MINUTE_METRIC_NAME = "failedProcessedCountMinute";
+
/**
* Is this service alive?
*
@@ -101,6 +107,11 @@
//Object entityStatistics = operation.invoke(context.getResourceKey());
int counter = 0;
+ int success = 0;
+ int failed = 0;
+
+ int counterBytesFailed = 0;
+ int counterBytesProcessed = 0;
for (MeasurementScheduleRequest request : requests) {
String metricName = request.getName();
if (metricName.equals (SUCCESS_METRIC_NAME)) {
@@ -109,6 +120,7 @@
if (attribute != null) {
processed = (Integer) attribute.refresh();
}
+ success = processed.intValue();
counter += processed.intValue();
report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
} else if (metricName.equals(FAILED_METRIC_NAME)) {
@@ -117,6 +129,7 @@
if (attribute != null) {
processed = (Integer) attribute.refresh();
}
+ failed = processed.intValue();
counter += processed.intValue();
report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
} else if (metricName.equals(PROCESSINGTIME_METRIC_NAME)) {
@@ -133,21 +146,31 @@
Integer bytesProcessed = new Integer(0);
if (attribute != null) {
bytesProcessed = (Integer) attribute.refresh();
+ counterBytesProcessed = bytesProcessed.intValue();
}
report.addData(new MeasurementDataNumeric(request, new Double(bytesProcessed.doubleValue())));
} else if (metricName.equals(BYTESFAILED_METRIC_NAME)) {
EmsAttribute attribute = this.bean.getAttribute(actionName + " " + OVERALL_BYTES_FAILED);
- Integer bytesProcessed = new Integer(0);
+ Integer bytesFailed = new Integer(0);
if (attribute != null) {
- bytesProcessed = (Integer) attribute.refresh();
+ bytesFailed = (Integer) attribute.refresh();
+ counterBytesFailed += bytesFailed.intValue();
}
- report.addData(new MeasurementDataNumeric(request, new Double(bytesProcessed.doubleValue())));
+ report.addData(new MeasurementDataNumeric(request, new Double(bytesFailed.doubleValue())));
}
}
for (MeasurementScheduleRequest request : requests) {
String metricName = request.getName();
if (metricName.equals (OVERALL_METRIC_NAME)) {
report.addData(new MeasurementDataNumeric(request, new Double(counter)));
+ } else if (metricName.equals(OVERALL_MINUTE_METRIC_NAME)) {
+ report.addData(new MeasurementDataNumeric(request, new Double(counter)));
+ } else if (metricName.equals(SUCCESS_MINUTE_METRIC_NAME)) {
+ report.addData(new MeasurementDataNumeric(request, new Double(success)));
+ } else if (metricName.equals(FAILED_MINUTE_METRIC_NAME)) {
+ report.addData(new MeasurementDataNumeric(request, new Double(failed)));
+ } else if (metricName.equals(OVERALL_BYTES_METRIC_NAME)) {
+ report.addData(new MeasurementDataNumeric(request, new Double(counterBytesProcessed + counterBytesFailed)));
}
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/DeploymentComponent.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/DeploymentComponent.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/DeploymentComponent.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,4 +1,4 @@
-package org.jbosson.plugins.jbossesb;
+ package org.jbosson.plugins.jbossesb;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -36,6 +36,7 @@
import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.core.pluginapi.operation.OperationContext;
import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.plugins.jbossas.JBossASServerComponent;
import org.rhq.plugins.jbossas.util.FileContentDelegate;
import org.rhq.plugins.jmx.JMXComponent;
import org.rhq.plugins.jmx.MBeanResourceComponent;
@@ -241,9 +242,12 @@
public void deleteResource() throws Exception {
Configuration pluginConfiguration = super.resourceContext.getPluginConfiguration();
- String fullFileName = pluginConfiguration.getSimple("filename").getStringValue();
+ String fullFileName = pluginConfiguration.getSimple("deployment").getStringValue();
+
+ ESBComponent jbossASComponent = (ESBComponent) super.resourceContext.getParentResourceComponent();
+ //File deploymentFile = jbossASComponent.getDeploymentFilePath(super.resourceContext.getResourceKey());
- File file = new File(fullFileName);
+ File file = new File(jbossASComponent.getConfigurationPath() + "/deploy/" + fullFileName);
if (!file.exists()) {
throw new Exception("Cannot find application file to delete: " + fullFileName);
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBComponent.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBComponent.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBComponent.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -35,6 +35,7 @@
import org.rhq.plugins.jbossas.JBossASServerComponent;
import org.rhq.plugins.jbossas.util.FileContentDelegate;
import org.rhq.plugins.jmx.MBeanResourceComponent;
+import org.rhq.plugins.utils.FileUtils;
public class ESBComponent extends MBeanResourceComponent implements CreateChildResourceFacet, ContentFacet {
private static final String RESOURCE_TYPE_ESB = "JBoss ESB Deployment";
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -42,8 +42,9 @@
private static final String OVERALL_MESSAGE_COUNT = "overall service message count";
private static final String OVERALL_MESSAGE_METRIC = "overallMessageCount";
- private static final String OVERALL_BYTES_PROCESSED_METRIC = "overallBytesProcessed";
- private static final String OVERALL_BYTES_FAILED_METRIC = "overallBytesFailed";
+ private static final String OVERALL_BYTES_METRIC = "overallBytes";
+ private static final String OVERALL_BYTES_PROCESSED_METRIC = "bytesProcessed";
+ private static final String OVERALL_BYTES_FAILED_METRIC = "bytesFailed";
private static final String OVERALL_BYTES_PROCESSED = "overall bytes processed";
private static final String OVERALL_BYTES_FAILED = "overall bytes failed";
@@ -60,7 +61,10 @@
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
Configuration pluginConfig = this.context.getPluginConfiguration();
pluginConfig.put(new PropertySimple("type", "service"));
- Integer overallMessages = null;
+ Integer overallMessages = new Integer(0);
+
+ int bytesProcessed = 0;
+ int bytesFailed = 0;
for (MeasurementScheduleRequest request : requests) {
String metricName = request.getName();
if (metricName.equals(OVERALL_MESSAGE_METRIC)) {
@@ -72,6 +76,7 @@
Integer processed = new Integer(0);
if (attribute != null) {
processed = (Integer) attribute.refresh();
+ bytesProcessed = processed.intValue();
}
report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
} else if (metricName.equals(OVERALL_BYTES_FAILED_METRIC)) {
@@ -79,14 +84,18 @@
Integer processed = new Integer(0);
if (attribute != null) {
processed = (Integer) attribute.refresh();
+ bytesFailed = processed.intValue();
}
report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
}
}
+
for (MeasurementScheduleRequest request : requests) {
String metricName = request.getName();
if (metricName.equals(OVERALL_MINUTE_METRIC_NAME)) {
report.addData(new MeasurementDataNumeric(request, new Double(overallMessages.doubleValue())));
+ } else if (metricName.equals(OVERALL_BYTES_METRIC)) {
+ report.addData(new MeasurementDataNumeric(request, new Double(bytesProcessed + bytesFailed)));
}
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -50,13 +50,13 @@
<operation name="create" displayName="Move .esb deployment into the create state" description="Move the .esb deployment into the create state"/>
<operation name="destroy" displayName="Move .esb deployment into the destroy state" description="Move the .esb deployment into the destroy state"/>
<operation name="resetCounts" displayName="Reset Counts" description="Reset the overall counter"/>
- <metric displayName="Successful Message Count" property="SuccessfulMessageCount" category="utilization" displayType="summary" measurementType="dynamic" description="Overall Successful Message Count"/>
- <metric displayName="Total Message Count" property="TotalMessageCount" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Total Message Count"/>
- <metric displayName="Failed Message Count" property="FailedMessageCount" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Failed Message Count"/>
+ <metric displayName="Message Count (Successful)" property="SuccessfulMessageCount" category="utilization" displayType="summary" measurementType="dynamic" description="Overall Successful Message Count"/>
+ <metric displayName="Message Count (Total)" property="TotalMessageCount" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Total Message Count"/>
+ <metric displayName="Message Counts (Failed)" property="FailedMessageCount" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Failed Message Count"/>
+ <metric displayName="Processed Bytes" property="ProcessedBytes" units="bytes" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Overall Bytes Processed"/>
<metric property="LastSuccessfulMessageDate" displayName="Last Successful Message Date" dataType="trait" displayType="summary" defaultOn="true" description="Last Successful Message Date"/>
<metric property="LastFailedMessageDate" displayName="Last Failed Message Date" dataType="trait" displayType="summary" defaultOn="true" description="Last Failed Message Date"/>
- <metric property="StateString" dataType="trait" displayName="State" displayType="summary" defaultOn="true" description="State of the ESB"/>
- <metric displayName="Bytes Processed" property="ProcessedBytes" units="bytes" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Overall Bytes Processed"/>
+ <metric property="StateString" dataType="trait" displayName="State" displayType="summary" defaultOn="true" description="State of the ESB"/>
<content name="library" displayName="Jar Library" category="deployable"
description="Library Jar files deployed in JBoss AS">
<configuration>
@@ -88,8 +88,6 @@
</plugin-configuration>
<operation name="start" displayName="Start deployment" description="Start the JBoss ESB deployment"/>
<operation name="stop" displayName="Stop deployment" description="Stop the JBoss ESB deployment"/>
- <operation name="create" displayName="Move .esb deployment into the create state" description="Move the .esb deployment into the create state"/>
- <operation name="destroy" displayName="Move .esb deployment into the destroy state" description="Move the .esb deployment into the destroy state"/>
<metric property="Name" displayName="Deployment Type" dataType="trait" displayType="summary" defaultOn="true" description="Type of deployment"/>
<metric property="StateString" displayName=".esb State String" dataType="trait" displayType="summary" defaultOn="true" description="Current state of the ESB"/>
<metric property="State" displayName=".esb State" dataType="trait" displayType="summary" defaultOn="true" description="Numeric value of the state of the ESB deployment"/>
@@ -109,20 +107,23 @@
</configuration>
</content>
<service name="JBoss ESB Services"
- discovery="org.jbosson.plugins.jbossesb.ServiceDiscoveryComponent"
- class="ServiceComponent"
+ discovery="org.jbosson.plugins.jbossesb.ESBDiscoveryComponent"
+ class="org.jbosson.plugins.jbossesb.ServiceComponent"
description="JBoss ESB Services">
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="jboss.esb:category=MessageCounter,deployment={deployment},service-category=%serviceCategory%,service-name=%serviceName%"/>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.esb:category=MessageCounter,deployment={deployment},service-category=%categoryName%,service-name=%serviceName%"/>
<c:simple-property name="nameTemplate" default="{serviceName} Service"/>
<c:simple-property name="DescriptionTemplate" default="JBoss ESB statistics for the {serviceName} service."/>
<c:simple-property name="serviceName" type="string" description="the JBoss ESB service name"/>
- <c:simple-property name="serviceCategory" type="string" description="The JBoss ESB service category"/>
+ <c:simple-property name="categoryName" type="string" description="the JBoss ESB service category name"/>
</plugin-configuration>
<operation name="resetCounter" displayName="Reset the message counter" description="Reset the message counter"/>
- <metric displayName="Overall Service Message Count" property="overallMessageCount" category="utilization" displayType="summary" measurementType="dynamic" description="Overall Service Message Count"/>
- <metric displayName="Overall Service Bytes Processed" property="overallBytesProcessed" units="bytes" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Overall Service Bytes Processed"/>
- <metric displayName="Overall Service Bytes Failed" property="overallBytesFailed" units="bytes" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Overall Service Bytes Failed"/>
+ <metric displayName="Message Count" property="overallMessageCount" category="utilization" displayType="summary" measurementType="dynamic" description="Message Count"/>
+ <metric displayName="Message Count (avg)" property="overallMessageCountByMinute" category="utilization" displayType="summary" measurementType="dynamic" description="Message Count (avg)"/>
+ <metric displayName="Overall Bytes" property="overallBytes" units="bytes" category="utilization" displayType="summary"
+defaultOn="true" measurementType="dynamic" description="Overall Bytes"/>
+ <metric displayName="Overall Bytes Processed" property="bytesProcessed" units="bytes" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Overall Bytes Processed"/>
+ <metric displayName="Overall Bytes Failed" property="bytesFailed" units="bytes" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic" description="Overall Bytes Failed"/>
<help>
<![CDATA[
JBoss ESB Services are the services available within a deployment.
@@ -133,16 +134,15 @@
class="ListenerComponent"
description="JBoss ESB Listeners">
<plugin-configuration>
- <c:simple-property name="objectName" readOnly="true" default="jboss.esb:listener-name=listener,service-category=%service-category%,service-name={serviceName}"/>
- <c:simple-property name="nameTemplate" default="{service-category} Listener Configuration"/>
+ <c:simple-property name="objectName" readOnly="true" default="jboss.esb:deployment=%deploymentName%,listener-name=%listenerName%,service-category=%serviceCategory%,service-name={serviceName}"/>
+ <c:simple-property name="nameTemplate" default="{listenerName} - {serviceCategory} Listener Configuration"/>
<c:simple-property name="descriptionTemplate" default="JBoss Listener statistics"/>
<c:simple-property name="serviceCategory" type="string" description="the service category of the listener"/>
+ <c:simple-property name="listenerName" type="string" description="the name of the Listener"/>
+ <c:simple-property name="deploymentName" type="string" description="name of deployment"/>
</plugin-configuration>
- <operation name="initialise" displayName="Initialize listener" description="Initialize the listener."/>
<operation name="start" displayName="Start listener" description="Start the listener."/>
<operation name="stop" displayName="Stop listener" description="Stop the listener."/>
- <operation name="destroy" displayName="Destroy listener" description="Destroy the listener."/>
-
<metric property="mep" displayName="MEP" dataType="trait" displayType="summary" defaultOn="true" description="Type of deployment"/>
<metric property="LifeCycleState" displayName="Lifecycle State" dataType="trait" displayType="summary" defaultOn="true" description="Lifecycle State"/>
<metric property="maxThreads" displayName="Maximum Number of Threads" dataType="trait" displayType="summary" defaultOn="true" description="Maximum number of threads"/>
@@ -167,11 +167,18 @@
<c:simple-property name="descriptionTemplate" default="JBoss ESB statistics for the {actionName} action."/>
<c:simple-property name="actionName" type="string" description="the JBoss ESB action name"/>
</plugin-configuration>
- <metric displayName="Messages Successfully Processed" property="successProcessedCount" category="throughput" defaultOn="true"/>
- <metric displayName="Messages Failed" property="failedProcessedCount" category="performance" defaultOn="true"/>
+ <metric displayName="Message Count" property="overallMessagesCount" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic"/>
+ <metric displayName="Message Count (avg)" property="overallMessagesCountMinute" category="utilization"
+displayType="summary" defaultOn="true" measurementType="dynamic"/>
+ <metric displayName="Messages Failed" property="failedProcessedCount" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic"/>
+ <metric displayName="Messages Failed (avg)" property="failedProcessedCountMinute" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic"/>
+ <metric displayName="Messages Successfully Processed" property="successProcessedCount" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic"/>
+ <metric displayName="Messages Successfully Processed (avg)" property="successProcessedCountMinute" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic"/>
+ <metric displayName="Overall Bytes" property="overallBytesProcessed" units="bytes" category="utilization"
+displayType="summary" defaultOn="true" measurementType="dynamic"/>
+ <metric displayName="Overall Bytes Processed" property="bytesSuccessful" units="bytes" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic"/>
+ <metric displayName="Overall Bytes Failed" property="overallBytesFailed" units="bytes" category="utilization" displayType="summary" defaultOn="true" measurementType="dynamic"/>
<metric displayName="Processing Time" property="processingTime" units="milliseconds" defaultOn="true" category="performance"/>
- <metric displayName="Bytes Processed" property="overallBytesProcessed" units="bytes" category="performance" defaultOn="true"/>
- <metric displayName="Bytes Failed" property="overallBytesFailed" units="bytes" category="performance" defaultOn="true"/>
<help>
<![CDATA[
JBoss ESB Actions are the actions executed within a service.
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/build.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/build.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -161,6 +161,12 @@
<include name="META-INF/*.xml"/>
</fileset>
</jar>
+ <jar jarfile="${qa.build.lib}/aop-test.sar">
+ <fileset dir="${qa.junit.classes}">
+ <include name="org/jboss/soa/esb/server/aop/*.class"/>
+ </fileset>
+ <fileset dir="${qa.junit.resources}/server/aop"/>
+ </jar>
</target>
<target name="one-test" if="test" depends="jars"
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/resources/server/aop)
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/resources/server/aop/META-INF)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/jboss-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/resources/server/aop/META-INF/jboss-service.xml 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/jboss-service.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
- <mbean name="jboss.esb:test=AOPServer" code="org.jboss.soa.esb.server.aop.AOPServer"/>
-</server>
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/jboss-service.xml (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/resources/server/aop/META-INF/jboss-service.xml)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/jboss-service.xml (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/resources/server/aop/META-INF/jboss-service.xml 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean name="jboss.esb:test=AOPServer" code="org.jboss.soa.esb.server.aop.AOPServer"/>
+</server>
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/src/org/jboss/soa/esb/server/aop)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,189 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.server.aop;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collection;
-
-import javax.xml.registry.BulkResponse;
-import javax.xml.registry.BusinessQueryManager;
-import javax.xml.registry.Connection;
-import javax.xml.registry.JAXRException;
-import javax.xml.registry.JAXRResponse;
-import javax.xml.registry.RegistryService;
-import javax.xml.registry.infomodel.Service;
-import javax.xml.registry.infomodel.ServiceBinding;
-
-import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
-import org.jboss.internal.soa.esb.services.registry.JAXRConnectionFactory;
-import org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.addressing.eprs.LogicalEPR;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
-
-
-/**
- * MBean to manage AOP tests.
- *
- * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
- */
-public class AOPServer implements AOPServerMBean
-{
- public AOPServer()
- {
- System.out.println("AOP test MBean deployed") ;
- }
-
- public String verifyScoutPerformanceIssue()
- throws JAXRException, ConfigurationException
- {
- return new TestScoutRegistryImpl().checkService() ;
- }
-
- public String verifyJUDDICDataIssue()
- throws RegistryException, MarshalException, ServiceNotFoundException
- {
- final Registry registry = RegistryFactory.getRegistry() ;
- final String category = "DummyAOPCategory" ;
- final String serviceName = "DummyAOPServiceName" ;
- final String serviceDescription = "Dummy AOP Service Description" ;
- final LogicalEPR epr = new LogicalEPR(category, serviceName) ;
- for (char name = 'a' ; name <= 'z' ; name++)
- {
- final String val = new String(new char[] {name}) ;
- epr.getAddr().addExtension(val, val) ;
- }
- final String eprAsXML = EPRHelper.toXMLString(epr) ;
- final String heuristic = verifyHeuristic(eprAsXML) ;
- if (heuristic != null)
- {
- return null ;
- }
-
- final String eprDescription = "Dummy AOP EPR Description" ;
-
- registry.registerEPR(category, serviceName, serviceDescription, epr, eprDescription) ;
- try
- {
- registry.findEPR(category, serviceName) ;
- }
- catch (final Throwable th)
- {
- final StringWriter sw = new StringWriter() ;
- final PrintWriter pw = new PrintWriter(sw) ;
- th.printStackTrace(pw) ;
- pw.flush() ;
- return sw.toString() ;
- }
-
- return null ;
- }
-
- private String verifyHeuristic(final String value)
- {
- final char[] contents = value.toCharArray() ;
- final int numChars = contents.length ;
- int counter = 0 ;
- for(int index = 0 ; index < numChars ; index++)
- {
- final char ch = contents[index] ;
- if ((ch == '<') || (ch == '&'))
- {
- counter++;
- }
- }
- if ((numChars > 32) && (counter > 5) &&
- (((counter * 100) / numChars) > 1))
- {
- return null ;
- }
- else
- {
- return "Heuristic failure" ;
- }
- }
-
- private static final class TestScoutRegistryImpl extends JAXRRegistryImpl
- {
- public TestScoutRegistryImpl()
- throws ConfigurationException
- {
- }
-
- public String checkService()
- throws JAXRException, ConfigurationException
- {
- final Service service = findService("JBossESB-Internal", "DeadLetterService") ;
-
- if (service == null)
- {
- return "Service not found" ;
- }
-
- final ScoutConnectionFactory scoutConnectionFactory = new ScoutConnectionFactory() ;
- final Connection connection = scoutConnectionFactory.getConnection();
- final RegistryService rs = connection.getRegistryService();
- final BusinessQueryManager bqm = rs.getBusinessQueryManager();
- final BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),null,null,null);
- if (bulkResponse.getStatus()!=JAXRResponse.STATUS_SUCCESS)
- {
- return "findServiceBindings failed" ;
- }
- final Collection<ServiceBinding> serviceBindings = (Collection<ServiceBinding>)bulkResponse.getCollection();
- if ((serviceBindings == null) || (serviceBindings.size() == 0))
- {
- return "could not find service bindings for DeadLetterService" ;
- }
-
- for(ServiceBinding serviceBinding: serviceBindings)
- {
- final Service bindingService = serviceBinding.getService() ;
- if (bindingService == null)
- {
- return "Could not find service associated with binding" ;
- }
- if (bindingService.getProvidingOrganization() != null)
- {
- return "FAILED: Organization is present in service binding" ;
- }
- }
-
- return null ;
- }
- }
-
- private static class ScoutConnectionFactory extends JAXRConnectionFactory
- {
- public ScoutConnectionFactory()
- throws ConfigurationException
- {
- }
-
- public Connection getConnection()
- {
- return super.getConnection() ;
- }
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.server.aop;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Collection;
+
+import javax.xml.registry.BulkResponse;
+import javax.xml.registry.BusinessQueryManager;
+import javax.xml.registry.Connection;
+import javax.xml.registry.JAXRException;
+import javax.xml.registry.JAXRResponse;
+import javax.xml.registry.RegistryService;
+import javax.xml.registry.infomodel.Service;
+import javax.xml.registry.infomodel.ServiceBinding;
+
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
+import org.jboss.internal.soa.esb.services.registry.JAXRConnectionFactory;
+import org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.addressing.eprs.LogicalEPR;
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
+
+
+/**
+ * MBean to manage AOP tests.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public class AOPServer implements AOPServerMBean
+{
+ public AOPServer()
+ {
+ System.out.println("AOP test MBean deployed") ;
+ }
+
+ public String verifyScoutPerformanceIssue()
+ throws JAXRException, ConfigurationException
+ {
+ return new TestScoutRegistryImpl().checkService() ;
+ }
+
+ public String verifyJUDDICDataIssue()
+ throws RegistryException, MarshalException, ServiceNotFoundException
+ {
+ final Registry registry = RegistryFactory.getRegistry() ;
+ final String category = "DummyAOPCategory" ;
+ final String serviceName = "DummyAOPServiceName" ;
+ final String serviceDescription = "Dummy AOP Service Description" ;
+ final LogicalEPR epr = new LogicalEPR(category, serviceName) ;
+ for (char name = 'a' ; name <= 'z' ; name++)
+ {
+ final String val = new String(new char[] {name}) ;
+ epr.getAddr().addExtension(val, val) ;
+ }
+ final String eprAsXML = EPRHelper.toXMLString(epr) ;
+ final String heuristic = verifyHeuristic(eprAsXML) ;
+ if (heuristic != null)
+ {
+ return null ;
+ }
+
+ final String eprDescription = "Dummy AOP EPR Description" ;
+
+ registry.registerEPR(category, serviceName, serviceDescription, epr, eprDescription) ;
+ try
+ {
+ registry.findEPR(category, serviceName) ;
+ }
+ catch (final Throwable th)
+ {
+ final StringWriter sw = new StringWriter() ;
+ final PrintWriter pw = new PrintWriter(sw) ;
+ th.printStackTrace(pw) ;
+ pw.flush() ;
+ return sw.toString() ;
+ }
+
+ return null ;
+ }
+
+ private String verifyHeuristic(final String value)
+ {
+ final char[] contents = value.toCharArray() ;
+ final int numChars = contents.length ;
+ int counter = 0 ;
+ for(int index = 0 ; index < numChars ; index++)
+ {
+ final char ch = contents[index] ;
+ if ((ch == '<') || (ch == '&'))
+ {
+ counter++;
+ }
+ }
+ if ((numChars > 32) && (counter > 5) &&
+ (((counter * 100) / numChars) > 1))
+ {
+ return null ;
+ }
+ else
+ {
+ return "Heuristic failure" ;
+ }
+ }
+
+ private static final class TestScoutRegistryImpl extends JAXRRegistryImpl
+ {
+ public TestScoutRegistryImpl()
+ throws ConfigurationException
+ {
+ }
+
+ public String checkService()
+ throws JAXRException, ConfigurationException
+ {
+ final Service service = findService("JBossESB-Internal", "DeadLetterService") ;
+
+ if (service == null)
+ {
+ return "Service not found" ;
+ }
+
+ final ScoutConnectionFactory scoutConnectionFactory = new ScoutConnectionFactory() ;
+ final Connection connection = scoutConnectionFactory.getConnection();
+ final RegistryService rs = connection.getRegistryService();
+ final BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ final BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),null,null,null);
+ if (bulkResponse.getStatus()!=JAXRResponse.STATUS_SUCCESS)
+ {
+ return "findServiceBindings failed" ;
+ }
+ final Collection<ServiceBinding> serviceBindings = (Collection<ServiceBinding>)bulkResponse.getCollection();
+ if ((serviceBindings == null) || (serviceBindings.size() == 0))
+ {
+ return "could not find service bindings for DeadLetterService" ;
+ }
+
+ for(ServiceBinding serviceBinding: serviceBindings)
+ {
+ final Service bindingService = serviceBinding.getService() ;
+ if (bindingService == null)
+ {
+ return "Could not find service associated with binding" ;
+ }
+ if (bindingService.getProvidingOrganization() != null)
+ {
+ return "FAILED: Organization is present in service binding" ;
+ }
+ }
+
+ return null ;
+ }
+ }
+
+ private static class ScoutConnectionFactory extends JAXRConnectionFactory
+ {
+ public ScoutConnectionFactory()
+ throws ConfigurationException
+ {
+ }
+
+ public Connection getConnection()
+ {
+ return super.getConnection() ;
+ }
+ }
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.server.aop;
-
-import javax.xml.registry.JAXRException;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
-
-/**
- * MBean to manage AOP tests.
- *
- * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
- */
-public interface AOPServerMBean
-{
- public static final String OBJECT_NAME="jboss.esb:test=AOPServer" ;
-
- public String verifyScoutPerformanceIssue()
- throws JAXRException, ConfigurationException ;
-
- public String verifyJUDDICDataIssue()
- throws RegistryException, MarshalException, ServiceNotFoundException ;
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.server.aop;
+
+import javax.xml.registry.JAXRException;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
+
+/**
+ * MBean to manage AOP tests.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public interface AOPServerMBean
+{
+ public static final String OBJECT_NAME="jboss.esb:test=AOPServer" ;
+
+ public String verifyScoutPerformanceIssue()
+ throws JAXRException, ConfigurationException ;
+
+ public String verifyJUDDICDataIssue()
+ throws RegistryException, MarshalException, ServiceNotFoundException ;
+}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java 2008-10-13 11:58:02 UTC (rev 23436)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -1,100 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.server.aop;
-
-import javax.management.ObjectName;
-
-import junit.framework.Test;
-
-import org.jboss.test.JBossTestCase;
-
-/**
- * Test asynchronous callbacks for jBPM processes.
- *
- * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
- */
-public class AOPUnitTest extends JBossTestCase
-{
- /**
- * The name of the deployment archive.
- */
- private static final String SAR_ARCHIVE = "aop-test.sar" ;
-
- /**
- * Construct the test case with the specified name.
- * @param name The name of the test case.
- */
- public AOPUnitTest(final String name)
- {
- super(name) ;
- }
-
- /**
- * Test for scout performance issue.
- * @throws Exception For any failures.
- */
- public void testScoutPerformanceIssue()
- throws Exception
- {
- final String result = (String)execute("verifyScoutPerformanceIssue", null, null) ;
- if (result != null)
- {
- fail(result) ;
- }
- }
-
- /**
- * Test for juddi CDATA issue..
- * @throws Exception For any failures.
- */
- public void testJUDDICDataIssue()
- throws Exception
- {
- final String result = (String)execute("verifyJUDDICDataIssue", null, null) ;
- if (result != null)
- {
- fail(result) ;
- }
- }
-
- /**
- * Execute the specified method on the mbean.
- * @param method The method name.
- * @param values The parmeter values.
- * @param types The parameter types.
- * @return The method return value.
- * @throws Exception For errors during invocation.
- */
- private Object execute(final String method, final Object[] values, final String[] types)
- throws Exception
- {
- return getServer().invoke(new ObjectName(AOPServerMBean.OBJECT_NAME), method, values, types) ;
- }
-
- /**
- * Create the test suite.
- * @return The suite representing this test case.
- */
- public static Test suite()
- throws Exception
- {
- return getDeploySetup(AOPUnitTest.class, SAR_ARCHIVE);
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java (from rev 23436, labs/jbossesb/tags/JBESB_4_4_GA_CP1_CR1/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java 2008-10-13 12:25:47 UTC (rev 23437)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.server.aop;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Test asynchronous callbacks for jBPM processes.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public class AOPUnitTest extends JBossTestCase
+{
+ /**
+ * The name of the deployment archive.
+ */
+ private static final String SAR_ARCHIVE = "aop-test.sar" ;
+
+ /**
+ * Construct the test case with the specified name.
+ * @param name The name of the test case.
+ */
+ public AOPUnitTest(final String name)
+ {
+ super(name) ;
+ }
+
+ /**
+ * Test for scout performance issue.
+ * @throws Exception For any failures.
+ */
+ public void testScoutPerformanceIssue()
+ throws Exception
+ {
+ final String result = (String)execute("verifyScoutPerformanceIssue", null, null) ;
+ if (result != null)
+ {
+ fail(result) ;
+ }
+ }
+
+ /**
+ * Test for juddi CDATA issue..
+ * @throws Exception For any failures.
+ */
+ public void testJUDDICDataIssue()
+ throws Exception
+ {
+ final String result = (String)execute("verifyJUDDICDataIssue", null, null) ;
+ if (result != null)
+ {
+ fail(result) ;
+ }
+ }
+
+ /**
+ * Execute the specified method on the mbean.
+ * @param method The method name.
+ * @param values The parmeter values.
+ * @param types The parameter types.
+ * @return The method return value.
+ * @throws Exception For errors during invocation.
+ */
+ private Object execute(final String method, final Object[] values, final String[] types)
+ throws Exception
+ {
+ return getServer().invoke(new ObjectName(AOPServerMBean.OBJECT_NAME), method, values, types) ;
+ }
+
+ /**
+ * Create the test suite.
+ * @return The suite representing this test case.
+ */
+ public static Test suite()
+ throws Exception
+ {
+ return getDeploySetup(AOPUnitTest.class, SAR_ARCHIVE);
+ }
+}
More information about the jboss-svn-commits
mailing list