[jboss-svn-commits] JBL Code SVN: r24944 - in labs/jbossesb/trunk: product/docs and 101 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Jan 27 08:29:51 EST 2009
Author: kevin.conner at jboss.com
Date: 2009-01-27 08:29:49 -0500 (Tue, 27 Jan 2009)
New Revision: 24944
Added:
labs/jbossesb/trunk/product/docs/SOASoftwareIntegration.odt
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagator.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagator.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactory.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/NullWriter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBResponseFilter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagatorUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactoryUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/test_jaas.config
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JMSRouterUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers/
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockSecurityContextPropagator.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/test_jaas.config
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigTestUtil.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/certtestKeystore
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/lib/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/listener.log
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.project
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/keystore
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/login-config.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/roles.properties
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/index.jsp
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/publicKeyStore
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java
labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/
labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql
labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java
labs/jbossesb/trunk/product/tools/console/management-web/lib/jstl.jar
labs/jbossesb/trunk/product/tools/console/management-web/lib/standard.jar
Removed:
labs/jbossesb/trunk/product/install/conf/jaas.login
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/jaas.login
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/certtestKeystore
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/jaas.login
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java
labs/jbossesb/trunk/product/samples/quickstarts/helloworld_db_registration/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/lib/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/listener.log
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.project
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java
labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/keystore
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/login-config.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/roles.properties
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/
labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/index.jsp
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/build.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/deployment.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jboss-esb.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/publicKeyStore
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/readme.txt
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/
labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java
labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql
labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java
labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
Modified:
labs/jbossesb/trunk/product/.classpath
labs/jbossesb/trunk/product/.project
labs/jbossesb/trunk/product/build-distr.xml
labs/jbossesb/trunk/product/docs/GettingStarted.odt
labs/jbossesb/trunk/product/docs/ServicesGuide.pdf
labs/jbossesb/trunk/product/esb-config.xml
labs/jbossesb/trunk/product/install/build.xml
labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml
labs/jbossesb/trunk/product/rosetta/build.xml
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryInterceptor.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JaasSecurityService.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/PrivateCryptoUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionStatusBean.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounter.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterMBean.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageStatusBean.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/PublicCryptoUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityConfigUtil.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityContext.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityServiceFactory.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/AuthenticationRequestImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/util/CryptoUtil.java
labs/jbossesb/trunk/product/rosetta/tests/build.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryInterceptorUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JaasSecurityServiceUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/PrivateCryptoUtilUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/security-properties.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterIntegrationTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/security-properties.xml
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/PublicCryptoUtilUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigUtilUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityContextUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/security-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/readme.txt
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java
labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java
labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperUnitTest.java
labs/jbossesb/trunk/product/services/soap/src/test/resources/log4j.xml
labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/hsqldb/create_database.sql
labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/mysql/create_database.sql
labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/oracle/create_database.sql
labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/postgresql/create_database.sql
labs/jbossesb/trunk/product/tools/console/management-web/build.xml
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/attribute.jsp
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/index.jsp
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/invoke.jsp
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/operations.jsp
labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/results.jsp
labs/jbossesb/trunk/product/tools/console/management-web/web.xml
labs/jbossesb/trunk/product/tools/console/management/monitoring-mappings.hbm.xml
labs/jbossesb/trunk/product/tools/console/management/src/main/resources/hsqldb/monitoring-mappings.hbm.xml
labs/jbossesb/trunk/product/tools/console/management/src/main/resources/mysql/monitoring-mappings.hbm.xml
labs/jbossesb/trunk/product/tools/console/management/src/main/resources/oracle/monitoring-mappings.hbm.xml
labs/jbossesb/trunk/product/tools/console/management/src/main/resources/postgresql/monitoring-mappings.hbm.xml
labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml
labs/jbossesb/trunk/qa/quickstarts/build.xml
Log:
initial commit of 4.4CP2: JBESB-2233
Modified: labs/jbossesb/trunk/product/.classpath
===================================================================
--- labs/jbossesb/trunk/product/.classpath 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/.classpath 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,57 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.0.1.jar"/>
<classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.1.0.jar"/>
<classpathentry excluding="**/.svn/" kind="src" path="rosetta/src"/>
- <classpathentry kind="src" path="services/jbossesb/src/main/java"/>
- <classpathentry kind="src" path="services/jbrules/src/main/java"/>
- <classpathentry kind="src" path="services/jbossesb/src/test/java"/>
- <classpathentry kind="src" path="services/jbpm/src/test/java"/>
- <classpathentry kind="src" path="services/jbrules/src/test/java"/>
- <classpathentry kind="src" path="services/jbpm/src/main/java"/>
- <classpathentry kind="src" path="services/smooks/src/test/java"/>
- <classpathentry kind="src" path="services/smooks/src/main/java"/>
- <classpathentry kind="src" path="services/slsb/src/main/java"/>
- <classpathentry kind="src" path="build/schema-model/src"/>
+ <classpathentry kind="src" path="rosetta/tests/resources"/>
<classpathentry excluding="**/.svn/" kind="src" path="rosetta/tests/src"/>
<classpathentry kind="src" path="services/soap/src/main/java"/>
<classpathentry kind="src" path="services/soap/src/test/java"/>
<classpathentry kind="src" path="services/soapui-client/src/main/java"/>
<classpathentry kind="lib" path="etc/test/resources/log4j/dev"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="lib/ext/activation.jar"/>
- <classpathentry kind="lib" path="lib/ext/antlr-2.7.6.jar"/>
- <classpathentry kind="lib" path="lib/ext/commons-collections-3.2.jar"/>
- <classpathentry kind="lib" path="lib/ext/commons-lang-2.1.jar"/>
- <classpathentry kind="lib" path="lib/ext/commons-codec-1.3.jar"/>
- <classpathentry kind="lib" path="lib/ext/emma_ant.jar"/>
- <classpathentry kind="lib" path="lib/ext/emma.jar"/>
- <classpathentry kind="lib" path="lib/ext/groovy-all-1.0.jar"/>
- <classpathentry kind="lib" path="lib/ext/hsqldb.jar"/>
- <classpathentry kind="lib" path="lib/ext/jbossall-client.jar"/>
- <classpathentry kind="lib" path="lib/ext/jboss-system.jar"/>
- <classpathentry kind="lib" path="lib/ext/jbossts-common.jar"/>
- <classpathentry kind="lib" path="lib/ext/jsch-0.1.jar"/>
- <classpathentry kind="lib" path="lib/ext/juddi-2.0rc5.jar"/>
- <classpathentry kind="lib" path="lib/ext/juddi-client-2.0rc5.jar"/>
- <classpathentry kind="lib" path="lib/ext/junit-4.1.jar"/>
- <classpathentry kind="lib" path="lib/ext/log4j.jar"/>
- <classpathentry kind="lib" path="lib/ext/mail.jar"/>
- <classpathentry kind="lib" path="lib/ext/mockejb.jar"/>
- <classpathentry kind="lib" path="lib/ext/ognl-2.6.9.jar"/>
- <classpathentry kind="lib" path="lib/ext/opencsv-1.6.jar"/>
- <classpathentry kind="lib" path="lib/ext/properties-plugin.jar"/>
- <classpathentry kind="lib" path="lib/ext/stax-api-1.0.1.jar"/>
- <classpathentry kind="lib" path="lib/ext/xalan-2.7.0.jar"/>
- <classpathentry kind="lib" path="lib/ext/xbean.jar"/>
- <classpathentry kind="lib" path="lib/ext/xercesImpl-2.7.1.jar"/>
- <classpathentry kind="lib" path="lib/ext/xml-apis-1.3.02.jar"/>
- <classpathentry kind="lib" path="lib/ext/xmlpublic.jar"/>
- <classpathentry kind="lib" path="lib/ext/xstream-1.2.2.jar"/>
- <classpathentry kind="lib" path="lib/ext/jboss.jar"/>
- <classpathentry kind="lib" path="lib/ext/commons-io-1.3.jar"/>
- <classpathentry kind="lib" path="lib/ext/edtftpj-1.5.4.jar"/>
- <classpathentry kind="lib" path="ftp/lib/backport-util-concurrent-2.2.jar"/>
+ <classpathentry kind="lib" path="build/lib/activation-1.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/antlr-2.7.7.jar"/>
+ <classpathentry kind="lib" path="build/lib/asm-1.5.3.jar"/>
+ <classpathentry kind="lib" path="build/lib/avalon-framework-4.1.3.jar"/>
+ <classpathentry kind="lib" path="build/lib/bsf-2.3.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/bsh-1.3.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/cglib-nodep-2.1_3.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-beanutils-1.6.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-beanutils-bean-collections-1.7.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-codec-1.3.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-collections-3.2.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-dbcp-1.2.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-digester-1.7.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-discovery-0.2.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-httpclient-3.0.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-io-1.3.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-lang-2.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-logging-1.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/commons-pool-1.2.jar"/>
+ <classpathentry kind="lib" path="build/lib/dom4j-1.6.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/groovy-all-1.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/h2-1.0.68.jar"/>
+ <classpathentry kind="lib" path="build/lib/hibernate3-3.2.4.SP1.jar"/>
+ <classpathentry kind="lib" path="build/lib/javassist-3.6.0.GA.jar"/>
+ <classpathentry kind="lib" path="build/lib/jaxb-xjc-2.1.4.jar"/>
+ <classpathentry kind="lib" path="build/lib/jaxen-1.1-beta-8.jar"/>
+ <classpathentry kind="lib" path="build/lib/jaxr-api-1.0rc2.jar"/>
+ <classpathentry kind="lib" path="build/lib/jbossall-client-4.2.2.GA.jar"/>
+ <classpathentry kind="lib" path="build/lib/jaxws-rt-2.1.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/jaxws-tools-2.1.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/jboss-aop-jdk50-1.5.6.GA.jar"/>
+ <classpathentry kind="lib" path="build/lib/jboss-cache-1.2.4.SP2.jar"/>
+ <classpathentry kind="lib" path="build/lib/jboss-system-4.2.2.GA.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb/lib/ext/jbosssx.jar"/>
+ <classpathentry kind="lib" path="build/lib/jcr-1.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/jdom-1.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/jettison-1.0-RC1.jar"/>
+ <classpathentry kind="lib" path="build/lib/jgroups-2.4.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/jmock-1.0.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/joda-time-1.2.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/jsch-0.1.38.jar"/>
+ <classpathentry kind="lib" path="build/lib/juddi-2.0rc5.jar"/>
+ <classpathentry kind="lib" path="build/lib/juddi-client-2.0rc5.jar"/>
+ <classpathentry kind="lib" path="build/lib/junit-3.8.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/jzlib-1.0.7.jar"/>
+ <classpathentry kind="lib" path="build/lib/log4j-1.2.14.jar"/>
+ <classpathentry kind="lib" path="build/lib/logkit-1.0.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/mail-1.4.jar"/>
+ <classpathentry kind="lib" path="build/lib/milyn-commons-1.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/milyn-smooks-core-1.0.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/milyn-smooks-javabean-1.0.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/mvel-1.3.3-java1.5.jar"/>
+ <classpathentry kind="lib" path="build/lib/ognl-2.6.9.jar"/>
+ <classpathentry kind="lib" path="build/lib/quartz-1.5.2.jar"/>
+ <classpathentry kind="lib" path="build/lib/scout-1.0rc2.jar"/>
+ <classpathentry kind="lib" path="build/lib/servlet-api-2.4.jar"/>
+ <classpathentry kind="lib" path="build/lib/stax-1.2.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/stax-api-1.0.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/stringtemplate-3.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/wstx-asl-3.2.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/xalan-2.7.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/xbean-2.2.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/xercesImpl-2.8.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/xml-writer-0.2.jar"/>
+ <classpathentry kind="lib" path="build/lib/xmlParserAPIs-2.6.2.jar"/>
+ <classpathentry kind="lib" path="build/lib/xmlpublic-2.2.0.jar"/>
+ <classpathentry kind="lib" path="build/lib/xom-1.1.jar"/>
+ <classpathentry kind="lib" path="build/lib/xpp3_min-1.1.3.4.O.jar"/>
+ <classpathentry kind="lib" path="build/lib/xstream-1.2.2.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb.sar/lib/jbossesb-rosetta.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb/lib/ext/jbossts-common.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb/lib/jbossesb.esb/c3p0-0.9.1-pre9.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/javassist.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jaxb-api.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jaxb-impl.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jaxb-xjc.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jaxws-rt.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jaxws-tools.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-aop-jdk50-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-aspect-jdk50-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-common-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-deployment.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-iiop-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-j2ee.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-jaxrpc.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-jaxws.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-jsr77-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-messaging-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-remoting.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-saaj.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-serialization.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-srp-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-system-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-transaction-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jboss-xml-binding.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossall-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbosscx-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossha-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossjmx-ant.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossmq-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbosssx-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossws-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossws-common.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossws-framework.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossws-jboss42.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jbossws-spi.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jmx-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jmx-invoker-adaptor-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/jnp-client.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/log4j.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/policy.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/stax-ex.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/streambuffer.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/trove.jar"/>
+ <classpathentry kind="lib" path="build/jbossesb-server-4.4.GA/client/wsdl4j.jar"/>
+ <classpathentry kind="lib" path="lib/ext/commons-net-2.0.0-652071.jar"/>
+ <classpathentry kind="lib" path="lib/ext/commons-ssl-0.3.4.jar"/>
+ <classpathentry kind="lib" path="lib/ext/jboss-jaxws.jar"/>
+ <classpathentry kind="lib" path="lib/ext/jbossws-core.jar"/>
+ <classpathentry kind="lib" path="lib/ext/jbossws-spi.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/emma.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/emma_ant.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/hsqldb.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/jakarta-oro-2.0.8.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/jboss-jaxb-intros.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/jboss-remoting.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/jbossweb.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/junit-4.1.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/mockejb.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/opencsv-1.6.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/properties-plugin.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/wsdl4j-1.6.2.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/JBESB_4_4_GA_CP/testlib/xalan-2.7.0.jar"/>
<classpathentry kind="lib" path="ftp/lib/ftplet-api-1.0-incubator-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="ftp/lib/ftpserver-admin-gui-1.0-incubator-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="ftp/lib/ftpserver-core-1.0-incubator-SNAPSHOT.jar"/>
Modified: labs/jbossesb/trunk/product/.project
===================================================================
--- labs/jbossesb/trunk/product/.project 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/.project 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JBossESB</name>
+ <name>JBossESB-CP4.4_NEW</name>
<comment></comment>
<projects>
</projects>
Modified: labs/jbossesb/trunk/product/build-distr.xml
===================================================================
--- labs/jbossesb/trunk/product/build-distr.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/build-distr.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -82,7 +82,6 @@
<include name="jbossesb-properties.xml"/>
<include name="esb.juddi.xml"/>
<include name="actionArtifactMap.properties"/>
- <include name="jaas.login"/>
<include name="privateKeyStore"/>
<include name="publicKeyStore"/>
</fileset>
Modified: labs/jbossesb/trunk/product/docs/GettingStarted.odt
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/docs/SOASoftwareIntegration.odt (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/docs/SOASoftwareIntegration.odt)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/ServicesGuide.pdf
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/esb-config.xml
===================================================================
--- labs/jbossesb/trunk/product/esb-config.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/esb-config.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -51,6 +51,7 @@
dir="@{serverHome}/bin">
<classpath refid="server.classpath"/>
<jvmarg line="${agent.jvmarg}"/>
+ <jvmarg line="-Djava.endorsed.dirs=${server.endorsed}"/>
<arg value="-c"/>
<arg value="@{serverConfig}"/>
<serverElements/>
@@ -188,6 +189,7 @@
<pathelement location="${java.home}/lib/tools.jar"/>
<pathelement location="${org.jboss.esb.server.home}/bin/run.jar"/>
</path>
+ <property name="server.endorsed" location="${org.jboss.esb.server.home}/lib/endorsed"/>
</target>
<target name="esb.configure" depends="esb.init, esb.configure-app-server, esb.configure-esb-server, esb.configure-ftp-server"/>
Modified: labs/jbossesb/trunk/product/install/build.xml
===================================================================
--- labs/jbossesb/trunk/product/install/build.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/install/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -155,9 +155,6 @@
<!-- contracts app -->
<copy file="${org.jboss.esb.dist}/tools/console/console/jboss-esb-console.ear/contract.war" todir="${deploy.dir}" />
- <!-- config-editor app -->
- <copy file="${org.jboss.esb.dist}/tools/configeditor/dist/jbossesb-config-editor.war" todir="${deploy.dir}" />
- <copy file="${org.jboss.esb.dist}/tools/configeditor/resources/action-templates.xml" todir="${conf.dir}" />
<!-- install h2 jar -->
<copy file="${org.jboss.esb.dist.lib}/h2-1.0.68.jar" todir="${server.lib.dir}"/>
@@ -190,7 +187,6 @@
<delete dir="${deploy.dir}/soap.esb" />
<delete dir="${deploy.dir}/soapui-client.sar" />
<delete dir="${deploy.dir}/contract.war" />
- <delete dir="${deploy.dir}/jbossesb-config-editor.war" />
<delete dir="${conf.dir}/action-templates.xml" />
</target>
Deleted: labs/jbossesb/trunk/product/install/conf/jaas.login
===================================================================
--- labs/jbossesb/trunk/product/install/conf/jaas.login 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/install/conf/jaas.login 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1 +0,0 @@
-// Plase login module configs here
Modified: labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/install/conf/jbossesb-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -40,14 +40,16 @@
<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"/>
+
+ <!-- Algorithm and key size for internal sealing of objects -->
+ <property name="org.jboss.soa.esb.services.security.sealAlgorithm" value="TripleDES"/>
+ <property name="org.jboss.soa.esb.services.security.sealKeySize" value="168"/>
+
+ <!-- Timeout in milliseconds. After which the context is considered invalid -->
+ <property name="org.jboss.soa.esb.services.security.contextTimeout" value="30000"/>
+ <property name="org.jboss.soa.esb.services.security.contextPropagatorImplementationClass" value="org.jboss.internal.soa.esb.services.security.JBossASContextPropagator"/>
- <property name="org.jboss.soa.esb.services.security.privateKeystore" value="/privateKeyStore"/>
- <property name="org.jboss.soa.esb.services.security.privateKeystorePassword" value="testKeystorePassword"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyAlias" value="testAlias"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyPassword" value="testPassword"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyTransformation" value="RSA/ECB/PKCS1Padding"/>
-
+ <!-- Public keystore configuration used to hold keys for encryption/decryption -->
<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"/>
Modified: labs/jbossesb/trunk/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/build.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -97,6 +97,7 @@
>
<fileset dir="${org.jboss.esb.rosetta.src.dir}" includes="**/*.groovy"/>
<fileset dir="${org.jboss.esb.rosetta.src.dir}" includes="**/*.properties"/>
+ <fileset dir="${org.jboss.esb.rosetta.src.dir}" includes="**/*.ftl"/>
<fileset dir="${org.jboss.esb.rosetta.src.dir}" includes="org/jboss/soa/esb/services/security/auth/ws/smooks-ws-security.xml"/>
</jar>
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -44,6 +44,7 @@
try {
threadEPR = new InVMEpr(URI.create("invm://thread-" + Thread.currentThread().getId()));
invmReplyToEPRTL.set(threadEPR);
+ CourierFactory.getInstance().addInVMCourier(threadEPR);
} catch (URISyntaxException e) {
throw new RuntimeException("Unexpected Exception creating replyTo InVMEpr.", e);
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -31,6 +31,7 @@
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.message.ByReferenceMessage;
import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.Service;
import java.io.IOException;
import java.util.Queue;
@@ -56,6 +57,7 @@
protected static Logger logger = Logger.getLogger(InVMCourier.class);
+ private Service service;
private Queue<Object> messageQueue = new ConcurrentLinkedQueue<Object>();
private long deliveryTimeout = 0;
@@ -94,6 +96,22 @@
}
/**
+ * Get the Service name owning this InVMCourier instance.
+ * @return The owning Service name.
+ */
+ public Service getService() {
+ return service;
+ }
+
+ /**
+ * Set the Service name owning this InVMCourier instance.
+ * @param service The owning Service name.
+ */
+ public void setService(Service service) {
+ this.service = service;
+ }
+
+ /**
* package the ESB message into the queue. If this is a transactional interaction
* then the deliver will return immediately, but the message may not go into
* the queue if the transaction subsequently rolls back. The caller must monitor
@@ -107,7 +125,7 @@
*/
public boolean deliver(Message message) throws CourierException {
- isCourierActive() ;
+ assertCourierActive() ;
if (message == null) {
return false;
@@ -243,7 +261,7 @@
// see associated test
public Message pickup(long millis) throws CourierException {
- isCourierActive() ;
+ assertCourierActive() ;
Message message = null;
@@ -306,12 +324,16 @@
public void cleanup() {
}
- private void isCourierActive() throws CourierException {
+ private void assertCourierActive() throws CourierException {
if (!isActive) {
throw new CourierException("InVMCourier for EPR '" + epr.getAddr().getAddress() + "' is not active. Cannot pickup/deliver on this courier.");
}
}
+ public boolean isActive() {
+ return isActive;
+ }
+
public void setActive(boolean active) {
isActive = active;
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -240,7 +240,7 @@
}
synchronized(this) {
- while (_messageProducer != null) {
+ if (_messageProducer != null) {
try {
for (KeyValuePair kvp : _messageProperties) {
String key = kvp.getKey();
@@ -248,7 +248,11 @@
message.setStringProperty(key, kvp.getValue());
}
}
+ } catch (final JMSException e) {
+ throw new CourierTransportException("Caught exception initialising properties! ",e);
+ }
+ try {
_messageProducer.send(message);
return true;
@@ -256,6 +260,15 @@
catch (JMSException e) {
if (!jmsConnectRetry(e))
throw new CourierTransportException("Caught exception during delivery and could not reconnect! ",e);
+ try {
+ _messageProducer.send(message);
+
+ return true;
+ } catch (final JMSException e2) {
+ throw new CourierTransportException("Caught exception during delivery having successfully recovered! ",e2);
+ } catch (Exception e2) {
+ throw new CourierException(e2);
+ }
}
catch (Exception e) {
throw new CourierException(e);
@@ -409,14 +422,20 @@
javax.jms.Message jmsMessage = null;
synchronized(this) {
- while (null != _messageConsumer) {
+ if (null != _messageConsumer) {
try {
jmsMessage = _messageConsumer.receive(millis);
- break;
}
catch (JMSException e) {
if (!jmsConnectRetry(e))
throw new CourierTransportException("Caught exception during receive and could not reconnect! ",e);
+ try {
+ jmsMessage = _messageConsumer.receive(millis);
+ } catch (JMSException e2) {
+ throw new CourierTransportException("Caught exception during delivery having successfully recovered! ",e2);
+ } catch (Exception e2) {
+ throw new CourierTransportException(e2);
+ }
}
catch (Exception e) {
throw new CourierTransportException(e);
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -42,7 +42,10 @@
public Object get(String name)
{
- return SerializedValueImpl.unwrap(_table.get(name));
+ synchronized(_table)
+ {
+ return SerializedValueImpl.unwrap(_table.get(name));
+ }
}
public Object put(String name, Object value)
@@ -50,30 +53,45 @@
if (value instanceof Serializable)
{
final Serializable wrapped = SerializedValueImpl.wrap((Serializable)value) ;
- final Serializable previous = _table.put(name, wrapped) ;
- return SerializedValueImpl.unwrap(previous);
+ synchronized(_table)
+ {
+ final Serializable previous = _table.put(name, wrapped) ;
+ return SerializedValueImpl.unwrap(previous);
+ }
}
throw new IllegalArgumentException("value must be Serializable");
}
public Object remove(String name)
{
- return SerializedValueImpl.unwrap(_table.remove(name));
+ synchronized(_table)
+ {
+ return SerializedValueImpl.unwrap(_table.remove(name));
+ }
}
public String[] getNames()
{
- return _table.keySet().toArray(new String[_table.size()]);
+ synchronized(_table)
+ {
+ return _table.keySet().toArray(new String[_table.size()]);
+ }
}
public Object itemAt(int index) throws IndexOutOfBoundsException
{
- return SerializedValueImpl.unwrap(_list.get(index));
+ synchronized(_list)
+ {
+ return SerializedValueImpl.unwrap(_list.get(index));
+ }
}
public Object removeItemAt(int index) throws IndexOutOfBoundsException
{
- return SerializedValueImpl.unwrap(_list.remove(index));
+ synchronized(_list)
+ {
+ return SerializedValueImpl.unwrap(_list.remove(index));
+ }
}
public Object replaceItemAt(int index, Object value) throws IndexOutOfBoundsException
@@ -81,8 +99,11 @@
if (value instanceof Serializable)
{
final Serializable wrapped = SerializedValueImpl.wrap((Serializable)value) ;
- final Serializable previous = _list.set(index, wrapped) ;
- return SerializedValueImpl.unwrap(previous);
+ synchronized(_list)
+ {
+ final Serializable previous = _list.set(index, wrapped) ;
+ return SerializedValueImpl.unwrap(previous);
+ }
}
throw new IllegalArgumentException("value must be Serializable");
}
@@ -90,7 +111,10 @@
public void addItem(Object value)
{
if (value instanceof Serializable)
- _list.add(SerializedValueImpl.wrap((Serializable)value)) ;
+ synchronized(_list)
+ {
+ _list.add(SerializedValueImpl.wrap((Serializable)value)) ;
+ }
else
throw new IllegalArgumentException("value must be Serializable");
}
@@ -98,27 +122,43 @@
public void addItemAt(int index, Object value) throws IndexOutOfBoundsException
{
if (value instanceof Serializable)
- _list.add(index, SerializedValueImpl.wrap((Serializable)value));
+ synchronized(_list)
+ {
+ _list.add(index, SerializedValueImpl.wrap((Serializable)value));
+ }
else
throw new IllegalArgumentException("value must be Serializable");
}
public int getNamedCount()
{
- return _table.size();
+ synchronized(_table)
+ {
+ return _table.size();
+ }
}
public int getUnnamedCount()
{
- return _list.size();
+ synchronized(_list)
+ {
+ return _list.size();
+ }
}
public String toString()
{
- return new StringBuilder()
- .append("attachments: [ Named:").append(_table.toString())
- .append(", Unnamed:").append(_list.toString())
- .toString()+" ]";
+ final String tableVal ;
+ synchronized(_table)
+ {
+ tableVal = _table.toString() ;
+ }
+ final String listVal ;
+ synchronized(_list)
+ {
+ listVal = _list.toString() ;
+ }
+ return "attachments: [ Named:" + tableVal + ", Unnamed:" + listVal +" ]";
}
private void readObject(final ObjectInputStream stream)
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,6 +1,8 @@
package org.jboss.internal.soa.esb.message.format.serialized;
import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;
@@ -70,7 +72,7 @@
add(Body.DEFAULT_LOCATION, value);
}
- public void add(String name, Object value)
+ public synchronized void add(String name, Object value)
{
AssertArgument.isNotNull(value, "value");
AssertArgument.isNotNull(name, "name");
@@ -88,14 +90,14 @@
return get(Body.DEFAULT_LOCATION);
}
- public Object get(String name)
+ public synchronized Object get(String name)
{
AssertArgument.isNotNull(name, "name");
return SerializedValueImpl.unwrap(_objects.get(name));
}
- public String[] getNames()
+ public synchronized String[] getNames()
{
final Set<String> keys = _objects.keySet() ;
return keys.toArray(new String[0]) ;
@@ -103,14 +105,17 @@
public Enumeration<String> getEnumeratedNames()
{
- return _objects.keys() ;
+ return Collections.enumeration(Arrays.asList(getNames())) ;
}
- public Object remove(String name)
+ public synchronized Object remove(String name)
{
return SerializedValueImpl.unwrap(_objects.remove(name));
}
+ /**
+ * This method is not thread safe.
+ */
public void replace(Body b)
{
if (b == null)
@@ -121,6 +126,9 @@
_objects = ((BodyImpl) b)._objects;
}
+ /**
+ * This method is not thread safe.
+ */
public void merge(Body b)
{
if (b == null)
@@ -143,18 +151,18 @@
public String toString()
{
- String toReturn = "body: [ ";
+ StringBuilder toReturn = new StringBuilder("body: [ ");
byte[] content = getByteArray();
if (content != null)
- toReturn += "byte[]: " + Util.format(new String(content));
+ toReturn.append("byte[]: ").append(Util.format(new String(content))).append(", ");
- if (content != null)
- toReturn += ", ";
+ synchronized(this)
+ {
+ toReturn.append("objects: ").append(_objects.toString());
+ }
- toReturn += "objects: " + _objects.toString();
-
- return toReturn + " ]";
+ return toReturn.append(" ]").toString();
}
// copy constructor.
@@ -166,7 +174,7 @@
protected void initialiseMap(final Map<String, Serializable> payload)
{
- synchronized(_objects)
+ synchronized(this)
{
_objects.clear() ;
_objects.putAll(payload) ;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -30,6 +30,9 @@
* @author mark.little at jboss.com
*/
+/**
+ * This class is not thread safe and will be duplicated during InVM operations.
+ */
public class ContextImpl implements Context, java.io.Serializable
{
/**
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -32,6 +32,8 @@
/**
* The message header. Contains such things as routing information.
+ *
+ * This class is not thread safe and will be duplicated during InVM operations.
*/
public class HeaderImpl implements Header, Serializable
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -29,7 +29,7 @@
{
private static final long serialVersionUID = 0x0;
- public Object getProperty(String name)
+ public synchronized Object getProperty(String name)
{
return SerializedValueImpl.unwrap(_table.get(name));
}
@@ -45,26 +45,29 @@
if (value instanceof Serializable)
{
final Serializable wrapped = SerializedValueImpl.wrap((Serializable)value) ;
- final Serializable previous = _table.put(name, wrapped) ;
- return SerializedValueImpl.unwrap(previous);
+ synchronized(this)
+ {
+ final Serializable previous = _table.put(name, wrapped) ;
+ return SerializedValueImpl.unwrap(previous);
+ }
}
else
throw new IllegalArgumentException("Value must be serializable");
}
- public Object remove(String name)
+ public synchronized Object remove(String name)
{
return SerializedValueImpl.unwrap(_table.remove(name));
}
- public int size() {return _table.size(); }
+ public synchronized int size() {return _table.size(); }
- public String[] getNames()
+ public synchronized String[] getNames()
{
return _table.keySet().toArray(new String[0]);
}
- public String toString()
+ public synchronized String toString()
{
return "properties: [ "+_table.toString()+" ]";
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -23,7 +23,7 @@
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.Hashtable;
+import java.util.HashMap;
import java.util.Map.Entry;
import javax.xml.namespace.QName;
@@ -66,70 +66,111 @@
public Object get(String name)
{
- return unwrap(_table.get(name));
+ synchronized(_table)
+ {
+ return unwrap(_table.get(name));
+ }
}
public Object put(String name, Object value)
{
assertValidAttachment(value);
- return unwrap(_table.put(name, new SerializedValueImpl((Serializable) value)));
+ synchronized(_table)
+ {
+ return unwrap(_table.put(name, new SerializedValueImpl((Serializable) value)));
+ }
}
public Object remove(String name)
{
- return unwrap(_table.remove(name));
+ synchronized(_table)
+ {
+ return unwrap(_table.remove(name));
+ }
}
public String[] getNames()
{
- return _table.keySet().toArray(new String[0]);
+ synchronized(_table)
+ {
+ return _table.keySet().toArray(new String[0]);
+ }
}
public Object itemAt(int index) throws IndexOutOfBoundsException
{
- return unwrap(_list.get(index));
+ synchronized(_list)
+ {
+ return unwrap(_list.get(index));
+ }
}
public Object removeItemAt(int index) throws IndexOutOfBoundsException
{
- return unwrap(_list.remove(index));
+ synchronized(_list)
+ {
+ return unwrap(_list.remove(index));
+ }
}
public Object replaceItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
assertValidAttachment(value);
- return unwrap(_list.set(index, new SerializedValueImpl((Serializable) value)));
+ synchronized(_list)
+ {
+ return unwrap(_list.set(index, new SerializedValueImpl((Serializable) value)));
+ }
}
public void addItem(Object value)
{
assertValidAttachment(value);
- _list.add(new SerializedValueImpl((Serializable) value));
+ synchronized(_list)
+ {
+ _list.add(new SerializedValueImpl((Serializable) value));
+ }
}
public void addItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
assertValidAttachment(value);
- _list.add(index, new SerializedValueImpl((Serializable) value));
+ synchronized(_list)
+ {
+ _list.add(index, new SerializedValueImpl((Serializable) value));
+ }
}
public int getNamedCount()
{
- return _table.size();
+ synchronized(_table)
+ {
+ return _table.size();
+ }
}
public int getUnnamedCount()
{
- return _list.size();
+ synchronized(_list)
+ {
+ return _list.size();
+ }
}
public String toString()
{
- return new StringBuilder().append("attachments: [ Named:").append(
- _table.toString()).append(", Unnamed:").append(_list.toString())
- .toString()+" ]";
+ final String tableVal ;
+ synchronized(_table)
+ {
+ tableVal = _table.toString() ;
+ }
+ final String listVal ;
+ synchronized (_list)
+ {
+ listVal = _list.toString() ;
+ }
+ return "attachments: [ Named:" + tableVal + ", Unnamed:" + listVal + " ]";
}
/**
@@ -141,19 +182,25 @@
protected void writeChildContent(XMLStreamWriter out)
throws XMLStreamException
{
- for (SerializedValueImpl value : _list)
+ synchronized(_list)
{
- final TextElement unnamed = new TextElement(value.getSerialisedForm()) ;
- StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_UNNAMED, unnamed) ;
+ for (SerializedValueImpl value : _list)
+ {
+ final TextElement unnamed = new TextElement(value.getSerialisedForm()) ;
+ StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_UNNAMED, unnamed) ;
+ }
}
- for (Entry<String, SerializedValueImpl> entry : _table.entrySet())
+ synchronized(_table)
{
- final TextElement named = new TextElement(entry.getValue().getSerialisedForm()) ;
- final String origNamedURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_NAMED) ;
- StreamHelper.writeAttribute(out, XMLUtil.ESB_QNAME_ATTRIBUTE_ATTACHMENT_NAMED_NAME, entry.getKey()) ;
- named.writeContent(out) ;
- StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_NAMED.getPrefix(), origNamedURI) ;
+ for (Entry<String, SerializedValueImpl> entry : _table.entrySet())
+ {
+ final TextElement named = new TextElement(entry.getValue().getSerialisedForm()) ;
+ final String origNamedURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_NAMED) ;
+ StreamHelper.writeAttribute(out, XMLUtil.ESB_QNAME_ATTRIBUTE_ATTACHMENT_NAMED_NAME, entry.getKey()) ;
+ named.writeContent(out) ;
+ StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_NAMED.getPrefix(), origNamedURI) ;
+ }
}
}
@@ -200,5 +247,5 @@
}
private ArrayList<SerializedValueImpl> _list = new ArrayList<SerializedValueImpl>();
- private Hashtable<String, SerializedValueImpl> _table = new Hashtable<String, SerializedValueImpl>();
+ private HashMap<String, SerializedValueImpl> _table = new HashMap<String, SerializedValueImpl>();
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,8 +1,10 @@
package org.jboss.internal.soa.esb.message.format.xml;
import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
@@ -76,7 +78,7 @@
add(Body.DEFAULT_LOCATION, value);
}
- public void add(String name, Object value)
+ public synchronized void add(String name, Object value)
{
AssertArgument.isNotNull(value, "value");
AssertArgument.isNotNull(name, "name");
@@ -89,14 +91,14 @@
return get(Body.DEFAULT_LOCATION);
}
- public Object get(String name)
+ public synchronized Object get(String name)
{
AssertArgument.isNotNull(name, "name");
return unwrap(_objects.get(name));
}
- public String[] getNames()
+ public synchronized String[] getNames()
{
Set<String> keys = _objects.keySet();
return keys.toArray(new String[0]) ;
@@ -104,10 +106,10 @@
public Enumeration<String> getEnumeratedNames()
{
- return _objects.keys() ;
+ return Collections.enumeration(Arrays.asList(getNames())) ;
}
- public Object remove(String name)
+ public synchronized Object remove(String name)
{
return unwrap(_objects.remove(name));
}
@@ -118,7 +120,7 @@
* @throws XMLStreamException For errors during output.
*/
@Override
- protected void writeChildContent(XMLStreamWriter out)
+ protected synchronized void writeChildContent(XMLStreamWriter out)
throws XMLStreamException
{
/*
@@ -215,6 +217,9 @@
return getByteArray();
}
+ /**
+ * This method is not thread safe.
+ */
public void replace(Body b)
{
if (b == null)
@@ -225,6 +230,9 @@
_objects = ((BodyImpl) b)._objects;
}
+ /**
+ * This method is not thread safe.
+ */
public void merge(Body b)
{
if (b == null)
@@ -247,21 +255,18 @@
public String toString()
{
- String toReturn = "body: [ ";
+ StringBuilder toReturn = new StringBuilder("body: [ ");
byte[] content = getByteArray();
if (content != null)
- toReturn += "byte[]: " + Util.format(new String(content));
+ toReturn.append("byte[]: ").append(Util.format(new String(content))).append(", ");
- if (_objects != null)
+ synchronized(this)
{
- if (content != null)
- toReturn += ", ";
-
- toReturn += "objects: " + _objects.toString();
+ toReturn.append("objects: ").append(_objects);
}
- return toReturn + " ]";
+ return toReturn.append(" ]").toString() ;
}
// copy constructor (almost - doesn't copy, just references).
@@ -278,7 +283,7 @@
protected void initialiseMap(final Map<String, Serializable> payload)
{
- synchronized(_objects)
+ synchronized(this)
{
_objects.clear() ;
for(Entry<String, Serializable> entry: payload.entrySet())
@@ -288,5 +293,5 @@
}
}
- private Hashtable<String, MarshalValueImpl> _objects = new Hashtable<String, MarshalValueImpl>();
+ private HashMap<String, MarshalValueImpl> _objects = new HashMap<String, MarshalValueImpl>();
}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -40,6 +40,9 @@
* @author mark.little at jboss.com
*/
+/**
+ * This class is not thread safe and will be duplicated during InVM operations.
+ */
public class ContextImpl extends ElementContent implements Context
{
/**
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -32,6 +32,8 @@
/**
* The message header. Contains such things as routing information.
+ *
+ * This class is not thread safe and will be duplicated during InVM operations.
*/
public class HeaderImpl extends ElementContent implements Header
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -21,7 +21,7 @@
package org.jboss.internal.soa.esb.message.format.xml;
import java.io.Serializable;
-import java.util.Hashtable;
+import java.util.HashMap;
import java.util.Map.Entry;
import javax.xml.namespace.QName;
@@ -57,7 +57,7 @@
parse(in) ;
}
- public Object getProperty(String name)
+ public synchronized Object getProperty(String name)
{
return unwrap(_table.get(name));
}
@@ -68,7 +68,7 @@
return (null == oRet) ? defaultVal : oRet;
}
- public Object setProperty(String name, Object value)
+ public synchronized Object setProperty(String name, Object value)
{
AssertArgument.isNotNull(name, "name");
AssertArgument.isNotNull(value, "value");
@@ -80,17 +80,17 @@
return unwrap(_table.put(name, new SerializedValueImpl((Serializable)value)));
}
- public Object remove(String name)
+ public synchronized Object remove(String name)
{
return unwrap(_table.remove(name));
}
- public int size()
+ public synchronized int size()
{
return _table.size();
}
- public String[] getNames()
+ public synchronized String[] getNames()
{
return _table.keySet().toArray(new String[0]);
}
@@ -101,7 +101,7 @@
* @throws XMLStreamException For errors during output.
*/
@Override
- protected void writeChildContent(XMLStreamWriter out)
+ protected synchronized void writeChildContent(XMLStreamWriter out)
throws XMLStreamException
{
for (Entry<String, SerializedValueImpl> entry: _table.entrySet())
@@ -150,7 +150,7 @@
}
}
- public String toString()
+ public synchronized String toString()
{
return "properties: [ "+_table.toString()+" ]";
}
@@ -160,6 +160,6 @@
return (value == null ? null : value.getValue()) ;
}
- private Hashtable<String, SerializedValueImpl> _table = new Hashtable<String, SerializedValueImpl>();
+ private HashMap<String, SerializedValueImpl> _table = new HashMap<String, SerializedValueImpl>();
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryInterceptor.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryInterceptor.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryInterceptor.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -19,7 +19,6 @@
*/
package org.jboss.internal.soa.esb.services.registry;
-import org.jboss.internal.soa.esb.couriers.InVMCourier;
import org.jboss.soa.esb.Service;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.eprs.InVMEpr;
@@ -27,6 +26,7 @@
import org.jboss.soa.esb.services.registry.AbstractRegistryInterceptor;
import org.jboss.soa.esb.services.registry.RegistryException;
import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
+import org.jboss.internal.soa.esb.couriers.InVMCourier;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@@ -45,7 +45,29 @@
Service service = new Service(serviceCategoryName, serviceName);
RegsitryEntry regEntry = new RegsitryEntry(service, serviceDescription, epr, eprDescription);
List<RegsitryEntry> serviceEntries = getServiceEntries(service);
-
+
+ if(serviceEntries == null) {
+ serviceEntries = new ArrayList<RegsitryEntry>();
+ regEntries.put(service, serviceEntries);
+ }
+
+ if(serviceEntries.isEmpty()) {
+ InVMCourier existingInVMCourier = CourierFactory.getInstance().getInVMCourier((InVMEpr) epr);
+
+ if(existingInVMCourier != null) {
+ throw new RegistryException("Invalid attempt to register InVM EPR '" + epr + "' for Service '" + service + "'. This InVM EPR is already registered for Service '" + existingInVMCourier.getService() + "'." );
+ }
+ InVMCourier newInVMCourier = CourierFactory.getInstance().addInVMCourier((InVMEpr) epr);
+ newInVMCourier.setService(service);
+ } else {
+ // Verify that the InVM EPRs on the other registrations for this service
+ // are exactly the same...
+ EPR existingEpr = serviceEntries.get(0).getEpr();
+ if(!epr.equals(existingEpr)) {
+ throw new RegistryException("Invalid attempt to register different InVM EPRs for Service '" + service + "'. EPR '" + existingEpr + "' already registered. Attempt to register '" + epr + "'.");
+ }
+ }
+
serviceEntries.add(regEntry);
} else {
getRegistry().registerEPR(serviceCategoryName, serviceName, serviceDescription, epr, eprDescription) ;
@@ -63,10 +85,9 @@
}
}
- protected boolean unRegisterInVMService(String category, String serviceName) throws RegistryException, ServiceNotFoundException {
+ private boolean unRegisterInVMService(String category, String serviceName) throws RegistryException, ServiceNotFoundException {
if (isValidService(category, serviceName)) {
- _unRegisterEPR(category, serviceName, null);
- return (regEntries.remove(new Service(category, serviceName)) != null);
+ return _unRegisterEPR(category, serviceName, true);
} else {
return false ;
}
@@ -74,31 +95,37 @@
public void unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException, ServiceNotFoundException {
if (epr instanceof InVMEpr) {
- _unRegisterEPR(serviceCategoryName, serviceName, epr);
+ _unRegisterEPR(serviceCategoryName, serviceName, false);
} else {
getRegistry().unRegisterEPR(serviceCategoryName, serviceName, epr) ;
}
}
- private void _unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) {
+ private boolean _unRegisterEPR(String serviceCategoryName, String serviceName, boolean removeAll) {
Service service = new Service(serviceCategoryName, serviceName);
List<RegsitryEntry> serviceEntries = getServiceEntries(service);
- Iterator<RegsitryEntry> iterator = serviceEntries.iterator();
- while (iterator.hasNext()) {
- RegsitryEntry regsitryEntry = iterator.next();
+ if(serviceEntries != null) {
+ InVMEpr removedInVMEpr = null;
- if(epr == null || regsitryEntry.getEpr().getAddr().getAddress().equals(epr.getAddr().getAddress())) {
- if(regsitryEntry.getEpr() instanceof InVMEpr) {
- InVMCourier courier = CourierFactory.getInstance().getInVMCourier((InVMEpr)regsitryEntry.getEpr());
- if(courier != null) {
- courier.setActive(false);
- }
- }
+ if(!serviceEntries.isEmpty()) {
+ // Just remove one (decrement the count)...
+ removedInVMEpr = (InVMEpr) serviceEntries.remove(0).getEpr();
+ }
- iterator.remove();
+ if(removeAll) {
+ serviceEntries.clear();
}
+
+ // Zap the InVM courier if there are no more Services using it...
+ if(removedInVMEpr != null && serviceEntries.isEmpty()) {
+ CourierFactory.getInstance().removeInVMCourier(removedInVMEpr);
+ }
+
+ return (removedInVMEpr != null);
}
+
+ return false;
}
public List<String> findAllServices() throws RegistryException {
@@ -156,9 +183,11 @@
if (isValidService(serviceCategoryName, serviceName)) {
Service service = new Service(serviceCategoryName, serviceName);
List<RegsitryEntry> serviceEntries = getServiceEntries(service);
-
- for (RegsitryEntry serviceEntry : serviceEntries) {
- eprs.add(serviceEntry.getEpr());
+
+ if(serviceEntries != null) {
+ for (RegsitryEntry serviceEntry : serviceEntries) {
+ eprs.add(serviceEntry.getEpr());
+ }
}
}
return eprs ;
@@ -175,11 +204,6 @@
}
}
- if(serviceEntries == null) {
- serviceEntries = new ArrayList<RegsitryEntry>();
- regEntries.put(service, serviceEntries);
- }
-
return serviceEntries;
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -52,9 +52,9 @@
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
+import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.MarshalException;
import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.services.registry.Registry;
import org.jboss.soa.esb.services.registry.RegistryException;
@@ -71,11 +71,12 @@
private static Logger logger = Logger.getLogger(JAXRRegistryImpl.class);
private JAXRConnectionFactory jaxrConnectionFactory;
private static Organization jbossESBOrganization;
-
+ public static final String JBOSS_ESB_CATEGORY = "org.jboss.soa.esb.:category";
+
public JAXRRegistryImpl() throws ConfigurationException {
jaxrConnectionFactory = new JAXRConnectionFactory();
}
-
+
/**
* Publish an EPR to the Registry
*/
@@ -94,7 +95,7 @@
Collection<String> findQualifiers = new ArrayList<String>();
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
+ ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
Classification classification = blm.createClassification(cScheme, "category", category);
service.addClassification(classification);
organization.addService(service);
@@ -157,7 +158,7 @@
Collection<String> findQualifiers = new ArrayList<String>();
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
+ ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
Classification classification = blm.createClassification(cScheme, "category", category);
service.addClassification(classification);
@@ -420,8 +421,20 @@
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
+ ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
Collection<Classification> classifications = new ArrayList<Classification>();
+ // If the scheme returned null, then we have to create a org.jboss.soa.esb.:category scheme to use
+ if (cScheme == null) {
+ try {
+ ClassificationScheme scheme = blm.createClassificationScheme(JBOSS_ESB_CATEGORY, JBOSS_ESB_CATEGORY);
+ ArrayList<ClassificationScheme> cSchemes = new ArrayList<ClassificationScheme>();
+ cSchemes.add(scheme);
+ BulkResponse br = blm.saveClassificationSchemes(cSchemes);
+ } catch (Exception e) {
+ throw new JAXRException(e);
+ }
+ cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ }
Classification classification =
blm.createClassification(
cScheme,
@@ -477,7 +490,7 @@
Collection<String> findQualifiers = new ArrayList<String>();
findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
+ ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
//Create classification
Classification classification =
blm.createClassification(
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagator.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagator.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagator.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,103 @@
+/*
+ * 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.security.Principal;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.security.RunAsIdentity;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.soa.esb.services.security.SecurityConfig;
+import org.jboss.soa.esb.services.security.SecurityContext;
+import org.jboss.soa.esb.services.security.principals.User;
+
+/**
+ * JBoss Application Server(AS) specifiec security context propagator.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public final class JBossASContextPropagator implements SecurityContextPropagator
+{
+ /**
+ * Pushed the subject by calling {@link SecurityAssociation#pushSubjectContext(Subject, Principal, Object)}.
+ *
+ * @param context The SecurityContext holding the subject to push/propagate. May not be null.
+ * @param config The SecurityConfig which contains the information specified from the security configuration element. Can be null.
+ */
+ public void pushSecurityContext(final SecurityContext context, Set<?> authCredentials, final SecurityConfig config)
+ {
+ AssertArgument.isNotNull(context, "context");
+
+ final Subject subject = context.getSubject();
+ final Principal principal = getPrincipal(subject);
+
+ // associate the subject with jboss security
+ Object credential = null;
+ if (authCredentials != null)
+ {
+ credential = authCredentials.iterator().next();
+ }
+ SecurityAssociation.pushSubjectContext(subject, principal, credential);
+
+
+ if (isRunAsSet(config))
+ {
+ // associate the runAs role with jboss security
+ SecurityAssociation.pushRunAsIdentity(new RunAsIdentity(config.getRunAs(), principal.getName()));
+ }
+ }
+
+ /**
+ * Pops the subject by calling {@link SecurityAssociation#pushSubjectContext(Subject, Principal, Object)}.
+ *
+ * @param context The SecurityContext holding the subject to push/propagate. Can be null.
+ * @param config The SecurityConfig which contains the information specified from the security configuration element. Can be null.
+ */
+ public void popSecurityContext(final SecurityContext context, final SecurityConfig config)
+ {
+ // diassociate the subject with jboss security
+ SecurityAssociation.popSubjectContext();
+
+ if (isRunAsSet(config))
+ {
+ // associate the runAs role with jboss security
+ SecurityAssociation.popRunAsIdentity();
+ }
+ }
+
+ private Principal getPrincipal( final Subject subject)
+ {
+ for (Principal principal : subject.getPrincipals())
+ {
+ return principal;
+ }
+ return new User("NullPrincipal");
+ }
+
+ private boolean isRunAsSet(final SecurityConfig config)
+ {
+ return config != null && config.getRunAs() != null;
+ }
+
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JaasSecurityService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JaasSecurityService.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/JaasSecurityService.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -20,24 +20,17 @@
*/
package org.jboss.internal.soa.esb.services.security;
-import java.net.URL;
import java.security.Principal;
-import java.security.Security;
import java.util.List;
-import java.util.Properties;
import java.util.Set;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginContext;
import javax.security.auth.login.LoginException;
-import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.security.RunAsIdentity;
-import org.jboss.security.SecurityAssociation;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.common.Environment;
import org.jboss.soa.esb.services.security.SecurityConfig;
import org.jboss.soa.esb.services.security.SecurityContext;
import org.jboss.soa.esb.services.security.SecurityService;
@@ -47,8 +40,6 @@
import org.jboss.soa.esb.services.security.principals.Role;
import org.jboss.soa.esb.util.ClassUtil;
-import com.sun.security.auth.login.ConfigFile;
-
/**
* Concrete impl of a SecurityService in JBoss ESB that uses JAAS.
* <p/>
@@ -60,7 +51,6 @@
* <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"/>
* </properties>
* </pre>}
*
@@ -70,39 +60,14 @@
public final class JaasSecurityService implements SecurityService
{
/*
- * Property name for login config urls.
- */
- private static final String LOGIN_CONFIG_URL_PREFIX = "login.config.url.";
-
- /*
* Callback handler implementation name
*/
private String callbackHandlerClassName;
- /*
- * Original login configuration e.g JBoss AS login configuration
- */
- private javax.security.auth.login.Configuration containerConfig;
-
- /*
- * Custom login configuration
- */
- private javax.security.auth.login.Configuration configuration;
-
- private final Logger log = Logger.getLogger(JaasSecurityService.class);
-
/**
* Performs authentication of the passed in SecurityContext.
* </p>
*
- * This method will first try to authenticate the authRequest by using a custom <br>
- * javax.security.auth.login.Configuration, which would be the case where the <br>
- * login module name specified exists in a jaas.login file.
- * <br>
- * If the login module name cannot be found in jaas.login then this method will <br>
- * fall back and try to authenticate using a an underlying Configuration. This would <br>
- * be the case when running in an appserver for instance.
- *
* @param config - the security configuration. Properties from jboss-esb.xml
* @param securityContext - the security context to be used.
* @param authRequest - the authentication request to be processed.
@@ -114,40 +79,23 @@
AssertArgument.isNotNull(config, "config");
LoginContext loginContext;
- final String runAs = config.getRunAs();
try
{
final EsbCallbackHandler callbackHandler = createCallbackHandler(config, authRequest);
- try
+ if (callbackHandler != null)
{
- // try to login with a standalone jaas login configuration file(for example jaas.login file)
- loginContext = new LoginContext(config.getModuleName(), securityContext.getSubject(), callbackHandler, getConfiguration());
+ loginContext = new LoginContext(config.getModuleName(), securityContext.getSubject(), callbackHandler);
}
- catch (final LoginException ignore)
+ else
{
- // fall back and try using the orginal configuration(for example jboss login-config.xml)
- loginContext = new LoginContext(config.getModuleName(), securityContext.getSubject(), callbackHandler, containerConfig);
+ loginContext = new LoginContext(config.getModuleName(), securityContext.getSubject());
}
- // invoke the login process
loginContext.login();
- final Subject subject = securityContext.getSubject();
-
// add a runAs group if specified
- addRunAs(runAs, subject);
+ addRunAs(config.getRunAs(), securityContext.getSubject());
- final Principal principal = getPrincipal(subject);
-
- // associate the subject with jboss security
- SecurityAssociation.pushSubjectContext(subject, principal, subject.getPublicCredentials());
-
- if ( runAs != null )
- {
- // associate the runAs role with jboss security
- SecurityAssociation.pushRunAsIdentity(new RunAsIdentity(runAs, principal.getName()));
- }
-
}
catch (final LoginException e)
{
@@ -180,7 +128,7 @@
*/
public boolean isCallerInRole( final Subject subject, final Principal role)
{
- Set<java.security.acl.Group> principals = subject.getPrincipals(java.security.acl.Group.class);
+ final Set<java.security.acl.Group> principals = subject.getPrincipals(java.security.acl.Group.class);
for (java.security.acl.Group group : principals)
{
if ( group.isMember(role) )
@@ -195,31 +143,8 @@
*/
public void configure() throws ConfigurationException
{
- try
- {
- containerConfig = javax.security.auth.login.Configuration.getConfiguration();
- }
- catch(final SecurityException ignore)
- {
- log.warn("Could not locate a security configuration");
- }
-
- final Properties securityProperties = Configuration.getSecurityServiceProperies();
- final String loginConfigUrl = securityProperties.getProperty(Environment.SECURITY_SERVICE_CONFIG_URL);
- if ( loginConfigUrl != null )
- {
- final URL loginUrl = ClassUtil.getResource(loginConfigUrl, getClass());
- if ( loginUrl == null )
- {
- final String invalidPropertyMsg = "The value for property [" + Environment.SECURITY_SERVICE_CONFIG_URL +
- "] must be a valid URL. This property should point to a file on the local file system or on the classpath.";
- throw new ConfigurationException(invalidPropertyMsg);
- }
- addLoginConfig(loginUrl);
- }
-
// get a EsbCallbackHandler if one is configured in jbossesb-properties.xml
- callbackHandlerClassName = securityProperties.getProperty(Environment.SECURITY_SERVICE_CALLBACK_HANLDER_CLASS);
+ callbackHandlerClassName = Configuration.getSecurityServiceCallbackHandlerImplClass();
}
public void logout(SecurityConfig config)
@@ -227,24 +152,11 @@
// NoOp
}
- public synchronized void refreshSecurityConfig()
- {
- if ( configuration != null )
- {
- log.info("Refreshing Security configuration");
- configuration.refresh();
- }
- }
+ public void refreshSecurityConfig()
+ {
+ // NoOp
+ }
- private Principal getPrincipal( final Subject subject)
- {
- for (Principal principal : subject.getPrincipals())
- {
- return principal;
- }
- return null;
- }
-
/**
* Creates an instance of EsbCallbackHandler specified in either jboss-esb.xml:
* <pre>
@@ -287,53 +199,12 @@
return callbackHandler;
}
- private void addLoginConfig(final URL loginConfigUrl) throws ConfigurationException
- {
- if (loginConfigUrl == null)
- {
- throw new ConfigurationException("Could not locate the login config file at Url [" + loginConfigUrl + "]");
- }
-
- int urlIndex = 1;
- boolean loginUrlRegistered = false;
- String registeredLoginUrl;
- while ((registeredLoginUrl = Security.getProperty(LOGIN_CONFIG_URL_PREFIX + urlIndex)) != null)
- {
- loginUrlRegistered = registeredLoginUrl.equals(loginConfigUrl.toString());
- if (loginUrlRegistered)
- {
- break;
- }
- else
- {
- urlIndex++;
- }
- }
-
- if (!loginUrlRegistered)
- {
- log.info("Adding file [ " + loginConfigUrl + "] as [" + LOGIN_CONFIG_URL_PREFIX + urlIndex + "]");
- Security.setProperty(LOGIN_CONFIG_URL_PREFIX + urlIndex, loginConfigUrl.toExternalForm());
- setConfiguration(new ConfigFile());
- }
- }
-
- private synchronized javax.security.auth.login.Configuration getConfiguration()
- {
- return configuration;
- }
-
- private synchronized void setConfiguration(final javax.security.auth.login.Configuration configuration)
- {
- this.configuration = configuration;
- }
-
private void addRunAs( final String runAs, final Subject subject )
{
if ( runAs != null )
{
final Role runAsRole = new Role(runAs);
- Set<Group> principals = subject.getPrincipals(Group.class);
+ final Set<Group> principals = subject.getPrincipals(Group.class);
if ( principals.isEmpty() )
{
final Group group = new Group("Roles");
@@ -358,7 +229,7 @@
try
{
@SuppressWarnings("unchecked")
- Class<T> forName = ClassUtil.forName(className, getClass());
+ final Class<T> forName = ClassUtil.forName(className, getClass());
return forName.newInstance();
}
catch (final ClassNotFoundException e)
@@ -374,5 +245,4 @@
throw new SecurityServiceException("IllegalAccess while trying to create an impl of [" + className + "]", e);
}
}
-
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/PrivateCryptoUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/PrivateCryptoUtil.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/PrivateCryptoUtil.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -20,50 +20,42 @@
*/
package org.jboss.internal.soa.esb.services.security;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.io.Serializable;
-import java.security.Key;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
+import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.KeyGenerator;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SealedObject;
+import javax.crypto.SecretKey;
import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.common.Environment;
import org.jboss.soa.esb.services.security.SecurityServiceException;
-import org.jboss.soa.esb.services.security.util.CryptoUtil;
-import org.jboss.soa.esb.util.ClassUtil;
/**
+ * Util for sealing and unsealing object.
*
* @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
- *
*/
public enum PrivateCryptoUtil
{
INSTANCE;
private Logger log;
- private Key key;
- private PublicKey publicKey;
- private String transformation;
+ private Cipher cipher;
+ private SecretKey secretKey;
private PrivateCryptoUtil()
{
try
{
log = getLogger();
- init();
+ initSecretKey();
}
catch (final Exception e)
{
@@ -71,189 +63,130 @@
}
}
- private void init() throws SecurityServiceException
+ /**
+ * Will create a Sealed object containing the passed in Serializable object.
+ *
+ * @param serializable The serializable object to be sealed.
+ * @return SealedObject The resulting sealed object
+ * @throws SecurityServiceException
+ * @throws IOException
+ * @throws IllegalBlockSizeException
+ */
+ public SealedObject sealObject(final Serializable serializable) throws SecurityServiceException
{
- String keystorePath = Configuration.getSecurityServicePrivateKeystore();
- if (keystorePath == null)
+ AssertArgument.isNotNull(serializable, "serializable");
+ try
{
- log.info("No private keystore was specified in jbossesb-properites.xml. Add '" + Environment.SECURITY_SERVICE_PUBLIC_KEYSTORE + "'");
- }
- else
- {
- try
+ synchronized (cipher)
{
- String keystoreType = Configuration.getSecurityServicePrivateKeystoreType();
- if (keystoreType == null)
- {
- keystoreType = KeyStore.getDefaultType();
- }
- String keystorePassword = Configuration.getSecurityServicePrivateKeystorePassword();
- String privateKeyAlias = Configuration.getSecurityServicePrivateKeyAlias();
- String privateKeyPass = Configuration.getSecurityServicePrivateKeyPassword();
-
- try
- {
- KeyStore keystore = KeyStore.getInstance(keystoreType);
- InputStream in = ClassUtil.getResourceAsStream(keystorePath, this.getClass());
- if (in == null)
- {
- throw new SecurityServiceException("Could not locate public keystore using '" + keystorePath + "'");
- }
-
- // load the keystore contents
- keystore.load(in, keystorePassword.toCharArray());
- key = keystore.getKey(privateKeyAlias, privateKeyPass.toCharArray());
- Certificate certificate = keystore.getCertificate(privateKeyAlias);
- publicKey = certificate.getPublicKey();
-
- // "algorithm/mode/padding" or defaults to "algorithm"
- transformation = Configuration.getSecurityServicePrivateKeyTransformation();
- if (transformation == null)
- {
- this.transformation = key.getAlgorithm();
- }
- }
- finally
- {
- keystorePassword = null;
- privateKeyAlias = null;
- privateKeyPass = null;
- }
+ cipher.init(Cipher.ENCRYPT_MODE, secretKey);;
+ return new SealedObject(serializable, cipher);
}
- catch (final KeyStoreException e)
- {
- throw new SecurityServiceException(e.getMessage(), e);
- }
- catch (final NoSuchAlgorithmException e)
- {
- throw new SecurityServiceException(e.getMessage(), e);
- }
- catch (final CertificateException e)
- {
- throw new SecurityServiceException(e.getMessage(), e);
- }
- catch (final IOException e)
- {
- throw new SecurityServiceException(e.getMessage(), e);
- }
- catch (final UnrecoverableKeyException e)
- {
- throw new SecurityServiceException(e.getMessage(), e);
- }
}
- }
-
- private static byte[] getBytes(final Serializable ser) throws IOException
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- ObjectOutputStream oout = new ObjectOutputStream(bout);
- oout.writeObject(ser);
- return bout.toByteArray();
- }
-
- public byte[] encrypt(final Serializable object) throws SecurityServiceException
- {
- ByteArrayInputStream plainInStream;
- try
+ catch (final InvalidKeyException e)
{
- plainInStream = new ByteArrayInputStream(getBytes(object));
+ throw new SecurityServiceException(e.getMessage(), e);
}
- catch (final IOException e)
+ catch (final IllegalBlockSizeException e)
{
throw new SecurityServiceException(e.getMessage(), e);
}
-
- ByteArrayOutputStream encryptedOutStream = new ByteArrayOutputStream();
-
- try
- {
- byte[] buf = new byte[100];
- int bufLength;
- while ( (bufLength = plainInStream.read(buf)) != -1)
- {
- byte[] tmp = CryptoUtil.encrypt(copyBytes(buf,bufLength),publicKey, transformation);
- encryptedOutStream.write(tmp);
- encryptedOutStream.flush();
- }
- return encryptedOutStream.toByteArray();
- }
catch (final IOException e)
{
throw new SecurityServiceException(e.getMessage(), e);
}
}
- public Serializable decrypt(final byte[] bytes) throws SecurityServiceException
+ /**
+ * Unseals a previously sealed object.
+ *
+ * @param sealedObject The object to unseal
+ * @return {@link Serializable} The unsealed Serializeable Object.
+ * @throws SecurityServiceException
+ */
+ public Serializable unSealObject(SealedObject sealedObject) throws SecurityServiceException
{
- ByteArrayInputStream encryptedBytesInStream = new ByteArrayInputStream(bytes);
-
- ByteArrayOutputStream decryptedBytesOutStream = new ByteArrayOutputStream();
-
- byte[] decryptBytes = null;
+ AssertArgument.isNotNull(sealedObject, "sealedObject");
try
{
- byte[] buf = new byte[128];
- int bufLenth;
- while ( (bufLenth = encryptedBytesInStream.read(buf)) != -1)
+ synchronized (cipher)
{
- byte[] tmp = CryptoUtil.decrypt( copyBytes(buf,bufLenth),(PrivateKey)key, transformation);
- decryptedBytesOutStream.write(tmp);
- decryptedBytesOutStream.flush();
- decryptBytes = decryptedBytesOutStream.toByteArray();
+ cipher.init(Cipher.DECRYPT_MODE, secretKey);
+ return (Serializable) sealedObject.getObject(cipher);
}
}
- catch (final IOException e)
+ catch (final InvalidKeyException e)
{
throw new SecurityServiceException(e.getMessage(), e);
}
- finally
+ catch (final IllegalBlockSizeException e)
{
- try { decryptedBytesOutStream.close(); } catch (IOException ignore) { log.error(ignore.getMessage(),ignore); }
+ throw new SecurityServiceException(e.getMessage(), e);
}
-
- return toSerializable(decryptBytes);
- }
-
- private Serializable toSerializable(final byte[] decryptBytes) throws SecurityServiceException
- {
- ObjectInputStream inputStream = null;
- try
+ catch (final BadPaddingException e)
{
- inputStream = new ObjectInputStream(new ByteArrayInputStream(decryptBytes));
- return (Serializable) inputStream.readObject();
+ throw new SecurityServiceException(e.getMessage(), e);
}
- catch (final IOException e)
+ catch (IOException e)
{
throw new SecurityServiceException(e.getMessage(), e);
}
- catch (final ClassNotFoundException e)
+ catch (ClassNotFoundException e)
{
throw new SecurityServiceException(e.getMessage(), e);
}
- finally
- {
- try { inputStream.close(); } catch (IOException ignore) { log.error(ignore.getMessage(), ignore); }
- }
}
- private static byte[] copyBytes(byte[] bytes, int length)
+ /**
+ * Generates a symmetric key used for sealing object.
+ *
+ * @throws SecurityServiceException
+ */
+ private void initSecretKey() throws SecurityServiceException
{
- if (bytes.length == length)
+ try
{
- return bytes;
- }
+ final String algorithm = Configuration.getSecurityServiceSealAlgorithm();
+ if (algorithm == null)
+ {
+ throw new SecurityServiceException("'" + Environment.SECURITY_SERVICE_SEAL_ALGORITHM + "' has not been configured. Please set the algorithm to use in jbossesb-properties.xml");
+ }
- byte[] newBytes = new byte[length];
- for (int i = 0; i < length; i++)
+ final String keySizeStr = Configuration.getSecurityServiceSealKeySize();
+ if (keySizeStr == null)
+ {
+ throw new SecurityServiceException("'" + Environment.SECURITY_SERVICE_SEAL_KEYSIZE + "' has not been configured. Please set the key size to use in jbossesb-properties.xml");
+ }
+
+ int keySize;
+ try
+ {
+ keySize = Integer.parseInt(keySizeStr.trim());
+ }
+ catch(final NumberFormatException e)
+ {
+ throw new SecurityServiceException("'" + Environment.SECURITY_SERVICE_SEAL_KEYSIZE + "' must be a number. Please set the key size correctly in jbossesb-properties.xml");
+ }
+
+ log.debug("SealAlgorithm '" + algorithm + "' keySize '" + keySize + "'");
+
+ final KeyGenerator kpg = KeyGenerator.getInstance(algorithm);
+ kpg.init(keySize);
+ secretKey = kpg.generateKey();
+ cipher = Cipher.getInstance(algorithm);
+ }
+ catch (final NoSuchAlgorithmException e)
{
- newBytes[i] = bytes[i];
+ throw new SecurityServiceException(e.getMessage(), e);
}
- return newBytes;
+ catch (final NoSuchPaddingException e)
+ {
+ throw new SecurityServiceException(e.getMessage(), e);
+ }
}
private static Logger getLogger()
{
return Logger.getLogger(PrivateCryptoUtil.class);
}
-
}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagator.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagator.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagator.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,56 @@
+/*
+ * 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.util.Set;
+
+import org.jboss.soa.esb.services.security.SecurityConfig;
+import org.jboss.soa.esb.services.security.SecurityContext;
+
+/**
+ * A SecurityContextPropagator can push/propagate and pop/remove security context
+ * information to a specified targets security subsytem.
+ * </p>
+ * For example, a SecurityContextPropagator for JBossAS would propagate a security
+ * context so that it is made available to JBossAS Security subsystem.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public interface SecurityContextPropagator
+{
+ /**
+ * Push/Propagate the Security context information to the destined system.
+ *
+ * @param context The security context to be pushed(propagated)
+ * @param credentials The set of credentials that were provided for authentication.
+ * @param config The SecurityConfig which give access to the service's security configuration.
+ */
+ void pushSecurityContext(final SecurityContext context, final Set<?> credentials, final SecurityConfig config);
+
+ /**
+ * Pop/Remove the Security context information to the destined system.
+ *
+ * @param context The security context to be pushed(propagated)
+ * @param config The SecurityConfig which give access to the service's security configuration.
+ */
+ void popSecurityContext(final SecurityContext context, final SecurityConfig config);
+
+}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactory.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactory.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactory.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,81 @@
+/*
+ * 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 org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.services.security.SecurityServiceException;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Factory for creating {@link SecurityContextPropagator} instances.
+ * Only contains factory methods.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public final class SecurityContextPropagatorFactory
+{
+ private SecurityContextPropagatorFactory() {}
+
+ public static SecurityContextPropagator createFromConfig() throws SecurityServiceException
+ {
+ return create(Configuration.getSecurityContextPropagatorImplementationClass());
+ }
+
+ /**
+ * Creates an instance of the specified className which must be an instance of {@link SecurityContextPropagator}.
+ *
+ * @param className The fully qualified name of the class to be used.
+ * @return SecurityContextPropagator An instance of the passed in className of if className of null is className was null.
+ * @throws SecurityServiceException If an exception occurs while trying to create the instance.
+ */
+ public static SecurityContextPropagator create(final String className) throws SecurityServiceException
+ {
+ if (className == null)
+ {
+ return null;
+ }
+ return createInstance(className);
+ }
+
+ private static SecurityContextPropagator createInstance(final String className) throws SecurityServiceException
+ {
+ try
+ {
+ final Class<?> propagator = ClassUtil.forName(className, SecurityContextPropagatorFactory.class);
+ Object newInstance = propagator.newInstance();
+ return (SecurityContextPropagator) newInstance;
+ }
+ catch (final ClassNotFoundException e)
+ {
+ throw new SecurityServiceException("SecurityContextPropagator implementation '" + className + "' not found", e);
+ }
+ catch (final InstantiationException e)
+ {
+ throw new SecurityServiceException("Instantiation Exception while trying to create a SecurityContextPropagator of type '" + className + "'", e);
+ }
+ catch (final IllegalAccessException e)
+ {
+ throw new SecurityServiceException("IllegalAccessException while trying to create a SecurityContextPropagator of type '" + className + "'", e);
+ }
+ }
+
+}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/NullWriter.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/internal/soa/esb/util/NullWriter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/NullWriter.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/NullWriter.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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-2008, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.util;
+
+import java.io.Writer;
+import java.io.IOException;
+
+/**
+ * Null {@link Writer}.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NullWriter extends Writer {
+
+ public NullWriter() {
+ super();
+ }
+
+ public NullWriter(Object lock) {
+ super(lock);
+ }
+
+ public void write() throws IOException {
+
+ }
+
+ public void write(int c) throws IOException {
+ write();
+ }
+
+ public void write(char cbuf[]) throws IOException {
+ write();
+ }
+
+ public void write(String str) throws IOException {
+ write();
+ }
+
+ public void write(String str, int off, int len) throws IOException {
+ write();
+ }
+
+ public Writer append(CharSequence csq) throws IOException {
+ write();
+ return this;
+ }
+
+ public Writer append(CharSequence csq, int start, int end) throws IOException {
+ write();
+ return this;
+ }
+
+ public Writer append(char c) throws IOException {
+ write();
+ return this;
+ }
+
+ public void write(char cbuf[], int off, int len) throws IOException {
+ write();
+ }
+
+ public void flush() throws IOException {
+ }
+
+ public void close() throws IOException {
+ }
+}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBResponseFilter.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBResponseFilter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBResponseFilter.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBResponseFilter.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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-2008, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.webservice;
+
+import org.jboss.internal.soa.esb.util.NullWriter;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletResponseWrapper;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * Webservice response filter.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ESBResponseFilter implements Filter {
+
+ private boolean isOneWay = false;
+
+ public void init(FilterConfig filterConfig) throws ServletException {
+ String oneWayConfig = filterConfig.getInitParameter("OneWay");
+ isOneWay = "true".equalsIgnoreCase(oneWayConfig);
+ }
+
+ public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+ if(isOneWay) {
+ filterChain.doFilter(servletRequest, new OneWayResponseWrapper((HttpServletResponse) servletResponse));
+ servletResponse.setContentType("text/xml");
+ servletResponse.setContentLength(0);
+ } else {
+ filterChain.doFilter(servletRequest, servletResponse);
+ }
+ }
+
+ public void destroy() {
+ }
+
+ /**
+ * OneWay response wrapper.
+ * <p/>
+ * Filters out the response i.e. ensures that the response body is empty.
+ */
+ private class OneWayResponseWrapper extends HttpServletResponseWrapper {
+
+ public OneWayResponseWrapper(HttpServletResponse httpServletResponse) {
+ super(httpServletResponse);
+ }
+
+ public PrintWriter getWriter() throws IOException {
+ return new PrintWriter(new NullWriter());
+ }
+
+ public ServletOutputStream getOutputStream() throws IOException {
+ return new NullServletOutputStream();
+ }
+ }
+
+ /**
+ * Null {@link ServletOutputStream}.
+ */
+ private class NullServletOutputStream extends ServletOutputStream {
+ public void write(int b) throws IOException {
+ }
+ public void write(byte b[]) throws IOException {
+ }
+ public void write(byte b[], int off, int len) throws IOException {
+ }
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -45,6 +45,7 @@
import org.jboss.internal.soa.esb.rosetta.pooling.JmsSession;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.eprs.JMSEpr;
import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.helpers.ConfigTree;
@@ -137,10 +138,6 @@
*/
private String queueName;
/**
- * JMS Queue setup.
- */
- private JMSSendQueueSetup queueSetup;
- /**
* Strategy for setting JMSProperties
*/
private final JMSPropertiesSetter jmsPropertiesStrategy ;
@@ -164,6 +161,25 @@
private String connectionFactory;
/**
+ * The pool to use for the jms routing.
+ */
+ private JmsConnectionPool pool ;
+ /**
+ * The jms target destination for routing.
+ */
+ private Destination jmsDestination ;
+ /**
+ * Thread local used for passing JmsSession between methods.
+ * This is to allow modifications without changing the API.
+ */
+ private ThreadLocal<JmsSession> SESSION = new ThreadLocal<JmsSession>() ;
+ /**
+ * The JMS reply to destination.
+ */
+ private String jmsReplyToName ;
+
+
+ /**
* Sole public constructor.
*
* @param propertiesTree Action properties.
@@ -192,10 +208,10 @@
if ( ttlStr != null )
timeToLive = Long.parseLong( ttlStr );
- jndiContextFactory = properties.getAttribute( JMSEpr.JNDI_CONTEXT_FACTORY_TAG );
- jndiUrl = properties.getAttribute( JMSEpr.JNDI_URL_TAG );
- jndiPkgPrefix = properties.getAttribute( JMSEpr.JNDI_PKG_PREFIX_TAG );
- connectionFactory = properties.getAttribute( JMSEpr.CONNECTION_FACTORY_TAG );
+ jndiContextFactory = properties.getAttribute( JMSEpr.JNDI_CONTEXT_FACTORY_TAG, Configuration.getJndiServerContextFactory());
+ jndiUrl = properties.getAttribute( JMSEpr.JNDI_URL_TAG, Configuration.getJndiServerURL());
+ jndiPkgPrefix = properties.getAttribute( JMSEpr.JNDI_PKG_PREFIX_TAG, Configuration.getJndiServerPkgPrefix());
+ connectionFactory = properties.getAttribute( JMSEpr.CONNECTION_FACTORY_TAG, "ConnectionFactory");
final String propertyStrategy = properties.getAttribute(PROPERTY_STRATEGY) ;
if (propertyStrategy == null) {
@@ -215,8 +231,17 @@
throw new ConfigurationException("'" + SECURITY_PRINCIPAL + "' must be accompanied by a '" + SECURITY_CREDITIAL + "'");
else if ( securityCredential != null && securityPrincipal == null )
throw new ConfigurationException("'" + SECURITY_CREDITIAL + "' must be accompanied by a '" + SECURITY_PRINCIPAL + "'");
-
- createQueueSetup( queueName, jndiContextFactory, jndiUrl, jndiPkgPrefix, connectionFactory, securityPrincipal, securityCredential );
+
+ final Properties environment = getEnvironment() ;
+ try {
+ pool = ( securityPrincipal != null ) ?
+ JmsConnectionPoolContainer.getPool(environment, connectionFactory, securityPrincipal, securityCredential) :
+ JmsConnectionPoolContainer.getPool(environment, connectionFactory );
+ } catch (final ConnectionException ce) {
+ throw new ConfigurationException("Unexpected error obtaining JMS connection pool") ;
+ }
+
+ createQueueSetup(queueName, jndiContextFactory, jndiUrl, jndiPkgPrefix, connectionFactory, securityPrincipal, securityCredential);
}
/**
@@ -235,60 +260,95 @@
* @see org.jboss.soa.esb.actions.routing.AbstractRouter#route(java.lang.Object)
*/
public void route(Object message) throws ActionProcessingException {
-
- if(!(message instanceof org.jboss.soa.esb.message.Message)) {
- throw new ActionProcessingException("Cannot send Object [" + message.getClass().getName() + "] to destination [" + queueName + "]. Object must be an instance of org.jboss.soa.esb.message.Message) .");
+ final JmsSession jmsSession = getJmsSession() ;
+ try {
+ handleRouting(jmsSession, message) ;
+ } catch (final JMSException jmse) {
+ try {
+ if (jmsSession.getTransacted()) {
+ jmsSession.rollback() ;
+ throw new ActionProcessingException("Unexpected exception routing message", jmse) ;
+ } else {
+ // Try to acquire again
+ final JmsSession newJmsSession = getJmsSession() ;
+ try {
+ handleRouting(newJmsSession, message) ;
+ } finally {
+ pool.closeSession(newJmsSession) ;
+ }
+ }
+ } catch (final JMSException jmse2) {
+ throw new ActionProcessingException("Unexpected exception routing message", jmse) ;
+ }
+ } finally {
+ pool.closeSession(jmsSession) ;
}
-
- final org.jboss.soa.esb.message.Message esbMessage = (org.jboss.soa.esb.message.Message)message;
-
+ }
+
+ private void handleRouting(final JmsSession jmsSession, Object message) throws JMSException, ActionProcessingException {
+ SESSION.set(jmsSession) ;
try {
- Message jmsMessage = null;
+ if(!(message instanceof org.jboss.soa.esb.message.Message)) {
+ throw new ActionProcessingException("Cannot send Object [" + message.getClass().getName() + "] to destination [" + queueName + "]. Object must be an instance of org.jboss.soa.esb.message.Message) .");
+ }
+
+ final org.jboss.soa.esb.message.Message esbMessage = (org.jboss.soa.esb.message.Message)message;
- if ( unwrap ) {
- Object objectFromBody = getPayloadProxy().getPayload(esbMessage);
- jmsMessage = createJMSMessageWithObjectType( objectFromBody );
+ try {
+ Message jmsMessage = null;
+
+ if ( unwrap ) {
+ Object objectFromBody = getPayloadProxy().getPayload(esbMessage);
+ jmsMessage = createJMSMessageWithObjectType( objectFromBody );
+ }
+ else {
+ jmsMessage = createObjectMessage(Util.serialize(esbMessage));
+ }
+
+ setStringProperties(jmsMessage);
+ setJMSProperties( esbMessage, jmsMessage );
+ setJMSReplyTo( jmsMessage, esbMessage );
+ send( jmsMessage );
+ } catch (JMSException jmse) {
+ throw jmse ;
+ } catch(Exception e) {
+ final String errorMessage = "Exception while sending message [" + message + "] to destination [" + queueName + "]." ;
+ logger.error(errorMessage);
+ throw new ActionProcessingException(errorMessage, e);
}
- else {
- jmsMessage = createObjectMessage(Util.serialize(esbMessage));
- }
+ } finally {
+ SESSION.set(null) ;
+ }
+ }
- setStringProperties(jmsMessage);
- setJMSProperties( esbMessage, jmsMessage );
- setJMSReplyTo( jmsMessage, esbMessage );
- send( jmsMessage );
-
- } catch(Exception e) {
- StringBuilder sb = new StringBuilder();
- sb.append("Exception while sending message [").append(message).append("] to destination [");
-
- if (queueSetup != null)
- sb.append(queueSetup.destinationName).append("].");
- else
- sb.append("null ].");
-
- String errorMessage = sb.toString();
- logger.error(errorMessage, e);
- throw new ActionProcessingException(errorMessage, e);
+ private JmsSession getJmsSession() throws ActionProcessingException {
+ try {
+ return pool.getSession() ;
+ } catch (final ConnectionException ce) {
+ throw new ActionProcessingException("Unexpected ConnectionException acquiring JMS session", ce) ;
+ } catch (NamingException ne) {
+ throw new ActionProcessingException("Unexpected NamingException acquiring JMS session", ne) ;
+ } catch (JMSException jmse) {
+ throw new ActionProcessingException("Unexpected JMSException acquiring JMS session", jmse) ;
}
}
-
+
protected Message createJMSMessageWithObjectType( Object objectFromBody ) throws JMSException
{
Message jmsMessage = null;
if(objectFromBody instanceof String) {
- jmsMessage = queueSetup.jmsSession.createTextMessage();
+ jmsMessage = SESSION.get().createTextMessage();
if(logger.isDebugEnabled()) {
- logger.debug("Sending Text message: [" + objectFromBody + "] to destination [" + queueSetup.destinationName + "].");
+ logger.debug("Sending Text message: [" + objectFromBody + "] to destination [" + queueName + "].");
}
((TextMessage)jmsMessage).setText((String)objectFromBody);
} else if(objectFromBody instanceof byte[]) {
- jmsMessage = queueSetup.jmsSession.createBytesMessage();
+ jmsMessage = SESSION.get().createBytesMessage();
if(logger.isDebugEnabled()) {
- logger.debug("Sending byte[] message: [" + objectFromBody + "] to destination [" + queueSetup.destinationName + "].");
+ logger.debug("Sending byte[] message: [" + objectFromBody + "] to destination [" + queueName + "].");
}
((BytesMessage)jmsMessage).writeBytes((byte[])objectFromBody);
@@ -301,7 +361,22 @@
protected void send( Message jmsMessage ) throws JMSException
{
- queueSetup.jmsProducer.send(jmsMessage);
+ final MessageProducer jmsProducer = SESSION.get().createProducer(jmsDestination) ;
+ try {
+ jmsProducer.setPriority(priority) ;
+ jmsProducer.setDeliveryMode(deliveryMode) ;
+ jmsProducer.setTimeToLive(timeToLive) ;
+
+ // The following seems to be broken but is copied for now.
+ if (jmsReplyToName != null) {
+ final Destination jmsReplyToDestination = SESSION.get().createQueue(jmsReplyToName);
+ jmsMessage.setJMSReplyTo(jmsReplyToDestination);
+ }
+
+ jmsProducer.send(jmsMessage);
+ } finally {
+ jmsProducer.close() ;
+ }
}
/**
@@ -318,10 +393,10 @@
protected Message createObjectMessage(Object message) throws JMSException {
Message jmsMessage;
- jmsMessage = queueSetup.jmsSession.createObjectMessage();
+ jmsMessage = SESSION.get().createObjectMessage();
if(logger.isDebugEnabled()) {
- logger.debug("Sending Object message: [" + message + "] to destination [" + queueSetup.destinationName + "].");
+ logger.debug("Sending Object message: [" + message + "] to destination [" + queueName + "].");
}
((ObjectMessage)jmsMessage).setObject((Serializable) message);
return jmsMessage;
@@ -353,17 +428,6 @@
return null;
}
- @Override
- protected void finalize() throws Throwable {
- queueSetup.close();
- super.finalize();
- }
-
- protected void createQueueSetup( String queueName ) throws ConfigurationException
- {
- createQueueSetup( queueName, null, null, null, null, null, null );
- }
-
protected void createQueueSetup( String queueName,
String jndiContextFactory,
String jndiUrl,
@@ -372,124 +436,65 @@
String securityPrincipal,
String securityCredential) throws ConfigurationException
{
- try {
- queueSetup = new JMSSendQueueSetup(queueName, jndiContextFactory, jndiUrl, jndiPkgPrefix, connectionFactory, securityPrincipal, securityCredential );
- queueSetup.setDeliveryMode( deliveryMode );
- queueSetup.setPriority( priority );
- queueSetup.setTimeToLive( timeToLive );
- if ( logger.isDebugEnabled() )
- {
- logger.debug( "JMSRouter DeliveryMode : " + deliveryMode);
- logger.debug( "JMSRouter Priority : " + priority);
- logger.debug( "JMSRouter TimeToLive : " + timeToLive);
- }
- } catch (Throwable t) {
- throw new ConfigurationException("Failed to configure JMS Queue for routing.", t);
- }
- }
-
- private static class JMSSendQueueSetup {
- JmsSession jmsSession;
- Destination jmsDestination;
- MessageProducer jmsProducer;
- String destinationName;
- JmsConnectionPool pool;
-
- private JMSSendQueueSetup(String destinationName) throws NamingException, JMSException, ConnectionException, NamingContextException {
- this( destinationName, null, null, null, null, null, null );
- }
-
- private JMSSendQueueSetup(String destinationName,
- String jndiContextFactory,
- String jndiUrl,
- String jndiPkgPrefix,
- String connectionFactoryName,
- String securityPrincipal,
- String securityCredential) throws NamingException, JMSException, ConnectionException, NamingContextException {
-
- if ( jndiContextFactory == null )
- jndiContextFactory = Configuration.getJndiServerContextFactory();
- if ( jndiUrl == null )
- jndiUrl = Configuration.getJndiServerURL();
- if ( jndiPkgPrefix == null )
- jndiPkgPrefix = Configuration.getJndiServerPkgPrefix();
- if ( connectionFactoryName == null )
- connectionFactoryName = "ConnectionFactory";
-
- Properties environment = new Properties();
- environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, jndiContextFactory);
- environment.setProperty(Context.PROVIDER_URL, jndiUrl);
- environment.setProperty(Context.URL_PKG_PREFIXES, jndiPkgPrefix);
- Context oCtx = NamingContextPool.getNamingContext(environment);
+ final Properties environment = getEnvironment() ;
+ try
+ {
+ final JmsSession jmsSession = pool.getSession();
try {
- pool = ( securityPrincipal != null ) ?
- JmsConnectionPoolContainer.getPool(environment, connectionFactoryName, securityPrincipal, securityCredential) :
- JmsConnectionPoolContainer.getPool(environment, connectionFactoryName );
-
- this.destinationName = destinationName;
-
- jmsSession = pool.getSession();
- boolean clean = true ;
+ Context oCtx = NamingContextPool.getNamingContext(environment);
try {
try {
- jmsDestination = (Destination) oCtx.lookup(destinationName);
+ jmsDestination = (Queue) oCtx.lookup(queueName);
} catch (NamingException ne) {
try {
oCtx = NamingContextPool.replaceNamingContext(oCtx, environment);
- jmsDestination = (Queue) oCtx.lookup(destinationName);
+ jmsDestination = (Queue) oCtx.lookup(queueName);
} catch (NamingException nex) {
//ActiveMQ
- jmsDestination = jmsSession.createQueue(destinationName);
+ jmsDestination = jmsSession.createQueue(queueName);
}
}
- jmsProducer = jmsSession.createProducer(jmsDestination);
- clean = false ;
+ final MessageProducer jmsProducer = jmsSession.createProducer(jmsDestination);
+ jmsProducer.close() ;
} finally {
- if (clean) {
- pool.closeSession(jmsSession) ;
- }
+ NamingContextPool.releaseNamingContext(oCtx) ;
}
} finally {
- NamingContextPool.releaseNamingContext(oCtx) ;
+ pool.closeSession(jmsSession) ;
}
- }
-
- public void setDeliveryMode(final int deliveryMode ) throws JMSException
- {
- if ( jmsProducer != null )
- jmsProducer.setDeliveryMode( deliveryMode );
- }
-
- public void setPriority(final int priority ) throws JMSException
- {
- if ( jmsProducer != null )
- jmsProducer.setPriority( priority );
- }
-
- public void setTimeToLive(final long ttl ) throws JMSException
- {
- if ( jmsProducer != null )
- jmsProducer.setTimeToLive( ttl );
- }
-
- private void close() {
- try {
- pool.closeSession(jmsSession);
- if (jmsProducer!=null) {
- jmsProducer.close();
- }
- } catch (Exception e) {
- logger.error("Unable to close JMS Queue Setup.", e);
- }
- }
+ }
+ catch (Throwable t)
+ {
+ throw new ConfigurationException("Failed to configure JMS Queue for routing.", t);
+ }
}
+
+ private Properties getEnvironment()
+ {
+ final Properties environment = new Properties();
+ environment.setProperty(Context.PROVIDER_URL, jndiUrl);
+ environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, jndiContextFactory);
+ environment.setProperty(Context.URL_PKG_PREFIXES, jndiPkgPrefix);
+ return environment ;
+ }
+
+ protected void createQueueSetup( String queueName ) throws ConfigurationException
+ {
+ createQueueSetup(queueName, null, null, null, null, null, null);
+ }
+
protected void setJMSReplyTo( final Message jmsMessage, final org.jboss.soa.esb.message.Message esbMessage ) throws URISyntaxException, JMSException, NamingException, ConnectionException, NamingContextException
{
- Destination destination = (Destination) esbMessage.getProperties().getProperty( JMSPropertiesSetter.JMS_REPLY_TO );
- if ( destination != null )
+ EPR replyToEpr = esbMessage.getHeader().getCall().getReplyTo();
+ if( !( replyToEpr instanceof JMSEpr) )
+ return;
+
+ JMSEpr jmsEpr = (JMSEpr) replyToEpr;
+ String destinationType = jmsEpr.getDestinationType();
+ if ( destinationType.equals( JMSEpr.QUEUE_TYPE ))
{
- jmsMessage.setJMSReplyTo( (Destination) destination );
+ jmsReplyToName = jmsEpr.getDestinationName() ;
}
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/InVMEpr.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -284,7 +284,7 @@
AssertArgument.isNotNullAndNotEmpty(catagory, "catagory");
AssertArgument.isNotNullAndNotEmpty(name, "name");
- byte[] bytes = (catagory.trim() + name.trim()).getBytes();
+ byte[] bytes = (catagory.trim() + "$$$$$$$$$$$$" + name.trim()).getBytes();
return new String(Hex.encodeHex(bytes));
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -247,8 +247,10 @@
}
}
}
- if (uri != null)
- setAddr(new PortReference(JMS_PROTOCOL + PROTOCOL_SEPARATOR + uri + "/" + name));
+ if (uri != null) {
+ final String address = getJmsAddress(uri, name) ;
+ setAddr(new PortReference(address));
+ }
}
/**
@@ -505,7 +507,7 @@
if (destinationType.equals(QUEUE_TYPE)
|| destinationType.equals(TOPIC_TYPE))
{
- String uri = Configuration.getJndiServerURL();
+ String uri = null;
String name = null;
PortReference addr = new PortReference();
@@ -526,14 +528,20 @@
addr.addExtension(key.toString(), environment.getProperty(key.toString()));
}
}
-
-
}
+
+ if (uri == null) {
+ uri = addr.getExtensionValue(Context.PROVIDER_URL) ;
+ }
+
+ if (uri == null) {
+ uri = Configuration.getJndiServerURL() ;
+ }
if (name == null)
name = destinationName;
- addr.setAddress(JMS_PROTOCOL + PROTOCOL_SEPARATOR + uri + "/" + name);
+ addr.setAddress(getJmsAddress(uri, name));
addr.addExtension(DESTINATION_TYPE_TAG, destinationType);
@@ -751,6 +759,23 @@
return new JMSEpr(this);
}
+ private String getJmsAddress(final String uri, final String name)
+ {
+ try {
+ final URI uriVal = new URI(uri) ;
+ final String host = uriVal.getHost() ;
+ if (host != null) {
+ final int port = uriVal.getPort() ;
+ if (port > 0) {
+ return JMS_PROTOCOL + PROTOCOL_SEPARATOR + host + ":" + port + "/" + name;
+ } else {
+ return JMS_PROTOCOL + PROTOCOL_SEPARATOR + host + "/" + name;
+ }
+ }
+ } catch (final URISyntaxException urise) {}
+ return JMS_PROTOCOL + PROTOCOL_SEPARATOR + uri + "/" + name;
+ }
+
public String toString ()
{
return "JMSEpr [ "+super.getAddr().extendedToString()+" ]";
@@ -776,4 +801,4 @@
throw new ExceptionInInitializerError(ex.toString());
}
}
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -19,17 +19,15 @@
*/
package org.jboss.soa.esb.client;
-import java.security.AccessController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import javax.security.auth.Subject;
+import javax.crypto.SealedObject;
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.internal.soa.esb.services.security.PrivateCryptoUtil;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
import org.jboss.soa.esb.addressing.Call;
@@ -46,9 +44,9 @@
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierFactory;
import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.couriers.CourierMarshalUnmarshalException;
+import org.jboss.soa.esb.couriers.CourierServiceBindException;
import org.jboss.soa.esb.couriers.CourierTransportException;
-import org.jboss.soa.esb.couriers.CourierServiceBindException;
-import org.jboss.soa.esb.couriers.CourierMarshalUnmarshalException;
import org.jboss.soa.esb.couriers.CourierUtil;
import org.jboss.soa.esb.couriers.FaultMessageException;
import org.jboss.soa.esb.couriers.TwoWayCourier;
@@ -68,7 +66,7 @@
import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
import org.jboss.soa.esb.services.security.SecurityContext;
import org.jboss.soa.esb.services.security.SecurityService;
-import org.jboss.soa.esb.services.security.SecurityServiceException;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
import org.jboss.soa.esb.util.ClassUtil;
/**
@@ -302,6 +300,28 @@
private Message post(Message message, EPRInvoker eprInvoker) throws MessageDeliverException, FaultMessageException {
boolean staleEPRCache = true;
boolean initialPass = true;
+
+ /*
+ * Re-attach encrypted SecurityContext to outgoing message.
+ */
+ final SealedObject sealedObject = SecurityContext.getSecurityContext();
+ if (sealedObject != null)
+ {
+ message.getContext().setContext(SecurityService.CONTEXT, sealedObject);
+ // clear the security context from the thread local.
+ SecurityContext.setSecurityContext(null);
+ }
+ /*
+ * Re-attach encrypted AuthenticationRequest to outgoing message.
+ */
+ final byte[] encryptedAuthRequest = AuthenticationRequestImpl.getEncryptedAuthRequest();
+ if (encryptedAuthRequest != null)
+ {
+ message.getContext().setContext(SecurityService.AUTH_REQUEST, encryptedAuthRequest);
+ // clear the auth request from the thread local.
+ AuthenticationRequestImpl.setEncryptedAuthRequest(null);
+ }
+
//We are removing dead EPRs from the serviceClusterInfo. *Previous* deliveries maybe have
//removed EPRs that have now come back to life. We should try once more to pull a fresh list of EPRS
//from the registry before we give up (and fail-over to redelivery at a later time in the care
@@ -335,26 +355,12 @@
while ((epr = loadBalancer.chooseEPR(serviceClusterInfo)) != null) {
try
{
- final Subject subject = Subject.getSubject(AccessController.getContext());
- if (subject != null)
- {
- logger.info("Subject in ServiceInvoker " + subject);
- try
- {
- byte[] encrypted = PrivateCryptoUtil.INSTANCE.encrypt(new SecurityContext(subject));
- message.getContext().setContext(SecurityService.CONTEXT, encrypted);
- }
- catch (final SecurityServiceException e)
- {
- logger.error("Could not encrypt the security conext. Will not be added to the outgoing message", e);
- }
- }
-
replyMessage = eprInvoker.attemptDelivery(message, epr);
if (replyMessage != null) {
if(eprInvoker.synchronous) {
// remove the security context so that it is not exposed to the action pipeline.
replyMessage.getContext().removeContext(SecurityService.CONTEXT);
+ replyMessage.getContext().removeContext(SecurityService.AUTH_REQUEST);
if (Type.isFaultMessage(replyMessage)) {
Factory.createExceptionFromFault(replyMessage) ;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -36,8 +36,6 @@
import org.jboss.soa.esb.helpers.NamingContextException;
import org.jboss.soa.esb.helpers.NamingContextPool;
-import com.arjuna.common.util.propertyservice.PropertyManager;
-
public class Configuration
{
private static Logger _logger = Logger.getLogger(Configuration.class);
@@ -462,45 +460,7 @@
return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_IMPEMENTATION_CLASS);
}
- public static String getSecurityServiceConfigUrl()
- {
- return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_CONFIG_URL);
- }
-
/*
- * Private Keystore getters
- */
- public static String getSecurityServicePrivateKeystore()
- {
- return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_PRIVATE_KEYSTORE);
- }
-
- public static String getSecurityServicePrivateKeyAlias()
- {
- return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_PRIVATE_KEY_ALIAS);
- }
-
- public static String getSecurityServicePrivateKeyPassword()
- {
- return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_PRIVATE_KEY_PASS);
- }
-
- public static String getSecurityServicePrivateKeystorePassword()
- {
- return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_PRIVATE_KEYSTORE_PASS);
- }
-
- public static String getSecurityServicePrivateKeystoreType()
- {
- return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_PRIVATE_KEYSTORE_TYPE);
- }
-
- public static String getSecurityServicePrivateKeyTransformation()
- {
- return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_PRIVATE_KEY_TRANSFORMATION);
- }
-
- /*
* Public Keystore getters
*/
@@ -539,8 +499,33 @@
return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_CALLBACK_HANLDER_CLASS);
}
+ public static String getSecurityServiceSealAlgorithm()
+ {
+ return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_SEAL_ALGORITHM);
+ }
+
+ public static String getSecurityServiceSealKeySize()
+ {
+ return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_SEAL_KEYSIZE);
+ }
+
+ public static String getSecurityServiceContextTimeout()
+ {
+ return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_CONTEXT_TIMEOUT);
+ }
+
public static Properties getSecurityServiceProperies()
{
return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperties();
}
+
+ /**
+ * The SecurityContextPropagator implememtation class to use.
+ *
+ * @return String The fully qualified name of the SecurityContextPropagator implementation class
+ */
+ public static String getSecurityContextPropagatorImplementationClass()
+ {
+ return ModulePropertyManager.getPropertyManager(ModulePropertyManager.SECURITY_MODULE).getProperty(Environment.SECURITY_SERVICE_CONTEXT_PROPAGATOR_CLASS);
+ }
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -230,14 +230,9 @@
public static final String SECURITY_SERVICE_CONFIG_URL = "org.jboss.soa.esb.services.security.configUrl";
public static final String SECURITY_SERVICE_SEAL_ALGORITHM = "org.jboss.soa.esb.services.security.sealAlgorithm";
public static final String SECURITY_SERVICE_SEAL_KEYSIZE = "org.jboss.soa.esb.services.security.sealKeySize";
+ public static final String SECURITY_SERVICE_CONTEXT_TIMEOUT = "org.jboss.soa.esb.services.security.contextTimeout";
+ public static final String SECURITY_SERVICE_CONTEXT_PROPAGATOR_CLASS= "org.jboss.soa.esb.services.security.contextPropagatorImplementationClass";
- public static final String SECURITY_SERVICE_PRIVATE_KEYSTORE = "org.jboss.soa.esb.services.security.privateKeystore";
- public static final String SECURITY_SERVICE_PRIVATE_KEYSTORE_TYPE = "org.jboss.soa.esb.services.security.privateKeystoreType";
- public static final String SECURITY_SERVICE_PRIVATE_KEYSTORE_PASS = "org.jboss.soa.esb.services.security.privateKeystorePassword";
- public static final String SECURITY_SERVICE_PRIVATE_KEY_ALIAS = "org.jboss.soa.esb.services.security.privateKeyAlias";
- public static final String SECURITY_SERVICE_PRIVATE_KEY_PASS = "org.jboss.soa.esb.services.security.privateKeyPassword";
- public static final String SECURITY_SERVICE_PRIVATE_KEY_TRANSFORMATION = "org.jboss.soa.esb.services.security.privateKeyTransformation";
-
public static final String SECURITY_SERVICE_PUBLIC_KEYSTORE = "org.jboss.soa.esb.services.security.publicKeystore";
public static final String SECURITY_SERVICE_PUBLIC_KEYSTORE_TYPE = "org.jboss.soa.esb.services.security.publicKeystoreType";
public static final String SECURITY_SERVICE_PUBLIC_KEYSTORE_PASS = "org.jboss.soa.esb.services.security.publicKeystorePassword";
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -91,7 +91,7 @@
*
* @param instance New factory instance.
*/
- protected static void setInstance(CourierFactory instance) {
+ public static void setInstance(CourierFactory instance) {
CourierFactory.instance = instance;
}
@@ -141,21 +141,32 @@
return getCourier(null, replyToEPR);
}
}
-
- public synchronized InVMCourier getInVMCourier(InVMEpr epr) {
+
+ public synchronized InVMCourier addInVMCourier(InVMEpr epr) {
String address = epr.getAddr().getAddress();
- InVMCourier courier = inVMCouriers.get(address);
+ InVMCourier courier = new InVMCourier(epr);
- if (courier == null) {
- courier = new InVMCourier(epr);
- inVMCouriers.put(address, courier);
- }
-
+ inVMCouriers.put(address, courier);
courier.setActive(true);
return courier;
}
+ public synchronized InVMCourier getInVMCourier(InVMEpr epr) {
+ String address = epr.getAddr().getAddress();
+
+ return inVMCouriers.get(address);
+ }
+
+ public synchronized void removeInVMCourier(InVMEpr epr) {
+ String address = epr.getAddr().getAddress();
+ InVMCourier courier = inVMCouriers.remove(address);
+
+ if(courier != null) {
+ courier.setActive(false);
+ }
+ }
+
/**
* Obtain a courier which can perform both deliveries and pickups and prime it with
* the "to address" (toEPR) and the "replyTo address" (replyToEPR).
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -111,8 +111,20 @@
ManagedLifecycleController controller = new ManagedLifecycleController(instances);
// In parallel, create a map of the contract publication info...
- ServicePublisher.addServicePublishers(controller, generator.getModel().getServicePublishers());
- ServicePublisher.addContractReferencePublishers(controller, publishers) ;
+ boolean success = false ;
+ try
+ {
+ ServicePublisher.addServicePublishers(controller, generator.getModel().getServicePublishers());
+ ServicePublisher.addContractReferencePublishers(controller, publishers) ;
+ success = true ;
+ }
+ finally
+ {
+ if (!success)
+ {
+ ServicePublisher.removeServicePublishers(controller) ;
+ }
+ }
return controller;
}
else
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -49,10 +49,7 @@
import org.jboss.deployment.SubDeployerSupport;
import org.jboss.internal.soa.esb.publish.ContractReferencePublisher;
import org.jboss.internal.soa.esb.util.XMLHelper;
-import org.jboss.internal.soa.esb.webservice.ESBContractGenerator;
-import org.jboss.internal.soa.esb.webservice.ESBServiceContractPublisher;
-import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
-import org.jboss.internal.soa.esb.webservice.JAXWSProviderClassGenerator;
+import org.jboss.internal.soa.esb.webservice.*;
import org.jboss.logging.Logger;
import org.jboss.metadata.MetaData;
import org.jboss.metadata.XmlFileLoader;
@@ -453,8 +450,10 @@
{
if (endpointServices.size() > 0)
{
- final StringWriter servletDefinition = new StringWriter() ;
- final StringWriter servletMapping = new StringWriter() ;
+ final StringWriter filterDefinitions = new StringWriter() ;
+ final StringWriter filterMappings = new StringWriter() ;
+ final StringWriter servletDefinitions = new StringWriter() ;
+ final StringWriter servletMappings = new StringWriter() ;
final ByteArrayOutputStream baos = new ByteArrayOutputStream() ;
final ZipOutputStream zos = new ZipOutputStream(baos) ;
@@ -474,19 +473,41 @@
service.getName(), serviceInfo) ;
final String wsClassName = serviceInfo.getClassName().replace('.', '/') + ".class" ;
addFile(zos, "WEB-INF/classes/" + wsClassName, wsClass) ;
+
+ // Filter...
+ // At the moment we only need the filter to overcome a bug in JBossWS re In-Only endpoints, so
+ // we only include for one way services...
+ if(serviceInfo.isOneWay()) {
+ String filterName = serviceInfo.getServletName() + "_Filter";
+
+ filterDefinitions.append("<filter><filter-name>") ;
+ filterDefinitions.append(filterName) ;
+ filterDefinitions.append("</filter-name><filter-class>") ;
+ filterDefinitions.append(ESBResponseFilter.class.getName()) ;
+ filterDefinitions.append("</filter-class>") ;
+ filterDefinitions.append("<init-param><param-name>OneWay</param-name><param-value>true</param-value></init-param>") ;
+ filterDefinitions.append("</filter>") ;
+
+ filterMappings.append("<filter-mapping><filter-name>") ;
+ filterMappings.append(filterName) ;
+ filterMappings.append("</filter-name><servlet-name>") ;
+ filterMappings.append(serviceInfo.getServletName()) ;
+ filterMappings.append("</servlet-name></filter-mapping>") ;
+ }
+
+ // Servlet....
+ servletDefinitions.append("<servlet><servlet-name>") ;
+ servletDefinitions.append(serviceInfo.getServletName()) ;
+ servletDefinitions.append("</servlet-name><servlet-class>") ;
+ servletDefinitions.append(serviceInfo.getClassName()) ;
+ servletDefinitions.append("</servlet-class></servlet>") ;
- servletDefinition.append("<servlet><servlet-name>") ;
- servletDefinition.append(serviceInfo.getServletName()) ;
- servletDefinition.append("</servlet-name><servlet-class>") ;
- servletDefinition.append(serviceInfo.getClassName()) ;
- servletDefinition.append("</servlet-class></servlet>") ;
+ servletMappings.append("<servlet-mapping><servlet-name>") ;
+ servletMappings.append(serviceInfo.getServletName()) ;
+ servletMappings.append("</servlet-name><url-pattern>") ;
+ servletMappings.append(serviceInfo.getServletPath()) ;
+ servletMappings.append("</url-pattern></servlet-mapping>") ;
- servletMapping.append("<servlet-mapping><servlet-name>") ;
- servletMapping.append(serviceInfo.getServletName()) ;
- servletMapping.append("</servlet-name><url-pattern>") ;
- servletMapping.append(serviceInfo.getServletPath()) ;
- servletMapping.append("</url-pattern></servlet-mapping>") ;
-
final ContractReferencePublisher publisher = new ESBServiceContractPublisher(service, webserviceInfo.getDescription(), serviceInfo.getServletName()) ;
publishers.add(publisher) ;
}
@@ -494,8 +515,10 @@
final StringWriter webXml = new StringWriter() ;
webXml.append("<web-app xmlns=\"http://java.sun.com/xml/ns/j2ee\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"") ;
webXml.append(" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\" version=\"2.4\">") ;
- webXml.append(servletDefinition.getBuffer()) ;
- webXml.append(servletMapping.getBuffer()) ;
+ webXml.append(filterDefinitions.getBuffer()) ;
+ webXml.append(filterMappings.getBuffer()) ;
+ webXml.append(servletDefinitions.getBuffer()) ;
+ webXml.append(servletMappings.getBuffer()) ;
webXml.append("</web-app>") ;
addFile(zos, "WEB-INF/web.xml", webXml.toString()) ;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -91,6 +91,16 @@
@Override
public void createService()
{
+ ClassLoader old = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(classloader);
+ LifecycleResourceManager.getSingleton().associateDeployment(deploymentName) ;
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(old);
+ }
}
@Override
@@ -100,7 +110,6 @@
try
{
Thread.currentThread().setContextClassLoader(classloader);
- LifecycleResourceManager.getSingleton().associateDeployment(deploymentName) ;
controller = Configuration.create(jbossEsbXml, serviceName, publishers);
controller.start();
}
@@ -118,15 +127,28 @@
try
{
Thread.currentThread().setContextClassLoader(classloader);
- ServicePublisher.removeServicePublishers(controller);
+ ServicePublisher.removeServicePublishers(controller);
controller.stop();
}
finally
{
+ Thread.currentThread().setContextClassLoader(old);
+ }
+ }
+
+ @Override
+ public void destroyService() throws Exception
+ {
+ ClassLoader old = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(classloader);
LifecycleResourceManager.getSingleton().disassociateDeployment(deploymentName) ;
LifecycleResourceManager.getSingleton().destroyResources() ;
+ }
+ finally
+ {
Thread.currentThread().setContextClassLoader(old);
}
}
-
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -22,14 +22,18 @@
package org.jboss.soa.esb.listeners.message;
+import java.net.URISyntaxException;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
+import javax.crypto.SealedObject;
import javax.security.auth.Subject;
import javax.xml.validation.Schema;
import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.services.security.SecurityContextPropagator;
+import org.jboss.internal.soa.esb.services.security.SecurityContextPropagatorFactory;
import org.jboss.internal.soa.esb.util.XMLHelper;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.ActionLifecycle;
@@ -43,6 +47,7 @@
import org.jboss.soa.esb.addressing.util.DefaultFaultTo;
import org.jboss.soa.esb.addressing.util.DefaultReplyTo;
import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.common.Environment;
import org.jboss.soa.esb.couriers.Courier;
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierFactory;
@@ -62,6 +67,7 @@
import org.jboss.soa.esb.services.security.SecurityServiceException;
import org.jboss.soa.esb.services.security.SecurityServiceFactory;
import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
import org.jboss.soa.esb.util.ClassUtil;
import org.xml.sax.SAXException;
@@ -71,6 +77,7 @@
* @author <a
* href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
* @author kevin
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
* @since Version 4.0
*/
public class ActionProcessingPipeline
@@ -78,8 +85,7 @@
/**
* The logger instance.
*/
- private final static Logger LOGGER = Logger
- .getLogger(ActionProcessingPipeline.class);
+ private final static Logger LOGGER = Logger .getLogger(ActionProcessingPipeline.class);
/**
* The processors.
@@ -115,9 +121,9 @@
*/
private final boolean oneWay ;
- /**
- * The flag indicating whether we are using implicit or explicit processing.
- */
+ /**
+ * The flag indicating whether we are using implicit or explicit processing.
+ */
private final boolean defaultProcessing ;
/**
@@ -126,18 +132,24 @@
private SecurityConfig securityConf;
/**
+ * The {@link SecurityContextPropagator} is use.
+ * This can be configured either globally in jbossesb-properites.xml or
+ * per-service in jboss-esb.xml.
+ */
+ private SecurityContextPropagator securityContextPropagator;
+
+ private String serviceName;
+
+ /**
* public constructor
*
- * @param config
- * The pipeline configuration.
+ * @param config The pipeline configuration.
*/
- public ActionProcessingPipeline(final ConfigTree config)
- throws ConfigurationException
+ public ActionProcessingPipeline(final ConfigTree config) throws ConfigurationException
{
if (config == null)
{
- throw new IllegalArgumentException(
- "Configuration needed for action classes");
+ throw new IllegalArgumentException( "Configuration needed for action classes");
}
final String mep = config.getAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG) ;
@@ -266,9 +278,7 @@
{
if (LOGGER.isDebugEnabled())
{
- LOGGER
- .debug("Using normal action pipeline processor for "
- + actionClassTag);
+ LOGGER.debug("Using normal action pipeline processor for " + actionClassTag);
}
processor = currentProcessor;
}
@@ -277,9 +287,7 @@
{
if (LOGGER.isDebugEnabled())
{
- LOGGER
- .debug("Using overridden action lifecycle processor for "
- + actionClassTag);
+ LOGGER.debug("Using overridden action lifecycle processor for " + actionClassTag);
}
final ActionLifecycle currentLifecycle = (ActionLifecycle) ActionProcessorMethodInfo
.getActionClassInstance(actionConfig, actionClass);
@@ -288,30 +296,57 @@
}
else
{
- LOGGER.warn("Action class " + actionClassTag
- + " does not implement the ActionLifecycle interface");
+ LOGGER.warn("Action class " + actionClassTag + " does not implement the ActionLifecycle interface");
if (LOGGER.isDebugEnabled())
{
- LOGGER.debug("Using overridden actions processor for "
- + actionClassTag);
+ LOGGER.debug("Using overridden actions processor for " + actionClassTag);
}
- processor = new OverriddenActionProcessor(actionConfig,
- actionClass);
+ processor = new OverriddenActionProcessor(actionConfig, actionClass);
}
processorList.add(processor);
}
- processors = processorList
- .toArray(new ActionPipelineProcessor[processorList.size()]);
+ processors = processorList.toArray(new ActionPipelineProcessor[processorList.size()]);
ConfigTree[] securityConfigs = config.getChildren( ListenerTagNames.SECURITY_TAG );
+ String securityPropagatorClass = null;
if (securityConfigs.length > 0)
{
securityConf = SecurityConfigUtil.createSecurityConfig(securityConfigs[0]);
- LOGGER.debug(securityConf);
- final SecurityService securitySerivce = SecurityServiceFactory.getSecurityService();
- securitySerivce.configure();
- securitySerivce.refreshSecurityConfig();
+ // Check if a security context propagator was specified in the security element.
+ securityPropagatorClass = securityConf.getProperties().get(Environment.SECURITY_SERVICE_CONTEXT_PROPAGATOR_CLASS);
}
+ serviceName = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
+
+ try
+ {
+ securityContextPropagator = securityPropagatorClass != null ?
+ SecurityContextPropagatorFactory.create(securityPropagatorClass):
+ SecurityContextPropagatorFactory.createFromConfig();
+ }
+ catch (final SecurityServiceException e)
+ {
+ final String errorMsg;
+ if (securityPropagatorClass != null )
+ {
+ errorMsg = "Could not create an instance of class '" + securityPropagatorClass + "' which was configured for service '" +
+ serviceName + "'. Please check the value of '" + Environment.SECURITY_SERVICE_CONTEXT_PROPAGATOR_CLASS + "'" +
+ " which is a property element of the security element declared in jboss-esb.xml.";
+ }
+ else
+ {
+ errorMsg = "Could not create an instance of class the security context propagator configured in jbossesb-properties.xml" +
+ ".Please check the value of '" + Environment.SECURITY_SERVICE_CONTEXT_PROPAGATOR_CLASS + "' in jbossesb-properties.xml";
+ }
+ throw new ConfigurationException(errorMsg, e);
+ }
+
+ if (LOGGER.isDebugEnabled())
+ {
+ if (securityContextPropagator != null)
+ {
+ LOGGER.debug("SecurityContextPropagator in use for service '" + serviceName + "' is '" + securityContextPropagator.getClass().getName() + "'" );
+ }
+ }
}
/**
@@ -370,32 +405,11 @@
LOGGER.debug("pipeline process for message: "+message.getHeader());
}
- SecurityContext securityContext = null;
- try
- {
- // Check if a encrypted SecurityContext was passed with the Message to this service.
- securityContext = SecurityContext.decryptContext((byte[])message.getContext().getContext(SecurityService.CONTEXT));
- }
- catch (final SecurityServiceException 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;
- }
-
- if (securityConf != null || securityContext != null)
- {
- return processPipelineSecured(message, securityContext);
- }
- else
- {
- return processPipeline(message);
- }
+ return processPipeline(message, getSecurityContext(message));
}
else
{
- final Call callDetails = new Call() ;
- callDetails.copy(message.getHeader().getCall()) ;
+ final Call callDetails = createCallDetails(message);
LOGGER.debug("pipeline process disabled for message: "+message.getHeader());
faultTo(callDetails, Factory.createErrorMessage(Factory.NOT_ENABLED, message, null));
@@ -407,40 +421,110 @@
}
}
- private boolean processPipelineSecured(final Message message, SecurityContext securityContext)
+ /**
+ * Processes the action pipeline.
+ * <p/>
+ * If the service has been enable for security authentication, it has the security element
+ * in the configuration xml that is, this method will authenitcate the caller.
+ * If security has not been enabled this method will not perform any authentication but
+ * it will pass through a pre-existing SecurityContext.
+ * <p>
+ *
+ * <h1>SecurityContext</h1>
+ * After the caller has been successfully authenticated a SecurityContext will be created.
+ * This context is valid on the current ESB node(VM) only.
+ * When a SecurityContext is created a timeout is specified. This value can either be the globally
+ * value specified in jbossesb-properties.xml or it can be overridden per service by specifiying the
+ * same property in the security element in jboss-esb.xml:
+ * The value is specified in milliseconds.
+ * <pre>
+ * <security module="someModuleName">
+ * <property name="org.jboss.soa.esb.services.security.contextTimeout" value="50000"/>
+ * </security>
+ * </pre>
+ *
+ * <h1>AuthenticationRequest</h1>
+ * If a call is routed to a different ESB node then that node will re-authenticate the caller.
+ * The node will descrypt the authentication request passed with the Message object
+ * and try to authenticate the caller.
+ *
+ * <h1>SecurityContext Propagation</h1>
+ * Regardless of whether the service has been configured with security or not, the security
+ * context information might need to be propagated using the configured {@link SecurityContextPropagator}.
+ *
+ * @param message The ESB message object.
+ * @param sealedSecurityContext The sealed SecurityContext which will exist if the caller has already been authenticated.
+ * @return true If the action pipeline was processed successfully.
+ */
+ private boolean processPipeline(final Message message, final SealedObject sealedSecurityContext)
{
- final Call callDetails = new Call() ;
- callDetails.copy(message.getHeader().getCall()) ;
+ SecurityContext securityContext = null;
+ if (sealedSecurityContext != null )
+ {
+ // Store the security context. Will be re-attached to outgoing messages regardless whether the service is secured or not.
+ SecurityContext.setSecurityContext(sealedSecurityContext);
+ }
+
+ AuthenticationRequest authRequest;
try
{
- // always perform authentication if the service is security enabled.
- if (securityConf != null )
+ /*
+ * Get the authentication reqeust if one exists. Note that this is needed even if
+ * the current service does not require authentication. A service later down the line might
+ * need to access this information, it might call an EJB that is secured for example, and
+ * this way pass it through.
+ */
+ authRequest = getAutenticationRequest(message);
+
+ if (isServiceSecured())
{
- if (securityContext == null)
+ try
+ {
+ // Try to decrypt the security context.
+ securityContext = SecurityContext.decryptContext(sealedSecurityContext);
+ }
+ catch (final SecurityServiceException ignored)
+ {
+ LOGGER.info("Could not decrypt the security context in Service '" + serviceName + "'. The call might have come from a different VM. Will re-authenticate if security is enabled for this service.", ignored);
+ securityContext = null;
+ }
+
+ if (LOGGER.isDebugEnabled())
+ {
+ if (securityContext != null)
+ {
+ /*
+ * Might be interesting to know if a security context is often invalid as this
+ * will cause re-authentication. This might be avoidable by setting a longer
+ * timeout by overriding the default timeout(jbossesb-properties.xml) and specifying
+ * one on the security element in jboss-esb.xml.
+ */
+ LOGGER.debug(securityContext);
+ }
+ }
+
+ final SecurityService securityService = SecurityServiceFactory.getSecurityService();
+
+ if (securityContext == null || !securityContext.isValid())
{
- // no existing security context exist. Create one to drive the autentication.
- securityContext = new SecurityContext();
+ if (authRequest == null)
+ {
+ throw new SecurityServiceException("Service '" + serviceName + "' has been configured for security but no AuthenticationRequest could be located in the Message Context. Cannot authenticate without an AuthenticationRequest.");
+ }
- // get the authentication request from the message
- 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);
+ // No existing security context exist or it had expired. Create a new one to drive the autentication.
+ securityContext = new SecurityContext(new Subject(), getSecurityContextTimeout(securityConf));
- // authenticate the caller
- SecurityServiceFactory.getSecurityService().authenticate(securityConf, securityContext, authRequest);
+ // Authenticate the caller
+ securityService.authenticate(securityConf, securityContext, authRequest);
+
+ // Store the encrypted security context. Will be re-attached to outgoing messages.
+ SecurityContext.setSecurityContext(SecurityContext.encryptContext(securityContext));
}
- /*
- * The SecurityContext was not null so we were able to decrypt the security context
- * and this is a valid authenticated request and re-authentication is not done.
- */
- // check the allowed roles if configured.
- boolean checkRolesAllowed = SecurityServiceFactory.getSecurityService().checkRolesAllowed(securityConf.getRolesAllowed(), securityContext);
- if (!checkRolesAllowed)
+ // Check that the caller is a member of atleast one of the declared roles.
+ if (!securityService.checkRolesAllowed(securityConf.getRolesAllowed(), securityContext))
{
throw new SecurityServiceException("Caller did not belong to any of the rolesAllowed " + securityConf.getRolesAllowed());
}
@@ -448,42 +532,53 @@
}
catch (final SecurityServiceException e)
{
- LOGGER.debug( "SecurityService exception : ", e);
- faultTo(callDetails, Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, e));
+ LOGGER.error( "SecurityService exception : ", e);
+ faultTo(createCallDetails(message), Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, e));
return false;
}
catch (final ConfigurationException e)
{
- LOGGER.debug( "SecurityService exception : ", e);
- faultTo(callDetails, Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, e));
+ LOGGER.error( "SecurityService exception : ", e);
+ faultTo(createCallDetails(message), Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, e));
return false;
}
finally
{
- // always remove the security context
+ // Always remove the security context.
message.getContext().removeContext(SecurityService.CONTEXT);
message.getContext().removeContext(SecurityService.AUTH_REQUEST);
}
- // the work to be performed in the context of the authenticated caller
- PrivilegedAction<Boolean> action = new PrivilegedAction<Boolean>()
+ if (securityContext != null)
{
- public Boolean run()
- {
- return processPipeline(message);
- }
- };
+ try
+ {
+ // Need to propagate the security context regardless if security was enabled for this service or not.
+ propagateSecurityContext(message, securityContext, authRequest);
- Boolean processResult = (Boolean)Subject.doAsPrivileged(securityContext.getSubject(), action, null);
-
- return processResult.booleanValue();
+ return (Boolean) Subject.doAsPrivileged(securityContext.getSubject(), getPrivilegedAction(message), null);
+ }
+ catch (final SecurityServiceException e)
+ {
+ LOGGER.error( "SecurityService exception : ", e);
+ faultTo(createCallDetails(message), Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, e));
+ return false;
+ }
+ finally
+ {
+ popSecurityContext(securityContext);
+ }
+ }
+ else
+ {
+ return processPipeline(message);
+ }
}
private boolean processPipeline(final Message message)
{
final long start = System.nanoTime();
- final Call callDetails = new Call() ;
- callDetails.copy(message.getHeader().getCall()) ;
+ final Call callDetails = createCallDetails(message);
if (LOGGER.isDebugEnabled())
{
@@ -839,4 +934,141 @@
}
}
+ private boolean isServiceSecured()
+ {
+ return securityConf != null;
+ }
+
+ /**
+ * Retrieves the authentication reqeust from the Message context using
+ * {@link SecurityService#AUTH_REQUEST} as the key.
+ * <p/>
+ * This location may contain an encrypted AuthenticationRequest and if one
+ * exists it will be decryped and return. If one does not exist this
+ * method will return null.
+ *
+ * @param message The ESB Message object.
+ * @return {@link AuthenticationRequest} The decrypted AuthenticationRequest or null if one did not exist.
+ *
+ * @throws SecurityServiceException If a problem occurs during decryption.
+ */
+ private AuthenticationRequest getAutenticationRequest(final Message message) throws SecurityServiceException
+ {
+ final byte[] encryptedAuthRequest = (byte[]) message.getContext().getContext(SecurityService.AUTH_REQUEST);
+ if (encryptedAuthRequest != null)
+ {
+ // store the encrypted auth request. Will be re-attached to outgoing messages.
+ AuthenticationRequestImpl.setEncryptedAuthRequest(encryptedAuthRequest);
+
+ return (AuthenticationRequest) PublicCryptoUtil.INSTANCE.decrypt(encryptedAuthRequest);
+ }
+ return null;
+ }
+
+ private SealedObject getSecurityContext(final Message message)
+ {
+ return (SealedObject) message.getContext().getContext(SecurityService.CONTEXT);
+ }
+
+ private PrivilegedAction<Boolean> getPrivilegedAction(final Message message)
+ {
+ // the work to be performed in the context of the authenticated caller
+ return new PrivilegedAction<Boolean>()
+ {
+ public Boolean run()
+ {
+ return processPipeline(message);
+ }
+ };
+ }
+
+ @SuppressWarnings("deprecation")
+ private Call createCallDetails(final Message message)
+ {
+ Call callDetails;
+ try
+ {
+ callDetails = new Call(message.getHeader().getCall());
+ }
+ catch (final URISyntaxException e)
+ {
+ LOGGER.error("Caught an URISyntaxException while calling Call's copy constructor. Will revert to using the old way using the copy method.", e);
+ callDetails = new Call();
+ callDetails.copy(message.getHeader().getCall()) ;
+ }
+ return callDetails;
+ }
+
+ /**
+ * Checks if the security config has a property named 'org.jboss.soa.esb.services.security.contextTimeout'
+ * specified. This will in that case be used as the SecurityContext timeout for this pipeline.
+ * If not specified the value will fallback to the value specified in jbossesb-properties.xml
+ *
+ * @param securityConfig The security configuration for this pipeline. This maps to the security element in jboss-esb.xml
+ * @return long Either the timeout value specified in the security element in jboss-esb.xml otherwise the value in jbossesb-properties.xml
+ * @throws SecurityServiceException If the value specified in jbossesb-properties.xml cannot be parsed. If the value in jboss-esb.xml cannot be parsed, only a warning will be issued.
+ */
+ long getSecurityContextTimeout(final SecurityConfig securityConfig) throws SecurityServiceException
+ {
+ String timeoutStr = securityConfig.getProperties().get(Environment.SECURITY_SERVICE_CONTEXT_TIMEOUT);
+ if (timeoutStr != null)
+ {
+ try
+ {
+ return Long.parseLong(timeoutStr);
+ }
+ catch (final NumberFormatException ignore)
+ {
+ LOGGER.warn("Could not parse '" + timeoutStr +"' to a long. Please make sure the the value of the property '" + Environment.SECURITY_SERVICE_CONTEXT_TIMEOUT + "' in jbossesb-xml is a valid long(ms)");
+ // fallback to global configuration.
+ }
+ }
+ return SecurityContext.getConfigurationTimeout();
+ }
+
+ /**
+ * Propagates the security context by delegating to the current {@link SecurityContextPropagator}.
+ * This method returns silently if a SecurityContextPropagator has not been configured to avoid
+ * the overhead of decrypting the AuthenticationRequest (is needed).
+ *
+ * @param message The ESB message object.
+ * @param context The SecurityContext.
+ * @param authRequest The {@link AuthenticationRequest}.
+ * @throws SecurityServiceException
+ */
+ private void propagateSecurityContext(final Message message, final SecurityContext context, final AuthenticationRequest authRequest) throws SecurityServiceException
+ {
+ if (securityContextPropagator == null)
+ {
+ // No need to do anything if a security context propagator was not configured.
+ return;
+ }
+
+ final AuthenticationRequest request;
+ if (authRequest == null)
+ {
+ final byte[] encryptedAuthRequest = (byte[]) message.getContext().getContext(SecurityService.AUTH_REQUEST);
+ if (encryptedAuthRequest == null)
+ {
+ // there might not be a authentication reqeust. Just return.
+ return;
+ }
+ request = (AuthenticationRequest) PublicCryptoUtil.INSTANCE.decrypt(encryptedAuthRequest);
+ }
+ else
+ {
+ // use the passed in authentication request.
+ request = authRequest;
+ }
+
+ securityContextPropagator.pushSecurityContext(context, request.getCredentials(), securityConf);
+ }
+
+ private void popSecurityContext(final SecurityContext securityContext)
+ {
+ if (securityContextPropagator != null)
+ {
+ securityContextPropagator.popSecurityContext(securityContext, securityConf);
+ }
+ }
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionStatusBean.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionStatusBean.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionStatusBean.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -36,7 +36,7 @@
private int m_procCount;
private String m_status;
private long m_procTime;
- private int m_bytesProcessed;
+ private long m_bytesProcessed;
public static final String ACTION_SENT = "SENT";
@@ -55,13 +55,13 @@
m_bytesProcessed = 0;
try {
String bytes = (String) f_message.getProperties().getProperty(Environment.MESSAGE_BYTE_SIZE);
- m_bytesProcessed = Integer.parseInt(bytes);
+ m_bytesProcessed = Long.parseLong(bytes);
} catch (NullPointerException npe) {
} catch (NumberFormatException nfe) {
}
}
- public int getBytesProcessed() {
+ public long getBytesProcessed() {
return m_bytesProcessed;
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -195,7 +195,16 @@
{
throw new ManagedLifecycleException("Error configuring action processing pipeline", ce) ;
}
-
+
+ try
+ {
+ RegistryUtil.register(_config, _epr);
+ }
+ catch (final RegistryException re)
+ {
+ throw new ManagedLifecycleException("Unexpected error during registration for epr " + _epr, re);
+ }
+
this.pipeline = pipeline ;
final PickUpOnlyCourier pickUpCourier ;
try
@@ -205,21 +214,14 @@
}
catch (final MalformedEPRException mepre)
{
+ RegistryUtil.unregister(_eprCategoryName, _eprName, _epr) ;
throw new ManagedLifecycleException("Malformed EPR: " + _epr) ;
}
catch (final CourierException ce)
{
+ RegistryUtil.unregister(_eprCategoryName, _eprName, _epr) ;
throw new ManagedLifecycleException("No appropriate courier can be obtained for " + _epr, ce);
}
-
- try
- {
- RegistryUtil.register(_config, _epr);
- }
- catch (final RegistryException re)
- {
- throw new ManagedLifecycleException("Unexpected error during registration for epr " + _epr, re);
- }
}
/**
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounter.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounter.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -69,11 +69,11 @@
return MessageCounterStatistics.getMessageCounterStatistics().getSuccessfulMessageCount();
}
- public int getProcessedBytes() {
+ public long getProcessedBytes() {
return MessageCounterStatistics.getMessageCounterStatistics().getProcessedBytes();
}
- public int getFailedBytes() {
+ public long getFailedBytes() {
return MessageCounterStatistics.getMessageCounterStatistics().getFailedBytes();
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterMBean.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterMBean.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterMBean.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -43,7 +43,7 @@
public void resetCounts();
- public int getProcessedBytes();
+ public long getProcessedBytes();
- public int getFailedBytes();
+ public long getFailedBytes();
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageCounterStatistics.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -39,8 +39,8 @@
private int failedMessageCount;
private int successMessageCount;
private long totalProcessTime;
- private int bytesProcessed;
- private int bytesFailed;
+ private long bytesProcessed;
+ private long bytesFailed;
/**
* Constructor.
@@ -89,11 +89,11 @@
return successMessageCount;
}
- public synchronized int getProcessedBytes() {
+ public synchronized long getProcessedBytes() {
return bytesProcessed;
}
- public synchronized int getFailedBytes() {
+ public synchronized long getFailedBytes() {
return bytesFailed;
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageStatusBean.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageStatusBean.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageStatusBean.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -95,12 +95,12 @@
* Message number of bytes getter
* @return message bytes
*/
- public int getMessageBytes() {
- int messageBytes = 0;
+ public long getMessageBytes() {
+ long messageBytes = 0;
try {
String byteSizeString = (String) this.m_msg.getProperties().getProperty(Environment.MESSAGE_BYTE_SIZE);
if (byteSizeString != null) {
- messageBytes = Integer.parseInt(byteSizeString);
+ messageBytes = Long.parseLong(byteSizeString);
}
} catch (NullPointerException npe) {
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -168,6 +168,8 @@
/**
* Replace this body instance with the one given.
*
+ * This method is not thread safe.
+ *
* @param b
* the body to be replaced with.
*/
@@ -178,6 +180,8 @@
* Merge two bodies. Any duplicate entries in the current instance will be
* lost in favour of the new instance.
*
+ * This method is not thread safe.
+ *
* @param b
* the body to be merged with.
*/
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/schedule/SchedulerJob.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -239,7 +239,7 @@
throws ParseException
{
final CronTrigger trigger = new CronTrigger(getJobName(), JOB_GROUP, cronExpression) ;
- trigger.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING) ;
+ trigger.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW) ;
if (startDate != null)
{
trigger.setStartTime(startDate) ;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/PublicCryptoUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/PublicCryptoUtil.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/PublicCryptoUtil.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -44,6 +44,7 @@
import org.jboss.soa.esb.util.ClassUtil;
/**
+ * Util for encrypting/decrypting using assymmetric keys.
*
* @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
*
@@ -71,6 +72,78 @@
}
}
+ public byte[] encrypt(final Serializable object) throws SecurityServiceException
+ {
+ if (!isSecurityConfigured)
+ {
+ return null;
+ }
+
+ ByteArrayInputStream plainInStream;
+ try
+ {
+ plainInStream = new ByteArrayInputStream(getBytes(object));
+ }
+ catch (final IOException e)
+ {
+ throw new SecurityServiceException(e.getMessage(), e);
+ }
+
+ ByteArrayOutputStream encryptedOutStream = new ByteArrayOutputStream();
+
+ try
+ {
+ byte[] buf = new byte[100];
+ int bufLength;
+ while ( (bufLength = plainInStream.read(buf)) != -1)
+ {
+ byte[] tmp = CryptoUtil.encrypt(copyBytes(buf,bufLength), publicKey, transformation);
+ encryptedOutStream.write(tmp);
+ encryptedOutStream.flush();
+ }
+ return encryptedOutStream.toByteArray();
+ }
+ catch (final IOException e)
+ {
+ throw new SecurityServiceException(e.getMessage(), e);
+ }
+ }
+
+ public Serializable decrypt(final byte[] bytes) throws SecurityServiceException
+ {
+ if (!isSecurityConfigured)
+ {
+ return null;
+ }
+ ByteArrayInputStream encryptedBytesInStream = new ByteArrayInputStream(bytes);
+
+ ByteArrayOutputStream decryptedBytesOutStream = new ByteArrayOutputStream();
+
+ byte[] decryptBytes = null;
+ try
+ {
+ byte[] buf = new byte[128];
+ int bufLenth;
+ while ( (bufLenth = encryptedBytesInStream.read(buf)) != -1)
+ {
+ byte[] tmp = CryptoUtil.decrypt( copyBytes(buf,bufLenth),(PrivateKey)key, transformation);
+ decryptedBytesOutStream.write(tmp);
+ decryptedBytesOutStream.flush();
+ decryptBytes = decryptedBytesOutStream.toByteArray();
+ }
+ }
+ catch (final IOException e)
+ {
+ throw new SecurityServiceException(e.getMessage(), e);
+ }
+ finally
+ {
+ try { decryptedBytesOutStream.close(); } catch (IOException ignore) { log.error(ignore.getMessage(),ignore); }
+ }
+
+ return toSerializable(decryptBytes);
+ }
+
private void init() throws SecurityServiceException
{
String keystorePath = Configuration.getSecurityServicePublicKeystore();
@@ -152,78 +225,6 @@
return bout.toByteArray();
}
- public byte[] encrypt(final Serializable object) throws SecurityServiceException
- {
- if (!isSecurityConfigured)
- {
- return null;
- }
-
- ByteArrayInputStream plainInStream;
- try
- {
- plainInStream = new ByteArrayInputStream(getBytes(object));
- }
- catch (final IOException e)
- {
- throw new SecurityServiceException(e.getMessage(), e);
- }
-
- ByteArrayOutputStream encryptedOutStream = new ByteArrayOutputStream();
-
- try
- {
- byte[] buf = new byte[100];
- int bufLength;
- while ( (bufLength = plainInStream.read(buf)) != -1)
- {
- byte[] tmp = CryptoUtil.encrypt(copyBytes(buf,bufLength),publicKey, transformation);
- encryptedOutStream.write(tmp);
- encryptedOutStream.flush();
- }
- return encryptedOutStream.toByteArray();
- }
- catch (final IOException e)
- {
- throw new SecurityServiceException(e.getMessage(), e);
- }
- }
-
- public Serializable decrypt(final byte[] bytes) throws SecurityServiceException
- {
- if (!isSecurityConfigured)
- {
- return null;
- }
- ByteArrayInputStream encryptedBytesInStream = new ByteArrayInputStream(bytes);
-
- ByteArrayOutputStream decryptedBytesOutStream = new ByteArrayOutputStream();
-
- byte[] decryptBytes = null;
- try
- {
- byte[] buf = new byte[128];
- int bufLenth;
- while ( (bufLenth = encryptedBytesInStream.read(buf)) != -1)
- {
- byte[] tmp = CryptoUtil.decrypt( copyBytes(buf,bufLenth),(PrivateKey)key, transformation);
- decryptedBytesOutStream.write(tmp);
- decryptedBytesOutStream.flush();
- decryptBytes = decryptedBytesOutStream.toByteArray();
- }
- }
- catch (final IOException e)
- {
- throw new SecurityServiceException(e.getMessage(), e);
- }
- finally
- {
- try { decryptedBytesOutStream.close(); } catch (IOException ignore) { log.error(ignore.getMessage(),ignore); }
- }
-
- return toSerializable(decryptBytes);
- }
-
private Serializable toSerializable(final byte[] decryptBytes) throws SecurityServiceException
{
ObjectInputStream inputStream = null;
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityConfigUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityConfigUtil.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityConfigUtil.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -49,13 +49,11 @@
builder.rolesAllowed(securityFragment.getAttribute(ListenerTagNames.ROLES_ALLOWED));
builder.callBackhandler(securityFragment.getAttribute(ListenerTagNames.CALLBACK_HANDLER_TAG));
- final Map<String,String> properties = new HashMap<String, String>();
ConfigTree[] children = securityFragment.getChildren("property");
for (ConfigTree configTree : children)
{
String propertyName = configTree.getAttribute("name");
String propertyValue = configTree.getAttribute("value");
- System.out.println(propertyName + " " + propertyValue);
builder.property(propertyName, propertyValue);
}
return builder.build();
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityContext.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityContext.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityContext.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -22,9 +22,6 @@
import static org.jboss.soa.esb.services.security.principals.Group.ROLES_GROUP_NAME;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.security.Principal;
import java.security.acl.Group;
@@ -32,20 +29,28 @@
import java.util.Enumeration;
import java.util.Set;
+import javax.crypto.SealedObject;
import javax.security.auth.Subject;
import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.internal.soa.esb.services.security.PrivateCryptoUtil;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.Environment;
import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-import org.mvel.ast.AssertNode;
/**
* Security Context contains security related information.
* <p/>
+ *
* Note that even though a Subject object instance is serialiable,
* its private and public credentials are not(they are transient).
+ * <p>
* Also not that the Principal interface is not serializable but
* all implemenations should be.
+ * <p>
+ * When created a SecurityContext will be given a timeout argument which
+ * is the time in milliseconds after which the context is considered
+ * invalid.
*
* @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
* @since 4.4
@@ -55,34 +60,43 @@
{
private static final long serialVersionUID = 1L;
+ private static transient ThreadLocal<SealedObject> securityContextTl = new ThreadLocal<SealedObject>();
+
+ private static long globalConfiguredTimeout;
+
+ /**
+ * The Subject associated with this context.
+ */
private final Subject subject;
- private Set<?> pubCredentials;
+ /**
+ * Timeout (ms) for the security context. Defaults to 5 mins.
+ */
+ private long timeout = 30000;
- private Set<?> privCredentials;
+ /**
+ * Time of creation.
+ */
+ private long timeOfCreation = System.currentTimeMillis();
- public SecurityContext()
+ /**
+ * Creates a SecurityContext associating the passed in Subject with it.
+ *
+ * @param subject The Subject that is to be associated with this security context.
+ * @param timeout A timeout which specifies how long this Security Context is valid for. Must be a positiv value.
+ */
+ public SecurityContext(final Subject subject, final long timeout)
{
- subject = new Subject();
- }
-
- public SecurityContext(Subject subject)
- {
AssertArgument.isNotNull(subject, "subject");
this.subject = subject;
- }
- public Subject getSubject()
- {
- return subject;
+ if ( timeout < -1 )
+ {
+ throw new IllegalArgumentException("'timeout' for SecurityContext must not be negative other then '-1' which indicates a SecurityContext that never expires.");
+ }
+ this.timeout = timeout;
}
- @Override
- public String toString()
- {
- return "SecurityContext [" + subject + "]";
- }
-
public boolean isCallerInRole( final String roleName )
{
Set<Principal> principals = subject.getPrincipals();
@@ -108,35 +122,6 @@
return false;
}
- private void writeObject(final ObjectOutputStream out) throws IOException
- {
- out.defaultWriteObject();
- out.writeObject(subject.getPrivateCredentials());
- out.writeObject(subject.getPublicCredentials());
- }
-
- private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException
- {
- in.defaultReadObject();
- privCredentials = (Set<?>) in.readObject();
- pubCredentials = (Set<?>) in.readObject();
- }
-
- final Set<? extends Principal> getPrincipals()
- {
- return Collections.unmodifiableSet(subject.getPrincipals());
- }
-
- final Set<?> getPubCredentials()
- {
- return Collections.unmodifiableSet(pubCredentials);
- }
-
- public Set<?> getPrivCredentials()
- {
- return Collections.unmodifiableSet(privCredentials);
- }
-
/**
* Will check if the passed in {@link AuthenticationRequest} contains the
* same security information (Principal and credentials) as the this context.
@@ -176,38 +161,114 @@
}
}
}
-
return false;
}
- public static SecurityContext decryptContext(final byte[] encrypt) throws SecurityServiceException
+ public long getTimeOfCreation()
{
+ return timeOfCreation;
+ }
+
+ /**
+ * Timeout if milliseconds.
+ *
+ * @return long The timeout (ms) for this security context.
+ */
+ public long getTimeout()
+ {
+ return timeout;
+ }
+
+ public boolean isValid()
+ {
+ if ( timeout == -1 )
+ {
+ return true;
+ }
+
+ return timeOfCreation + timeout > System.currentTimeMillis();
+ }
+
+ public Subject getSubject()
+ {
+ return subject;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "SecurityContext [isValid " + isValid() + ", timeout :" + timeout + ", timeOfCreation : " + timeOfCreation + "]";
+ }
+
+ // package protected methods
+
+ final Set<? extends Principal> getPrincipals()
+ {
+ return Collections.unmodifiableSet(subject.getPrincipals());
+ }
+
+ // static methods
+
+ public static SecurityContext decryptContext(final SealedObject sealedObject) throws SecurityServiceException
+ {
+ if (sealedObject == null)
+ return null;
+
SecurityContext context = null;
- if (encrypt == null)
- return context;
-
- Serializable decrypted = PrivateCryptoUtil.INSTANCE.decrypt(encrypt);
+ Serializable decrypted = PrivateCryptoUtil.INSTANCE.unSealObject(sealedObject);
if (decrypted instanceof SecurityContext)
{
context = (SecurityContext) decrypted;
- final Subject subject = context.getSubject();
- final Set<?> publCreds = context.getPubCredentials();
- if (publCreds != null )
- {
- subject.getPublicCredentials().addAll(publCreds);
- }
- final Set<?> privCreds = context.getPrivCredentials();
- if (privCreds != null)
- {
- subject.getPrivateCredentials().addAll(privCreds);
- }
}
return context;
}
- public static byte[] encryptContext(final SecurityContext context) throws SecurityServiceException
+ public static SealedObject encryptContext(final SecurityContext context) throws SecurityServiceException
{
- return PrivateCryptoUtil.INSTANCE.encrypt(context);
+ return PrivateCryptoUtil.INSTANCE.sealObject(context);
}
+ /**
+ * Get the globally configured security context timeout.
+ * @return
+ * @throws SecurityServiceException
+ */
+ public static long getConfigurationTimeout() throws SecurityServiceException
+ {
+ if (globalConfiguredTimeout == 0l)
+ {
+ globalConfiguredTimeout = getGlobalConfigurationTimeout();
+ }
+ return globalConfiguredTimeout;
+ }
+
+ public static void setSecurityContext(final SealedObject sealedObject)
+ {
+ SecurityContext.securityContextTl.set(sealedObject);
+ }
+
+ public static SealedObject getSecurityContext()
+ {
+ return SecurityContext.securityContextTl.get();
+ }
+
+ private static long getGlobalConfigurationTimeout() throws SecurityServiceException
+ {
+ final String timeoutStr = Configuration.getSecurityServiceContextTimeout();
+ if (timeoutStr == null)
+ {
+ throw new SecurityServiceException("No timeout was configured for the security context. Please set the value of '" + Environment.SECURITY_SERVICE_CONTEXT_TIMEOUT + "' to the timeout you desire");
+ }
+ else
+ {
+ try
+ {
+ return Long.parseLong(timeoutStr.trim());
+ }
+ catch(final NumberFormatException e)
+ {
+ throw new SecurityServiceException("The value of '" + Environment.SECURITY_SERVICE_CONTEXT_TIMEOUT + "' must be specified as a long");
+ }
+ }
+ }
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityServiceFactory.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityServiceFactory.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/SecurityServiceFactory.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -2,17 +2,17 @@
* 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
@@ -28,7 +28,7 @@
public class SecurityServiceFactory
{
private static Logger log = Logger.getLogger(SecurityServiceFactory.class);
-
+
private static SecurityService instance;
private SecurityServiceFactory() { }
@@ -52,11 +52,12 @@
log.info("Using [" + className + "] as the SecurityService implementation.");
Class<?> securityClass = ClassUtil.forName(className, SecurityService.class);
service = (SecurityService) securityClass.newInstance();
- }
+ service.configure();
+ }
catch (ClassNotFoundException e)
{
throw new ConfigurationException("SecurityService Implementation=" + className + " not found", e);
- }
+ }
catch (Exception e)
{
throw new ConfigurationException("Invocation exception. " + e.getLocalizedMessage(), e);
@@ -64,5 +65,5 @@
instance = service;
return service;
}
-
+
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/AuthenticationRequestImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/AuthenticationRequestImpl.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/AuthenticationRequestImpl.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -41,6 +41,8 @@
{
private static final long serialVersionUID = 1L;
+ private static transient ThreadLocal<byte[]> encryptedAuthRequest = new ThreadLocal<byte[]>();
+
private Principal principal;
private Set<?> credentials;
private Map<String,?> properties;
@@ -69,7 +71,17 @@
return principal;
}
- public static class Builder
+ public static byte[] getEncryptedAuthRequest()
+ {
+ return encryptedAuthRequest.get();
+ }
+
+ public static void setEncryptedAuthRequest(byte[] encryptedAuthRequest)
+ {
+ AuthenticationRequestImpl.encryptedAuthRequest.set(encryptedAuthRequest);
+ }
+
+ public static class Builder
{
private Principal principal;
private Set<Object> credentials = new HashSet<Object>();
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login)
Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,83 +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.login;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.jboss.internal.soa.esb.services.security.EsbCallbackHandler;
-import org.jboss.security.auth.callback.ObjectCallback;
-import org.jboss.soa.esb.services.security.SecurityConfig;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-
-public class CertCallbackHandler implements EsbCallbackHandler
-{
- private String keyStoreAlias;
- private char[] keyPassword;
- private AuthenticationRequest authRequest;
-
- public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- if (callbacks[i] instanceof NameCallback)
- {
- NameCallback nameCallback = (NameCallback) callbacks[i];
- nameCallback.setName(keyStoreAlias);
- }
- else if (callbacks[i] instanceof PasswordCallback)
- {
- PasswordCallback passwordCallback = (PasswordCallback) callbacks[i];
- passwordCallback.setPassword(keyPassword);
- }
- else if (callbacks[i] instanceof ObjectCallback)
- {
- ObjectCallback objectCallback = (ObjectCallback) callbacks[i];
- objectCallback.setCredential(authRequest.getCredentials());
- }
- }
- }
-
- public void setAuthenticationRequest(AuthenticationRequest authRequest)
- {
- this.authRequest = authRequest;
- }
-
- public void setSecurityConfig(final SecurityConfig config)
- {
- if (config != null)
- {
- Map<String, String> properties = config.getProperties();
- this.keyStoreAlias = properties.get("alias");
-
- String keyPass = properties.get("keyPassword");
- if (keyPass != null)
- this.keyPassword = keyPass.toCharArray();
-
- keyPass = null;
- }
- }
-}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertCallbackHandler.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,83 @@
+/*
+ * 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.login;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.jboss.internal.soa.esb.services.security.EsbCallbackHandler;
+import org.jboss.security.auth.callback.ObjectCallback;
+import org.jboss.soa.esb.services.security.SecurityConfig;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
+
+public class CertCallbackHandler implements EsbCallbackHandler
+{
+ private String keyStoreAlias;
+ private char[] keyPassword;
+ private AuthenticationRequest authRequest;
+
+ public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ for (int i = 0; i < callbacks.length; i++)
+ {
+ if (callbacks[i] instanceof NameCallback)
+ {
+ NameCallback nameCallback = (NameCallback) callbacks[i];
+ nameCallback.setName(keyStoreAlias);
+ }
+ else if (callbacks[i] instanceof PasswordCallback)
+ {
+ PasswordCallback passwordCallback = (PasswordCallback) callbacks[i];
+ passwordCallback.setPassword(keyPassword);
+ }
+ else if (callbacks[i] instanceof ObjectCallback)
+ {
+ ObjectCallback objectCallback = (ObjectCallback) callbacks[i];
+ objectCallback.setCredential(authRequest.getCredentials());
+ }
+ }
+ }
+
+ public void setAuthenticationRequest(AuthenticationRequest authRequest)
+ {
+ this.authRequest = authRequest;
+ }
+
+ public void setSecurityConfig(final SecurityConfig config)
+ {
+ if (config != null)
+ {
+ Map<String, String> properties = config.getProperties();
+ this.keyStoreAlias = properties.get("alias");
+
+ String keyPass = properties.get("keyPassword");
+ if (keyPass != null)
+ this.keyPassword = keyPass.toCharArray();
+
+ keyPass = null;
+ }
+ }
+}
Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,483 +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.login;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.InvalidKeyException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Principal;
-import java.security.SignatureException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.login.LoginException;
-import javax.security.auth.spi.LoginModule;
-
-import org.apache.log4j.Logger;
-import org.jboss.security.auth.callback.ObjectCallback;
-import org.jboss.soa.esb.services.security.principals.Group;
-import org.jboss.soa.esb.services.security.principals.Role;
-import org.jboss.soa.esb.services.security.principals.User;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * A JAAS Login module that performs authentication by verifying that the
- * certificate that is passed to the ESB by the calling client can be verified
- * against a certificate in a local keystore.
- * <p/>
- *
- * Usage:
- * <pre>
- * CertLogin {
- * org.jboss.soa.esb.services.security.auth.login.CertificateLoginModule required keyStoreURL="file://keystore" keyStorePassword="jbossesb" rolesPropertiesFile="file://roles.properties";
- * };
- * </pre>
- *
- * Option description:
- * <lu>
- * <li>keyStoreURL - URL or simply a path to a file on the local file system or on the classpath</li>
- * <li>keyStorePassword - password for the above keystore</li>
- * <li>rolesPropertiesFile - URL or simply a path to a file on the local file sytem of on the classpath that contains user to role mappings:
- * user=role1,role2
- * </li>
- * </lu>
- *
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- *
- */
-public class CertificateLoginModule implements LoginModule
-{
- public static final String KEYSTORE_URL = "keyStoreURL";
- public static final String KEYSTORE_PASSWORD = "keyStorePassword";
- public static final String KEYSTORE_TYPE = "keyStoreType";
- public static final String ROLE_PROPERTIES = "rolesPropertiesFile";
-
- private Logger log = Logger.getLogger(CertificateLoginModule.class);
-
- private Subject subject;
- private CallbackHandler callbackHandler;
- private Map<String, ?> options;
- private X509Certificate verifiedCertificate;
-
- /**
- * Initialized this login module. Simple stores the passed in fields and also validates the options.
- *
- * @param subject The subject to authenticate/populate.
- * @param callbackHandler The callbackhandler that will gather information required by this login module.
- * @param sharedState State that is shared with other login modules. Used when modules are chained/stacked.
- * @param options The options that were specified for this login module. See "Usage" section of this types javadoc.
- */
- public void initialize(final Subject subject, final CallbackHandler callbackHandler, final Map<String, ?> sharedState, final Map<String, ?> options)
- {
- this.subject = subject;
- this.callbackHandler = callbackHandler;
- this.options = options;
- }
-
- /**
- * Login performs the verification of the callers certificate against the alias
- * that that is provided by the callback handler.
- *
- * @return true If the login was successful otherwise false.
- * @throws LoginException If an error occurs while trying to perform the authentication.
- */
- public boolean login() throws LoginException
- {
- assertOptions(options);
- assertCallbackHandler(callbackHandler);
-
- final NameCallback aliasCallback = new NameCallback("Key Alias: ");
- final PasswordCallback passwordCallback = new PasswordCallback("Key Password", false);
- final ObjectCallback objectCallback = new ObjectCallback("Certificate: ");
-
- try
- {
- // get information from caller
- callbackHandler.handle(new Callback[]{aliasCallback, passwordCallback, objectCallback});
- }
- catch (final IOException e)
- {
- throw new LoginException("Failed to invoke callback: "+ e.toString());
- }
- catch (final UnsupportedCallbackException e)
- {
- throw new LoginException("CallbackHandler does not support: " + e.getCallback());
- }
-
- final X509Certificate callerCert = getCallerCertificate(objectCallback);
- final String alias = getAlias(aliasCallback);
- final KeyStore keyStore = loadKeyStore();
- try
- {
- // get the certificate that matches the alias from the keystore
- final Certificate esbCertificate = keyStore.getCertificate(alias);
- if (esbCertificate == null)
- {
- throw new LoginException("No certificate found in keystore for alias '" + alias + "'");
- }
- // verify that the caller supplied certificate was signed using the public key in our keystore.
- callerCert.verify(esbCertificate.getPublicKey());
-
- // set the verified certificate. Will be used in commit to add principals to the subject.
- this.verifiedCertificate = callerCert;
- return true;
- }
- catch (final KeyStoreException e)
- {
- throw new LoginException("KeystoreException : " + e.getMessage());
- }
- catch (final NoSuchAlgorithmException e)
- {
- throw new LoginException("NoSuchAlgorithmException : " + e.getMessage());
- }
- catch (final InvalidKeyException e)
- {
- throw new LoginException("InvalidKeyExcpetion : " + e.getMessage());
- }
- catch (final NoSuchProviderException e)
- {
- throw new LoginException("NoSuchProviderException : " + e.getMessage());
- }
- catch (final SignatureException e)
- {
- throw new LoginException("SignatureException : " + e.getMessage());
- }
- catch (final CertificateException e)
- {
- throw new LoginException("CertificateException : " + e.getMessage());
- }
- }
-
- /**
- * If the login was successful this method adds principals and roles to the subject.
- * When adding a Principal we simply use the Common Name(CN) from the Distinguished Name(DN).
- *
- */
- public boolean commit() throws LoginException
- {
- if (verifiedCertificate == null)
- {
- return false;
- }
- else
- {
- final Set<Principal> principals = subject.getPrincipals();
- String name = verifiedCertificate.getSubjectX500Principal().getName();
- // get the CN from the DN.
- name = name.substring(name.indexOf('=') + 1, name.indexOf(','));
- final User authenticatedPrincipal = new User(name);
- principals.add(authenticatedPrincipal);
-
- addRoles(subject, authenticatedPrincipal, verifiedCertificate, Collections.unmodifiableMap(options));
- return true;
- }
- }
-
- public boolean abort() throws LoginException
- {
- return false;
- }
-
- public boolean logout() throws LoginException
- {
- verifiedCertificate = null;
- return false;
- }
-
- /**
- * The addRoles method add roles to the authenticated subject.
- * This method is protected to let users easliy override only this method if they
- * need a different behaviour.
- *
- * @param subject The subject
- * @param principal The authenticated principal
- * @param cert The certificate that of the authenticated principal
- * @param options The options that were specified to this login module.
- * @throws LoginException
- */
- protected void addRoles(final Subject subject, final Principal principal, final X509Certificate cert, final Map<String, ?> options) throws LoginException
- {
- final String roleProperties = (String) options.get(ROLE_PROPERTIES);
- if (roleProperties == null)
- {
- log.warn("No " + ROLE_PROPERTIES + " was specified hence no roles will be added.");
- }
- else
- {
- InputStream resourceAsStream = getResourceAsStream(roleProperties, getClass());
- try
- {
- resourceAsStream = getResourceAsStream(roleProperties, getClass());
- if (resourceAsStream == null )
- {
- throw new LoginException(ROLE_PROPERTIES + " was specified as '" + roleProperties + "' but could not be located on the local file system or on the classpath. Please check the configuration.");
- }
- final Properties roles = new Properties();
- // load the roles properties file
- roles.load(resourceAsStream);
-
- // get the list of roles specified for the authenticated principal
- final String listOfRoles = (String)roles.get(principal.getName());
- if (listOfRoles != null )
- {
- log.debug("Roles for " + principal.getName() + " [" + listOfRoles + "]");
- for (String role : listOfRoles.split(","))
- {
- addRole(role, subject);
- }
- }
- }
- catch (final IOException e)
- {
- throw new LoginException("IOException while trying to read properties from '" + roleProperties + "'");
- }
- finally
- {
- try { resourceAsStream.close(); } catch (final IOException ignore) { log.error(ignore.getMessage(), ignore);}
- }
- }
- }
-
- private void addRole(final String roleName, final Subject subject )
- {
- if (roleName != null)
- {
- final Role role = new Role(roleName);
- final Set<Group> principals = subject.getPrincipals(Group.class);
- if ( principals.isEmpty() )
- {
- final Group group = new Group("Roles");
- group.addMember(role);
- subject.getPrincipals().add(group);
- }
- else
- {
- for (Group groups : principals)
- {
- if ( "Roles".equals(groups.getName()) )
- {
- groups.addMember(role);
- }
- }
- }
- }
- }
-
- /**
- * Assert that the required options have been specified for this login module.
- * Mandatory options are:
- * <lu>
- * <li>keyStoreURL</li>
- * <li>keyStorePassword</li>
- * </lu>
- * @param options The options that were specified.
- * @throws LoginException If a mandatory option was missing.
- */
- void assertOptions(final Map<String, ?> options) throws LoginException
- {
- if (options == null || options.isEmpty() || !options.containsKey(KEYSTORE_URL) || !options.containsKey(KEYSTORE_PASSWORD))
- {
- throw new LoginException(getMissingRequiredOptionString(options));
- }
- }
-
- private KeyStore loadKeyStore() throws LoginException
- {
- final String keyStorePath = (String)options.get(KEYSTORE_URL);
- KeyStore keystore = null;
- InputStream in = null;
- try
- {
- String keyStoreType = (String)options.get(KEYSTORE_TYPE);
- if (keyStoreType == null)
- {
- keyStoreType = KeyStore.getDefaultType();
- }
-
- keystore = KeyStore.getInstance(keyStoreType);
- in = getResourceAsStream(keyStorePath, getClass());
- if (in == null)
- {
- throw new LoginException("Could not open a stream to the keystore '" + keyStorePath + "'");
- }
- keystore.load(in, ((String)options.get(KEYSTORE_PASSWORD)).toCharArray());
-
- log.info("Successfully loaded keystore: '" + keyStorePath + "'");
- }
- catch (final KeyStoreException e)
- {
- throw new LoginException("KeyStoreException while trying to load keystore '" + keyStorePath + "': " + e.getMessage());
- }
- catch (NoSuchAlgorithmException e)
- {
- throw new LoginException("NoSuchAlgorithm while trying to load keystore '" + keyStorePath + "': " + e.getMessage());
- }
- catch (CertificateException e)
- {
- throw new LoginException("CertificateException while trying to load keystore '" + keyStorePath + "': " + e.getMessage());
- }
- catch (IOException e)
- {
- throw new LoginException("IOException while trying to load keystore '" + keyStorePath + "': " + e.getMessage());
- }
- finally
- {
- if (in != null) { try { in.close(); } catch (final IOException e) { log.error("Error while closing stream to keystore '" + keyStorePath + "'", e); } }
- }
- return keystore;
- }
-
- /**
- * Get an string contain the options that were missing in the configuration
- * for this login module.
- *
- * @param options The map of options that were specified for this login module.
- * @return String A string that contains only the options that were not specified.
- */
- private String getMissingRequiredOptionString(final Map<String, ?> options)
- {
-
- final StringBuilder sb = new StringBuilder();
- sb.append("Options missing [");
-
- if (options == null || !options.containsKey(KEYSTORE_URL))
- {
- sb.append(KEYSTORE_URL).append(", ");
- }
-
- if (options == null || !options.containsKey(KEYSTORE_PASSWORD))
- {
- sb.append(KEYSTORE_PASSWORD).append(",");
- }
-
- sb.append("]");
-
- return sb.toString();
- }
-
- private void assertCallbackHandler(final CallbackHandler handler) throws LoginException
- {
- if (callbackHandler == null)
- {
- throw new LoginException("No callback handler was specified for CertificateLoginModule.");
- }
- }
-
- private X509Certificate getCallerCertificate(final ObjectCallback objectCallback) throws LoginException
- {
- final Set<?> credentials = (Set<?>) objectCallback.getCredential();
- if (credentials == null || credentials.isEmpty())
- {
- throw new LoginException("No X509Certificate was passed to the login module");
- }
-
- X509Certificate callerCert = null;
- for (Object object : credentials)
- {
- if (object instanceof X509Certificate)
- {
- callerCert = (X509Certificate) object;
- break;
- }
- }
-
- if (callerCert == null)
- {
- throw new LoginException("No X509Certificate was passed to the login module");
- }
-
- return callerCert;
- }
-
- private String getAlias(final NameCallback callback) throws LoginException
- {
- final String alias = callback.getName();
- if (alias == null)
- {
- throw new LoginException("No X509Certificate was passed to the login module");
- }
- else
- {
- return callback.getName();
- }
- }
-
- /**
- * Get the specified resource as a stream. First try the resource as a file
- * from the file system, and if not found try the classpath.
- * <p/>
- * The method performs the file system search but delegates the classpath
- * lookup to {@link ClassUtil}.
- *
- * @param resourceName The name of the class to load.
- * @param caller The class of the caller.
- * @return The input stream for the resource or null if not found.
- */
- private InputStream getResourceAsStream(final String resourceName, final Class<?> caller)
- {
- URL fileUrl = null;
- File file = null;
- try
- {
- // try to parse the resouceName as an url.
- fileUrl = new URL(resourceName);
- file = new File(fileUrl.getFile());
- }
- catch (MalformedURLException ignored)
- {
- file = new File(resourceName);
- }
-
- if (file.exists() && file.isFile())
- {
- try
- {
- return new FileInputStream(file);
- }
- catch (final FileNotFoundException ignore)
- {
- // will revert to looking for the resource using the classpath
- }
- }
- return ClassUtil.getResourceAsStream(resourceName, caller);
- }
-
-}
Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModule.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,483 @@
+/*
+ * 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.login;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.InvalidKeyException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.Principal;
+import java.security.SignatureException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
+
+import org.apache.log4j.Logger;
+import org.jboss.security.auth.callback.ObjectCallback;
+import org.jboss.soa.esb.services.security.principals.Group;
+import org.jboss.soa.esb.services.security.principals.Role;
+import org.jboss.soa.esb.services.security.principals.User;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * A JAAS Login module that performs authentication by verifying that the
+ * certificate that is passed to the ESB by the calling client can be verified
+ * against a certificate in a local keystore.
+ * <p/>
+ *
+ * Usage:
+ * <pre>
+ * CertLogin {
+ * org.jboss.soa.esb.services.security.auth.login.CertificateLoginModule required keyStoreURL="file://keystore" keyStorePassword="jbossesb" rolesPropertiesFile="file://roles.properties";
+ * };
+ * </pre>
+ *
+ * Option description:
+ * <lu>
+ * <li>keyStoreURL - URL or simply a path to a file on the local file system or on the classpath</li>
+ * <li>keyStorePassword - password for the above keystore</li>
+ * <li>rolesPropertiesFile - URL or simply a path to a file on the local file sytem of on the classpath that contains user to role mappings:
+ * user=role1,role2
+ * </li>
+ * </lu>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class CertificateLoginModule implements LoginModule
+{
+ public static final String KEYSTORE_URL = "keyStoreURL";
+ public static final String KEYSTORE_PASSWORD = "keyStorePassword";
+ public static final String KEYSTORE_TYPE = "keyStoreType";
+ public static final String ROLE_PROPERTIES = "rolesPropertiesFile";
+
+ private Logger log = Logger.getLogger(CertificateLoginModule.class);
+
+ private Subject subject;
+ private CallbackHandler callbackHandler;
+ private Map<String, ?> options;
+ private X509Certificate verifiedCertificate;
+
+ /**
+ * Initialized this login module. Simple stores the passed in fields and also validates the options.
+ *
+ * @param subject The subject to authenticate/populate.
+ * @param callbackHandler The callbackhandler that will gather information required by this login module.
+ * @param sharedState State that is shared with other login modules. Used when modules are chained/stacked.
+ * @param options The options that were specified for this login module. See "Usage" section of this types javadoc.
+ */
+ public void initialize(final Subject subject, final CallbackHandler callbackHandler, final Map<String, ?> sharedState, final Map<String, ?> options)
+ {
+ this.subject = subject;
+ this.callbackHandler = callbackHandler;
+ this.options = options;
+ }
+
+ /**
+ * Login performs the verification of the callers certificate against the alias
+ * that that is provided by the callback handler.
+ *
+ * @return true If the login was successful otherwise false.
+ * @throws LoginException If an error occurs while trying to perform the authentication.
+ */
+ public boolean login() throws LoginException
+ {
+ assertOptions(options);
+ assertCallbackHandler(callbackHandler);
+
+ final NameCallback aliasCallback = new NameCallback("Key Alias: ");
+ final PasswordCallback passwordCallback = new PasswordCallback("Key Password", false);
+ final ObjectCallback objectCallback = new ObjectCallback("Certificate: ");
+
+ try
+ {
+ // get information from caller
+ callbackHandler.handle(new Callback[]{aliasCallback, passwordCallback, objectCallback});
+ }
+ catch (final IOException e)
+ {
+ throw new LoginException("Failed to invoke callback: "+ e.toString());
+ }
+ catch (final UnsupportedCallbackException e)
+ {
+ throw new LoginException("CallbackHandler does not support: " + e.getCallback());
+ }
+
+ final X509Certificate callerCert = getCallerCertificate(objectCallback);
+ final String alias = getAlias(aliasCallback);
+ final KeyStore keyStore = loadKeyStore();
+ try
+ {
+ // get the certificate that matches the alias from the keystore
+ final Certificate esbCertificate = keyStore.getCertificate(alias);
+ if (esbCertificate == null)
+ {
+ throw new LoginException("No certificate found in keystore for alias '" + alias + "'");
+ }
+ // verify that the caller supplied certificate was signed using the public key in our keystore.
+ callerCert.verify(esbCertificate.getPublicKey());
+
+ // set the verified certificate. Will be used in commit to add principals to the subject.
+ this.verifiedCertificate = callerCert;
+ return true;
+ }
+ catch (final KeyStoreException e)
+ {
+ throw new LoginException("KeystoreException : " + e.getMessage());
+ }
+ catch (final NoSuchAlgorithmException e)
+ {
+ throw new LoginException("NoSuchAlgorithmException : " + e.getMessage());
+ }
+ catch (final InvalidKeyException e)
+ {
+ throw new LoginException("InvalidKeyExcpetion : " + e.getMessage());
+ }
+ catch (final NoSuchProviderException e)
+ {
+ throw new LoginException("NoSuchProviderException : " + e.getMessage());
+ }
+ catch (final SignatureException e)
+ {
+ throw new LoginException("SignatureException : " + e.getMessage());
+ }
+ catch (final CertificateException e)
+ {
+ throw new LoginException("CertificateException : " + e.getMessage());
+ }
+ }
+
+ /**
+ * If the login was successful this method adds principals and roles to the subject.
+ * When adding a Principal we simply use the Common Name(CN) from the Distinguished Name(DN).
+ *
+ */
+ public boolean commit() throws LoginException
+ {
+ if (verifiedCertificate == null)
+ {
+ return false;
+ }
+ else
+ {
+ final Set<Principal> principals = subject.getPrincipals();
+ String name = verifiedCertificate.getSubjectX500Principal().getName();
+ // get the CN from the DN.
+ name = name.substring(name.indexOf('=') + 1, name.indexOf(','));
+ final User authenticatedPrincipal = new User(name);
+ principals.add(authenticatedPrincipal);
+
+ addRoles(subject, authenticatedPrincipal, verifiedCertificate, Collections.unmodifiableMap(options));
+ return true;
+ }
+ }
+
+ public boolean abort() throws LoginException
+ {
+ return false;
+ }
+
+ public boolean logout() throws LoginException
+ {
+ verifiedCertificate = null;
+ return false;
+ }
+
+ /**
+ * The addRoles method add roles to the authenticated subject.
+ * This method is protected to let users easliy override only this method if they
+ * need a different behaviour.
+ *
+ * @param subject The subject
+ * @param principal The authenticated principal
+ * @param cert The certificate that of the authenticated principal
+ * @param options The options that were specified to this login module.
+ * @throws LoginException
+ */
+ protected void addRoles(final Subject subject, final Principal principal, final X509Certificate cert, final Map<String, ?> options) throws LoginException
+ {
+ final String roleProperties = (String) options.get(ROLE_PROPERTIES);
+ if (roleProperties == null)
+ {
+ log.warn("No " + ROLE_PROPERTIES + " was specified hence no roles will be added.");
+ }
+ else
+ {
+ InputStream resourceAsStream = getResourceAsStream(roleProperties, getClass());
+ try
+ {
+ resourceAsStream = getResourceAsStream(roleProperties, getClass());
+ if (resourceAsStream == null )
+ {
+ throw new LoginException(ROLE_PROPERTIES + " was specified as '" + roleProperties + "' but could not be located on the local file system or on the classpath. Please check the configuration.");
+ }
+ final Properties roles = new Properties();
+ // load the roles properties file
+ roles.load(resourceAsStream);
+
+ // get the list of roles specified for the authenticated principal
+ final String listOfRoles = (String)roles.get(principal.getName());
+ if (listOfRoles != null )
+ {
+ log.debug("Roles for " + principal.getName() + " [" + listOfRoles + "]");
+ for (String role : listOfRoles.split(","))
+ {
+ addRole(role, subject);
+ }
+ }
+ }
+ catch (final IOException e)
+ {
+ throw new LoginException("IOException while trying to read properties from '" + roleProperties + "'");
+ }
+ finally
+ {
+ try { resourceAsStream.close(); } catch (final IOException ignore) { log.error(ignore.getMessage(), ignore);}
+ }
+ }
+ }
+
+ private void addRole(final String roleName, final Subject subject )
+ {
+ if (roleName != null)
+ {
+ final Role role = new Role(roleName);
+ final Set<Group> principals = subject.getPrincipals(Group.class);
+ if ( principals.isEmpty() )
+ {
+ final Group group = new Group("Roles");
+ group.addMember(role);
+ subject.getPrincipals().add(group);
+ }
+ else
+ {
+ for (Group groups : principals)
+ {
+ if ( "Roles".equals(groups.getName()) )
+ {
+ groups.addMember(role);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Assert that the required options have been specified for this login module.
+ * Mandatory options are:
+ * <lu>
+ * <li>keyStoreURL</li>
+ * <li>keyStorePassword</li>
+ * </lu>
+ * @param options The options that were specified.
+ * @throws LoginException If a mandatory option was missing.
+ */
+ void assertOptions(final Map<String, ?> options) throws LoginException
+ {
+ if (options == null || options.isEmpty() || !options.containsKey(KEYSTORE_URL) || !options.containsKey(KEYSTORE_PASSWORD))
+ {
+ throw new LoginException(getMissingRequiredOptionString(options));
+ }
+ }
+
+ private KeyStore loadKeyStore() throws LoginException
+ {
+ final String keyStorePath = (String)options.get(KEYSTORE_URL);
+ KeyStore keystore = null;
+ InputStream in = null;
+ try
+ {
+ String keyStoreType = (String)options.get(KEYSTORE_TYPE);
+ if (keyStoreType == null)
+ {
+ keyStoreType = KeyStore.getDefaultType();
+ }
+
+ keystore = KeyStore.getInstance(keyStoreType);
+ in = getResourceAsStream(keyStorePath, getClass());
+ if (in == null)
+ {
+ throw new LoginException("Could not open a stream to the keystore '" + keyStorePath + "'");
+ }
+ keystore.load(in, ((String)options.get(KEYSTORE_PASSWORD)).toCharArray());
+
+ log.info("Successfully loaded keystore: '" + keyStorePath + "'");
+ }
+ catch (final KeyStoreException e)
+ {
+ throw new LoginException("KeyStoreException while trying to load keystore '" + keyStorePath + "': " + e.getMessage());
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ throw new LoginException("NoSuchAlgorithm while trying to load keystore '" + keyStorePath + "': " + e.getMessage());
+ }
+ catch (CertificateException e)
+ {
+ throw new LoginException("CertificateException while trying to load keystore '" + keyStorePath + "': " + e.getMessage());
+ }
+ catch (IOException e)
+ {
+ throw new LoginException("IOException while trying to load keystore '" + keyStorePath + "': " + e.getMessage());
+ }
+ finally
+ {
+ if (in != null) { try { in.close(); } catch (final IOException e) { log.error("Error while closing stream to keystore '" + keyStorePath + "'", e); } }
+ }
+ return keystore;
+ }
+
+ /**
+ * Get an string contain the options that were missing in the configuration
+ * for this login module.
+ *
+ * @param options The map of options that were specified for this login module.
+ * @return String A string that contains only the options that were not specified.
+ */
+ private String getMissingRequiredOptionString(final Map<String, ?> options)
+ {
+
+ final StringBuilder sb = new StringBuilder();
+ sb.append("Options missing [");
+
+ if (options == null || !options.containsKey(KEYSTORE_URL))
+ {
+ sb.append(KEYSTORE_URL).append(", ");
+ }
+
+ if (options == null || !options.containsKey(KEYSTORE_PASSWORD))
+ {
+ sb.append(KEYSTORE_PASSWORD).append(",");
+ }
+
+ sb.append("]");
+
+ return sb.toString();
+ }
+
+ private void assertCallbackHandler(final CallbackHandler handler) throws LoginException
+ {
+ if (callbackHandler == null)
+ {
+ throw new LoginException("No callback handler was specified for CertificateLoginModule.");
+ }
+ }
+
+ private X509Certificate getCallerCertificate(final ObjectCallback objectCallback) throws LoginException
+ {
+ final Set<?> credentials = (Set<?>) objectCallback.getCredential();
+ if (credentials == null || credentials.isEmpty())
+ {
+ throw new LoginException("No X509Certificate was passed to the login module");
+ }
+
+ X509Certificate callerCert = null;
+ for (Object object : credentials)
+ {
+ if (object instanceof X509Certificate)
+ {
+ callerCert = (X509Certificate) object;
+ break;
+ }
+ }
+
+ if (callerCert == null)
+ {
+ throw new LoginException("No X509Certificate was passed to the login module");
+ }
+
+ return callerCert;
+ }
+
+ private String getAlias(final NameCallback callback) throws LoginException
+ {
+ final String alias = callback.getName();
+ if (alias == null)
+ {
+ throw new LoginException("No X509Certificate was passed to the login module");
+ }
+ else
+ {
+ return callback.getName();
+ }
+ }
+
+ /**
+ * Get the specified resource as a stream. First try the resource as a file
+ * from the file system, and if not found try the classpath.
+ * <p/>
+ * The method performs the file system search but delegates the classpath
+ * lookup to {@link ClassUtil}.
+ *
+ * @param resourceName The name of the class to load.
+ * @param caller The class of the caller.
+ * @return The input stream for the resource or null if not found.
+ */
+ private InputStream getResourceAsStream(final String resourceName, final Class<?> caller)
+ {
+ URL fileUrl = null;
+ File file = null;
+ try
+ {
+ // try to parse the resouceName as an url.
+ fileUrl = new URL(resourceName);
+ file = new File(fileUrl.getFile());
+ }
+ catch (MalformedURLException ignored)
+ {
+ file = new File(resourceName);
+ }
+
+ if (file.exists() && file.isFile())
+ {
+ try
+ {
+ return new FileInputStream(file);
+ }
+ catch (final FileNotFoundException ignore)
+ {
+ // will revert to looking for the resource using the classpath
+ }
+ }
+ return ClassUtil.getResourceAsStream(resourceName, caller);
+ }
+
+}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/util/CryptoUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/util/CryptoUtil.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/security/util/CryptoUtil.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -21,6 +21,7 @@
package org.jboss.soa.esb.services.security.util;
import java.security.InvalidKeyException;
+import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
@@ -41,7 +42,7 @@
{
private CryptoUtil() {}
- public static byte[] decrypt(final byte[] bytes, final PrivateKey key, final String transformation) throws SecurityServiceException
+ public static byte[] decrypt(final byte[] bytes, final Key key, final String transformation) throws SecurityServiceException
{
try
{
@@ -71,7 +72,7 @@
}
}
- public static byte[] encrypt(byte[] text, PublicKey key, String transformation) throws SecurityServiceException
+ public static byte[] encrypt(byte[] text, Key key, String transformation) throws SecurityServiceException
{
try
{
Modified: labs/jbossesb/trunk/product/rosetta/tests/build.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/build.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -26,6 +26,9 @@
<property name="org.jboss.esb.ftp.lib.dir" location="${org.jboss.esb.root.dir}/ftp/lib"/>
<path id="org.jboss.esb.tests.base.classpath">
+ <!-- added these first two jar explicetly to get the security features working -->
+ <fileset dir="${org.jboss.esb.lib.dir}" includes="jaxr-api*.jar"/>
+ <fileset dir="${org.jboss.esb.lib.dir}" includes="jbossall-client-*.jar"/>
<fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
<fileset dir="${org.jboss.esb.lib.dir}" includes="*.jar"/>
<fileset dir="${org.jboss.esb.root.dir}/../testlib" includes="*.jar"/>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierUnitTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/JmsCourierUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,316 @@
+/*
+ * 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.couriers;
+
+import static org.junit.Assert.fail;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.CourierTransportException;
+import org.jboss.soa.esb.helpers.NamingContextPool;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockejb.jms.MockQueue;
+import org.mockejb.jms.QueueConnectionFactoryImpl;
+import org.mockejb.jndi.MockContextFactory;
+
+/**
+ * JmsCourier unit tests.
+ *
+ * @author <a href="mailto:kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class JmsCourierUnitTest
+{
+ private static final String CONNECTION_FACTORY = "ConnectionFactory" ;
+ private static final String QUEUE_NAME = "failQueue" ;
+
+ private JMSEpr testEPR ;
+
+ @Before
+ public void setUp()
+ throws Exception
+ {
+ MockContextFactory.setAsInitial();
+
+ final Context ctx = NamingContextPool.getNamingContext(null);
+ try
+ {
+ ctx.rebind(CONNECTION_FACTORY, new MockQueueConnectionFactory());
+ ctx.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
+ }
+ finally
+ {
+ NamingContextPool.releaseNamingContext(ctx) ;
+ }
+ testEPR = new JMSEpr(JMSEpr.QUEUE_TYPE, QUEUE_NAME, CONNECTION_FACTORY) ;
+ testEPR.getAddr().addExtension(Context.INITIAL_CONTEXT_FACTORY, System.getProperty(Context.INITIAL_CONTEXT_FACTORY)) ;
+ }
+
+ @After
+ public void tearDown()
+ throws Exception
+ {
+ MockContextFactory.revertSetAsInitial();
+ }
+
+ @Test(timeout=10000)
+ public void testDelivery()
+ throws Exception
+ {
+ final JmsCourier courier = new JmsCourier(testEPR) ;
+ try
+ {
+ courier.deliver(MessageFactory.getInstance().getMessage()) ;
+ fail("Expected to receive a CourierTransportException") ;
+ }
+ catch (final CourierTransportException cte) {} // expected
+ }
+
+ @Test(timeout=10000)
+ public void testPickup()
+ throws Exception
+ {
+ final JmsCourier courier = new JmsCourier(testEPR, true) ;
+ try
+ {
+ courier.pickup(10) ;
+ fail("Expected to receive a CourierTransportException") ;
+ }
+ catch (final CourierTransportException cte) {} // expected
+ }
+
+ private static final class MockQueueConnectionFactory extends QueueConnectionFactoryImpl
+ {
+ @Override
+ public QueueConnection createQueueConnection() throws JMSException
+ {
+ return (QueueConnection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {QueueConnection.class},
+ new MockQueueExceptionHandlerInvocationHandler(super.createQueueConnection())) ;
+ }
+ }
+
+ private static final class MockQueueExceptionHandlerInvocationHandler implements InvocationHandler
+ {
+ private final QueueConnection queueConnection ;
+ private ExceptionListener exceptionListener ;
+
+ MockQueueExceptionHandlerInvocationHandler(final QueueConnection queueConnection)
+ {
+ this.queueConnection = queueConnection ;
+ }
+
+ public Object invoke(final Object proxy, final Method method, final Object[] args)
+ throws Throwable
+ {
+ final String methodName = method.getName() ;
+ if ("setExceptionListener".equals(methodName))
+ {
+ exceptionListener = (ExceptionListener)args[0] ;
+ return null ;
+ }
+ else if ("getExceptionListener".equals(methodName))
+ {
+ return exceptionListener ;
+ }
+ else
+ {
+ final Object response = method.invoke(queueConnection, args) ;
+ if (response instanceof QueueSession)
+ {
+ final QueueSession queueSession = (QueueSession)response ;
+ return (QueueSession)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {QueueSession.class},
+ new MockQueueSessionInvocationHandler(queueSession)) ;
+ }
+ else
+ {
+ return response ;
+ }
+ }
+ }
+ }
+
+ private static final class MockQueueSessionInvocationHandler implements InvocationHandler
+ {
+ private final QueueSession queueSession ;
+
+ MockQueueSessionInvocationHandler(final QueueSession queueSession)
+ {
+ this.queueSession = queueSession ;
+ }
+
+ public Object invoke(final Object proxy, final Method method, final Object[] args)
+ throws Throwable
+ {
+ final String methodName = method.getName() ;
+ if ("recover".equals(methodName))
+ {
+ return null ;
+ }
+ else if ("createConsumer".equals(methodName))
+ {
+ return new MockFailMessageConsumer() ;
+ }
+ else if ("createProducer".equals(methodName))
+ {
+ return new MockFailMessageProducer() ;
+ }
+ else
+ {
+ return method.invoke(queueSession, args) ;
+ }
+ }
+ }
+
+ private static final class MockFailMessageConsumer implements MessageConsumer
+ {
+ public void close() throws JMSException {}
+
+ public MessageListener getMessageListener()
+ throws JMSException
+ {
+ return null;
+ }
+
+ public String getMessageSelector()
+ throws JMSException
+ {
+ return null;
+ }
+
+ public Message receive()
+ throws JMSException
+ {
+ throw new JMSException("Deliberate receive exception") ;
+ }
+
+ public Message receive(long arg0)
+ throws JMSException
+ {
+ throw new JMSException("Deliberate receive exception") ;
+ }
+
+ public Message receiveNoWait()
+ throws JMSException
+ {
+ throw new JMSException("Deliberate receive exception") ;
+ }
+
+ public void setMessageListener(MessageListener arg0) throws JMSException {}
+ }
+
+ private static final class MockFailMessageProducer implements MessageProducer
+ {
+ public void close() throws JMSException {}
+
+ public int getDeliveryMode()
+ throws JMSException
+ {
+ return 0;
+ }
+
+ public Destination getDestination()
+ throws JMSException
+ {
+ return null;
+ }
+
+ public boolean getDisableMessageID()
+ throws JMSException
+ {
+ return false;
+ }
+
+ public boolean getDisableMessageTimestamp()
+ throws JMSException
+ {
+ return false;
+ }
+
+ public int getPriority()
+ throws JMSException
+ {
+ return 0;
+ }
+
+ public long getTimeToLive()
+ throws JMSException
+ {
+ return 0;
+ }
+
+ public void send(Message arg0)
+ throws JMSException
+ {
+ throw new JMSException("Deliberate send exception") ;
+ }
+
+ public void send(Destination arg0, Message arg1)
+ throws JMSException
+ {
+ throw new JMSException("Deliberate send exception") ;
+ }
+
+ public void send(Message arg0, int arg1, int arg2, long arg3)
+ throws JMSException
+ {
+ throw new JMSException("Deliberate send exception") ;
+ }
+
+ public void send(Destination arg0, Message arg1, int arg2, int arg3, long arg4)
+ throws JMSException
+ {
+ }
+
+ public void setDeliveryMode(int arg0) throws JMSException {}
+
+ public void setDisableMessageID(boolean arg0) throws JMSException {}
+
+ public void setDisableMessageTimestamp(boolean arg0) throws JMSException {}
+
+ public void setPriority(int arg0) throws JMSException {}
+
+ public void setTimeToLive(long arg0) throws JMSException {}
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(JmsCourierUnitTest.class);
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/InVMCourierUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -24,24 +24,36 @@
import junit.framework.Assert;
import junit.framework.JUnit4TestAdapter;
+import junit.framework.TestCase;
import org.jboss.internal.soa.esb.couriers.InVMCourier;
import org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl;
+import org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.eprs.InVMEpr;
import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierFactoryUtil;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
+import org.jboss.soa.esb.services.registry.RegistryException;
import org.junit.Test;
import java.net.URI;
import java.net.URISyntaxException;
-public class InVMCourierUnitTest {
+public class InVMCourierUnitTest extends TestCase {
+
public static junit.framework.Test suite() {
return new JUnit4TestAdapter(InVMCourierUnitTest.class);
}
+ protected void tearDown() throws Exception {
+ CourierFactoryUtil.resetCourierFactory();
+ }
+
@Test
public void testUnthreadedDeliver() throws Exception {
InVMEpr epr = new InVMEpr(new URI("invm://serviceid1"));
@@ -199,6 +211,97 @@
System.err.println("Messages per second: " + msgsPerSecond);
}
+ @Test
+ public void test_JBESB_2108_01() throws ServiceNotFoundException, RegistryException {
+ InVMRegistryInterceptor reg = new InVMRegistryInterceptor();
+ reg.setRegistry(new MockRegistry()) ;
+
+ reg.registerEPR("x", "y", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
+
+ EPR eprFromReg = reg.findEPR("x", "y");
+ InVMCourier courier = CourierFactory.getInstance().getInVMCourier((InVMEpr) eprFromReg);
+ Assert.assertNotNull(courier);
+ Assert.assertTrue(courier.isActive());
+
+ // Register the EPR again...
+ reg.registerEPR("x", "y", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
+
+ // Unregister it once...
+ reg.unRegisterEPR("x", "y", new InVMEpr(new EPR(URI.create("x://123"))));
+
+ // Should still be able to find it...
+ reg.findEPR("x", "y");
+ // Should still be able to get the courier and it should still be active...
+ Assert.assertNotNull(CourierFactory.getInstance().getInVMCourier((InVMEpr) eprFromReg));
+ Assert.assertTrue(courier.isActive());
+
+ // Unregister it again...
+ reg.unRegisterEPR("x", "y", new InVMEpr(new EPR(URI.create("x://123"))));
+
+ // Should get an error trying to find it now...
+ try {
+ reg.findEPR("x", "y");
+ Assert.fail("Expected ServiceNotFoundException.");
+ } catch(ServiceNotFoundException e) {
+ Assert.assertEquals("Registry entry [x][y] not found.", e.getMessage());
+ }
+
+ // Shouldn't be able to get the courier and it should be inactive...
+ Assert.assertNull(CourierFactory.getInstance().getInVMCourier((InVMEpr) eprFromReg));
+ Assert.assertFalse(courier.isActive());
+ }
+
+ @Test
+ public void test_JBESB_2108_02() throws ServiceNotFoundException, RegistryException {
+ InVMRegistryInterceptor reg = new InVMRegistryInterceptor();
+ reg.setRegistry(new MockRegistry()) ;
+
+ reg.registerEPR("xy", "z", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
+ try {
+ reg.registerEPR("x", "yz", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
+ Assert.fail("Expected RegistryException");
+ } catch (RegistryException e) {
+ Assert.assertEquals("Invalid attempt to register InVM EPR 'InVMEpr [ PortReference < <wsa:Address x://123/> > ]' for Service 'x:yz'. This InVM EPR is already registered for Service 'xy:z'.", e.getMessage());
+ }
+ }
+
+ @Test
+ public void test_JBESB_2108_03() throws ServiceNotFoundException, RegistryException {
+ InVMRegistryInterceptor reg = new InVMRegistryInterceptor();
+ EPR xy_z = new InVMEpr(new EPR(URI.create("x://123")));
+ EPR x_yz = new InVMEpr(new EPR(URI.create("x://1234")));
+ reg.setRegistry(new MockRegistry()) ;
+
+ // Register "xy:z"...
+ reg.registerEPR("xy", "z", "blah", xy_z, "blah");
+ Assert.assertEquals(xy_z, reg.findEPR("xy", "z"));
+ InVMCourier xy_z_courier = CourierFactory.getInstance().getInVMCourier((InVMEpr) xy_z);
+ Assert.assertNotNull(xy_z_courier);
+ Assert.assertTrue(xy_z_courier.isActive());
+
+ // Register "x:yz"...
+ reg.registerEPR("x", "yz", "blah", x_yz, "blah");
+ Assert.assertEquals(x_yz, reg.findEPR("x", "yz"));
+ InVMCourier x_yz_courier = CourierFactory.getInstance().getInVMCourier((InVMEpr) x_yz);
+ Assert.assertNotNull(x_yz_courier);
+ Assert.assertTrue(x_yz_courier.isActive());
+
+ // Unregister "xy:z"...
+ reg.unRegisterEPR("xy", "z", xy_z);
+ // Shouldn't be able to get the courier for "xy_z" and should be inactive...
+ Assert.assertNull(CourierFactory.getInstance().getInVMCourier((InVMEpr) xy_z));
+ Assert.assertFalse(xy_z_courier.isActive());
+ // Should still be able to get the courier for "x_yz" and should still be active...
+ Assert.assertNotNull(CourierFactory.getInstance().getInVMCourier((InVMEpr) x_yz));
+ Assert.assertTrue(x_yz_courier.isActive());
+
+ // Unregister "x:yz"...
+ reg.unRegisterEPR("x", "yz", x_yz);
+ // Shouldn't be able to get the courier for "x_yz" and should be inactive...
+ Assert.assertNull(CourierFactory.getInstance().getInVMCourier((InVMEpr) x_yz));
+ Assert.assertFalse(x_yz_courier.isActive());
+ }
+
/*
* test that WeakHashMap could be used to gc invmcouriers.
*
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryInterceptorUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryInterceptorUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/InVMRegistryInterceptorUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -46,7 +46,7 @@
assertEquals(1, reg.findEPRs("x", "y").size());
assertEquals("x://123", reg.findEPR("x", "y").getAddr().getAddress());
- reg.registerEPR("x", "y", "blah", new InVMEpr(new EPR(URI.create("x://1234"))), "blah");
+ reg.registerEPR("x", "y", "blah", new InVMEpr(new EPR(URI.create("x://123"))), "blah");
assertEquals(2, reg.findEPRs("x", "y").size());
reg.registerEPR("a", "z", "blah", new InVMEpr(new EPR(URI.create("x://12345"))), "blah");
@@ -56,9 +56,6 @@
assertEquals(2, reg.findAllServices().size());
assertEquals(1, reg.findServices("x").size());
- // unreg using a valid service, but unregistred EPR... make sure nothing changes...
- reg.unRegisterEPR("a", "z", new InVMEpr(new EPR(URI.create("x://1"))));
- assertEquals(1, reg.findEPRs("a", "z").size());
// unreg using a valid service + registred EPR... make sure EPR is removed...
reg.unRegisterEPR("a", "z", new InVMEpr(new EPR(URI.create("x://12345"))));
assertEquals(0, reg.findEPRs("a", "z").size());
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagatorUnitTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagatorUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagatorUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JBossASContextPropagatorUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,104 @@
+/*
+ * 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 static org.junit.Assert.*;
+
+import javax.security.auth.Subject;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.services.security.SecurityConfig;
+import org.jboss.soa.esb.services.security.SecurityConfigTestUtil;
+import org.jboss.soa.esb.services.security.SecurityConfigUtil;
+import org.jboss.soa.esb.services.security.SecurityContext;
+import org.jboss.soa.esb.services.security.principals.User;
+import org.junit.Test;
+
+import junit.framework.JUnit4TestAdapter;
+
+/**
+ * Unit test for {@link JBossASContextPropagator}.
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class JBossASContextPropagatorUnitTest
+{
+ private JBossASContextPropagator propagator = new JBossASContextPropagator();
+
+ @Test
+ public void pushAndPop()
+ {
+ final SecurityConfig securityConfig = getSecurityConfig();
+ final SecurityContext context = getSecurityContext();
+
+ propagator.pushSecurityContext(context, null, securityConfig);
+
+ Subject pushedSubject = SecurityAssociation.getSubject();
+ assertEquals(context.getSubject(), pushedSubject);
+
+ propagator.popSecurityContext(context, securityConfig);
+ pushedSubject = SecurityAssociation.getSubject();
+ assertNull(pushedSubject);
+ }
+
+ @Test
+ public void pushAndPopWithNullSecurityConfig()
+ {
+ final SecurityConfig securityConfig = getSecurityConfig();
+ final SecurityContext context = getSecurityContext();
+
+ propagator.pushSecurityContext(context, null, null);
+
+ Subject pushedSubject = SecurityAssociation.getSubject();
+ assertEquals(context.getSubject(), pushedSubject);
+
+ propagator.popSecurityContext(context, securityConfig);
+ pushedSubject = SecurityAssociation.getSubject();
+ assertNull(pushedSubject);
+ }
+
+ @Test
+ public void popWithNullSecurityConfig()
+ {
+ propagator.popSecurityContext(null, null);
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(JBossASContextPropagatorUnitTest.class);
+ }
+
+ private SecurityContext getSecurityContext()
+ {
+ Subject subject = new Subject();
+ subject.getPrincipals().add(new User("Mr.Poon"));
+ return new SecurityContext(subject, 5000l);
+ }
+
+ private SecurityConfig getSecurityConfig()
+ {
+ ConfigTree securityFragment = SecurityConfigTestUtil.createSecurityFragment("adminRole", null, "SuccessfulLogin");
+ return SecurityConfigUtil.createSecurityConfig(securityFragment);
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JaasSecurityServiceUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JaasSecurityServiceUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/JaasSecurityServiceUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -76,7 +76,7 @@
credentials.add(password);
AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder(principal, credentials).build();
- SecurityContext context = new SecurityContext(subject);
+ SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
service.configure();
service.authenticate(configInfo, context, authRequest);
@@ -91,7 +91,7 @@
Builder builder = new SecurityConfig.Builder("SuccessfulLogin");
builder.runAs("adminRole");
SecurityConfig configInfo = builder.build();
- SecurityContext context = new SecurityContext(subject);
+ SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
service.authenticate(configInfo, context, null);
Set<Principal> principals = subject.getPrincipals( Principal.class );
assertEquals( 2, principals.size() );
@@ -108,7 +108,7 @@
subject.getPrincipals().add(group);
- SecurityContext context = new SecurityContext(subject);
+ SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
service.authenticate(configInfo, context, null);
Set<Principal> principals = subject.getPrincipals( Principal.class );
@@ -122,7 +122,7 @@
Builder builder = new SecurityConfig.Builder("SuccessfulLogin");
builder.runAs(roleName);
SecurityConfig configInfo = builder.build();
- SecurityContext context = new SecurityContext(subject);
+ SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
service.authenticate(configInfo, context, null);
assertTrue( service.isCallerInRole(subject, new Role(roleName)));
}
@@ -132,7 +132,7 @@
{
Builder builder = new SecurityConfig.Builder("FailureLogin");
SecurityConfig configInfo = builder.build();
- SecurityContext context = new SecurityContext(subject);
+ SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
service.authenticate( configInfo, context, null );
}
@@ -143,7 +143,7 @@
builder.runAs("esbRole");
builder.rolesAllowed("esbRole");
SecurityConfig configInfo = builder.build();
- SecurityContext context = new SecurityContext(subject);
+ SecurityContext context = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
service.authenticate( configInfo, context, null );
boolean checkRolesAllowed = service.checkRolesAllowed(configInfo.getRolesAllowed(), context);
assertTrue(checkRolesAllowed);
@@ -156,7 +156,14 @@
{
public void run()
{
- threadLogin();
+ try
+ {
+ threadLogin();
+ }
+ catch (final SecurityServiceException ignore)
+ {
+ ignore.printStackTrace();
+ }
}
};
for (int i = 0; i < 1000; i++)
@@ -168,12 +175,11 @@
}
}
- private void threadLogin()
+ private void threadLogin() throws SecurityServiceException
{
Builder builder = new SecurityConfig.Builder("SuccessfulLogin");
SecurityConfig configInfo = builder.build();
- SecurityContext context = new SecurityContext(new Subject());
- service.refreshSecurityConfig();
+ SecurityContext context = new SecurityContext(new Subject(), SecurityContext.getConfigurationTimeout());
try
{
service.authenticate( configInfo, context, null );
@@ -190,7 +196,9 @@
jbossEsbProperties = System.getProperty(Environment.PROPERTIES_FILE);
URL resource = ClassUtil.getResource("security-properties.xml", getClass());
System.setProperty(Environment.PROPERTIES_FILE, "abs://" + resource.getFile());
- service.configure();
+
+ URL loginConfig = ClassUtil.getResource("test_jaas.config", getClass());
+ System.setProperty("java.security.auth.login.config", loginConfig.getFile());
}
@After
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/PrivateCryptoUtilUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/PrivateCryptoUtilUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/PrivateCryptoUtilUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -20,17 +20,14 @@
*/
package org.jboss.internal.soa.esb.services.security;
-import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.io.IOException;
import java.io.Serializable;
import java.net.URL;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.Provider;
-import java.security.Security;
+import javax.crypto.IllegalBlockSizeException;
import javax.crypto.SealedObject;
import junit.framework.JUnit4TestAdapter;
@@ -54,13 +51,14 @@
private String jbossEsbProperties;
@Test
- public void encryptAndDecrypt() throws SecurityServiceException
+ public void sealObject() throws SecurityServiceException, IllegalBlockSizeException, IOException
{
- String object = "some texti: dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd";
- byte[] encrypted = PrivateCryptoUtil.INSTANCE.encrypt(object);
- assertFalse(object.equals(new String(encrypted)));
+ final String object = getLongString(5000);
- Serializable plainObject = PrivateCryptoUtil.INSTANCE.decrypt(encrypted);
+ final SealedObject sealedObject = PrivateCryptoUtil.INSTANCE.sealObject(object);
+ assertNotNull(sealedObject);
+
+ final Serializable plainObject = PrivateCryptoUtil.INSTANCE.unSealObject(sealedObject);
assertEquals(object, plainObject);
}
@@ -81,6 +79,16 @@
}
}
+ private String getLongString(final int size)
+ {
+ final StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < size; i++)
+ {
+ sb.append(i);
+ }
+ return sb.toString();
+ }
+
public static junit.framework.Test suite()
{
return new JUnit4TestAdapter(PrivateCryptoUtilUnitTest.class);
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactoryUnitTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactoryUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactoryUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/SecurityContextPropagatorFactoryUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,95 @@
+/*
+ * 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 static org.junit.Assert.*;
+import java.net.URL;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.services.security.SecurityServiceException;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import junit.framework.JUnit4TestAdapter;
+
+
+/**
+ * Unit test for {@link SecurityContextPropagatorFactory}.
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class SecurityContextPropagatorFactoryUnitTest
+{
+ // only used to store and restore a previously set configuration file.
+ private String jbossEsbProperties;
+
+ @Test
+ public void create() throws SecurityServiceException
+ {
+ SecurityContextPropagator propagator = SecurityContextPropagatorFactory.create(JBossASContextPropagator.class.getName());
+ assertTrue(propagator instanceof JBossASContextPropagator);
+ }
+
+ @Test
+ public void createNullClassNameSpecified() throws SecurityServiceException
+ {
+ SecurityContextPropagator propagator = SecurityContextPropagatorFactory.create(null);
+ assertNull(propagator);
+ }
+
+ @Test
+ public void createFromConfig() throws SecurityServiceException
+ {
+ SecurityContextPropagator propagator = SecurityContextPropagatorFactory.createFromConfig();
+
+ // should match the class specified in security-properties.xml (in this classes directory.
+ assertTrue(propagator instanceof JBossASContextPropagator);
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(SecurityContextPropagatorFactoryUnitTest.class);
+ }
+
+ @Before
+ public void setup() throws ConfigurationException
+ {
+ // store jbossesb properties env variable value
+ 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 )
+ {
+ // restore jbossesb-properties variable
+ System.setProperty(Environment.PROPERTIES_FILE, jbossEsbProperties);
+ }
+ }
+
+}
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/jaas.login
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/jaas.login 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/jaas.login 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,9 +0,0 @@
-SuccessfulLogin {
- org.jboss.soa.esb.services.security.TestLoginModule required forceLogin=true;
-};
-FailureLogin {
- org.jboss.soa.esb.services.security.TestLoginModule required forceLogin=false;
-};
-UserPassLogin {
- org.jboss.soa.esb.services.security.UserPassLoginModule required;
-};
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/security-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/security-properties.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/security-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -40,13 +40,13 @@
<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.privateKeystore" value="privateKeyStore"/>
- <property name="org.jboss.soa.esb.services.security.privateKeystorePassword" value="testKeystorePassword"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyAlias" value="testAlias"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyPassword" value="testPassword"/>
+ <property name="org.jboss.soa.esb.services.security.sealAlgorithm" value="TripleDES"/>
+ <property name="org.jboss.soa.esb.services.security.sealKeySize" value="168"/>
+ <property name="org.jboss.soa.esb.services.security.contextTimeout" value="30000"/>
+ <property name="org.jboss.soa.esb.services.security.contextPropagatorImplementationClass" value="org.jboss.internal.soa.esb.services.security.JBossASContextPropagator"/>
+
</properties>
<properties name="registry">
<property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/test_jaas.config (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/test_jaas.config)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/test_jaas.config (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/security/test_jaas.config 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,11 @@
+SuccessfulLogin {
+ org.jboss.soa.esb.services.security.TestLoginModule required forceLogin=true;
+};
+
+FailureLogin {
+ org.jboss.soa.esb.services.security.TestLoginModule required forceLogin=false;
+};
+
+UserPassLogin {
+ org.jboss.soa.esb.services.security.UserPassLoginModule required;
+};
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JMSRouterUnitTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JMSRouterUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JMSRouterUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JMSRouterUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,315 @@
+/*
+ * 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.actions.routing;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.naming.Context;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.NamingContextPool;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockejb.jms.MockQueue;
+import org.mockejb.jms.QueueConnectionFactoryImpl;
+import org.mockejb.jndi.MockContextFactory;
+
+/**
+ * JMSRouter unit tests.
+ *
+ * @author <a href="mailto:kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class JMSRouterUnitTest
+{
+ private static final String CONNECTION_FACTORY = "ConnectionFactory" ;
+ private static final String QUEUE_NAME = "failQueue" ;
+
+ @Before
+ public void setUp()
+ throws Exception
+ {
+ MockContextFactory.setAsInitial();
+
+ final Context ctx = NamingContextPool.getNamingContext(null);
+ try
+ {
+ ctx.rebind(CONNECTION_FACTORY, new MockQueueConnectionFactory());
+ ctx.rebind(QUEUE_NAME, new MockQueue(QUEUE_NAME));
+ }
+ finally
+ {
+ NamingContextPool.releaseNamingContext(ctx) ;
+ }
+ System.setProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY, System.getProperty(Context.INITIAL_CONTEXT_FACTORY)) ;
+ }
+
+ @After
+ public void tearDown()
+ throws Exception
+ {
+ MockContextFactory.revertSetAsInitial();
+ }
+
+ @Test
+ public void testRetry()
+ throws Exception
+ {
+ final ConfigTree config = new ConfigTree("config") ;
+ config.setAttribute("jndiName", QUEUE_NAME);
+
+ final JMSRouter router = new JMSRouter(config) ;
+
+ assertEquals("Original connection count", 1, MockQueueConnectionFactory.queueConnectionCount) ;
+ assertEquals("Original session count", 1, MockQueueExceptionHandlerInvocationHandler.queueSessionCount) ;
+ assertEquals("Original producer count", 1, MockQueueSessionInvocationHandler.producerCount) ;
+
+ try
+ {
+ router.process(MessageFactory.getInstance().getMessage()) ;
+ fail("Expected to receive an ActionProcessingException") ;
+ }
+ catch (final ActionProcessingException ape) {} // expected
+
+ // Connection count changes as we fire the exception handler and this closes connections/sessions/producers
+ assertEquals("Original connection count", 2, MockQueueConnectionFactory.queueConnectionCount) ;
+ // session count should increment by one to reflect the second session created when handling the exception.
+ assertEquals("Original session count", 2, MockQueueExceptionHandlerInvocationHandler.queueSessionCount) ;
+ // One producer for setup, first failure and second retry.
+ assertEquals("Original producer count", 3, MockQueueSessionInvocationHandler.producerCount) ;
+ }
+
+ private static final class MockQueueConnectionFactory extends QueueConnectionFactoryImpl
+ {
+ static int queueConnectionCount ;
+
+ @Override
+ public QueueConnection createQueueConnection() throws JMSException
+ {
+ queueConnectionCount++ ;
+ return (QueueConnection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {QueueConnection.class},
+ new MockQueueExceptionHandlerInvocationHandler(super.createQueueConnection())) ;
+ }
+ }
+
+ private static final class MockQueueExceptionHandlerInvocationHandler implements InvocationHandler
+ {
+ private final QueueConnection queueConnection ;
+ private ExceptionListener exceptionListener ;
+ static int queueSessionCount ;
+
+ MockQueueExceptionHandlerInvocationHandler(final QueueConnection queueConnection)
+ {
+ this.queueConnection = queueConnection ;
+ }
+
+ public Object invoke(final Object proxy, final Method method, final Object[] args)
+ throws Throwable
+ {
+ final String methodName = method.getName() ;
+ if ("setExceptionListener".equals(methodName))
+ {
+ exceptionListener = (ExceptionListener)args[0] ;
+ return null ;
+ }
+ else if ("getExceptionListener".equals(methodName))
+ {
+ return exceptionListener ;
+ }
+ else
+ {
+ final Object response = method.invoke(queueConnection, args) ;
+ if (response instanceof QueueSession)
+ {
+ queueSessionCount++ ;
+ final QueueSession queueSession = (QueueSession)response ;
+ return (QueueSession)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {QueueSession.class},
+ new MockQueueSessionInvocationHandler(this, queueSession)) ;
+ }
+ else
+ {
+ return response ;
+ }
+ }
+ }
+
+ void fireExceptionListener(final JMSException exception)
+ {
+ if (exceptionListener != null)
+ {
+ exceptionListener.onException(exception) ;
+ }
+ }
+ }
+
+ private static final class MockQueueSessionInvocationHandler implements InvocationHandler
+ {
+ private final MockQueueExceptionHandlerInvocationHandler exceptionHandler ;
+ private final QueueSession queueSession ;
+ static int producerCount ;
+
+ MockQueueSessionInvocationHandler(final MockQueueExceptionHandlerInvocationHandler exceptionHandler, final QueueSession queueSession)
+ {
+ this.exceptionHandler = exceptionHandler ;
+ this.queueSession = queueSession ;
+ }
+
+ public Object invoke(final Object proxy, final Method method, final Object[] args)
+ throws Throwable
+ {
+ final String methodName = method.getName() ;
+ if ("recover".equals(methodName))
+ {
+ return null ;
+ }
+ else if ("createProducer".equals(methodName))
+ {
+ producerCount++ ;
+ return new MockFailMessageProducer(exceptionHandler) ;
+ }
+ else if ("getAcknowledgeMode".equals(methodName))
+ {
+ return Integer.valueOf(Session.AUTO_ACKNOWLEDGE) ;
+ }
+ else if ("getTransacted".equals(methodName))
+ {
+ return Boolean.FALSE ;
+ }
+ else
+ {
+ return method.invoke(queueSession, args) ;
+ }
+ }
+ }
+
+ private static final class MockFailMessageProducer implements MessageProducer
+ {
+ private final MockQueueExceptionHandlerInvocationHandler exceptionHandler ;
+
+ public MockFailMessageProducer(final MockQueueExceptionHandlerInvocationHandler exceptionHandler)
+ {
+ this.exceptionHandler = exceptionHandler ;
+ }
+
+ public void close() throws JMSException {}
+
+ public int getDeliveryMode()
+ throws JMSException
+ {
+ return 0;
+ }
+
+ public Destination getDestination()
+ throws JMSException
+ {
+ return null;
+ }
+
+ public boolean getDisableMessageID()
+ throws JMSException
+ {
+ return false;
+ }
+
+ public boolean getDisableMessageTimestamp()
+ throws JMSException
+ {
+ return false;
+ }
+
+ public int getPriority()
+ throws JMSException
+ {
+ return 0;
+ }
+
+ public long getTimeToLive()
+ throws JMSException
+ {
+ return 0;
+ }
+
+ public void send(Message arg0)
+ throws JMSException
+ {
+ exception() ;
+ }
+
+ public void send(Destination arg0, Message arg1)
+ throws JMSException
+ {
+ throw new JMSException("Deliberate send exception") ;
+ }
+
+ public void send(Message arg0, int arg1, int arg2, long arg3)
+ throws JMSException
+ {
+ throw new JMSException("Deliberate send exception") ;
+ }
+
+ private void exception()
+ throws JMSException
+ {
+ final JMSException exception = new JMSException("Deliberate send exception") ;
+ exceptionHandler.fireExceptionListener(exception) ;
+ throw exception ;
+ }
+
+ public void send(Destination arg0, Message arg1, int arg2, int arg3, long arg4)
+ throws JMSException
+ {
+ }
+
+ public void setDeliveryMode(int arg0) throws JMSException {}
+
+ public void setDisableMessageID(boolean arg0) throws JMSException {}
+
+ public void setDisableMessageTimestamp(boolean arg0) throws JMSException {}
+
+ public void setPriority(int arg0) throws JMSException {}
+
+ public void setTimeToLive(long arg0) throws JMSException {}
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(JMSRouterUnitTest.class);
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterIntegrationTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterIntegrationTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterIntegrationTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -166,9 +166,6 @@
// outbound is to simulate a new jms message that is about to leave the ESB.
TextMessageImpl outBoundJmsMessage = new TextMessageImpl();
router.setJMSReplyTo( outBoundJmsMessage, msg );
-
- Destination replyTo = outBoundJmsMessage.getJMSReplyTo();
- assertTrue( replyTo instanceof Queue );
}
finally
{
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -32,7 +32,7 @@
import junit.framework.JUnit4TestAdapter;
import org.jboss.soa.esb.addressing.eprs.JMSEpr.AcknowledgeMode;
-import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.Environment;
import org.jboss.soa.esb.couriers.CourierException;
import org.junit.Test;
@@ -43,12 +43,16 @@
*/
public class JMSEprUnitTest
{
+ private String defaultProvider = "default.test" ;
+ private String extensionProvider = "extension.test" ;
+ private String propertyJndi = "jndiurl.test" ;
private String expectedDestination = "/queue/test";
private String expectedConnectionFactory = "ConnectionFactory";
private String expectedDestinationType = JMSEpr.QUEUE_TYPE;
private String expectedSelector = "JMSCorrelationID=1000";
private static final boolean NON_PERSISTENT = false;
private static final boolean PERSISTENT = true;
+ private static final String JNDI_PREFIX = "jnp://" ;
private final Properties nullEnvironment = null;
@@ -188,6 +192,49 @@
}
@Test
+ public void generatedAddresses()
+ {
+ final String jndiServerUrl = System.getProperty(Environment.JNDI_SERVER_URL) ;
+ try
+ {
+ System.setProperty(Environment.JNDI_SERVER_URL, JNDI_PREFIX + defaultProvider) ;
+
+ final String queueName = "queueName" ;
+
+ // should default address to system property
+ final JMSEpr firstEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
+ queueName, "connection", null, null, true, null, null, null, true) ;
+ assertEquals("System JNDI_SERVER_URL", "jms://" + defaultProvider + "/" + queueName, firstEpr.getAddr().getAddress()) ;
+
+ // should use Provider URL extension
+ final Properties environment = new Properties() ;
+ environment.setProperty(Context.PROVIDER_URL, JNDI_PREFIX + extensionProvider) ;
+ final JMSEpr secondEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
+ queueName, "connection", environment, null, true, null, null, null, true) ;
+ assertEquals("Extension Context.PROVIDER_URL", "jms://" + extensionProvider + "/" + queueName, secondEpr.getAddr().getAddress()) ;
+
+ // should use jndi-URL property
+ environment.setProperty(JNDI_URL_TAG, JNDI_PREFIX + propertyJndi) ;
+ final JMSEpr thirdEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
+ queueName, "connection", environment, null, true, null, null, null, true) ;
+ assertEquals("Extension Context.PROVIDER_URL", "jms://" + propertyJndi + "/" + queueName, thirdEpr.getAddr().getAddress()) ;
+ }
+ finally
+ {
+ if (jndiServerUrl != null)
+ {
+ System.setProperty(Environment.JNDI_SERVER_URL, jndiServerUrl) ;
+ }
+ else
+ {
+ final Properties properties = System.getProperties() ;
+ properties.remove(Environment.JNDI_SERVER_URL) ;
+ System.setProperties(properties) ;
+ }
+ }
+ }
+
+ @Test
public void acknowledgeEnumTest()
{
AcknowledgeMode ackMode = AcknowledgeMode.getAckMode( null );
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/InVMUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -88,9 +88,9 @@
public void test_getEncodedServiceId() throws URISyntaxException {
String serviceId = InVMEpr.createEncodedServiceId("Service Cat / &&&", " Service / Name $$");
- assertEquals("5365727669636520436174202f2026262653657276696365202f204e616d65202424", serviceId);
+ assertEquals("5365727669636520436174202f2026262624242424242424242424242453657276696365202f204e616d65202424", serviceId);
InVMEpr epr = new InVMEpr(new URI(InVMEpr.INVM_PROTOCOL + "://" + serviceId));
- assertEquals("5365727669636520436174202f2026262653657276696365202f204e616d65202424", epr.getServiceId());
+ assertEquals("5365727669636520436174202f2026262624242424242424242424242453657276696365202f204e616d65202424", epr.getServiceId());
}
}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/couriers)
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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-2008, JBoss Inc.
- */
-package org.jboss.soa.esb.couriers;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class CourierFactoryUtil {
-
- public static void resetCourierFactory() {
- CourierFactory.setInstance(new CourierFactory());
- }
-}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/couriers/CourierFactoryUtil.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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-2008, JBoss Inc.
+ */
+package org.jboss.soa.esb.couriers;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class CourierFactoryUtil {
+
+ public static void resetCourierFactory() {
+ CourierFactory.setInstance(new CourierFactory());
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -24,34 +24,31 @@
import java.io.Serializable;
import java.net.URL;
-import java.security.AccessControlContext;
-import java.security.AccessController;
+import java.util.concurrent.TimeUnit;
+import javax.crypto.SealedObject;
import javax.security.auth.Subject;
-import junit.framework.JUnit4TestAdapter;
import junit.framework.TestCase;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.lifecycle.LifecycleResourceManager;
import org.jboss.soa.esb.listeners.ListenerTagNames;
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.SecurityConfig;
+import org.jboss.soa.esb.services.security.SecurityConfigUtil;
import org.jboss.soa.esb.services.security.SecurityContext;
-import org.jboss.soa.esb.services.security.SecurityContextUnitTest;
import org.jboss.soa.esb.services.security.SecurityService;
-import org.jboss.soa.esb.services.security.SecurityServiceException;
import org.jboss.soa.esb.services.security.TestPrincipal;
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.principals.User;
import org.jboss.soa.esb.util.ClassUtil;
-import org.junit.After;
-import org.junit.Before;
public class ActionProcessingPipelineUnitTest extends TestCase
{
@@ -68,13 +65,15 @@
MockActionInfo.reset();
System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
- com.arjuna.common.util.propertyservice.PropertyManager pm = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE);
- pm.setProperty("javax.xml.registry.ConnectionFactoryClass", "org.apache.ws.scout.registry.ConnectionFactoryImpl");
+ MockRegistry.install();
LifecycleResourceManager.getSingleton().associateDeployment(getClass().getCanonicalName()) ;
jbossEsbProperties = System.getProperty(Environment.PROPERTIES_FILE);
URL resource = ClassUtil.getResource("security-properties.xml", getClass());
System.setProperty(Environment.PROPERTIES_FILE, "abs://" + resource.getFile());
+
+ URL loginConfig = ClassUtil.getResource("test_jaas.config", getClass());
+ System.setProperty("java.security.auth.login.config", loginConfig.getFile());
}
@Override
@@ -448,38 +447,62 @@
}
}
- public void testSecuredServiceWithoutExistingSecurityContext() throws Exception
+ public void testSecuredWithoutExistingSecurityContextOrAuthenticationRequest() throws ConfigurationException
{
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()) ;
+
+ final boolean processingResult = pipeline.process(MessageFactory.getInstance().getMessage());
+ assertFalse("The Service was configured with security but neither a AuthenticationContext nor a SecurityContext is made available", processingResult);
+
+ pipeline.destroy() ;
+ checkOrder(MockActionInfo.getDestroyList()) ;
+ }
+
+ public void testSecuredAuthentication() throws Exception
+ {
+ final ConfigTree configTree = new ConfigTree("parent") ;
+ // Add 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();
+ final Message message = MessageFactory.getInstance().getMessage();
- // create an AuthenticationRequest which is needed to authenticate if the security
- AuthenticationRequest build = new AuthenticationRequestImpl.Builder().build();
- message.getContext().setContext(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) build));
+ // Create an AuthenticationRequest which is needed to authenticate if the security
+ final AuthenticationRequest authRequest = new AuthenticationRequestImpl.Builder().build();
+ final byte[] encryptedAuthRequest = PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest);
+ message.getContext().setContext(SecurityService.AUTH_REQUEST, encryptedAuthRequest);
- final boolean result = pipeline.process(message);
- assertTrue(result);
+ final boolean processingResult = pipeline.process(message);
+
+ assertTrue(processingResult);
assertEquals(new TestPrincipal("test").getName(), MockSecuredActionProcessor.getSubject().getPrincipals().iterator().next().getName());
+ assertEquals("The encrypted AuthenticationRequest should have been set as a thread local",
+ encryptedAuthRequest, AuthenticationRequestImpl.getEncryptedAuthRequest());
+ assertTrue("The SecurityContext should have been pushed", MockSecurityContextPropagator.wasPushCalled());
+ assertTrue("The SerirityContext should have been popped", MockSecurityContextPropagator.wasPopCalled());
+ assertNull("AuthenticationRequest should have been removed from the message context",
+ message.getContext().getContext(SecurityService.AUTH_REQUEST));
pipeline.destroy() ;
checkOrder(MockActionInfo.getDestroyList()) ;
}
- public void testSecuredServiceWithoutAutenticationRequest() throws Exception
+ public void testSecuredWithPreExistingSecurityContext() 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) ;
@@ -489,22 +512,29 @@
pipeline.initialise() ;
checkOrder(MockActionInfo.getInitialiseList()) ;
- Message message = MessageFactory.getInstance().getMessage();
+ final Subject subject = new Subject();
+ final User user = new User("AustinPowerwich");
+ final byte[] publicCred = "publicsecret".getBytes();
+ subject.getPrincipals().add(user);
+ subject.getPublicCredentials().add(publicCred);
- try
- {
- pipeline.process(message);
- }
- catch(final Exception e)
- {
- assertTrue(e instanceof SecurityServiceException);
- }
+ // Create and encrypt the security context. This simulates a call for a service that has already been authentcated.
+ final SecurityContext securityContext = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
+ final SealedObject sealedObject = SecurityContext.encryptContext(securityContext);
+ final Message message = MessageFactory.getInstance().getMessage();
+ message.getContext().setContext(SecurityService.CONTEXT, sealedObject);
+ final boolean processingResult = pipeline.process(message);
+ assertTrue(processingResult);
+ assertEquals(user, MockSecuredActionProcessor.getSubject().getPrincipals().iterator().next());
+
+ assertNull(message.getContext().getContext(SecurityService.CONTEXT));
+
pipeline.destroy() ;
checkOrder(MockActionInfo.getDestroyList()) ;
}
- public void testSecuredServiceWithPreExistingSecurityContext() throws Exception
+ public void testSecuredWithExistingSecurityContextWhichHasExpired() throws Exception
{
final ConfigTree configTree = new ConfigTree("parent") ;
addSecurityConfig(configTree, "adminRole", null, "SuccessfulLogin", null);
@@ -516,7 +546,6 @@
pipeline.initialise() ;
checkOrder(MockActionInfo.getInitialiseList()) ;
- Message message = MessageFactory.getInstance().getMessage();
Subject subject = new Subject();
// add principal
@@ -525,32 +554,66 @@
// add public credentials
byte[] publicCred = "publicsecret".getBytes();
subject.getPublicCredentials().add(publicCred);
- // add private credentials
- byte[] privateCred = "privatesecret".getBytes();
- subject.getPrivateCredentials().add(privateCred);
- // create and encrypt the security context. This simulates a call for a service
- // that has already been authentcated..
- SecurityContext securityContext = new SecurityContext(subject);
- byte[] encrypt = SecurityContext.encryptContext(securityContext);
+ // Create and encrypt the security context. This simulates a call for a service
+ // that has already been authentcated...but with a very short timeout.
+ final SecurityContext securityContext = new SecurityContext(subject, 10);
- message.getContext().setContext(SecurityService.CONTEXT, encrypt);
+ TimeUnit.SECONDS.sleep(1);
- final boolean result = pipeline.process(message);
+ final SealedObject sealedObject = SecurityContext.encryptContext(securityContext);
+ final Message message = MessageFactory.getInstance().getMessage();
+ message.getContext().setContext(SecurityService.CONTEXT, sealedObject);
- assertTrue(result);
- assertEquals(user, MockSecuredActionProcessor.getSubject().getPrincipals().iterator().next());
+ final boolean processingResult = pipeline.process(message);
+ assertFalse("Processing should have failed as the SecurityContext was invalid(expired)", processingResult);
- assertNull(message.getContext().getContext(SecurityService.CONTEXT));
-
pipeline.destroy() ;
checkOrder(MockActionInfo.getDestroyList()) ;
}
- public void testSecuredWithSecurityContextRolesAllowedNegativeCheck() throws Exception
+ public void testSecuredWithSecurityContextOverriddenTimeout() throws Exception
{
+ final long timeout = 90000;
+
+ // setup config tree
final ConfigTree configTree = new ConfigTree("parent") ;
configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG, ListenerTagNames.MEP_ONE_WAY) ;
+ final ConfigTree securityConfigTree = addSecurityConfig(configTree, "adminRole", null, "SuccessfulLogin", null, timeout);
+ addAction(configTree, MockSecuredActionProcessor.class.getName(), "process", null, null) ;
+
+ final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+ final SecurityConfig securityConfig = SecurityConfigUtil.createSecurityConfig(securityConfigTree);
+
+ final long contextTimeout = pipeline.getSecurityContextTimeout(securityConfig);
+
+ assertEquals("Timeout should be equals to the one in securty element(jboss-esb.xml) and not the global timeout(jbossesb-properties.xml",
+ timeout, contextTimeout);
+
+ pipeline.destroy() ;
+ }
+
+ public void testSecuredWithSecurityContextDefaultTimeout() throws Exception
+ {
+ final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG, ListenerTagNames.MEP_ONE_WAY) ;
+ final ConfigTree securityConfigTree = addSecurityConfig(configTree, "adminRole", null, "SuccessfulLogin", null);
+ addAction(configTree, MockSecuredActionProcessor.class.getName(), "process", null, null) ;
+
+ final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+
+ final SecurityConfig securityConfig = SecurityConfigUtil.createSecurityConfig(securityConfigTree);
+ final long contextTimeout = pipeline.getSecurityContextTimeout(securityConfig);
+
+ assertEquals(30000, contextTimeout);
+
+ pipeline.destroy() ;
+ }
+
+ public void testSecuredWithSecurityContextAndInvalidRoles() throws Exception
+ {
+ final ConfigTree configTree = new ConfigTree("parent") ;
+ configTree.setAttribute(ListenerTagNames.MEP_ATTRIBUTE_TAG, ListenerTagNames.MEP_ONE_WAY) ;
addSecurityConfig(configTree, "adminRole", null, "SuccessfulLogin", "noRole");
addAction(configTree, MockSecuredActionProcessor.class.getName(), "process", null, null) ;
@@ -559,29 +622,19 @@
pipeline.initialise() ;
checkOrder(MockActionInfo.getInitialiseList()) ;
- Message message = MessageFactory.getInstance().getMessage();
-
- Subject subject = new Subject();
- User user = new User("AustinPowerwich");
+ final Subject subject = new Subject();
+ final User user = new User("AustinPowerwich");
subject.getPrincipals().add(user);
- byte[] publicCred = "publicsecret".getBytes();
+ final byte[] publicCred = "publicsecret".getBytes();
subject.getPublicCredentials().add(publicCred);
- byte[] privateCred = "privatesecret".getBytes();
- subject.getPrivateCredentials().add(privateCred);
- SecurityContext securityContext = new SecurityContext(subject);
- byte[] encrypt = SecurityContext.encryptContext(securityContext);
- message.getContext().setContext(SecurityService.CONTEXT, encrypt);
+ final SecurityContext securityContext = new SecurityContext(subject, SecurityContext.getConfigurationTimeout());
+ final SealedObject sealedObject = SecurityContext.encryptContext(securityContext);
+ final Message message = MessageFactory.getInstance().getMessage();
+ message.getContext().setContext(SecurityService.CONTEXT, sealedObject);
- try
- {
- pipeline.process(message);
- }
- catch(final Exception e)
- {
- e.printStackTrace();
- assertTrue (e instanceof SecurityServiceException);
- }
+ final boolean processingResult = pipeline.process(message);
+ assertFalse("Processing should have failed as the caller was not in any of the allowed roles", processingResult);
pipeline.destroy() ;
checkOrder(MockActionInfo.getDestroyList()) ;
@@ -641,4 +694,22 @@
return securityElement;
}
+ private ConfigTree addSecurityConfig(
+ final ConfigTree parent,
+ final String runAs,
+ final String callerIdentity,
+ final String moduleName,
+ final String rolesAllowed,
+ final long timeout)
+ {
+ ConfigTree securityElement = this.addSecurityConfig(parent, runAs, callerIdentity, moduleName, rolesAllowed);
+ if (timeout != 0l)
+ {
+ ConfigTree property = new ConfigTree("property", securityElement);
+ property.setAttribute("name", Environment.SECURITY_SERVICE_CONTEXT_TIMEOUT);
+ property.setAttribute("value", Long.toString(timeout));
+ }
+ return securityElement;
+ }
+
}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockSecurityContextPropagator.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockSecurityContextPropagator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockSecurityContextPropagator.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockSecurityContextPropagator.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,72 @@
+/*
+ * 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.listeners.message;
+
+import java.util.Set;
+
+import org.jboss.internal.soa.esb.services.security.SecurityContextPropagator;
+import org.jboss.soa.esb.services.security.SecurityConfig;
+import org.jboss.soa.esb.services.security.SecurityContext;
+
+/**
+ * Mock SecurityContextPropagator used in unit tests.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class MockSecurityContextPropagator implements SecurityContextPropagator
+{
+ private static boolean pushCalled;
+ private static SecurityContext pushSecurityContext;
+
+ private static boolean popCalled;
+ private static SecurityContext popSecurityContext;
+
+ public void popSecurityContext(final SecurityContext context, final SecurityConfig config)
+ {
+ popCalled = true;
+ }
+
+ public void pushSecurityContext(final SecurityContext context, final Set<?> creds, final SecurityConfig config)
+ {
+ pushCalled = true;
+ }
+
+ public static boolean wasPopCalled()
+ {
+ return popCalled;
+ }
+
+ public static boolean wasPushCalled()
+ {
+ return pushCalled;
+ }
+
+ public static SecurityContext getPopSecurityContext()
+ {
+ return popSecurityContext;
+ }
+
+ public static SecurityContext getPushSecurityContext()
+ {
+ return pushSecurityContext;
+ }
+
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/security-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/security-properties.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/security-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -40,18 +40,19 @@
<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.privateKeystore" value="privateKeyStore"/>
- <property name="org.jboss.soa.esb.services.security.privateKeystorePassword" value="testKeystorePassword"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyAlias" value="testAlias"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyPassword" value="testPassword"/>
+ <property name="org.jboss.soa.esb.services.security.sealAlgorithm" value="TripleDES"/>
+ <property name="org.jboss.soa.esb.services.security.sealKeySize" value="168"/>
+ <property name="org.jboss.soa.esb.services.security.contextTimeout" value="30000"/>
+ <property name="org.jboss.soa.esb.services.security.contextPropagatorImplementationClass" value="org.jboss.soa.esb.listeners.message.MockSecurityContextPropagator"/>
+
<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"/>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/test_jaas.config (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/test_jaas.config)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/test_jaas.config (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/test_jaas.config 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,11 @@
+SuccessfulLogin {
+ org.jboss.soa.esb.services.security.TestLoginModule required forceLogin=true;
+};
+
+FailureLogin {
+ org.jboss.soa.esb.services.security.TestLoginModule required forceLogin=false;
+};
+
+UserPassLogin {
+ org.jboss.soa.esb.services.security.UserPassLoginModule required;
+};
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -308,12 +308,11 @@
assertEquals(names.length, 2);
/*
- * The array comes back ordered alphabetically.
+ * The array is not ordered.
*/
+ assertTrue("Check for bar", "bar".equals(names[0]) || "bar".equals(names[1]));
+ assertTrue("Check for foo", "foo".equals(names[0]) || "foo".equals(names[1]));
- assertEquals(names[0], "bar");
- assertEquals(names[1], "foo");
-
try
{
ByteArrayOutputStream s = new ByteArrayOutputStream();
@@ -338,8 +337,11 @@
assertNotNull(names);
assertEquals(names.length, 2);
- assertEquals(names[0], "foo");
- assertEquals(names[1], "bar");
+ /*
+ * The array is not ordered.
+ */
+ assertTrue("Check for bar", "bar".equals(names[0]) || "bar".equals(names[1]));
+ assertTrue("Check for foo", "foo".equals(names[0]) || "foo".equals(names[1]));
}
catch (Exception ex)
{
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -274,12 +274,11 @@
assertEquals(names.length, 2);
/*
- * The array comes back ordered alphabetically.
+ * The array is not ordered.
*/
+ assertTrue("Check for bar", "bar".equals(names[0]) || "bar".equals(names[1]));
+ assertTrue("Check for foo", "foo".equals(names[0]) || "foo".equals(names[1]));
- assertEquals(names[0], "bar");
- assertEquals(names[1], "foo");
-
try
{
final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
@@ -300,11 +299,10 @@
assertEquals(names.length, 2);
/*
- * The array comes back ordered alphabetically.
+ * The array is not ordered.
*/
-
- assertEquals(names[0], "bar");
- assertEquals(names[1], "foo");
+ assertTrue("Check for bar", "bar".equals(names[0]) || "bar".equals(names[1]));
+ assertTrue("Check for foo", "foo".equals(names[0]) || "foo".equals(names[1]));
}
catch (Exception ex)
{
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146 (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146)
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,67 +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.schedule.JBESB_2146;
-
-import org.jboss.soa.esb.listeners.ScheduledEventMessageComposer;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.schedule.SchedulingException;
-import org.jboss.soa.esb.schedule.MockScheduledEventMessageComposer;
-
-import java.util.*;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class JBESB_2146_ScheduledEventMessageComposer implements ScheduledEventMessageComposer {
-
- public ConfigTree config;
- public List<Message> composedMessages = Collections.synchronizedList(new ArrayList<Message>());
- public List<Message> completedMessage = Collections.synchronizedList(new ArrayList<Message>());
- private static Map<String, JBESB_2146_ScheduledEventMessageComposer> composers = new HashMap<String, JBESB_2146_ScheduledEventMessageComposer>();
-
- public void reset() {
- composedMessages.clear();
- completedMessage.clear();
- }
-
- public void initialize(ConfigTree config) {
- this.config = config;
- composers.put(config.getAttribute("name"), this);
- }
-
- public static JBESB_2146_ScheduledEventMessageComposer getComposer(String name) {
- return composers.get(name);
- }
-
- public void uninitialize() {
- }
-
- public Message composeMessage() throws SchedulingException {
- Message message = org.jboss.soa.esb.message.format.MessageFactory.getInstance().getMessage();
- composedMessages.add(message);
- return message;
- }
-
- public Message onProcessingComplete(Message message) throws SchedulingException {
- completedMessage.add(message);
- return message;
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_ScheduledEventMessageComposer.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -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.schedule.JBESB_2146;
+
+import org.jboss.soa.esb.listeners.ScheduledEventMessageComposer;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.schedule.SchedulingException;
+import org.jboss.soa.esb.schedule.MockScheduledEventMessageComposer;
+
+import java.util.*;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JBESB_2146_ScheduledEventMessageComposer implements ScheduledEventMessageComposer {
+
+ public ConfigTree config;
+ public List<Message> composedMessages = Collections.synchronizedList(new ArrayList<Message>());
+ public List<Message> completedMessage = Collections.synchronizedList(new ArrayList<Message>());
+ private static Map<String, JBESB_2146_ScheduledEventMessageComposer> composers = new HashMap<String, JBESB_2146_ScheduledEventMessageComposer>();
+
+ public void reset() {
+ composedMessages.clear();
+ completedMessage.clear();
+ }
+
+ public void initialize(ConfigTree config) {
+ this.config = config;
+ composers.put(config.getAttribute("name"), this);
+ }
+
+ public static JBESB_2146_ScheduledEventMessageComposer getComposer(String name) {
+ return composers.get(name);
+ }
+
+ public void uninitialize() {
+ }
+
+ public Message composeMessage() throws SchedulingException {
+ Message message = org.jboss.soa.esb.message.format.MessageFactory.getInstance().getMessage();
+ composedMessages.add(message);
+ return message;
+ }
+
+ public Message onProcessingComplete(Message message) throws SchedulingException {
+ completedMessage.add(message);
+ return message;
+ }
+}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,58 +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.schedule.JBESB_2146;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.mock.MockAction;
-import org.jboss.soa.esb.schedule.MockScheduledEventListener;
-import org.jboss.soa.esb.schedule.MockScheduledEventMessageComposer;
-import org.jboss.soa.esb.testutils.ESBConfigUtil;
-
-/**
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class JBESB_2146_UnitTest extends TestCase {
-
- protected void setUp() throws Exception {
- MockScheduledEventMessageComposer.reset();
- MockScheduledEventListener.reset();
- MockAction.message = null;
- }
-
- public void test_simple_schedule_01() throws Exception {
- runTestConfig("config-01.xml", 10000);
-
- JBESB_2146_ScheduledEventMessageComposer composer1 = JBESB_2146_ScheduledEventMessageComposer.getComposer("simple-schedule-listener1");
- JBESB_2146_ScheduledEventMessageComposer composer2 = JBESB_2146_ScheduledEventMessageComposer.getComposer("simple-schedule-listener2");
-
- assertTrue("simple-schedule-listener1 fired", composer1.composedMessages.size() > 0);
- assertTrue("simple-schedule-listener2 fired", composer2.composedMessages.size() > 0);
- }
-
- private void runTestConfig(String configName, long upTime) throws Exception {
- ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream(configName));
-
- configUtil.startController();
- Thread.sleep(upTime);
- configUtil.stopController();
- }
-}
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/JBESB_2146_UnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,58 @@
+/*
+ * 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.JBESB_2146;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.mock.MockAction;
+import org.jboss.soa.esb.schedule.MockScheduledEventListener;
+import org.jboss.soa.esb.schedule.MockScheduledEventMessageComposer;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+
+/**
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JBESB_2146_UnitTest extends TestCase {
+
+ protected void setUp() throws Exception {
+ MockScheduledEventMessageComposer.reset();
+ MockScheduledEventListener.reset();
+ MockAction.message = null;
+ }
+
+ public void test_simple_schedule_01() throws Exception {
+ runTestConfig("config-01.xml", 10000);
+
+ JBESB_2146_ScheduledEventMessageComposer composer1 = JBESB_2146_ScheduledEventMessageComposer.getComposer("simple-schedule-listener1");
+ JBESB_2146_ScheduledEventMessageComposer composer2 = JBESB_2146_ScheduledEventMessageComposer.getComposer("simple-schedule-listener2");
+
+ assertTrue("simple-schedule-listener1 fired", composer1.composedMessages.size() > 0);
+ assertTrue("simple-schedule-listener2 fired", composer2.composedMessages.size() > 0);
+ }
+
+ private void runTestConfig(String configName, long upTime) throws Exception {
+ ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream(configName));
+
+ configUtil.startController();
+ Thread.sleep(upTime);
+ configUtil.stopController();
+ }
+}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,33 +0,0 @@
-<?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>
- <schedule-provider name="schedule">
- <cron-schedule scheduleid="schedule1" cronExpression="0/2 * * * * ?"/>
- </schedule-provider>
- </providers>
-
- <services>
- <service category="ServiceCat" name="ServiceName-01" description="Test Service">
-
- <listeners>
- <scheduled-listener name="simple-schedule-listener1" scheduleidref="schedule1" event-processor="org.jboss.soa.esb.schedule.JBESB_2146.JBESB_2146_ScheduledEventMessageComposer" />
- </listeners>
-
- <actions>
- <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
- </actions>
- </service>
- <service category="ServiceCat" name="ServiceName-02" description="Test Service">
-
- <listeners>
- <scheduled-listener name="simple-schedule-listener2" scheduleidref="schedule1" event-processor="org.jboss.soa.esb.schedule.JBESB_2146.JBESB_2146_ScheduledEventMessageComposer" />
- </listeners>
-
- <actions>
- <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
- </actions>
- </service>
- </services>
-
-</jbossesb>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/JBESB_2146/config-01.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,33 @@
+<?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>
+ <schedule-provider name="schedule">
+ <cron-schedule scheduleid="schedule1" cronExpression="0/2 * * * * ?"/>
+ </schedule-provider>
+ </providers>
+
+ <services>
+ <service category="ServiceCat" name="ServiceName-01" description="Test Service">
+
+ <listeners>
+ <scheduled-listener name="simple-schedule-listener1" scheduleidref="schedule1" event-processor="org.jboss.soa.esb.schedule.JBESB_2146.JBESB_2146_ScheduledEventMessageComposer" />
+ </listeners>
+
+ <actions>
+ <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
+ </actions>
+ </service>
+ <service category="ServiceCat" name="ServiceName-02" description="Test Service">
+
+ <listeners>
+ <scheduled-listener name="simple-schedule-listener2" scheduleidref="schedule1" event-processor="org.jboss.soa.esb.schedule.JBESB_2146.JBESB_2146_ScheduledEventMessageComposer" />
+ </listeners>
+
+ <actions>
+ <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/PublicCryptoUtilUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/PublicCryptoUtilUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/PublicCryptoUtilUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -53,7 +53,7 @@
@Test
public void encryptAndDecrypt() throws SecurityServiceException, InvalidKeyException, NoSuchAlgorithmException, IOException, ClassNotFoundException
{
- String object = "some textaalddddddddddddddaldkfjlakjfafadlalkfdalfjkfladsjfalkfjfljsafkjalkfjjafjlkafjfjjfaadlasajfkafkjalalfkjakljdljfajfjajfljalkfjlafljalsjfjj";
+ final String object = getLongString(5000);
byte[] encrypted = PublicCryptoUtil.INSTANCE.encrypt(object);
assertFalse(object.equals(new String(encrypted)));
@@ -71,6 +71,16 @@
}
}
+ private String getLongString(final int size)
+ {
+ final StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < size; i++)
+ {
+ sb.append(i);
+ }
+ return sb.toString();
+ }
+
@Before
public void setup() throws ConfigurationException
{
@@ -79,6 +89,8 @@
System.setProperty(Environment.PROPERTIES_FILE, "abs://" + resource.getFile());
}
+
+
@After
public void tearDown()
{
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigTestUtil.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigTestUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigTestUtil.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigTestUtil.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,78 @@
+/*
+ * 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;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+
+/**
+ * Util methods for help creating ConfigTree instances.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public final class SecurityConfigTestUtil
+{
+ private SecurityConfigTestUtil()
+ {
+ }
+
+ public static ConfigTree createSecurityFragment(
+ final String runAs,
+ final String callerIdentity,
+ final String moduleName)
+ {
+ final ConfigTree securityElement = new ConfigTree(ListenerTagNames.SECURITY_TAG);
+ securityElement.setAttribute(ListenerTagNames.RUN_AS_TAG, runAs);
+ securityElement.setAttribute(ListenerTagNames.USE_CALLERS_IDENTIDY_TAG, callerIdentity);
+ securityElement.setAttribute(ListenerTagNames.MODULE_NAME_TAG, moduleName);
+ return securityElement;
+ }
+
+ public static ConfigTree createSecurityFragment(
+ final String runAs,
+ final String callerIdentity,
+ final String moduleName,
+ final String alias)
+ {
+ final ConfigTree securityElement = createSecurityFragment(runAs, callerIdentity, moduleName);
+ if ( alias != null )
+ {
+ ConfigTree property = new ConfigTree("property", securityElement);
+ property.setAttribute("name", "alias");
+ property.setAttribute("value", alias);
+ }
+ return securityElement;
+ }
+
+ public static ConfigTree createSecurityFragment(
+ final String runAs,
+ final String rolesAllowed,
+ final String callerIdentity,
+ final String moduleName,
+ final String alias)
+ {
+ final ConfigTree securityElement = createSecurityFragment(runAs, callerIdentity, moduleName, alias);
+ securityElement.setAttribute("rolesAllowed", rolesAllowed);
+ return securityElement;
+ }
+
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigUtilUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigUtilUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityConfigUtilUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -20,8 +20,9 @@
*/
package org.jboss.soa.esb.services.security;
-import static org.junit.Assert.*;
+import static org.jboss.soa.esb.services.security.SecurityConfigTestUtil.createSecurityFragment;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -30,7 +31,6 @@
import junit.framework.JUnit4TestAdapter;
import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.junit.Test;
/**
@@ -111,45 +111,4 @@
{
return new JUnit4TestAdapter(SecurityConfigUtilUnitTest.class);
}
-
- private ConfigTree createSecurityFragment(
- final String runAs,
- final String callerIdentity,
- final String moduleName)
- {
- final ConfigTree securityElement = new ConfigTree(ListenerTagNames.SECURITY_TAG);
- securityElement.setAttribute(ListenerTagNames.RUN_AS_TAG, runAs);
- securityElement.setAttribute(ListenerTagNames.USE_CALLERS_IDENTIDY_TAG, callerIdentity);
- securityElement.setAttribute(ListenerTagNames.MODULE_NAME_TAG, moduleName);
- return securityElement;
- }
-
- private ConfigTree createSecurityFragment(
- final String runAs,
- final String callerIdentity,
- final String moduleName,
- final String alias)
- {
- final ConfigTree securityElement = createSecurityFragment(runAs, callerIdentity, moduleName);
- if ( alias != null )
- {
- ConfigTree property = new ConfigTree("property", securityElement);
- property.setAttribute("name", "alias");
- property.setAttribute("value", alias);
- }
- return securityElement;
- }
-
- private ConfigTree createSecurityFragment(
- final String runAs,
- final String rolesAllowed,
- final String callerIdentity,
- final String moduleName,
- final String alias)
- {
- final ConfigTree securityElement = createSecurityFragment(runAs, callerIdentity, moduleName, alias);
- securityElement.setAttribute("rolesAllowed", rolesAllowed);
- return securityElement;
- }
-
}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityContextUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityContextUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/SecurityContextUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -20,8 +20,8 @@
*/
package org.jboss.soa.esb.services.security;
-import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -32,7 +32,9 @@
import java.io.ObjectOutputStream;
import java.net.URL;
import java.util.HashSet;
+import java.util.concurrent.TimeUnit;
+import javax.crypto.SealedObject;
import javax.security.auth.Subject;
import junit.framework.JUnit4TestAdapter;
@@ -53,7 +55,8 @@
import org.junit.Test;
/**
- *
+ * Unit test for SecurityContext.
+ * <p/>
* @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
*
*/
@@ -70,7 +73,7 @@
roles.addMember( new Role("Admin"));
subject.getPrincipals().add(roles);
- SecurityContext securityContext = new SecurityContext(subject);
+ SecurityContext securityContext = new SecurityContext(subject, 30000);
boolean callerInRole = securityContext.isCallerInRole("Admin");
assertTrue( callerInRole );
}
@@ -84,7 +87,7 @@
byte[] publicCred = "secret".getBytes();
subject.getPublicCredentials().add(publicCred);
- SecurityContext securityContext = new SecurityContext(subject);
+ SecurityContext securityContext = new SecurityContext(subject, 30000l);
assertEquals( user, securityContext.getSubject().getPrincipals().iterator().next() );
assertEquals( publicCred, securityContext.getSubject().getPublicCredentials().iterator().next());
@@ -102,7 +105,6 @@
assertTrue (readObject instanceof SecurityContext);
SecurityContext deserialized = (SecurityContext)readObject;
assertEquals( user, deserialized.getSubject().getPrincipals().iterator().next() );
- assertEquals( new String(publicCred), new String((byte[])deserialized.getPubCredentials().iterator().next()));
}
@Test
@@ -114,12 +116,11 @@
byte[] publicCred = "secret".getBytes();
subject.getPublicCredentials().add(publicCred);
- SecurityContext securityContext = new SecurityContext(subject);
+ SecurityContext securityContext = new SecurityContext(subject, 30000l);
Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
- byte[] encryptContext = SecurityContext.encryptContext(securityContext);
- message.getContext().setContext(SecurityService.CONTEXT, encryptContext);
+ SealedObject sealedObject = SecurityContext.encryptContext(securityContext);
+ message.getContext().setContext(SecurityService.CONTEXT, sealedObject);
-
// serialize object
ByteArrayOutputStream bout = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bout);
@@ -133,10 +134,8 @@
// assert that the content is still matches.
assertTrue (readObject instanceof Message);
Message deserializedMsg = (Message) readObject;
- SecurityContext deserialized = SecurityContext.decryptContext((byte[]) deserializedMsg.getContext().getContext(SecurityService.CONTEXT));
+ SecurityContext deserialized = SecurityContext.decryptContext((SealedObject) 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()));
}
@Test
@@ -150,13 +149,12 @@
byte[] privateCred = "privatesecret".getBytes();
subject.getPrivateCredentials().add(privateCred);
- SecurityContext securityContext = new SecurityContext(subject);
- byte[] encrypt = SecurityContext.encryptContext(securityContext);
- assertNotNull(encrypt);
+ SecurityContext securityContext = new SecurityContext(subject, 30000);
+ SealedObject sealedObject = SecurityContext.encryptContext(securityContext);
+ assertNotNull(sealedObject);
- SecurityContext decryptContext = SecurityContext.decryptContext(encrypt);
- assertEquals( new String(publicCred), new String((byte[])decryptContext.getPubCredentials().iterator().next()));
- assertEquals( new String(privateCred), new String((byte[])decryptContext.getPrivCredentials().iterator().next()));
+ SecurityContext decryptContext = SecurityContext.decryptContext(sealedObject);
+ assertEquals( user, decryptContext.getSubject().getPrincipals().iterator().next());
}
@Test
@@ -170,7 +168,7 @@
byte[] privateCred = "privatesecret".getBytes();
subject.getPrivateCredentials().add(privateCred);
- SecurityContext securityContext = new SecurityContext(subject);
+ SecurityContext securityContext = new SecurityContext(subject, 30000);
HashSet<Object> credentials = new HashSet<Object>();
credentials.add(publicCred);
@@ -186,6 +184,41 @@
assertFalse(securityContext.compareTo(null));
}
+ @Test
+ public void timeout() throws InterruptedException
+ {
+ final Subject subject = new Subject();
+ SecurityContext context = new SecurityContext(subject, 30000);
+ assertTrue("Default is 5 min so context should be valid", context.isValid());
+
+ context = new SecurityContext(subject, 100);
+ TimeUnit.SECONDS.sleep(1);
+ assertFalse(context.isValid());
+
+ context = new SecurityContext(subject, 1000);
+ assertTrue(context.isValid());
+ }
+
+ @Test
+ public void constructWithNeverExpiringContext()
+ {
+ SecurityContext securityContext = new SecurityContext(new Subject(), -1);
+ assertTrue(securityContext.isValid());
+ }
+
+ @Test (expected = IllegalArgumentException.class )
+ public void shouldThrowIfTimeoutIsNegative()
+ {
+ new SecurityContext(new Subject(), -2);
+ }
+
+ @Test
+ public void getConfigurationTimeout() throws SecurityServiceException
+ {
+ final long timeout = SecurityContext.getConfigurationTimeout();
+ assertEquals("timeout should match the value in security-properties.xml", 30000l, timeout);
+ }
+
@Before
public void setup() throws ConfigurationException
{
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login)
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,256 +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.login;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.Principal;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-import javax.security.auth.login.LoginException;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.security.SecurityConfig;
-import org.jboss.soa.esb.services.security.SecurityConfigTestUtil;
-import org.jboss.soa.esb.services.security.SecurityConfigUtil;
-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.principals.Group;
-import org.jboss.soa.esb.services.security.principals.Role;
-import org.jboss.soa.esb.services.security.principals.User;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.junit.Test;
-
-/**
- * Unit test for {@link CertificateLoginModule}
- * <p/>
- *
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- *
- */
-public class CertificateLoginModuleUnitTest
-{
- private CertificateLoginModule module = new CertificateLoginModule();
-
- private String keyStorePath = "certtestKeystore";
- private String keyStorePassword = "storepassword";
- private String keyAlias = "certtest";
-
- @Test (expected = LoginException.class )
- public void shouldThrowIfOptionsWereNull() throws LoginException
- {
- module.assertOptions(null);
- }
-
- @Test (expected = LoginException.class )
- public void shouldThrowIfNoOptionsWereSpecified() throws LoginException
- {
- final HashMap<String, ?> options = new HashMap<String, Object>();
- module.assertOptions(options);
- }
-
- @Test (expected = LoginException.class )
- public void shouldThrowIfNoKeyStoreUrlWasSpecified() throws LoginException
- {
- final Map<String, Object> options = getAllOptions();
- options.remove(CertificateLoginModule.KEYSTORE_URL);
- module.assertOptions(options);
- }
-
- @Test (expected = LoginException.class )
- public void shouldThrowIfNoKeyStorePasswordWasSpecified() throws LoginException
- {
- final Map<String, Object> options = getAllOptions();
- options.remove(CertificateLoginModule.KEYSTORE_PASSWORD);
- module.assertOptions(options);
- }
-
- @Test
- public void login() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
- {
- final Certificate callerCert = getCertificate(keyStorePath, keyAlias);
-
- // create the authentication request using the callers certificate as the credential
- final AuthenticationRequest authRequest = getAuthenticationRequest(callerCert);
-
- // create and setup the esb callback handler
- final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
- certCallbackHandler.setAuthenticationRequest(authRequest);
- certCallbackHandler.setSecurityConfig(getSecurityConfig(keyAlias));
-
- // initialize and login
- final Subject subject = new Subject();
- final Map<String, Object> options = getAllOptions();
- options.put(CertificateLoginModule.ROLE_PROPERTIES, "roles.properties");
- module.initialize(subject, certCallbackHandler, null, options);
- boolean login = module.login();
- assertTrue(login);
-
- module.commit();
- final Principal principal = subject.getPrincipals().iterator().next();
- assertTrue(principal instanceof User);
- assertEquals(principal.getName(), "Daniel Bevenius");
-
- final Set<Group> principals = subject.getPrincipals(Group.class);
- assertTrue(principals.iterator().next().isMember(new Role("worker")));
- assertTrue(principals.iterator().next().isMember(new Role("esbrole")));
- }
-
- @Test (expected = LoginException.class)
- public void shouldThrowIsAliasIsNotFound() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
- {
- final Certificate callerCert = getCertificate(keyStorePath, keyAlias);
-
- // create the authentication request using the callers certificate as the credential
- final AuthenticationRequest authRequest = getAuthenticationRequest(callerCert);
-
- // create and setup the esb callback handler
- final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
- certCallbackHandler.setAuthenticationRequest(authRequest);
- certCallbackHandler.setSecurityConfig(getSecurityConfig("bogusAlias"));
-
- // initialize and login
- final Subject subject = new Subject();
- final Map<String, Object> options = getAllOptions();
- module.initialize(subject, certCallbackHandler, null, options);
- module.login();
- }
-
- @Test (expected = LoginException.class)
- public void shouldThrowIfCertificateIsNull() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
- {
- // create the authentication request using the callers certificate as the credential
- final AuthenticationRequest authRequest = getAuthenticationRequest(null);
-
- // create and setup the esb callback handler
- final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
- certCallbackHandler.setAuthenticationRequest(authRequest);
- certCallbackHandler.setSecurityConfig(getSecurityConfig("bogusAlias"));
-
- // initialize and login
- final Subject subject = new Subject();
- final Map<String, Object> options = getAllOptions();
- module.initialize(subject, certCallbackHandler, null, options);
- module.login();
- }
-
- @Test (expected = LoginException.class)
- public void shouldThrowIfCertifcatesDontMatch() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
- {
- // using a different certificate
- final Certificate callerCert = getCertificate(keyStorePath, "certtest2");
-
- // create the authentication request using the callers certificate as the credential
- final AuthenticationRequest authRequest = getAuthenticationRequest(callerCert);
-
- // create and setup the esb callback handler
- final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
- certCallbackHandler.setAuthenticationRequest(authRequest);
- certCallbackHandler.setSecurityConfig(getSecurityConfig(keyAlias));
-
- // initialize and login
- final Subject subject = new Subject();
- final Map<String, Object> options = getAllOptions();
- module.initialize(subject, certCallbackHandler, null, options);
- module.login();
- }
-
- @Test
- public void addRoles() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
- {
- final Subject subject = new Subject();
- final Map<String, Object> options = getAllOptions();
- options.put(CertificateLoginModule.ROLE_PROPERTIES, "roles.properties");
-
- // simulates the authenticated principal
- final Principal principal = new User("Daniel Bevenius");
- subject.getPrincipals().add(principal);
-
- // call add roles
- module.addRoles(subject, principal, null, options);
-
- final Set<Group> principals = subject.getPrincipals(Group.class);
- assertTrue(principals.iterator().next().isMember(new Role("worker")));
- assertTrue(principals.iterator().next().isMember(new Role("esbrole")));
- }
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(CertificateLoginModuleUnitTest.class);
- }
-
- private Map<String, Object> getAllOptions()
- {
- return getAllOptions(keyStorePath, keyStorePassword);
- }
-
- private Map<String, Object> getAllOptions(final String keystoreUrl, final String keyStorePassword)
- {
- HashMap<String, Object> options = new HashMap<String, Object>();
- options.put(CertificateLoginModule.KEYSTORE_URL, keystoreUrl);
- options.put(CertificateLoginModule.KEYSTORE_PASSWORD, keyStorePassword);
- return options;
- }
-
- private Certificate getCertificate(final String keyStorePath, final String alias) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
- {
- final KeyStore keyStore = loadKeyStore(keyStorePath, keyStorePassword);
- assertTrue("Keystore did not contain the expected alias : " + keyAlias, keyStore.containsAlias(alias));
- return keyStore.getCertificate(alias);
- }
-
- private AuthenticationRequest getAuthenticationRequest(final Certificate callerCert)
- {
- // create the authentication request using the callers certificate as the credential
- return new AuthenticationRequestImpl.Builder(null, Collections.singleton((Object)callerCert)).build();
- }
-
- private SecurityConfig getSecurityConfig(final String alias)
- {
- final ConfigTree securityFragment = SecurityConfigTestUtil.createSecurityFragment("adminRole", null, null, null, alias);
- return SecurityConfigUtil.createSecurityConfig(securityFragment);
- }
-
-
- private KeyStore loadKeyStore(final String keyStorePath, final String keyStorePassword) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
- {
- KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
- InputStream in = ClassUtil.getResourceAsStream(keyStorePath, this.getClass());
- keystore.load(in, (keyStorePassword).toCharArray());
- assertNotNull("Was not able to load keystore: " + keyStorePath, keystore);
- return keystore;
- }
-}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/CertificateLoginModuleUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,256 @@
+/*
+ * 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.login;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Principal;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+import javax.security.auth.login.LoginException;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.services.security.SecurityConfig;
+import org.jboss.soa.esb.services.security.SecurityConfigTestUtil;
+import org.jboss.soa.esb.services.security.SecurityConfigUtil;
+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.principals.Group;
+import org.jboss.soa.esb.services.security.principals.Role;
+import org.jboss.soa.esb.services.security.principals.User;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.junit.Test;
+
+/**
+ * Unit test for {@link CertificateLoginModule}
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class CertificateLoginModuleUnitTest
+{
+ private CertificateLoginModule module = new CertificateLoginModule();
+
+ private String keyStorePath = "certtestKeystore";
+ private String keyStorePassword = "storepassword";
+ private String keyAlias = "certtest";
+
+ @Test (expected = LoginException.class )
+ public void shouldThrowIfOptionsWereNull() throws LoginException
+ {
+ module.assertOptions(null);
+ }
+
+ @Test (expected = LoginException.class )
+ public void shouldThrowIfNoOptionsWereSpecified() throws LoginException
+ {
+ final HashMap<String, ?> options = new HashMap<String, Object>();
+ module.assertOptions(options);
+ }
+
+ @Test (expected = LoginException.class )
+ public void shouldThrowIfNoKeyStoreUrlWasSpecified() throws LoginException
+ {
+ final Map<String, Object> options = getAllOptions();
+ options.remove(CertificateLoginModule.KEYSTORE_URL);
+ module.assertOptions(options);
+ }
+
+ @Test (expected = LoginException.class )
+ public void shouldThrowIfNoKeyStorePasswordWasSpecified() throws LoginException
+ {
+ final Map<String, Object> options = getAllOptions();
+ options.remove(CertificateLoginModule.KEYSTORE_PASSWORD);
+ module.assertOptions(options);
+ }
+
+ @Test
+ public void login() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
+ {
+ final Certificate callerCert = getCertificate(keyStorePath, keyAlias);
+
+ // create the authentication request using the callers certificate as the credential
+ final AuthenticationRequest authRequest = getAuthenticationRequest(callerCert);
+
+ // create and setup the esb callback handler
+ final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
+ certCallbackHandler.setAuthenticationRequest(authRequest);
+ certCallbackHandler.setSecurityConfig(getSecurityConfig(keyAlias));
+
+ // initialize and login
+ final Subject subject = new Subject();
+ final Map<String, Object> options = getAllOptions();
+ options.put(CertificateLoginModule.ROLE_PROPERTIES, "roles.properties");
+ module.initialize(subject, certCallbackHandler, null, options);
+ boolean login = module.login();
+ assertTrue(login);
+
+ module.commit();
+ final Principal principal = subject.getPrincipals().iterator().next();
+ assertTrue(principal instanceof User);
+ assertEquals(principal.getName(), "Daniel Bevenius");
+
+ final Set<Group> principals = subject.getPrincipals(Group.class);
+ assertTrue(principals.iterator().next().isMember(new Role("worker")));
+ assertTrue(principals.iterator().next().isMember(new Role("esbrole")));
+ }
+
+ @Test (expected = LoginException.class)
+ public void shouldThrowIsAliasIsNotFound() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
+ {
+ final Certificate callerCert = getCertificate(keyStorePath, keyAlias);
+
+ // create the authentication request using the callers certificate as the credential
+ final AuthenticationRequest authRequest = getAuthenticationRequest(callerCert);
+
+ // create and setup the esb callback handler
+ final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
+ certCallbackHandler.setAuthenticationRequest(authRequest);
+ certCallbackHandler.setSecurityConfig(getSecurityConfig("bogusAlias"));
+
+ // initialize and login
+ final Subject subject = new Subject();
+ final Map<String, Object> options = getAllOptions();
+ module.initialize(subject, certCallbackHandler, null, options);
+ module.login();
+ }
+
+ @Test (expected = LoginException.class)
+ public void shouldThrowIfCertificateIsNull() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
+ {
+ // create the authentication request using the callers certificate as the credential
+ final AuthenticationRequest authRequest = getAuthenticationRequest(null);
+
+ // create and setup the esb callback handler
+ final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
+ certCallbackHandler.setAuthenticationRequest(authRequest);
+ certCallbackHandler.setSecurityConfig(getSecurityConfig("bogusAlias"));
+
+ // initialize and login
+ final Subject subject = new Subject();
+ final Map<String, Object> options = getAllOptions();
+ module.initialize(subject, certCallbackHandler, null, options);
+ module.login();
+ }
+
+ @Test (expected = LoginException.class)
+ public void shouldThrowIfCertifcatesDontMatch() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
+ {
+ // using a different certificate
+ final Certificate callerCert = getCertificate(keyStorePath, "certtest2");
+
+ // create the authentication request using the callers certificate as the credential
+ final AuthenticationRequest authRequest = getAuthenticationRequest(callerCert);
+
+ // create and setup the esb callback handler
+ final CertCallbackHandler certCallbackHandler = new CertCallbackHandler();
+ certCallbackHandler.setAuthenticationRequest(authRequest);
+ certCallbackHandler.setSecurityConfig(getSecurityConfig(keyAlias));
+
+ // initialize and login
+ final Subject subject = new Subject();
+ final Map<String, Object> options = getAllOptions();
+ module.initialize(subject, certCallbackHandler, null, options);
+ module.login();
+ }
+
+ @Test
+ public void addRoles() throws LoginException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
+ {
+ final Subject subject = new Subject();
+ final Map<String, Object> options = getAllOptions();
+ options.put(CertificateLoginModule.ROLE_PROPERTIES, "roles.properties");
+
+ // simulates the authenticated principal
+ final Principal principal = new User("Daniel Bevenius");
+ subject.getPrincipals().add(principal);
+
+ // call add roles
+ module.addRoles(subject, principal, null, options);
+
+ final Set<Group> principals = subject.getPrincipals(Group.class);
+ assertTrue(principals.iterator().next().isMember(new Role("worker")));
+ assertTrue(principals.iterator().next().isMember(new Role("esbrole")));
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(CertificateLoginModuleUnitTest.class);
+ }
+
+ private Map<String, Object> getAllOptions()
+ {
+ return getAllOptions(keyStorePath, keyStorePassword);
+ }
+
+ private Map<String, Object> getAllOptions(final String keystoreUrl, final String keyStorePassword)
+ {
+ HashMap<String, Object> options = new HashMap<String, Object>();
+ options.put(CertificateLoginModule.KEYSTORE_URL, keystoreUrl);
+ options.put(CertificateLoginModule.KEYSTORE_PASSWORD, keyStorePassword);
+ return options;
+ }
+
+ private Certificate getCertificate(final String keyStorePath, final String alias) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
+ {
+ final KeyStore keyStore = loadKeyStore(keyStorePath, keyStorePassword);
+ assertTrue("Keystore did not contain the expected alias : " + keyAlias, keyStore.containsAlias(alias));
+ return keyStore.getCertificate(alias);
+ }
+
+ private AuthenticationRequest getAuthenticationRequest(final Certificate callerCert)
+ {
+ // create the authentication request using the callers certificate as the credential
+ return new AuthenticationRequestImpl.Builder(null, Collections.singleton((Object)callerCert)).build();
+ }
+
+ private SecurityConfig getSecurityConfig(final String alias)
+ {
+ final ConfigTree securityFragment = SecurityConfigTestUtil.createSecurityFragment("adminRole", null, null, null, alias);
+ return SecurityConfigUtil.createSecurityConfig(securityFragment);
+ }
+
+
+ private KeyStore loadKeyStore(final String keyStorePath, final String keyStorePassword) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
+ {
+ KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
+ InputStream in = ClassUtil.getResourceAsStream(keyStorePath, this.getClass());
+ keystore.load(in, (keyStorePassword).toCharArray());
+ assertNotNull("Was not able to load keystore: " + keyStorePath, keystore);
+ return keystore;
+ }
+}
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/certtestKeystore
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/certtestKeystore (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/certtestKeystore)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,6 +0,0 @@
-# user=role1,role2,...
-guest=guest
-esbuser=esbrole
-
-# sort of ugly but can be used when a CN contains a space character.
-Daniel\u0020Bevenius=esbrole,worker
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/auth/login/roles.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,6 @@
+# user=role1,role2,...
+guest=guest
+esbuser=esbrole
+
+# sort of ugly but can be used when a CN contains a space character.
+Daniel\u0020Bevenius=esbrole,worker
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/jaas.login
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/jaas.login 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/jaas.login 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,9 +0,0 @@
-SuccessfulLogin {
- org.jboss.soa.esb.services.security.TestLoginModule required forceLogin=true;
-};
-FailureLogin {
- org.jboss.soa.esb.services.security.TestLoginModule required forceLogin=false;
-};
-UserPassLogin {
- org.jboss.soa.esb.services.security.SimpleLoginModule required ;
-};
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/security-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/security-properties.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/security-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -40,18 +40,18 @@
<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.privateKeystore" value="privateKeyStore"/>
- <property name="org.jboss.soa.esb.services.security.privateKeystorePassword" value="testKeystorePassword"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyAlias" value="testAlias"/>
- <property name="org.jboss.soa.esb.services.security.privateKeyPassword" value="testPassword"/>
+ <property name="org.jboss.soa.esb.services.security.sealAlgorithm" value="TripleDES"/>
+ <property name="org.jboss.soa.esb.services.security.sealKeySize" value="168"/>
+ <property name="org.jboss.soa.esb.services.security.contextTimeout" value="30000"/>
+
<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"/>
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util)
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,122 +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.util;
-
-import static org.junit.Assert.*;
-
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.NoSuchAlgorithmException;
-import java.security.Provider;
-import java.security.Security;
-
-import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
-
-import org.jboss.soa.esb.services.security.SecurityServiceException;
-import org.junit.Test;
-
-import junit.framework.JUnit4TestAdapter;
-
-/**
- * Unit test from CryptoUtil.
- *
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- *
- */
-public class CryptoUtilUnitTest
-{
- @Test
- public void encryptDecryptRSA() throws NoSuchAlgorithmException, SecurityServiceException
- {
- final String payload = "Some text...";
- KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
- keyGen.initialize(1024);
- KeyPair keyPair = keyGen.generateKeyPair();
-
- byte[] encrypt = CryptoUtil.encrypt(payload.getBytes() , keyPair.getPublic(), keyPair.getPublic().getAlgorithm());
- byte[] decrypt = CryptoUtil.decrypt(encrypt, keyPair.getPrivate(), keyPair.getPrivate().getAlgorithm());
- assertEquals(payload, new String(decrypt));
- }
-
- @Test
- public void encryptDecryptDES() throws NoSuchAlgorithmException, SecurityServiceException
- {
- final String payload = "Some text...";
- KeyGenerator keyGen = KeyGenerator.getInstance("DES");
- keyGen.init(56);
- SecretKey secretKey = keyGen.generateKey();
- final String transformation = "DES/ECB/PKCS5Padding";
-
- byte[] encrypt = CryptoUtil.encrypt(payload.getBytes() , secretKey, transformation);
-
- byte[] decrypt = CryptoUtil.decrypt(encrypt, secretKey, transformation);
- assertEquals(payload, new String(decrypt));
- }
-
- @Test
- public void encryptDecryptTripleDES() throws NoSuchAlgorithmException, SecurityServiceException
- {
- dumpSecurityProviders();
- final String payload = "Some text...";
- KeyGenerator keyGen = KeyGenerator.getInstance("Blowfish");
- keyGen.init(128);
- SecretKey secretKey = keyGen.generateKey();
- final String transformation = "Blowfish/ECB/PKCS5Padding";
-
- byte[] encrypt = CryptoUtil.encrypt(payload.getBytes() , secretKey, transformation);
-
- byte[] decrypt = CryptoUtil.decrypt(encrypt, secretKey, transformation);
- assertEquals(payload, new String(decrypt));
- }
-
- @Test
- public void encryptDecryptTripleEAS() throws NoSuchAlgorithmException, SecurityServiceException
- {
- final String payload = "Some text...";
- KeyGenerator keyGen = KeyGenerator.getInstance("AES");
- keyGen.init(128);
- SecretKey secretKey = keyGen.generateKey();
- final String transformation = "AES/ECB/PKCS5Padding";
-
- byte[] encrypt = CryptoUtil.encrypt(payload.getBytes() , secretKey, transformation);
-
- byte[] decrypt = CryptoUtil.decrypt(encrypt, secretKey, transformation);
- assertEquals(payload, new String(decrypt));
- }
-
-
- @SuppressWarnings("unused")
- private void dumpSecurityProviders()
- {
- Provider[] providers = Security.getProviders();
- for (Provider provider : providers)
- {
- System.out.println(provider.getServices());
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(CryptoUtilUnitTest.class);
- }
-
-}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/security/util/CryptoUtilUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,122 @@
+/*
+ * 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.util;
+
+import static org.junit.Assert.*;
+
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
+import java.security.Security;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+
+import org.jboss.soa.esb.services.security.SecurityServiceException;
+import org.junit.Test;
+
+import junit.framework.JUnit4TestAdapter;
+
+/**
+ * Unit test from CryptoUtil.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class CryptoUtilUnitTest
+{
+ @Test
+ public void encryptDecryptRSA() throws NoSuchAlgorithmException, SecurityServiceException
+ {
+ final String payload = "Some text...";
+ KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
+ keyGen.initialize(1024);
+ KeyPair keyPair = keyGen.generateKeyPair();
+
+ byte[] encrypt = CryptoUtil.encrypt(payload.getBytes() , keyPair.getPublic(), keyPair.getPublic().getAlgorithm());
+ byte[] decrypt = CryptoUtil.decrypt(encrypt, keyPair.getPrivate(), keyPair.getPrivate().getAlgorithm());
+ assertEquals(payload, new String(decrypt));
+ }
+
+ @Test
+ public void encryptDecryptDES() throws NoSuchAlgorithmException, SecurityServiceException
+ {
+ final String payload = "Some text...";
+ KeyGenerator keyGen = KeyGenerator.getInstance("DES");
+ keyGen.init(56);
+ SecretKey secretKey = keyGen.generateKey();
+ final String transformation = "DES/ECB/PKCS5Padding";
+
+ byte[] encrypt = CryptoUtil.encrypt(payload.getBytes() , secretKey, transformation);
+
+ byte[] decrypt = CryptoUtil.decrypt(encrypt, secretKey, transformation);
+ assertEquals(payload, new String(decrypt));
+ }
+
+ @Test
+ public void encryptDecryptTripleDES() throws NoSuchAlgorithmException, SecurityServiceException
+ {
+ dumpSecurityProviders();
+ final String payload = "Some text...";
+ KeyGenerator keyGen = KeyGenerator.getInstance("Blowfish");
+ keyGen.init(128);
+ SecretKey secretKey = keyGen.generateKey();
+ final String transformation = "Blowfish/ECB/PKCS5Padding";
+
+ byte[] encrypt = CryptoUtil.encrypt(payload.getBytes() , secretKey, transformation);
+
+ byte[] decrypt = CryptoUtil.decrypt(encrypt, secretKey, transformation);
+ assertEquals(payload, new String(decrypt));
+ }
+
+ @Test
+ public void encryptDecryptTripleEAS() throws NoSuchAlgorithmException, SecurityServiceException
+ {
+ final String payload = "Some text...";
+ KeyGenerator keyGen = KeyGenerator.getInstance("AES");
+ keyGen.init(128);
+ SecretKey secretKey = keyGen.generateKey();
+ final String transformation = "AES/ECB/PKCS5Padding";
+
+ byte[] encrypt = CryptoUtil.encrypt(payload.getBytes() , secretKey, transformation);
+
+ byte[] decrypt = CryptoUtil.decrypt(encrypt, secretKey, transformation);
+ assertEquals(payload, new String(decrypt));
+ }
+
+
+ @SuppressWarnings("unused")
+ private void dumpSecurityProviders()
+ {
+ Provider[] providers = Security.getProviders();
+ for (Provider provider : providers)
+ {
+ System.out.println(provider.getServices());
+ }
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(CryptoUtilUnitTest.class);
+ }
+
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/build.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,45 +0,0 @@
-<project name="Quickstart_publish_as_webservice_inonly" default="run" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <!-- additional deploys -->
- <property name="additional.deploys" value="*.xsd"/>
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
- <target name="runtest" depends="compile" description="sends soap message to published web service">
- <echo>Send soap message to published web service and receive reponse</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test.SOAPTest" failonerror="true">
- <arg value="soap-userpass-message.xml"/>
- <classpath refid="exec-classpath"/>
- </java>
- <echo/>
- <echo/>
- <echo>Send soap message to published web service and receive soap fault message</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test.SOAPTest" failonerror="true">
- <arg value="error-soap-message.xml"/>
- <classpath refid="exec-classpath"/>
- </java>
- </target>
-
- <target name="sendesb" depends="compile" description="send esb Message to esb service">
- <echo>Send esb message to esb service and get response</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test.SendEsbMessage" failonerror="true">
- <arg value="ESBServiceSample"/> <!-- service category -->
- <arg value="HelloWorldPubService"/> <!-- service name -->
- <arg value="HelloWorld"/> <!-- Message text -->
- <classpath refid="exec-classpath"/>
- </java>
- <echo>Send esb message to esb service and get error</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test.SendEsbMessage" failonerror="true">
- <arg value="ESBServiceSample"/> <!-- service category -->
- <arg value="HelloWorldPubService"/> <!-- service name -->
- <arg value="Error"/> <!-- Message text -->
- <classpath refid="exec-classpath"/>
- </java>
-
- </target>
-</project>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/build.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,45 @@
+<project name="Quickstart_publish_as_webservice_inonly" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- additional deploys -->
+ <property name="additional.deploys" value="*.xsd"/>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+ <target name="runtest" depends="compile" description="sends soap message to published web service">
+ <echo>Send soap message to published web service and receive reponse</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test.SOAPTest" failonerror="true">
+ <arg value="soap-userpass-message.xml"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ <echo/>
+ <echo/>
+ <echo>Send soap message to published web service and receive soap fault message</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test.SOAPTest" failonerror="true">
+ <arg value="error-soap-message.xml"/>
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="sendesb" depends="compile" description="send esb Message to esb service">
+ <echo>Send esb message to esb service and get response</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test.SendEsbMessage" failonerror="true">
+ <arg value="ESBServiceSample"/> <!-- service category -->
+ <arg value="HelloWorldPubService"/> <!-- service name -->
+ <arg value="HelloWorld"/> <!-- Message text -->
+ <classpath refid="exec-classpath"/>
+ </java>
+ <echo>Send esb message to esb service and get error</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test.SendEsbMessage" failonerror="true">
+ <arg value="ESBServiceSample"/> <!-- service category -->
+ <arg value="HelloWorldPubService"/> <!-- service name -->
+ <arg value="Error"/> <!-- Message text -->
+ <classpath refid="exec-classpath"/>
+ </java>
+
+ </target>
+</project>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,5 +0,0 @@
-<jbossesb-deployment>
- <depends>jboss.esb:deployment=soap.esb</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb_reply</depends>
-</jbossesb-deployment>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/deployment.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,5 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=soap.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb_reply</depends>
+</jbossesb-deployment>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,9 +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"
- xmlns:say="http://www.jboss.org/sayHi">
- <soap:Body>
- <say:sayHi><say:arg0>Error</say:arg0></say:sayHi>
- </soap:Body>
-
-</soap:Envelope>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/error-soap-message.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,9 @@
+<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"
+ xmlns:say="http://www.jboss.org/sayHi">
+ <soap:Body>
+ <say:sayHi><say:arg0>Error</say:arg0></say:sayHi>
+ </soap:Body>
+
+</soap:Envelope>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,9 +0,0 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:element name="sayFault" type="x1:fault"/>
- <xs:complexType name="fault">
- <xs:sequence>
- <xs:element name="code" type="xs:string"/>
- <xs:element name="faultString" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/fault.xsd 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,9 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="sayFault" type="x1:fault"/>
+ <xs:complexType name="fault">
+ <xs:sequence>
+ <xs:element name="code" type="xs:string"/>
+ <xs:element name="faultString" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbm-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb_reply">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbmq-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_publish_as_webservice_inonly_Request_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,34 +0,0 @@
-<?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" parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_publish_as_webservice_inonly_Request_esb"
- selector="serviceName='HelloWorldPubService'"
- />
- </jms-bus>
-
- </jms-provider>
- </providers>
-
- <services>
- <service
- category="ESBServiceSample"
- name="HelloWorldPubService"
- description="Hello world ESB Service">
- <listeners>
- <jms-listener name="helloWorld"
- busidref="quickstartEsbChannel"
- maxThreads="1"
- />
- </listeners>
- <actions mep="OneWay" inXsd="/request.xsd" faultXsd="/fault.xsd" >
- <action name="action" class="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.ESBWSListenerAction" process="displayMessage"/>
- </actions>
- </service>
- </services>
-
-</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jboss-esb.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,34 @@
+<?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" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_publish_as_webservice_inonly_Request_esb"
+ selector="serviceName='HelloWorldPubService'"
+ />
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service
+ category="ESBServiceSample"
+ name="HelloWorldPubService"
+ description="Hello world ESB Service">
+ <listeners>
+ <jms-listener name="helloWorld"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions mep="OneWay" inXsd="/request.xsd" faultXsd="/fault.xsd" >
+ <action name="action" class="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.ESBWSListenerAction" process="displayMessage"/>
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,86 +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.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <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="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI"
- value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
- value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#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.RMITransport"/>
- </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"/>
- </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">
- <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"/>
- <!-- # of milliseconds to timeout waiting for a connection from pool -->
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
- </properties>
- <properties name="messagerouting">
- <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
- </properties>
-</esb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jbossesb-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,86 @@
+<?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.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <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="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#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.RMITransport"/>
+ </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"/>
+ </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">
+ <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"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/jndi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
-
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/juddi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/lib (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/lib)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/listener.log
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/listener.log 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/listener.log 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,20 +0,0 @@
-2008-10-24 10:08:10,203 DEBUG [main][httpclient.wire.header] >> "POST /Quickstart_publish_as_webservice_inonly/ESBServiceSample/HelloWorldPubService?wsdl HTTP/1.1[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "Host: 127.0.0.1:8080[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "Content-Length: 324[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" [\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:xsd="http://www.w3.org/2001/XMLSchema"[\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:say="http://www.jboss.org/sayHi">[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " <soap:Body>[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " <say:sayHi><say:arg0>Error</say:arg0></say:sayHi>[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " </soap:Body>[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> "[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> "</soap:Envelope> [\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Server: Apache-Coyote/1.1[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Content-Length: 0[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Date: Fri, 24 Oct 2008 09:08:10 GMT[\r][\n]"
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/listener.log (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/listener.log)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/listener.log (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/listener.log 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,20 @@
+2008-10-24 10:08:10,203 DEBUG [main][httpclient.wire.header] >> "POST /Quickstart_publish_as_webservice_inonly/ESBServiceSample/HelloWorldPubService?wsdl HTTP/1.1[\r][\n]"
+2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "Host: 127.0.0.1:8080[\r][\n]"
+2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "Content-Length: 324[\r][\n]"
+2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "[\r][\n]"
+2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" [\n]"
+2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [\n]"
+2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:xsd="http://www.w3.org/2001/XMLSchema"[\n]"
+2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:say="http://www.jboss.org/sayHi">[\n]"
+2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " <soap:Body>[\n]"
+2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " <say:sayHi><say:arg0>Error</say:arg0></say:sayHi>[\n]"
+2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " </soap:Body>[\n]"
+2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> "[\n]"
+2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> "</soap:Envelope> [\n]"
+2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
+2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Server: Apache-Coyote/1.1[\r][\n]"
+2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5[\r][\n]"
+2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Content-Length: 0[\r][\n]"
+2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Date: Fri, 24 Oct 2008 09:08:10 GMT[\r][\n]"
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="INFO"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="DEBUG"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/log4j.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="DEBUG"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,33 +0,0 @@
-Overview:
-=========
- The purpose of the publish_as_webservice_inonly quickstart sample is to demonstrate how to
- publish an OneWay (In-Only) esb service as a web service.
-
-Running this quickstart:
-========================
- Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
- and a more detailed descripton of the different ways to run the quickstarts.
-
-To Run '.esb' archive mode:
-===========================
- 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
- 2. Open another command terminal window in this folder ("Window2"), type
- 'ant runtest'.
- 3. Open another command terminal window in this folder ("Window2"), type
- 'ant sendesb'.
- 4. In this folder ("Window1"), type 'ant undeploy'.
-
-To Run from Soapui:
-===========================
- 1. Use the following URL: 'http://127.0.0.1:8080/Quickstart_publish_as_webservice_inonly/ESBServiceSample/HelloWorldPubService?wsdl'.
- 2. Copy the contents of soap-userpass-message.xml.
- 3. Exceute the web service call from soapui.
-
-======================================
- 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.
-
- 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.
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/readme.txt 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,33 @@
+Overview:
+=========
+ The purpose of the publish_as_webservice_inonly quickstart sample is to demonstrate how to
+ publish an OneWay (In-Only) esb service as a web service.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open another command terminal window in this folder ("Window2"), type
+ 'ant runtest'.
+ 3. Open another command terminal window in this folder ("Window2"), type
+ 'ant sendesb'.
+ 4. In this folder ("Window1"), type 'ant undeploy'.
+
+To Run from Soapui:
+===========================
+ 1. Use the following URL: 'http://127.0.0.1:8080/Quickstart_publish_as_webservice_inonly/ESBServiceSample/HelloWorldPubService?wsdl'.
+ 2. Copy the contents of soap-userpass-message.xml.
+ 3. Exceute the web service call from soapui.
+
+======================================
+ 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.
+
+ 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.
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,8 +0,0 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:element name="sayHi" type="x1:sayHi"/>
- <xs:complexType name="sayHi">
- <xs:sequence>
- <xs:element name="arg0" type="xs:string" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/request.xsd 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="sayHi" type="x1:sayHi"/>
+ <xs:complexType name="sayHi">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,11 +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"
- xmlns:say="http://www.jboss.org/sayHi">
- <soap:Body>
- <say:sayHi>
- <say:arg0>HelloWorld</say:arg0>
- </say:sayHi>"
- </soap:Body>
-
-</soap:Envelope>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/soap-userpass-message.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,11 @@
+<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"
+ xmlns:say="http://www.jboss.org/sayHi">
+ <soap:Body>
+ <say:sayHi>
+ <say:arg0>HelloWorld</say:arg0>
+ </say:sayHi>"
+ </soap:Body>
+
+</soap:Envelope>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path=""/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path=""/>
-</classpath>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.classpath 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path=""/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.project
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/.project 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.project 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>pubservice-sample</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.project (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/.project)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.project (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/.project 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>pubservice-sample</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,55 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.publishAsWebservice;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.actions.ActionProcessingDetailFaultException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class ESBWSListenerAction extends AbstractActionLifecycle
-{
- protected ConfigTree _config;
-
- public ESBWSListenerAction(ConfigTree config)
- {
- _config = config;
- }
-
- public Message displayMessage(Message message) throws Exception
- {
- final String request = (String)message.getBody().get() ;
- if (request.contains("Error")) {
- final String detail = "<say:sayFault xmlns:say=\"http://www.jboss.org/sayHi\"><say:code>" +
- "myErrorCode" + "</say:code><say:faultString>" + "myDescription" +
- "</say:faultString></say:sayFault>" ;
- throw new ActionProcessingDetailFaultException(new QName("http://www.jboss.org/sayHi", "myErrorCode"), "myDescription", detail) ;
- }
-
- System.out.println("Received request: " + request) ;
- final String responseMsg = "<say:sayHiResponse xmlns:say=\"http://www.jboss.org/sayHi\"><say:arg0>" +
- "Response from ESB Service" + "</say:arg0></say:sayHiResponse>" ;
- message.getBody().add(responseMsg);
- return message;
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/ESBWSListenerAction.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package org.jboss.soa.esb.samples.quickstart.publishAsWebservice;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.actions.ActionProcessingDetailFaultException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class ESBWSListenerAction extends AbstractActionLifecycle
+{
+ protected ConfigTree _config;
+
+ public ESBWSListenerAction(ConfigTree config)
+ {
+ _config = config;
+ }
+
+ public Message displayMessage(Message message) throws Exception
+ {
+ final String request = (String)message.getBody().get() ;
+ if (request.contains("Error")) {
+ final String detail = "<say:sayFault xmlns:say=\"http://www.jboss.org/sayHi\"><say:code>" +
+ "myErrorCode" + "</say:code><say:faultString>" + "myDescription" +
+ "</say:faultString></say:sayFault>" ;
+ throw new ActionProcessingDetailFaultException(new QName("http://www.jboss.org/sayHi", "myErrorCode"), "myDescription", detail) ;
+ }
+
+ System.out.println("Received request: " + request) ;
+ final String responseMsg = "<say:sayHiResponse xmlns:say=\"http://www.jboss.org/sayHi\"><say:arg0>" +
+ "Response from ESB Service" + "</say:arg0></say:sayHiResponse>" ;
+ message.getBody().add(responseMsg);
+ return message;
+ }
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,58 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.StringRequestEntity;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.ConfigurationException;
-
-public class SOAPTest {
-
- public static void main(String args[]) throws ConfigurationException, UnsupportedEncodingException {
-
- final String soap = StreamUtils.getResourceAsString(args[0], "UTF-8");
- HttpClient client = new HttpClient();
- PostMethod postMethod = new PostMethod(
- "http://127.0.0.1:8080/Quickstart_publish_as_webservice_inonly/ESBServiceSample/HelloWorldPubService?wsdl");
-
- StringRequestEntity requestEntity = new StringRequestEntity(soap);
- postMethod.setRequestEntity(requestEntity);
- try {
- client.executeMethod(postMethod);
- System.out.println("Response from web service");
- System.out.println("[" + postMethod.getResponseBodyAsString() + "]");
- } catch (HttpException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- System.exit(0);
-
- }
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SOAPTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.jboss.soa.esb.samples.quickstart.publishAsWebservice.test;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.ConfigurationException;
+
+public class SOAPTest {
+
+ public static void main(String args[]) throws ConfigurationException, UnsupportedEncodingException {
+
+ final String soap = StreamUtils.getResourceAsString(args[0], "UTF-8");
+ HttpClient client = new HttpClient();
+ PostMethod postMethod = new PostMethod(
+ "http://127.0.0.1:8080/Quickstart_publish_as_webservice_inonly/ESBServiceSample/HelloWorldPubService?wsdl");
+
+ StringRequestEntity requestEntity = new StringRequestEntity(soap);
+ postMethod.setRequestEntity(requestEntity);
+ try {
+ client.executeMethod(postMethod);
+ System.out.println("Response from web service");
+ System.out.println("[" + postMethod.getResponseBodyAsString() + "]");
+ } catch (HttpException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ System.exit(0);
+
+ }
+
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,74 +0,0 @@
-/*
- * 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.samples.quickstart.publishAsWebservice.test;
-
-import java.util.Set;
-import java.io.Serializable;
-import java.util.HashSet;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.security.SecurityService;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-import org.jboss.soa.esb.services.security.principals.User;
-import org.jboss.soa.esb.client.ServiceInvoker;
-import org.jboss.soa.esb.couriers.FaultMessageException;
-import org.jboss.soa.esb.services.security.PublicCryptoUtil;
-
-/**
- * Standalone class with to send ESB messages to a 'known' [category,name].
- * <p/> arg0 - service category
- * <br/>arg1 - service name
- * <br/>arg2 - Text of message to send
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- *
- */
-public class SendEsbMessage
-{
- public static void main(String args[]) throws Exception
- {
-// Setting the ConnectionFactory such that it will use scout
- System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
-
- if (args.length < 3)
- {
- System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
- }
- Message esbMessage = MessageFactory.getInstance().getMessage();
-
- final String message = "<say:sayHi xmlns:say=\"http://www.jboss.org/sayHi\"><say:arg0>" + args[2] + "</say:arg0></say:sayHi>" ;
- esbMessage.getBody().add(message);
-
- ServiceInvoker invoker = new ServiceInvoker(args[0], args[1]);
-
- Message response = null;
- try {
- invoker.deliverAsync(esbMessage);
- }catch(Exception ex) {
- ex.printStackTrace();
- }
- System.exit(0);
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice_inonly/src/org/jboss/soa/esb/samples/quickstart/publishAsWebservice/test/SendEsbMessage.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,74 @@
+/*
+ * 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.samples.quickstart.publishAsWebservice.test;
+
+import java.util.Set;
+import java.io.Serializable;
+import java.util.HashSet;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.security.SecurityService;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
+import org.jboss.soa.esb.services.security.principals.User;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.couriers.FaultMessageException;
+import org.jboss.soa.esb.services.security.PublicCryptoUtil;
+
+/**
+ * Standalone class with to send ESB messages to a 'known' [category,name].
+ * <p/> arg0 - service category
+ * <br/>arg1 - service name
+ * <br/>arg2 - Text of message to send
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class SendEsbMessage
+{
+ public static void main(String args[]) throws Exception
+ {
+// Setting the ConnectionFactory such that it will use scout
+ System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+
+ if (args.length < 3)
+ {
+ System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+ }
+ Message esbMessage = MessageFactory.getInstance().getMessage();
+
+ final String message = "<say:sayHi xmlns:say=\"http://www.jboss.org/sayHi\"><say:arg0>" + args[2] + "</say:arg0></say:sayHi>" ;
+ esbMessage.getBody().add(message);
+
+ ServiceInvoker invoker = new ServiceInvoker(args[0], args[1]);
+
+ Message response = null;
+ try {
+ invoker.deliverAsync(esbMessage);
+ }catch(Exception ex) {
+ ex.printStackTrace();
+ }
+ System.exit(0);
+ }
+}
Modified: labs/jbossesb/trunk/product/samples/quickstarts/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/readme.txt 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/samples/quickstarts/readme.txt 2009-01-27 13:29:49 UTC (rev 24944)
@@ -30,9 +30,7 @@
App Server turned "off" while this process is occuring.
This process will add the JBoss ESB artifacts to your JBoss Application
Server.
-- Almost all of these examples use RMI-based registration.
- "helloworld_db_registration" makes a client/server connection to the registry
- database. It assumes a MySQL DB holds the registry.
+- All of these examples use RMI-based registration.
The following is a brief outline of some of the various quickstarts. If this is
your first time working with the JBoss ESB we recommend at least trying
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/build.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,68 +0,0 @@
-<project name="Quickstart_Security_Cert" default="deploy" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-
- <target name="quickstart-specific-checks" depends="assert-ws-available"/>
-
- <target name="quickstart-specific-dependencies">
- <path id="quickstart-dependencies-classpath">
- <fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
- </path>
- </target>
-
- <target name="quickstart-specific-assemblies">
- <!-- Overriden from the target of the same name in base-build.xml. -->
- <!-- Called by the "deploy" target. Don't call directly!! -->
-
- <!-- Build the webservice... -->
- <war warfile="build/${ant.project.name}.war"
- webxml="${basedir}/war/resources/WEB-INF/web.xml">
- <fileset dir="${basedir}/war/view">
- <include name="**/*"/>
- </fileset>
- </war>
- </target>
-
- <target name="runtest" depends="compile" description="run tests over jms, http, and socket">
- <antcall target="saygoodbye_over_http" />
- </target>
-
- <target name="saygoodbye_over_http" depends="compile">
- <echo></echo>
- <echo>Invoke JBR Gateway with successful login</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitycert.test.SendMessage" failonerror="true">
- <arg value="01" />
- <arg value="8765" />
- <classpath refid="exec-classpath" />
- </java>
- <echo></echo>
- <echo></echo>
- <echo>Invoke JBR Gateway with unsuccessful login</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitycert.test.SendMessage" failonerror="true">
- <arg value="02" />
- <arg value="8765" />
- <classpath refid="exec-classpath" />
- </java>
- </target>
-
- <target name="quickstart-specific-deploys">
- <copy todir="${build.dir}" filtering="true" overwrite="true">
-
- <filterset>
- <filter token="KEYSTORE_PATH" value="${basedir}/keystore"/>
- <filter token="ROLES_FILE_PATH" value="${basedir}/roles.properties"/>
- </filterset>
- <fileset dir="${basedir}">
- <include name="login-config.xml"/>
- </fileset>
- </copy>
- </target>
-
-
-</project>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/build.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,68 @@
+<project name="Quickstart_Security_Cert" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="quickstart-specific-checks" depends="assert-ws-available"/>
+
+ <target name="quickstart-specific-dependencies">
+ <path id="quickstart-dependencies-classpath">
+ <fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
+ </path>
+ </target>
+
+ <target name="quickstart-specific-assemblies">
+ <!-- Overriden from the target of the same name in base-build.xml. -->
+ <!-- Called by the "deploy" target. Don't call directly!! -->
+
+ <!-- Build the webservice... -->
+ <war warfile="build/${ant.project.name}.war"
+ webxml="${basedir}/war/resources/WEB-INF/web.xml">
+ <fileset dir="${basedir}/war/view">
+ <include name="**/*"/>
+ </fileset>
+ </war>
+ </target>
+
+ <target name="runtest" depends="compile" description="run tests over jms, http, and socket">
+ <antcall target="saygoodbye_over_http" />
+ </target>
+
+ <target name="saygoodbye_over_http" depends="compile">
+ <echo></echo>
+ <echo>Invoke JBR Gateway with successful login</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitycert.test.SendMessage" failonerror="true">
+ <arg value="01" />
+ <arg value="8765" />
+ <classpath refid="exec-classpath" />
+ </java>
+ <echo></echo>
+ <echo></echo>
+ <echo>Invoke JBR Gateway with unsuccessful login</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securitycert.test.SendMessage" failonerror="true">
+ <arg value="02" />
+ <arg value="8765" />
+ <classpath refid="exec-classpath" />
+ </java>
+ </target>
+
+ <target name="quickstart-specific-deploys">
+ <copy todir="${build.dir}" filtering="true" overwrite="true">
+
+ <filterset>
+ <filter token="KEYSTORE_PATH" value="${basedir}/keystore"/>
+ <filter token="ROLES_FILE_PATH" value="${basedir}/roles.properties"/>
+ </filterset>
+ <fileset dir="${basedir}">
+ <include name="login-config.xml"/>
+ </fileset>
+ </copy>
+ </target>
+
+
+</project>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/deployment.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/deployment.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,6 +0,0 @@
-<jbossesb-deployment>
- <depends>jboss.esb:deployment=soap.esb</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb_reply
- </depends>
-</jbossesb-deployment>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/deployment.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/deployment.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/deployment.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,6 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=soap.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb_reply
+ </depends>
+</jbossesb-deployment>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jbm-queue-service.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbm-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_gw"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbm-queue-service.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbm-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_gw"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jbmq-queue-service.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbmq-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_gw">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb_reply">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbmq-queue-service.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbmq-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_gw">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_cert_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jboss-esb.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jboss-esb.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,43 +0,0 @@
-<?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"
- parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMessageing" connection-factory="ConnectionFactory">
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_cert_esb"/>
- </jms-bus>
- </jms-provider>
-
- <jbr-provider name="JBR-Http" protocol="http" host="localhost">
- <jbr-bus busid="Http-1" port="8765" />
- </jbr-provider>
-
- </providers>
-
- <services>
-
- <service category="MyServiceCategory" name="MyWSProducerService" description="WS Frontend speaks natively to the ESB">
- <security moduleName="CertLogin" rolesAllowed="worker" callbackHandler="org.jboss.soa.esb.services.security.auth.login.CertCallbackHandler">
- <property name="alias" value="certtest"/>
- </security>
-
- <listeners>
- <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true"/>
- <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel"/>
- </listeners>
- <actions>
-
- <action name="print-before" class="org.jboss.soa.esb.samples.quickstart.securitycert.PrintSubjectAction"/>
-
- <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
- <property name="jbossws-endpoint" value="GoodbyeWorldWS"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
- </actions>
- </service>
-
- </services>
-
-</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jboss-esb.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jboss-esb.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,43 @@
+<?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"
+ parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMessageing" connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_cert_esb"/>
+ </jms-bus>
+ </jms-provider>
+
+ <jbr-provider name="JBR-Http" protocol="http" host="localhost">
+ <jbr-bus busid="Http-1" port="8765" />
+ </jbr-provider>
+
+ </providers>
+
+ <services>
+
+ <service category="MyServiceCategory" name="MyWSProducerService" description="WS Frontend speaks natively to the ESB">
+ <security moduleName="CertLogin" rolesAllowed="worker" callbackHandler="org.jboss.soa.esb.services.security.auth.login.CertCallbackHandler">
+ <property name="alias" value="certtest"/>
+ </security>
+
+ <listeners>
+ <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true"/>
+ <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel"/>
+ </listeners>
+ <actions>
+
+ <action name="print-before" class="org.jboss.soa.esb.samples.quickstart.securitycert.PrintSubjectAction"/>
+
+ <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
+ <property name="jbossws-endpoint" value="GoodbyeWorldWS"/>
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
+ </actions>
+ </service>
+
+ </services>
+
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jbossesb-properties.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbossesb-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,97 +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"/>
- </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>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbossesb-properties.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jbossesb-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,97 @@
+<?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"/>
+ </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/trunk/product/samples/quickstarts/security_cert/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jndi.properties 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jndi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jndi.properties (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/jndi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/jndi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/keystore
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/keystore (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/keystore)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/log4j.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/log4j.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="INFO"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/log4j.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/log4j.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/login-config.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/login-config.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/login-config.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,10 +0,0 @@
- <!-- To be pasted into <server>/<configname>/conf/login-config.xml -->
- <application-policy name = "CertLogin">
- <authentication>
- <login-module code = "org.jboss.soa.esb.services.security.auth.login.CertificateLoginModule" flag = "required" >
- <module-option name = "keyStoreURL">file://@KEYSTORE_PATH@</module-option>
- <module-option name = "keyStorePassword">storepassword</module-option>
- <module-option name = "rolesPropertiesFile">file://@ROLES_FILE_PATH@</module-option>
- </login-module>
- </authentication>
- </application-policy>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/login-config.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/login-config.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/login-config.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/login-config.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,10 @@
+ <!-- To be pasted into <server>/<configname>/conf/login-config.xml -->
+ <application-policy name = "CertLogin">
+ <authentication>
+ <login-module code = "org.jboss.soa.esb.services.security.auth.login.CertificateLoginModule" flag = "required" >
+ <module-option name = "keyStoreURL">file://@KEYSTORE_PATH@</module-option>
+ <module-option name = "keyStorePassword">storepassword</module-option>
+ <module-option name = "rolesPropertiesFile">file://@ROLES_FILE_PATH@</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/readme.txt 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/readme.txt 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,109 +0,0 @@
-Overview:
-
-=========
-
- This quickstart aims demonstrate how certificate based authentication can be configured in JBossESB.
- Authentication is done by verifying that the certificate that is passed to the ESB by the calling client
-
- can be verified against a certificate in a local keystore.
- The certifcate to be verified against is specified using an alias which is configured in jboss-esb.xml
-
-
- When executing this quickstart two calls will be made to the ESB service:
- 1. This call will use the content of the following file as its payload
- src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml
- soap_messsag_01.xml contains a security header with the certificate of the alias 'certtest'.
- This certificate matches the certificate in our keystore and this call will succeed.
-
- 2. This call will use the content of the following file as its payload
- src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml
- soap_messsag_01.xml contains a security header with the certificate of the alias 'certtest2'.
- This certificate does not match the certificate in our keystore and this call will not succeed.
-
- The keystore used for this quickstart is named 'keystore' and can be found in the same directory as this
- readme.txt file.
-
-
-
-Running this quickstart:
-
-========================
-
- Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
-
- and a more detailed descripton of the different ways to run the quickstarts.
-
-
-
- Note, this quickstart requires an ESB and JBossWS installation into
-
- JBoss AS 4.2.0.GA. Installation instructions for both can be found in the
-
- install/readme.txt.
-
-
-
-To Run:
-
-=======
-
- 1. Type 'ant deploy'.
-
- 2. Copy the xml element from build/login-config.xml and paste it into your servers conf/login-config.xml
- This contains the login module configuration used by this quickstart.
- 3. Restart you jbossesb server. This is needed so that the security configuration get picked up.
- 4. Type 'ant runtest'.
-
- 5. Switch back to Application Server console to see the output from the ESB
-
- 6. In this folder ("Window1"), type 'ant undeploy'.
-
-
-
-Things to look for in this quickstart:
-
-======================================
-
- 1.Security configuration in jboss-esb.xml
-
- <security moduleName="CertLogin" rolesAllowed="worker" callbackHandler="org.jboss.soa.esb.services.security.auth.login.CertCallbackHandler">
- <property name="alias" value="certtest"/>
- </security>
- # 'moduleName' identified the JAAS Login Module to use. This is an index into the file login-config.xml file.
- # 'rolesAllowed' lists the roles that are allowed to execute this service. To see how the roles are mapped please see item 3 below.
- # 'alias' specifies the alias that will be used to identify a certificate in the keystore.
-
- # 'callbackHandler' is the an ESB implementation of a JAAS Callback handler which provides access to the authentication request and also the above security configuration.
-
-
-
- 2.JAAS Configuration
- <application-policy name = "CertLogin">
- <authentication>
- <login-module code = "org.jboss.soa.esb.services.security.auth.login.CertificateLoginModule" flag = "required" >
- <module-option name = "keyStoreURL">file://@KEYSTORE_PATH@</module-option>
- <module-option name = "keyStorePassword">storepassword</module-option>
- <module-option name = "rolesPropertiesFile">file://@ROLES_FILE_PATH@</module-option>
- </login-module>
- </authentication>
- </application-policy>
- # CertificateLoginModule is the login module that will be used.
- # 'keyStoreURL' is the path to the keystore that will be used to verify the certificates. This can be a file on the local file system or on the classpath.
- # 'keyStorePassword' is the password to the keystore.
- # 'rolesPropertiesFile' path to a file containing role mappings. Please see the next item for more information about the roles mapping.
-
- 3.Role Mapping
- This file is can be optionally specified in login-config.xml by using the 'rolesPropertiesFile'. This can point to a file on the local file system or to
- a file on the classpath.
- The is an example of such a file:
- # user=role1,role2,...
- guest=guest
- esbuser=esbrole
-
- # The current implementation will use the Common Name(CN) specified for the certificate as the
- # user name. The unicode escape is needed only if your CN contains a space.
- Daniel\u0020Bevenius=esbrole,worker
-
-
-
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/readme.txt (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/readme.txt)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/readme.txt 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,109 @@
+Overview:
+
+=========
+
+ This quickstart aims demonstrate how certificate based authentication can be configured in JBossESB.
+ Authentication is done by verifying that the certificate that is passed to the ESB by the calling client
+
+ can be verified against a certificate in a local keystore.
+ The certifcate to be verified against is specified using an alias which is configured in jboss-esb.xml
+
+
+ When executing this quickstart two calls will be made to the ESB service:
+ 1. This call will use the content of the following file as its payload
+ src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml
+ soap_messsag_01.xml contains a security header with the certificate of the alias 'certtest'.
+ This certificate matches the certificate in our keystore and this call will succeed.
+
+ 2. This call will use the content of the following file as its payload
+ src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml
+ soap_messsag_01.xml contains a security header with the certificate of the alias 'certtest2'.
+ This certificate does not match the certificate in our keystore and this call will not succeed.
+
+ The keystore used for this quickstart is named 'keystore' and can be found in the same directory as this
+ readme.txt file.
+
+
+
+Running this quickstart:
+
+========================
+
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+
+
+ Note, this quickstart requires an ESB and JBossWS installation into
+
+ JBoss AS 4.2.0.GA. Installation instructions for both can be found in the
+
+ install/readme.txt.
+
+
+
+To Run:
+
+=======
+
+ 1. Type 'ant deploy'.
+
+ 2. Copy the xml element from build/login-config.xml and paste it into your servers conf/login-config.xml
+ This contains the login module configuration used by this quickstart.
+ 3. Restart you jbossesb server. This is needed so that the security configuration get picked up.
+ 4. Type 'ant runtest'.
+
+ 5. Switch back to Application Server console to see the output from the ESB
+
+ 6. In this folder ("Window1"), type 'ant undeploy'.
+
+
+
+Things to look for in this quickstart:
+
+======================================
+
+ 1.Security configuration in jboss-esb.xml
+
+ <security moduleName="CertLogin" rolesAllowed="worker" callbackHandler="org.jboss.soa.esb.services.security.auth.login.CertCallbackHandler">
+ <property name="alias" value="certtest"/>
+ </security>
+ # 'moduleName' identified the JAAS Login Module to use. This is an index into the file login-config.xml file.
+ # 'rolesAllowed' lists the roles that are allowed to execute this service. To see how the roles are mapped please see item 3 below.
+ # 'alias' specifies the alias that will be used to identify a certificate in the keystore.
+
+ # 'callbackHandler' is the an ESB implementation of a JAAS Callback handler which provides access to the authentication request and also the above security configuration.
+
+
+
+ 2.JAAS Configuration
+ <application-policy name = "CertLogin">
+ <authentication>
+ <login-module code = "org.jboss.soa.esb.services.security.auth.login.CertificateLoginModule" flag = "required" >
+ <module-option name = "keyStoreURL">file://@KEYSTORE_PATH@</module-option>
+ <module-option name = "keyStorePassword">storepassword</module-option>
+ <module-option name = "rolesPropertiesFile">file://@ROLES_FILE_PATH@</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+ # CertificateLoginModule is the login module that will be used.
+ # 'keyStoreURL' is the path to the keystore that will be used to verify the certificates. This can be a file on the local file system or on the classpath.
+ # 'keyStorePassword' is the password to the keystore.
+ # 'rolesPropertiesFile' path to a file containing role mappings. Please see the next item for more information about the roles mapping.
+
+ 3.Role Mapping
+ This file is can be optionally specified in login-config.xml by using the 'rolesPropertiesFile'. This can point to a file on the local file system or to
+ a file on the classpath.
+ The is an example of such a file:
+ # user=role1,role2,...
+ guest=guest
+ esbuser=esbrole
+
+ # The current implementation will use the Common Name(CN) specified for the certificate as the
+ # user name. The unicode escape is needed only if your CN contains a space.
+ Daniel\u0020Bevenius=esbrole,worker
+
+
+
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/roles.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/roles.properties 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/roles.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,6 +0,0 @@
-# user=role1,role2,...
-guest=guest
-esbuser=esbrole
-
-# sort of ugly but can be used when a CN contains a space character.
-Daniel\u0020Bevenius=esbrole,worker
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/roles.properties (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/roles.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/roles.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/roles.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,6 @@
+# user=role1,role2,...
+guest=guest
+esbuser=esbrole
+
+# sort of ugly but can be used when a CN contains a space character.
+Daniel\u0020Bevenius=esbrole,worker
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,58 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.securitycert;
-
-
-import java.net.URL;
-import java.io.File;
-import java.io.FilePermission;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.CodeSource;
-import java.security.Permissions;
-import java.security.PermissionCollection;
-import java.security.Policy;
-
-import javax.security.auth.Subject;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class PrintSubjectAction extends AbstractActionLifecycle
-{
-
- protected ConfigTree config;
-
- public PrintSubjectAction(ConfigTree config) throws ConfigurationException
- {
- this.config = config;
- }
-
- public Message process(Message message) throws Exception
- {
- System.out.println("SecurityContext " + message.getProperties().getProperty("org.jboss.soa.esb.services.security.context"));
- System.out.println("Subject : " + Subject.getSubject(AccessController.getContext()));
- return message;
- }
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/PrintSubjectAction.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.jboss.soa.esb.samples.quickstart.securitycert;
+
+
+import java.net.URL;
+import java.io.File;
+import java.io.FilePermission;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.CodeSource;
+import java.security.Permissions;
+import java.security.PermissionCollection;
+import java.security.Policy;
+
+import javax.security.auth.Subject;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class PrintSubjectAction extends AbstractActionLifecycle
+{
+
+ protected ConfigTree config;
+
+ public PrintSubjectAction(ConfigTree config) throws ConfigurationException
+ {
+ this.config = config;
+ }
+
+ public Message process(Message message) throws Exception
+ {
+ System.out.println("SecurityContext " + message.getProperties().getProperty("org.jboss.soa.esb.services.security.context"));
+ System.out.println("Subject : " + Subject.getSubject(AccessController.getContext()));
+ return message;
+ }
+
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,123 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.securitycert.test;
-
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.Client;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.net.InetAddress;
-
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-
-public class SendMessage {
- QueueConnection conn;
- QueueSession session;
- Queue que;
-
- public void sendMessageOverJMS(String message) throws JMSException, NamingException {
- QueueSender sender = null;
-
- setupJMSConnection();
- try {
- ObjectMessage tm = null;
-
- sender = session.createSender(que);
- tm = session.createObjectMessage(message);
- tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "WebServiceProducerTest.log");
- sender.send(tm);
- } finally {
- if(sender != null) {
- sender.close();
- }
- cleanupJMSConnection();
- }
- }
-
- private void sendMessageToJBRListener(String protocol, int port, String message) throws Throwable {
- String locatorURI = protocol + "://localhost:" + port;
- InvokerLocator locator = new InvokerLocator(locatorURI);
- System.out.println("Calling JBoss Remoting Listener using locator URI: " + locatorURI);
-
- Client remotingClient = null;
- try {
- remotingClient = new Client(locator);
- remotingClient.connect();
-
- // Deliver the message to the listener...
- Object response = remotingClient.invoke(message);
- System.out.println("JBR Class: " + response.getClass().getName());
- System.out.println("Response from JBoss Remoting Listener '" + locatorURI + "' was '" + response + "'.");
- } finally {
- if(remotingClient != null) {
- remotingClient.disconnect();
- }
- }
- }
-
- public void setupJMSConnection() throws JMSException, NamingException
- {
- InitialContext iniCtx = new InitialContext();
- Object tmp = iniCtx.lookup("ConnectionFactory");
- QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
- conn = qcf.createQueueConnection();
- que = (Queue) iniCtx.lookup("queue/quickstart_security_cert_secured_gw");
- session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- conn.start();
- }
-
- public void cleanupJMSConnection() throws JMSException
- {
- conn.stop();
- session.close();
- conn.close();
- }
-
- private static String getMessage(String messageNum) {
- String msg = new String(StreamUtils.readStream(SendMessage.class.getResourceAsStream("soap_message_" + messageNum + ".xml")));
- return msg;
- }
-
- public static void main(String args[]) throws Throwable
- {
- SendMessage sm = new SendMessage();
- String msg = getMessage(args[0]);
-
- try
- {
- sm.sendMessageToJBRListener("http", Integer.parseInt(args[1]), msg);
- }
- catch(final Exception e)
- {
- System.err.println("Call was not successful. See server.log for details. Exception was:");
- e.printStackTrace();
- }
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/SendMessage.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,123 @@
+/*
+ * 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.
+ */
+package org.jboss.soa.esb.samples.quickstart.securitycert.test;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Client;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.net.InetAddress;
+
+import org.jboss.soa.esb.actions.StoreMessageToFile;
+
+public class SendMessage {
+ QueueConnection conn;
+ QueueSession session;
+ Queue que;
+
+ public void sendMessageOverJMS(String message) throws JMSException, NamingException {
+ QueueSender sender = null;
+
+ setupJMSConnection();
+ try {
+ ObjectMessage tm = null;
+
+ sender = session.createSender(que);
+ tm = session.createObjectMessage(message);
+ tm.setStringProperty(StoreMessageToFile.PROPERTY_JBESB_FILENAME, "WebServiceProducerTest.log");
+ sender.send(tm);
+ } finally {
+ if(sender != null) {
+ sender.close();
+ }
+ cleanupJMSConnection();
+ }
+ }
+
+ private void sendMessageToJBRListener(String protocol, int port, String message) throws Throwable {
+ String locatorURI = protocol + "://localhost:" + port;
+ InvokerLocator locator = new InvokerLocator(locatorURI);
+ System.out.println("Calling JBoss Remoting Listener using locator URI: " + locatorURI);
+
+ Client remotingClient = null;
+ try {
+ remotingClient = new Client(locator);
+ remotingClient.connect();
+
+ // Deliver the message to the listener...
+ Object response = remotingClient.invoke(message);
+ System.out.println("JBR Class: " + response.getClass().getName());
+ System.out.println("Response from JBoss Remoting Listener '" + locatorURI + "' was '" + response + "'.");
+ } finally {
+ if(remotingClient != null) {
+ remotingClient.disconnect();
+ }
+ }
+ }
+
+ public void setupJMSConnection() throws JMSException, NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object tmp = iniCtx.lookup("ConnectionFactory");
+ QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+ conn = qcf.createQueueConnection();
+ que = (Queue) iniCtx.lookup("queue/quickstart_security_cert_secured_gw");
+ session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ conn.start();
+ }
+
+ public void cleanupJMSConnection() throws JMSException
+ {
+ conn.stop();
+ session.close();
+ conn.close();
+ }
+
+ private static String getMessage(String messageNum) {
+ String msg = new String(StreamUtils.readStream(SendMessage.class.getResourceAsStream("soap_message_" + messageNum + ".xml")));
+ return msg;
+ }
+
+ public static void main(String args[]) throws Throwable
+ {
+ SendMessage sm = new SendMessage();
+ String msg = getMessage(args[0]);
+
+ try
+ {
+ sm.sendMessageToJBRListener("http", Integer.parseInt(args[1]), msg);
+ }
+ catch(final Exception e)
+ {
+ System.err.println("Call was not successful. See server.log for details. Exception was:");
+ e.printStackTrace();
+ }
+ }
+}
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,22 +0,0 @@
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://security_cert/goodbyeworld">
- <soapenv: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'>MIICVDCCAb0CBEj0PZ4wDQYJKoZIhvcNAQEEBQAwcTELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0
-b2NraG9sbTESMBAGA1UEBxMJU3RvY2tob2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVK
-Qm9zczEYMBYGA1UEAxMPRGFuaWVsIEJldmVuaXVzMB4XDTA4MTAxNDA2MzUxMFoXDTExMDcxMDA2
-MzUxMFowcTELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0b2NraG9sbTESMBAGA1UEBxMJU3RvY2to
-b2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVKQm9zczEYMBYGA1UEAxMPRGFuaWVsIEJl
-dmVuaXVzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCPwfTNhUsBYIi+h5mt/tzcHRl2Uh//
-/alzFsGint0rlFRRa/LJ/6XSwviVbMXitpqUCw3Qknf6e4xRFJpfv35FALqyRJmwMjsgpy9GjWM9
-HHpCXetrpop7sWF3C8etwfv1T/mKk6jcQ4tX2So2Wjv1Lb3zqj/5Pgj8Pcy+oecZfwIDAQABMA0G
-CSqGSIb3DQEBBAUAA4GBADWjrmaDi01ZUAIAHim6hnNbuh9X+uszrkwglSjVDOKkuPjX8lgrlR9i
-jNP7gnwGg2+bQXW4P17BViwN9Kd00+hNkXw9smimPvUnGRAbX/I8ntQqfKs3dq1E3yBT4NZmb3Bc
-h6tJtOWrUv0mEl1pkOGFcDvP5Gsq70jAtwC/9Cge</wsse:BinarySecurityToken>
- </wsse:Security>
- </soapenv:Header>
- <soapenv:Body>
- <good:sayGoodbye>
- <message>Goodbye!!</message>
- </good:sayGoodbye>
- </soapenv:Body>
-</soapenv:Envelope>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_01.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,22 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://security_cert/goodbyeworld">
+ <soapenv: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'>MIICVDCCAb0CBEj0PZ4wDQYJKoZIhvcNAQEEBQAwcTELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0
+b2NraG9sbTESMBAGA1UEBxMJU3RvY2tob2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVK
+Qm9zczEYMBYGA1UEAxMPRGFuaWVsIEJldmVuaXVzMB4XDTA4MTAxNDA2MzUxMFoXDTExMDcxMDA2
+MzUxMFowcTELMAkGA1UEBhMCU0UxEjAQBgNVBAgTCVN0b2NraG9sbTESMBAGA1UEBxMJU3RvY2to
+b2xtMRAwDgYDVQQKEwdSZWQgSGF0MQ4wDAYDVQQLEwVKQm9zczEYMBYGA1UEAxMPRGFuaWVsIEJl
+dmVuaXVzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCPwfTNhUsBYIi+h5mt/tzcHRl2Uh//
+/alzFsGint0rlFRRa/LJ/6XSwviVbMXitpqUCw3Qknf6e4xRFJpfv35FALqyRJmwMjsgpy9GjWM9
+HHpCXetrpop7sWF3C8etwfv1T/mKk6jcQ4tX2So2Wjv1Lb3zqj/5Pgj8Pcy+oecZfwIDAQABMA0G
+CSqGSIb3DQEBBAUAA4GBADWjrmaDi01ZUAIAHim6hnNbuh9X+uszrkwglSjVDOKkuPjX8lgrlR9i
+jNP7gnwGg2+bQXW4P17BViwN9Kd00+hNkXw9smimPvUnGRAbX/I8ntQqfKs3dq1E3yBT4NZmb3Bc
+h6tJtOWrUv0mEl1pkOGFcDvP5Gsq70jAtwC/9Cge</wsse:BinarySecurityToken>
+ </wsse:Security>
+ </soapenv:Header>
+ <soapenv:Body>
+ <good:sayGoodbye>
+ <message>Goodbye!!</message>
+ </good:sayGoodbye>
+ </soapenv:Body>
+</soapenv:Envelope>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,21 +0,0 @@
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://security_cert/goodbyeworld">
- <soapenv: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'>MIICIjCCAYsCBEj0TGMwDQYJKoZIhvcNAQEEBQAwWDELMAkGA1UEBhMCQkIxDDAKBgNVBAgTA0Jh
-ZDEMMAoGA1UEBxMDQmFkMQwwCgYDVQQKEwNCYWQxDDAKBgNVBAsTA0JhZDERMA8GA1UEAxMIQmFk
-IHVzZXIwHhcNMDgxMDE0MDczODExWhcNMTEwNzEwMDczODExWjBYMQswCQYDVQQGEwJCQjEMMAoG
-A1UECBMDQmFkMQwwCgYDVQQHEwNCYWQxDDAKBgNVBAoTA0JhZDEMMAoGA1UECxMDQmFkMREwDwYD
-VQQDEwhCYWQgdXNlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAhlb/SagmAPrp5+CqSexB
-/X/GhdtaYXQHY0rKvyE/E2g5bKsXDcNAUu9ZwHmUHIPoyHTGTdQbYgQVbehOPys2RiyQr7MOP1L7
-X+H2YC6Fce55eydFliIFDKq9+991fmPSOZ6lz/vYnfN4fEwMuw4CbJ2Zlt+vb44AvVVyZHZpZykC
-AwEAATANBgkqhkiG9w0BAQQFAAOBgQB5fMiT7ApyoUoP3dq9rmpjrUxKIxBvbkWCWrR9KyN7kPT6
-/zDcqlmljjhVWZdOEQ6dTOmuA56fvNE8WO1xLq6F+OZZni3IDQ/cPgqEa/REOuv+tFGK08Te0WIe
-3Ff5vodp0s+H/X75X2Sy3ZbZMXCV115q5rASRbOjsxE5fVaRMw==</wsse:BinarySecurityToken>
- </wsse:Security>
- </soapenv:Header>
- <soapenv:Body>
- <good:sayGoodbyeWithoutResponse>
- <message>Goodbye!!</message>
- </good:sayGoodbyeWithoutResponse>
- </soapenv:Body>
-</soapenv:Envelope>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/test/soap_message_02.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,21 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://security_cert/goodbyeworld">
+ <soapenv: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'>MIICIjCCAYsCBEj0TGMwDQYJKoZIhvcNAQEEBQAwWDELMAkGA1UEBhMCQkIxDDAKBgNVBAgTA0Jh
+ZDEMMAoGA1UEBxMDQmFkMQwwCgYDVQQKEwNCYWQxDDAKBgNVBAsTA0JhZDERMA8GA1UEAxMIQmFk
+IHVzZXIwHhcNMDgxMDE0MDczODExWhcNMTEwNzEwMDczODExWjBYMQswCQYDVQQGEwJCQjEMMAoG
+A1UECBMDQmFkMQwwCgYDVQQHEwNCYWQxDDAKBgNVBAoTA0JhZDEMMAoGA1UECxMDQmFkMREwDwYD
+VQQDEwhCYWQgdXNlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAhlb/SagmAPrp5+CqSexB
+/X/GhdtaYXQHY0rKvyE/E2g5bKsXDcNAUu9ZwHmUHIPoyHTGTdQbYgQVbehOPys2RiyQr7MOP1L7
+X+H2YC6Fce55eydFliIFDKq9+991fmPSOZ6lz/vYnfN4fEwMuw4CbJ2Zlt+vb44AvVVyZHZpZykC
+AwEAATANBgkqhkiG9w0BAQQFAAOBgQB5fMiT7ApyoUoP3dq9rmpjrUxKIxBvbkWCWrR9KyN7kPT6
+/zDcqlmljjhVWZdOEQ6dTOmuA56fvNE8WO1xLq6F+OZZni3IDQ/cPgqEa/REOuv+tFGK08Te0WIe
+3Ff5vodp0s+H/X75X2Sy3ZbZMXCV115q5rASRbOjsxE5fVaRMw==</wsse:BinarySecurityToken>
+ </wsse:Security>
+ </soapenv:Header>
+ <soapenv:Body>
+ <good:sayGoodbyeWithoutResponse>
+ <message>Goodbye!!</message>
+ </good:sayGoodbyeWithoutResponse>
+ </soapenv:Body>
+</soapenv:Envelope>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,54 +0,0 @@
-package org.jboss.soa.esb.samples.quickstart.securitycert.webservice;
-
-import javax.jws.WebService;
-import javax.jws.WebMethod;
-import javax.jws.Oneway;
-import javax.jws.WebParam;
-import javax.jws.soap.SOAPBinding;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.actions.soap.SOAPProcessor;
-
-/**
- * @author
- */
- at WebService(name = "GoodbyeWorldWS", targetNamespace="http://security_cert/goodbyeworld")
-public class GoodbyeWorldWS {
-
- @WebMethod
- public String sayGoodbye(@WebParam(name="message") String message) {
-
- Message esbMessage = SOAPProcessor.getMessage();
- if(esbMessage != null) {
- System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
- // System.out.println("\n" + esbMessage.toString() + "\n");
- }
- System.out.println("Web Service Parameter - message=" + message);
- return "... Ah Goodbye then!!!! - " + message;
- }
-
- @WebMethod
- public String sayAdios(String message) {
- Message esbMessage = SOAPProcessor.getMessage();
- if(esbMessage != null) {
- System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
- // System.out.println("\n" + esbMessage.toString() + "\n");
- }
- System.out.println("Web Service Parameter - message=" + message);
- return "... Adios Amigo!!!! - " + message;
- }
-
- @WebMethod
- @Oneway
- public void sayGoodbyeWithoutResponse(@WebParam(name="message") String message) {
-
- Message esbMessage = SOAPProcessor.getMessage();
- if(esbMessage != null) {
- System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
- }
- System.out.println("Web Service Parameter - message=" + message);
- }
-
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/src/org/jboss/soa/esb/samples/quickstart/securitycert/webservice/GoodbyeWorldWS.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,54 @@
+package org.jboss.soa.esb.samples.quickstart.securitycert.webservice;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.jws.Oneway;
+import javax.jws.WebParam;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.actions.soap.SOAPProcessor;
+
+/**
+ * @author
+ */
+ at WebService(name = "GoodbyeWorldWS", targetNamespace="http://security_cert/goodbyeworld")
+public class GoodbyeWorldWS {
+
+ @WebMethod
+ public String sayGoodbye(@WebParam(name="message") String message) {
+
+ Message esbMessage = SOAPProcessor.getMessage();
+ if(esbMessage != null) {
+ System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
+ // System.out.println("\n" + esbMessage.toString() + "\n");
+ }
+ System.out.println("Web Service Parameter - message=" + message);
+ return "... Ah Goodbye then!!!! - " + message;
+ }
+
+ @WebMethod
+ public String sayAdios(String message) {
+ Message esbMessage = SOAPProcessor.getMessage();
+ if(esbMessage != null) {
+ System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
+ // System.out.println("\n" + esbMessage.toString() + "\n");
+ }
+ System.out.println("Web Service Parameter - message=" + message);
+ return "... Adios Amigo!!!! - " + message;
+ }
+
+ @WebMethod
+ @Oneway
+ public void sayGoodbyeWithoutResponse(@WebParam(name="message") String message) {
+
+ Message esbMessage = SOAPProcessor.getMessage();
+ if(esbMessage != null) {
+ System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());
+ }
+ System.out.println("Web Service Parameter - message=" + message);
+ }
+
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/war)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/war/resources)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/war/resources/WEB-INF)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
-
- <servlet>
- <servlet-name>GoodbyeWorldWS</servlet-name>
- <servlet-class>org.jboss.soa.esb.samples.quickstart.securitycert.webservice.GoodbyeWorldWS</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>GoodbyeWorldWS</servlet-name>
- <url-pattern>/GoodbyeWorldWS</url-pattern>
- </servlet-mapping>
-
-</web-app>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/resources/WEB-INF/web.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>GoodbyeWorldWS</servlet-name>
+ <servlet-class>org.jboss.soa.esb.samples.quickstart.securitycert.webservice.GoodbyeWorldWS</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>GoodbyeWorldWS</servlet-name>
+ <url-pattern>/GoodbyeWorldWS</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/war/view)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/index.jsp
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/war/view/index.jsp 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/index.jsp 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,9 +0,0 @@
-<html>
- <body>
- This is just a place holder.<br>
- Verify the that the WS has been deployed by hitting
- <a href="http://localhost:8080/jbossws">
- http://localhost:8080/jbossws
- </a>
- </body>
-</html>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/index.jsp (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_cert/war/view/index.jsp)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/index.jsp (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_cert/war/view/index.jsp 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,9 @@
+<html>
+ <body>
+ This is just a place holder.<br>
+ Verify the that the WS has been deployed by hitting
+ <a href="http://localhost:8080/jbossws">
+ http://localhost:8080/jbossws
+ </a>
+ </body>
+</html>
\ No newline at end of file
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/build.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,43 +0,0 @@
-<project name="Quickstart_security_jbpm" default="run" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <property name="username" value="esbuser" />
- <property name="password" value="esbpassword" />
-
-
- <!-- additional deploys
- <property name="additional.deploys" value="*.xsd"/>
- -->
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-
- <target name="runtest" depends="compile" description="send esb Message to esb service">
- <echo>Send esb message to esb service and get response</echo>
- <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securityjbpm.test.SendEsbMessage" failonerror="true">
- <arg value="ESBServiceSample"/> <!-- service category -->
- <arg value="HelloWorldStartServiceProcess"/> <!-- service name -->
- <arg value="Hello Secured World"/> <!-- Message text -->
- <arg value="${username}"/> <!-- username text -->
- <arg value="${password}"/> <!-- password text -->
- <classpath refid="exec-classpath"/>
- </java>
- </target>
-
- <target name="deployProcess" description="deploys the process definition" depends="dependencies">
- <echo>Deploy the process definition</echo>
- <taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
- <classpath refid="exec-classpath"/>
- </taskdef>
- <deployToServer username="${jbpm.console.username}" password="${jbpm.console.password}" serverDeployer="${org.jboss.esb.jbpm.console.upload.url}">
- <fileset dir="${basedir}/processDefinition" includes="*"/>
- </deployToServer>
- </target>
-
-
-
-</project>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/build.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/build.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,43 @@
+<project name="Quickstart_security_jbpm" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="username" value="esbuser" />
+ <property name="password" value="esbpassword" />
+
+
+ <!-- additional deploys
+ <property name="additional.deploys" value="*.xsd"/>
+ -->
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <target name="runtest" depends="compile" description="send esb Message to esb service">
+ <echo>Send esb message to esb service and get response</echo>
+ <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.securityjbpm.test.SendEsbMessage" failonerror="true">
+ <arg value="ESBServiceSample"/> <!-- service category -->
+ <arg value="HelloWorldStartServiceProcess"/> <!-- service name -->
+ <arg value="Hello Secured World"/> <!-- Message text -->
+ <arg value="${username}"/> <!-- username text -->
+ <arg value="${password}"/> <!-- password text -->
+ <classpath refid="exec-classpath"/>
+ </java>
+ </target>
+
+ <target name="deployProcess" description="deploys the process definition" depends="dependencies">
+ <echo>Deploy the process definition</echo>
+ <taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
+ <classpath refid="exec-classpath"/>
+ </taskdef>
+ <deployToServer username="${jbpm.console.username}" password="${jbpm.console.password}" serverDeployer="${org.jboss.esb.jbpm.console.upload.url}">
+ <fileset dir="${basedir}/processDefinition" includes="*"/>
+ </deployToServer>
+ </target>
+
+
+
+</project>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/deployment.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/deployment.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,9 +0,0 @@
-<jbossesb-deployment>
- <depends>jboss.esb:deployment=jbpm.esb</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_reply</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process_reply</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2_reply</depends>
-</jbossesb-deployment>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/deployment.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/deployment.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/deployment.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/deployment.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,9 @@
+<jbossesb-deployment>
+ <depends>jboss.esb:deployment=jbpm.esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_reply</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process_reply</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2_reply</depends>
+</jbossesb-deployment>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbm-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_reply">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process_reply">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
- </mbean>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2_reply">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbmq-queue-service.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_reply">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb_Process_reply">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_security_jbpm_Request_esb2_reply">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jboss-esb.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jboss-esb.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jboss-esb.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,79 +0,0 @@
-<?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" parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
- <jms-bus busid="quickstartEsbChannelProcess">
- <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_jbpm_Request_esb_Process" selector="serviceName='HelloWorldPubService'" />
- </jms-bus>
-
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_jbpm_Request_esb" selector="serviceName='HelloWorldPubService'" />
- </jms-bus>
-
- <jms-bus busid="quickstartEsbChannel2">
- <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_jbpm_Request_esb2"/>
- </jms-bus>
-
- </jms-provider>
- </providers>
-
- <services>
-
- <service category="ESBServiceSample" name="HelloWorldStartServiceProcess" description="Hello world ESB Service Process">
- <security moduleName="messaging" runAs="adminRole"/>
-
- <listeners>
- <jms-listener name="helloWorldProcess" busidref="quickstartEsbChannelProcess" maxThreads="1" />
- </listeners>
-
- <actions mep="OneWay">
-
- <action name="action" class="org.jboss.soa.esb.samples.quickstart.securityjbpm.MyListenerAction" process="displayMessage"/>
-
- <action name="create_new_process_instance" class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
- <property name="command" value="StartProcessInstanceCommand" />
- <property name="process-definition-name" value="helloWorld"/>
- <property name="esbToBpmVars">
- <mapping esb="BODY_CONTENT" bpm="request" />
- </property>
- </action>
- </actions>
-
- </service>
-
- <service category="ESBServiceSample" name="HelloWorldService1" description="Hello world ESB Service">
- <security moduleName="messaging" />
-
- <listeners>
- <jms-listener name="helloWorld" busidref="quickstartEsbChannel" maxThreads="1" />
- </listeners>
-
- <actions mep="OneWay">
-
- <action name="action" class="org.jboss.soa.esb.samples.quickstart.securityjbpm.MyListenerAction" process="displayMessage"/>
-
- <action name="routeAction" class="org.jboss.soa.esb.actions.StaticWiretap">
- <property name="destinations">
- <route-to service-category="ESBServiceSample" service-name="HelloWorldService2"/>
- </property>
- </action>
-
- </actions>
- </service>
-
- <service category="ESBServiceSample" name="HelloWorldService2" description="Hello world ESB Service">
- <security moduleName="messaging" />
-
- <listeners>
- <jms-listener name="helloWorld2" busidref="quickstartEsbChannel2" maxThreads="1" />
- </listeners>
-
- <actions mep="OneWay">
- <action name="action" class="org.jboss.soa.esb.samples.quickstart.securityjbpm.MyListenerAction" process="displayMessage"/>
- </actions>
-
- </service>
- </services>
-
-</jbossesb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jboss-esb.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jboss-esb.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,79 @@
+<?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" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartEsbChannelProcess">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_jbpm_Request_esb_Process" selector="serviceName='HelloWorldPubService'" />
+ </jms-bus>
+
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_jbpm_Request_esb" selector="serviceName='HelloWorldPubService'" />
+ </jms-bus>
+
+ <jms-bus busid="quickstartEsbChannel2">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_security_jbpm_Request_esb2"/>
+ </jms-bus>
+
+ </jms-provider>
+ </providers>
+
+ <services>
+
+ <service category="ESBServiceSample" name="HelloWorldStartServiceProcess" description="Hello world ESB Service Process">
+ <security moduleName="messaging" runAs="adminRole"/>
+
+ <listeners>
+ <jms-listener name="helloWorldProcess" busidref="quickstartEsbChannelProcess" maxThreads="1" />
+ </listeners>
+
+ <actions mep="OneWay">
+
+ <action name="action" class="org.jboss.soa.esb.samples.quickstart.securityjbpm.MyListenerAction" process="displayMessage"/>
+
+ <action name="create_new_process_instance" class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
+ <property name="command" value="StartProcessInstanceCommand" />
+ <property name="process-definition-name" value="helloWorld"/>
+ <property name="esbToBpmVars">
+ <mapping esb="BODY_CONTENT" bpm="request" />
+ </property>
+ </action>
+ </actions>
+
+ </service>
+
+ <service category="ESBServiceSample" name="HelloWorldService1" description="Hello world ESB Service">
+ <security moduleName="messaging" />
+
+ <listeners>
+ <jms-listener name="helloWorld" busidref="quickstartEsbChannel" maxThreads="1" />
+ </listeners>
+
+ <actions mep="OneWay">
+
+ <action name="action" class="org.jboss.soa.esb.samples.quickstart.securityjbpm.MyListenerAction" process="displayMessage"/>
+
+ <action name="routeAction" class="org.jboss.soa.esb.actions.StaticWiretap">
+ <property name="destinations">
+ <route-to service-category="ESBServiceSample" service-name="HelloWorldService2"/>
+ </property>
+ </action>
+
+ </actions>
+ </service>
+
+ <service category="ESBServiceSample" name="HelloWorldService2" description="Hello world ESB Service">
+ <security moduleName="messaging" />
+
+ <listeners>
+ <jms-listener name="helloWorld2" busidref="quickstartEsbChannel2" maxThreads="1" />
+ </listeners>
+
+ <actions mep="OneWay">
+ <action name="action" class="org.jboss.soa.esb.samples.quickstart.securityjbpm.MyListenerAction" process="displayMessage"/>
+ </actions>
+
+ </service>
+ </services>
+
+</jbossesb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,97 +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.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <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.implementationClass" value="org.jboss.internal.soa.esb.services.security.OpenSSOSecuritySerivce"/>
- <property name="org.jboss.soa.esb.services.security.configUrl" value="/AMConfig.properties"/>
-
- <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"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
- value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#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.RMITransport"/>
- </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"/>
- </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">
- <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"/>
- <!-- # of milliseconds to timeout waiting for a connection from pool -->
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
- </properties>
- <properties name="messagerouting">
- <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
- </properties>
-</esb>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jbossesb-properties.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,97 @@
+<?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.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <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.implementationClass" value="org.jboss.internal.soa.esb.services.security.OpenSSOSecuritySerivce"/>
+ <property name="org.jboss.soa.esb.services.security.configUrl" value="/AMConfig.properties"/>
+
+ <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"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#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.RMITransport"/>
+ </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"/>
+ </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">
+ <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"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jndi.properties 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jndi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jndi.properties (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/jndi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/jndi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/juddi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/juddi.properties 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/juddi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
-
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/juddi.properties (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/juddi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/juddi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/juddi.properties 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/log4j.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/log4j.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="INFO"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="DEBUG"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/log4j.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/log4j.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="DEBUG"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/processDefinition)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="helloWorld">
-
- <start-state name="start-state1">
- <transition to="HelloWorld"></transition>
- </start-state>
-
- <node name="HelloWorld">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
- <esbServiceName>HelloWorldService1</esbServiceName>
- <esbCategoryName>ESBServiceSample</esbCategoryName>
- <bpmToEsbVars>
- <mapping bpm="request" esb="BODY_CONTENT"></mapping>
- </bpmToEsbVars>
- <esbToBpmVars>
- <mapping bpm="response" esb="BODY_CONTENT"></mapping>
- </esbToBpmVars>
- </action>
- <transition to="end-state1"></transition>
- </node>
-
- <end-state name="end-state1"></end-state>
-
-</process-definition>
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/processDefinition/processdefinition.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="helloWorld">
+
+ <start-state name="start-state1">
+ <transition to="HelloWorld"></transition>
+ </start-state>
+
+ <node name="HelloWorld">
+ <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <esbServiceName>HelloWorldService1</esbServiceName>
+ <esbCategoryName>ESBServiceSample</esbCategoryName>
+ <bpmToEsbVars>
+ <mapping bpm="request" esb="BODY_CONTENT"></mapping>
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping bpm="response" esb="BODY_CONTENT"></mapping>
+ </esbToBpmVars>
+ </action>
+ <transition to="end-state1"></transition>
+ </node>
+
+ <end-state name="end-state1"></end-state>
+
+</process-definition>
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/publicKeyStore
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/publicKeyStore (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/publicKeyStore)
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/readme.txt 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/readme.txt 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,55 +0,0 @@
-Overview:
-=========
- The purpose of the security_jbpm quickstart demonstrate security integration with jBPM and JBossESB.
- There are three services in this quickstart and a jBPM process to orchestrate these services.
-
- All of the services print the Subject instance information to show the security Principals.
-
-Running this quickstart:
-========================
- Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
- and a more detailed descripton of the different ways to run the quickstarts.
-
-To Run '.esb' archive mode with jbossesb-server:
-===========================
- 1. Type 'ant deployProcess' -- Will deploy the jBPM HelloWorld processdefinition.
- 2. Type 'ant deploy' -- Will deploy the ESB process archive(.esb).
- 3. Type 'ant runtest' -- Will invoke the service by using the ServiceInvoker.
-
-
-What to look for in this quickstart
-===================================
- Flow of events:
- 1. 'ant runtest' invokes the ESB using the ServiceInoker and calls the Service 'HelloWorldStartServiceProcess'.
- This ESB service prints the following to the server console window:
- INFO [STDOUT] 'ServiceName 'HelloWorldStartServiceProcess'. Subject:Subject:
- Principal: esbuser
- Principal: Roles(members:esbrole)
- Principal: [groupName=Roles, members=[[roleName=adminRole]]]
-
- 2. HelloWorldStartServiceProcess start the jBPM process. The process-definition-name is 'helloworld' and
- can be found in processDefinitions/processdefinition.xml.
-
- 3. The jBPM process will call out to the ESB service named 'HelloWorldService1'.
- This ESB service prints the following to the server console window:
- INFO [STDOUT] 'ServiceName 'HelloWorldService1'. Subject:Subject:
- Principal: esbuser
- Principal: Roles(members:esbrole)
- Principal: [groupName=Roles, members=[[roleName=adminRole]]]
- Next this service will route to 'HelloWorldService2'
-
- 4. This ESB service prints the following to the server console window:
- INFO [STDOUT] 'ServiceName 'HelloWorldService2'. Subject:Subject:
- Principal: esbuser
- Principal: Roles(members:esbrole)
- Principal: [groupName=Roles, members=[[roleName=adminRole]]]
-
- Things to try:
- * Try commenting out the security configuration for 'HelloWorldService1'. Notice how the subject is not set for
- the service in this case, but the following service still works as expected.
-
-
-
-
-
-
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/readme.txt (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/readme.txt)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/readme.txt (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/readme.txt 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,55 @@
+Overview:
+=========
+ The purpose of the security_jbpm quickstart demonstrate security integration with jBPM and JBossESB.
+ There are three services in this quickstart and a jBPM process to orchestrate these services.
+
+ All of the services print the Subject instance information to show the security Principals.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run '.esb' archive mode with jbossesb-server:
+===========================
+ 1. Type 'ant deployProcess' -- Will deploy the jBPM HelloWorld processdefinition.
+ 2. Type 'ant deploy' -- Will deploy the ESB process archive(.esb).
+ 3. Type 'ant runtest' -- Will invoke the service by using the ServiceInvoker.
+
+
+What to look for in this quickstart
+===================================
+ Flow of events:
+ 1. 'ant runtest' invokes the ESB using the ServiceInoker and calls the Service 'HelloWorldStartServiceProcess'.
+ This ESB service prints the following to the server console window:
+ INFO [STDOUT] 'ServiceName 'HelloWorldStartServiceProcess'. Subject:Subject:
+ Principal: esbuser
+ Principal: Roles(members:esbrole)
+ Principal: [groupName=Roles, members=[[roleName=adminRole]]]
+
+ 2. HelloWorldStartServiceProcess start the jBPM process. The process-definition-name is 'helloworld' and
+ can be found in processDefinitions/processdefinition.xml.
+
+ 3. The jBPM process will call out to the ESB service named 'HelloWorldService1'.
+ This ESB service prints the following to the server console window:
+ INFO [STDOUT] 'ServiceName 'HelloWorldService1'. Subject:Subject:
+ Principal: esbuser
+ Principal: Roles(members:esbrole)
+ Principal: [groupName=Roles, members=[[roleName=adminRole]]]
+ Next this service will route to 'HelloWorldService2'
+
+ 4. This ESB service prints the following to the server console window:
+ INFO [STDOUT] 'ServiceName 'HelloWorldService2'. Subject:Subject:
+ Principal: esbuser
+ Principal: Roles(members:esbrole)
+ Principal: [groupName=Roles, members=[[roleName=adminRole]]]
+
+ Things to try:
+ * Try commenting out the security configuration for 'HelloWorldService1'. Notice how the subject is not set for
+ the service in this case, but the following service still works as expected.
+
+
+
+
+
+
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart)
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,55 +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,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.securityjbpm;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.actions.ActionProcessingDetailFaultException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-import java.io.FilePermission;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.CodeSource;
-import java.security.Permissions;
-import java.security.PermissionCollection;
-import java.security.Policy;
-import javax.security.auth.Subject;
-
-public final class MyListenerAction extends AbstractActionLifecycle
-{
- private ConfigTree config;
- private String serviceName;
-
- public MyListenerAction(final ConfigTree config)
- {
- this.config = config;
- serviceName = config.getParent().getAttribute("service-name");
- }
-
- public Message displayMessage(final Message message) throws Exception
- {
- System.out.println("'ServiceName '" + serviceName + "'. Subject:" + Subject.getSubject(AccessController.getContext()));
- return message;
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/MyListenerAction.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package org.jboss.soa.esb.samples.quickstart.securityjbpm;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.actions.ActionProcessingDetailFaultException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+import java.io.FilePermission;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.CodeSource;
+import java.security.Permissions;
+import java.security.PermissionCollection;
+import java.security.Policy;
+import javax.security.auth.Subject;
+
+public final class MyListenerAction extends AbstractActionLifecycle
+{
+ private ConfigTree config;
+ private String serviceName;
+
+ public MyListenerAction(final ConfigTree config)
+ {
+ this.config = config;
+ serviceName = config.getParent().getAttribute("service-name");
+ }
+
+ public Message displayMessage(final Message message) throws Exception
+ {
+ System.out.println("'ServiceName '" + serviceName + "'. Subject:" + Subject.getSubject(AccessController.getContext()));
+ return message;
+ }
+}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test)
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,80 +0,0 @@
-/*
- * 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.samples.quickstart.securityjbpm.test;
-
-import java.util.Set;
-import java.io.Serializable;
-import java.util.HashSet;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.security.SecurityService;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
-import org.jboss.soa.esb.services.security.principals.User;
-import org.jboss.soa.esb.client.ServiceInvoker;
-import org.jboss.soa.esb.couriers.FaultMessageException;
-import org.jboss.soa.esb.services.security.PublicCryptoUtil;
-
-/**
- * Standalone class with to send ESB messages to a 'known' [category,name].
- * <p/> arg0 - service category
- * <br/>arg1 - service name
- * <br/>arg2 - Text of message to send
- * <br/>arg3 - username
- * <br/>arg4 - password
- *
- * @since Version 4.0
- *
- */
-public class SendEsbMessage
-{
- public static void main(String args[]) throws Exception
- {
-// 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)
- {
- System.out.println("Usage SendEsbMessage <category> <name> <text to send> <username> <password>");
- }
- 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.getContext().setContext(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest));
-
- final String message = args[2];
- esbMessage.getBody().add(message);
-
- ServiceInvoker invoker = new ServiceInvoker(args[0], args[1]);
-
- try {
- invoker.deliverAsync(esbMessage);
- }catch(Exception ex) {
- ex.printStackTrace();
- }
- System.exit(0);
- }
-}
Copied: labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/security_jbpm/src/org/jboss/soa/esb/samples/quickstart/securityjbpm/test/SendEsbMessage.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,80 @@
+/*
+ * 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.samples.quickstart.securityjbpm.test;
+
+import java.util.Set;
+import java.io.Serializable;
+import java.util.HashSet;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.security.SecurityService;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequest;
+import org.jboss.soa.esb.services.security.principals.User;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.couriers.FaultMessageException;
+import org.jboss.soa.esb.services.security.PublicCryptoUtil;
+
+/**
+ * Standalone class with to send ESB messages to a 'known' [category,name].
+ * <p/> arg0 - service category
+ * <br/>arg1 - service name
+ * <br/>arg2 - Text of message to send
+ * <br/>arg3 - username
+ * <br/>arg4 - password
+ *
+ * @since Version 4.0
+ *
+ */
+public class SendEsbMessage
+{
+ public static void main(String args[]) throws Exception
+ {
+// 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)
+ {
+ System.out.println("Usage SendEsbMessage <category> <name> <text to send> <username> <password>");
+ }
+ 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.getContext().setContext(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest));
+
+ final String message = args[2];
+ esbMessage.getBody().add(message);
+
+ ServiceInvoker invoker = new ServiceInvoker(args[0], args[1]);
+
+ try {
+ invoker.deliverAsync(esbMessage);
+ }catch(Exception ex) {
+ ex.printStackTrace();
+ }
+ System.exit(0);
+ }
+}
Copied: labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2 (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/services/jbossesb/src/main/resources/message-store-sql/db2)
Deleted: labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,9 +0,0 @@
-CREATE TABLE message
-(
- uuid varchar(128) NOT NULL,
- type varchar(128) NOT NULL,
- message clob NOT NULL,
- delivered varchar(10) NOT NULL,
- classification varchar(10),
- PRIMARY KEY(uuid)
-);
Copied: labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql)
===================================================================
--- labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql (rev 0)
+++ labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/create_database.sql 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,9 @@
+CREATE TABLE message
+(
+ uuid varchar(128) NOT NULL,
+ type varchar(128) NOT NULL,
+ message clob NOT NULL,
+ delivered varchar(10) NOT NULL,
+ classification varchar(10),
+ PRIMARY KEY(uuid)
+);
Deleted: labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1 +0,0 @@
-DROP TABLE IF EXISTS message;
Copied: labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql)
===================================================================
--- labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql (rev 0)
+++ labs/jbossesb/trunk/product/services/jbossesb/src/main/resources/message-store-sql/db2/drop_database.sql 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS message;
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/Constants.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -23,15 +23,15 @@
/**
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
*
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ *
*/
public class Constants {
-
+
// 'Well known' names for action configuration
public static final String BODY_CONTENT_VARIABLE_NAME ="BODY_CONTENT";
-
+
// Names to be used as keys both in the ESB message and in the Jbpm context (process & token)
public static final String COMMAND_CODE ="jbpmCommandCode";
@@ -68,6 +68,9 @@
public static final String FAULT_TO ="jbpmFaultTo";
public static final String ESB_MESSAGE_ID ="jbpmEsbMessageId";
+ public static final String SECURITY_CONTEXT ="jbpmSecurityContext";
+ public static final String AUTH_REQUEST ="jbpmAuthenticationRequest";
+
// Possible values of return codes after execution of an action
public static final String RETCODE_OK ="jbpmReturnOK";
public static final String RETCODE_INVALID_OPCODE ="jbpmReturnInvalidOpCode";
@@ -93,7 +96,7 @@
public static final String OVERWRITE_SWIMLANE_TAG ="overwrite-swimlane";
public static final String KEY_TAG ="key";
public static final String REPLY_TO_ORIGINATOR_TAG ="reply-to-originator";
-
+
//tag names for xml configuration of jBPM actions
public static final String BPM_TO_ESB_VARS_TAG = "bpmToEsbVars";
public static final String ESB_TO_BPM_VARS_TAG = "esbToBpmVars";
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapper.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,5 +1,5 @@
/**
- *
+ *
*/
package org.jboss.soa.esb.services.jbpm;
@@ -9,17 +9,21 @@
import java.util.List;
import java.util.Map;
+import javax.crypto.SealedObject;
+
import org.apache.log4j.Logger;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.tree.DefaultElement;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.message.mapping.ObjectMapper;
import org.jboss.soa.esb.message.mapping.ObjectMappingException;
+import org.jboss.soa.esb.services.security.SecurityService;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.Token;
@@ -27,38 +31,42 @@
/**
* Mapping glue between jBPM and ESB. Handles setting up the replyTo of the
- * JBpmCallback Service, and is a wrapper around org.jboss.soa.esb.message.mapping.ObjectMapper
+ * JBpmCallback Service, and is a wrapper around org.jboss.soa.esb.message.mapping.ObjectMapper
* to handle jBPM specifics around mapping variables from jBPM to ESB and back.
- *
+ *
* @author kstam
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
*/
public class JBpmObjectMapper {
-
+
public JBpmObjectMapper() {
super();
}
private Logger log = Logger.getLogger(getClass());
private ObjectMapper objectMapper = new ObjectMapper();
-
+
/**
- * Creates an ESB Message, giving the mapping specified in the jbpmToEsbVars Element.
+ * Creates an ESB Message, giving the mapping specified in the jbpmToEsbVars Element.
* This element is defined in the jBPM process-definition.xml as child element
* of either the EsbNotifier ActionHandler, or the EsbActionHandler.
- *
+ *
* @param jbpmToEsbVars - the configuration of the mapping.
* @param isGlobalProcessScope - Variables will be looked up using either the token scope or the process-definition (global) scope
* See the jBPM documentation for more details.
* @param executionContext - the jBPM ExecutionContext.
* @return the newly created ESB message.
- *
+ *
* @throws Exception
*/
public Message mapFromJBpmToEsbMessage (final DefaultElement bpmToEsbVars, final Boolean isGlobalProcessScope, final ExecutionContext executionContext)
{
Message message = MessageFactory.getInstance().getMessage();
boolean gblPrcScope = (null == isGlobalProcessScope) ? false : isGlobalProcessScope;
-
+
+ // Map SecurityContext and AuthRequest if they exist.
+ mapSecurityInfoFromJbpmToEsb(gblPrcScope, executionContext, message);
+
if (bpmToEsbVars==null) {
return message;
}
@@ -83,12 +91,12 @@
/**
* Sets all the Objects in the jBPM VariableMap in the body of the ESB Message using the
* the jBPM object names as the Esb Message body keys.
- *
+ *
* @param gblPrcScope
* @param executionContext
* @param message
*/
- private void setAllOnEsbMessage(final boolean gblPrcScope, final ExecutionContext executionContext, Message message)
+ private void setAllOnEsbMessage(final boolean gblPrcScope, final ExecutionContext executionContext, Message message)
{
Token token = executionContext.getToken();
ContextInstance ctxInstance = token.getProcessInstance().getContextInstance();
@@ -104,7 +112,7 @@
}
/**
* Sets a jBPM object onto the ESB Message. The mapping is defined in the Mapping element.
- *
+ *
* @param mapping - Mapping object, used to extract the object from jBPM and used to set the object on the ESB Message
* @param gblPrcScope - Global setting for the jBPM scope
* @param message - ESB Message
@@ -139,8 +147,8 @@
}
}
/**
- * Obtains an Object from the jBPM variableMap.
- *
+ * Obtains an Object from the jBPM variableMap.
+ *
* @param isPrcScope - if true, within process-instance scope, if false, within token scope, or up the token hierarchy.
* @param expression - MVEL expression String.
* @param ctxInstance - jBPM ContextInstance where the jBPM variableMap lives.
@@ -156,7 +164,7 @@
if (dotPosition > 0) {
objectName = expression.substring(0, dotPosition);
remainingExpression = expression.substring(dotPosition+1);
- }
+ }
if (isPrcScope) {
object = ctxInstance.getVariable(objectName);
} else {
@@ -169,7 +177,7 @@
return object;
}
/**
- *
+ *
* @param message
* @param esbToBpmXml
* @return
@@ -180,7 +188,7 @@
return mapFromEsbMessageToJBpmMap(message, getMappingList(esbToBpmXml));
}
/**
- * This
+ * This
* @param message
* @param token
* @throws Exception
@@ -193,7 +201,7 @@
}
for (Mapping mapping: mappingList) {
if (mapping.getBpm()==null || "".equals(mapping.getBpm())) {
-
+
mapping.setBpm(mapping.getEsb());
}
Object value = null;
@@ -201,15 +209,17 @@
value = getObjectFromMessage(message, mapping);
} catch (ConfigurationException ce) {
log.error(ce.getMessage(), ce);
- }
+ }
// only put it in the map if it's not null
if (null!=value)
map.put(mapping.getBpm(), value);
}
+ map.putAll(mapSecurityContextFromEsbMessageToJBpmMap(message));
+ map.putAll(mapAuthRequestFromEsbMessageToJBpmMap(message));
return map;
}
/**
- *
+ *
* @param message
* @param esbToBpmXml
* @return
@@ -220,7 +230,7 @@
return mapFromEsbMessageToJBpmMapping(message, getMappingList(esbToBpmXml));
}
/**
- * This
+ * This
* @param message
* @param token
* @throws Exception
@@ -233,7 +243,7 @@
}
for (Mapping mapping: mappingList) {
if (mapping.getBpm()==null || "".equals(mapping.getBpm())) {
-
+
mapping.setBpm(mapping.getEsb());
}
Object value = null;
@@ -241,14 +251,14 @@
value = getObjectFromMessage(message, mapping);
} catch (ConfigurationException ce) {
log.error(ce.getMessage(), ce);
- }
+ }
// only put it in the map if it's not null
if (null!=value)
map.put(mapping, value);
}
return map;
}
-
+
private List<Mapping> getMappingList(final String esbToBpmXml)
throws ConfigurationException
{
@@ -269,8 +279,8 @@
}
return mappingList ;
}
-
- private Object getObjectFromMessage(Message message, Mapping mapping)
+
+ private Object getObjectFromMessage(Message message, Mapping mapping)
throws ConfigurationException
{
Object value = null;
@@ -288,4 +298,64 @@
log.debug("value=" + value);
return value;
}
+
+ public HashMap<String, Object> mapSecurityContextFromEsbMessageToJBpmMap(final Message message)
+ {
+ final HashMap<String, Object> map = new HashMap<String, Object>();
+ final SealedObject sealedObject = (SealedObject) message.getContext().getContext(SecurityService.CONTEXT);
+ if (sealedObject !=null)
+ {
+ map.put(Constants.SECURITY_CONTEXT, sealedObject);
+ }
+ return map;
+ }
+
+ public HashMap<String, ?> mapAuthRequestFromEsbMessageToJBpmMap(final Message message)
+ {
+ final HashMap<String, Object> map = new HashMap<String, Object>();
+ final byte[] encryptedAuthRequest = (byte[]) message.getContext().getContext(SecurityService.AUTH_REQUEST);
+ if (encryptedAuthRequest != null)
+ {
+ map.put(Constants.AUTH_REQUEST, encryptedAuthRequest);
+ }
+ return map;
+ }
+
+ /**
+ * Will map the SecurityContext and AuthenticationRequest from a jBPM
+ * variable to ESB Message context.
+ *
+ * @param gblPrcScope True if the process scope is global.
+ * @param executionContext The jBPM execution context.
+ * @param esbMessage The distination ESB message
+ * @return
+ */
+ public Message mapSecurityInfoFromJbpmToEsb(final boolean gblPrcScope, final ExecutionContext executionContext, final Message esbMessage)
+ {
+ AssertArgument.isNotNull(executionContext, "executionContext");
+ AssertArgument.isNotNull(esbMessage, "esbMessage");
+
+ final Token token = executionContext.getToken();
+ final ContextInstance ctxInstance = token.getProcessInstance().getContextInstance();
+ final Map jbpmMap = (gblPrcScope) ? ctxInstance.getVariables() : ctxInstance.getVariables(token);
+
+ if (jbpmMap == null)
+ {
+ return esbMessage;
+ }
+
+ final Object sealedObject = jbpmMap.get(Constants.SECURITY_CONTEXT);
+ if (sealedObject != null)
+ {
+ esbMessage.getContext().setContext(SecurityService.CONTEXT, sealedObject);
+ }
+
+ final Object encrypedAutRequest = jbpmMap.get(Constants.AUTH_REQUEST);
+ if (encrypedAutRequest != null)
+ {
+ esbMessage.getContext().setContext(SecurityService.AUTH_REQUEST, encrypedAutRequest);
+ }
+
+ return esbMessage;
+ }
}
Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessor.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -22,7 +22,10 @@
package org.jboss.soa.esb.services.jbpm.actions;
+import javax.crypto.SealedObject;
+
import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.ActionLifecycle;
import org.jboss.soa.esb.actions.ActionLifecycleException;
@@ -32,15 +35,19 @@
import org.jboss.soa.esb.services.jbpm.cmd.Command;
import org.jboss.soa.esb.services.jbpm.cmd.CommandExecutor;
import org.jboss.soa.esb.services.jbpm.cmd.MessageFacade;
+import org.jboss.soa.esb.services.security.SecurityContext;
+import org.jboss.soa.esb.services.security.SecurityService;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
/**
*
* Processes a single jBPM command.
* Part of the message content will be taken from constructor time configuration
* (from the action configuration XML)
-*
+*
* @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
* @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
+* @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
*/
public class BpmProcessor implements ActionLifecycle
{
@@ -61,21 +68,60 @@
throw new ActionLifecycleException(ce.getMessage(), ce);
}
}
-
+
public BpmProcessor(ConfigTree configTree) throws ConfigurationException
- {
+ {
this.configTree = configTree;
}
public Message process(Message message) throws ConfigurationException
{
+ // Add security context to message context.
+ addSecurityContext(message);
+ // Add authentication request context to message context.
+ addAuthenticationRequest(message);
+
message.getBody().add(Constants.COMMAND_CODE, messageFacade.getOpCode().toString());
messageFacade.setJBPMContextParameters(message);
+
CommandExecutor commandExecutor = CommandExecutor.getInstance();
String commandString = (String)message.getBody().get(Constants.COMMAND_CODE);
Command command = commandExecutor.getCommand(commandString);
command.execute(message);
return message;
}
-
+
+ /**
+ * Adds the current security context to the passed in message.
+ * The context is added, if set, to the message context keyed by {@link SecurityService#CONTEXT}.
+ *
+ * @param message The ESB message object.
+ */
+ final void addSecurityContext(Message message)
+ {
+ AssertArgument.isNotNull(message, "message");
+
+ SealedObject securityContext = SecurityContext.getSecurityContext();
+ if (securityContext != null)
+ {
+ message.getContext().setContext(SecurityService.CONTEXT, securityContext);
+ }
+ }
+
+ /**
+ * Adds the authentication request to the passed in message.
+ * The context is added, if set, to the message context keyed by {@link SecurityService#AUTH_REQUEST}.
+ *
+ * @param message The ESB message object.
+ */
+ final void addAuthenticationRequest(Message message)
+ {
+ AssertArgument.isNotNull(message, "message");
+
+ byte[] encryptedAuthRequest = AuthenticationRequestImpl.getEncryptedAuthRequest();
+ if (encryptedAuthRequest != null)
+ {
+ message.getContext().setContext(SecurityService.AUTH_REQUEST, encryptedAuthRequest);
+ }
+ }
}
Modified: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperUnitTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/JBpmObjectMapperUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -27,6 +27,19 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import java.io.IOException;
+import java.io.Serializable;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.util.HashMap;
+
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.KeyGenerator;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SealedObject;
+import javax.crypto.SecretKey;
+
import junit.framework.JUnit4TestAdapter;
import org.apache.log4j.Logger;
@@ -35,6 +48,8 @@
import org.dom4j.io.SAXReader;
import org.dom4j.tree.DefaultElement;
import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.security.SecurityService;
import org.jbpm.graph.def.Node;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.def.Transition;
@@ -45,47 +60,51 @@
import org.junit.Test;
/**
* Tests the capabilities of the JBpmObjectMapper.
- *
+ *
* @author kstam
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
*
*/
-public class JBpmObjectMapperUnitTest
+public class JBpmObjectMapperUnitTest
{
private static String PROCESS_DEF_XML = "JBpmObjectMapperTestProcessDefinition.xml";
private static Logger logger = Logger.getLogger(JBpmObjectMapperUnitTest.class);
private static ProcessInstance processInstance = null;
+ private static JBpmObjectMapper mapper;
@BeforeClass
public static void setup()
{
logger.info("Setting up jBPM");
//Extract a process definition from the processdefinition.xml file.
- ProcessDefinition processDefinition
+ ProcessDefinition processDefinition
= ProcessDefinition.parseXmlResource(PROCESS_DEF_XML);
assertNotNull(processDefinition);
//Create an instance of the process definition.
processInstance = new ProcessInstance(processDefinition);
assertTrue(
- "Instance is in start state",
+ "Instance is in start state",
"start".equals(processInstance.getRootToken().getNode().getName()));
+
+ mapper = new JBpmObjectMapper();
}
/**
* Tests obtaining variables from the jBPM variableMap and setting them on the EsbMessage.
* We are making sure the jBPM -> EsbMessage works using
- *
+ *
* <pre>
* <jbpmToEsbVars>
* <mapping jbpm="v1" esb="esbObj1" />
* <mapping jbpm="g2" esb="esbObj2" process-scope="true" />
* </jbpmToEsbVars>
* <pre>
- *
+ *
* @throws Exception
*/
@Test
public void jBpmVariableMap() throws Exception
- {
+ {
SAXReader reader = new SAXReader();
Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
Element element = document.getRootElement();
@@ -95,17 +114,17 @@
String helloWorldGlobalScope = "Hello world process-instance scope";
TestJBPMVariable objectTokenScope = new TestJBPMVariable("Object token scope") ;
TestJBPMVariable objectGlobalScope = new TestJBPMVariable("Object global scope") ;
-
+
Token token = processInstance.getRootToken();
processInstance.getContextInstance().setVariable("v1", helloWorldTokenScope, token);
processInstance.getContextInstance().setVariable("g2", helloWorldGlobalScope);
processInstance.getContextInstance().setVariable("h3", objectTokenScope, token);
processInstance.getContextInstance().setVariable("i4", objectGlobalScope);
ExecutionContext executionContext = new ExecutionContext(token);
-
+
JBpmObjectMapper mapper = new JBpmObjectMapper();
Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, Boolean.FALSE, executionContext);
-
+
assertEquals(helloWorldTokenScope,String.valueOf(message.getBody().get("esbObj1")));
assertEquals(helloWorldGlobalScope,String.valueOf(message.getBody().get("esbObj2")));
assertEquals(objectTokenScope.getInternal(), String.valueOf(message.getBody().get("esbObj3")));
@@ -113,12 +132,12 @@
}
/**
* Tests obtaining *no* variables from the jBPM variableMap.
- *
+ *
* @throws Exception
*/
@Test
public void jBpmCompleteVariableMap() throws Exception
- {
+ {
//Let's NOT give a mapping, this should get us all the variables in the VariableMap.
DefaultElement jbpmToEsbVars = null;
@@ -126,26 +145,26 @@
String helloWorldGlobalScope = "Hello world process-instance scope";
TestJBPMVariable objectTokenScope = new TestJBPMVariable("Object token scope") ;
TestJBPMVariable objectGlobalScope = new TestJBPMVariable("Object global scope") ;
-
+
Token token = processInstance.getRootToken();
processInstance.getContextInstance().createVariable("v1", helloWorldTokenScope, token);
processInstance.getContextInstance().createVariable("g2", helloWorldGlobalScope);
processInstance.getContextInstance().createVariable("h3", objectTokenScope, token);
processInstance.getContextInstance().createVariable("i4", objectGlobalScope);
ExecutionContext executionContext = new ExecutionContext(token);
-
+
JBpmObjectMapper mapper = new JBpmObjectMapper();
Message message = mapper.mapFromJBpmToEsbMessage(jbpmToEsbVars, Boolean.FALSE, executionContext);
assertEquals(message.getBody().getNames().length,0);
}
/**
* Tests obtaining *all* variables from the jBPM variableMap and setting them on the EsbMessage.
- *
+ *
* @throws Exception
*/
@Test
public void jBpmGetNothingFromVariableMap() throws Exception
- {
+ {
SAXReader reader = new SAXReader();
Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
Element element = document.getRootElement();
@@ -156,14 +175,14 @@
String helloWorldGlobalScope = "Hello world process-instance scope";
TestJBPMVariable objectTokenScope = new TestJBPMVariable("Object token scope") ;
TestJBPMVariable objectGlobalScope = new TestJBPMVariable("Object global scope") ;
-
+
Token token = processInstance.getRootToken();
processInstance.getContextInstance().createVariable("v1", helloWorldTokenScope, token);
processInstance.getContextInstance().createVariable("g2", helloWorldGlobalScope);
processInstance.getContextInstance().createVariable("h3", objectTokenScope, token);
processInstance.getContextInstance().createVariable("i4", objectGlobalScope);
ExecutionContext executionContext = new ExecutionContext(token);
-
+
JBpmObjectMapper mapper = new JBpmObjectMapper();
Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, Boolean.FALSE, executionContext);
//We should find 2 variables which are named just like their jBPM counterparts.
@@ -190,21 +209,21 @@
*/
@Test
public void jBpmTokenInfo() throws Exception
- {
+ {
SAXReader reader = new SAXReader();
Document document = reader.read(this.getClass().getResourceAsStream("/" + PROCESS_DEF_XML));
Element element = document.getRootElement();
Element secondMiddleState = (Element) element.elements("state").toArray()[1];
DefaultElement bpmToEsbVars = (DefaultElement) secondMiddleState.element("transition").element("action").element("bpmToEsbVars");
-
+
Token token = processInstance.getRootToken();
ExecutionContext executionContext = new ExecutionContext(token);
Node node = executionContext.getNode();
Transition transition = (Transition) node.getLeavingTransitions().get(0);
-
+
JBpmObjectMapper mapper = new JBpmObjectMapper();
Message message = mapper.mapFromJBpmToEsbMessage(bpmToEsbVars, Boolean.FALSE, executionContext);
-
+
assertEquals(message.getBody().getNames().length,6);
assertEquals(String.valueOf(String.valueOf(message.getBody().get("TokenId"))), String.valueOf(token.getId()));
//The token name is null.
@@ -218,7 +237,43 @@
logger.info("Message=" + message);
}
+ @Test
+ public void ensureSecurityContextWasMappedToJbpmMap() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException
+ {
+ final SealedObject securityContext = createSealedObject("dummy string");
+ final Message message = MessageFactory.getInstance().getMessage();
+ message.getContext().setContext(SecurityService.CONTEXT, securityContext);
+
+ final HashMap<String,?> map = mapper.mapSecurityContextFromEsbMessageToJBpmMap(message);
+ assertNotNull("Should never return null. Can return an empty map though", map);
+ assertTrue(map.containsKey(Constants.SECURITY_CONTEXT));
+ }
+
+ @Test
+ public void ensureAuthRequestWasMappedToJbpmMap() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException
+ {
+ // Doesn't need to be encrypted as this is only passed along and never descrypted.
+ byte[] encryptedAuthRequest = new byte[100];
+ final Message message = MessageFactory.getInstance().getMessage();
+ message.getContext().setContext(SecurityService.AUTH_REQUEST, encryptedAuthRequest);
+
+ final HashMap<String,?> map = mapper.mapAuthRequestFromEsbMessageToJBpmMap(message);
+ assertNotNull("Should never return null. Can return an empty map though", map);
+ assertTrue(map.containsKey(Constants.AUTH_REQUEST));
+ }
+
public static junit.framework.Test suite(){
return new JUnit4TestAdapter(JBpmObjectMapperUnitTest.class);
}
+
+ private SealedObject createSealedObject(final Serializable ser) throws NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException, InvalidKeyException
+ {
+ final KeyGenerator kpg = KeyGenerator.getInstance("TripleDES");
+ kpg.init(112);
+ final SecretKey secretKey = kpg.generateKey();
+ final Cipher cipher = Cipher.getInstance("TripleDES");
+ cipher.init(Cipher.ENCRYPT_MODE, secretKey);
+
+ return new SealedObject(ser, cipher);
+ }
}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions)
Deleted: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java 2009-01-27 07:29:52 UTC (rev 24940)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,126 +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.jbpm.actions;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.KeyGenerator;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.SealedObject;
-import javax.crypto.SecretKey;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.security.SecurityContext;
-import org.jboss.soa.esb.services.security.SecurityService;
-import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Unit test for {@link BpmProcessor}.
- *
- * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
- *
- */
-public class BpmProcessorUnitTest
-{
- private BpmProcessor bpmProcessor;
- private Message message;
- private ConfigTree configTree;
-
- @Test
- public void verifyThatSecurityContextWasAddedToMesssageContext() throws ConfigurationException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException
- {
- final SealedObject securityContext = createSealedObject("dummy string");
- SecurityContext.setSecurityContext(securityContext);
- bpmProcessor.addSecurityContext(message);
-
- assertNotNull(message.getContext().getContext(SecurityService.CONTEXT));
- assertEquals(securityContext, message.getContext().getContext(SecurityService.CONTEXT));
- }
-
- @Test
- public void verifyThatNullSecurityContextCanBeAddedToMesssageContext() throws ConfigurationException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException
- {
- SecurityContext.setSecurityContext(null);
- bpmProcessor.addSecurityContext(message);
-
- assertNull(message.getContext().getContext(SecurityService.CONTEXT));
- }
-
- @Test
- public void verifyThatAuthenticationRequestWasAddedToMessageContext() throws ConfigurationException
- {
- // Doesn't need to be encrypted as this is only passed along and never descrypted.
- byte[] encryptedAuthRequest = new byte[100];
- AuthenticationRequestImpl.setEncryptedAuthRequest(encryptedAuthRequest);
- bpmProcessor.addAuthenticationRequest(message);
-
- assertNotNull(message.getContext().getContext(SecurityService.AUTH_REQUEST));
- assertEquals(encryptedAuthRequest, message.getContext().getContext(SecurityService.AUTH_REQUEST));
- }
-
- @Test
- public void verifyThatNullAuthenticationRequestCanBeAddedToMessageContext() throws ConfigurationException
- {
- AuthenticationRequestImpl.setEncryptedAuthRequest(null);
- bpmProcessor.addAuthenticationRequest(message);
- assertNull(message.getContext().getContext(SecurityService.AUTH_REQUEST));
- }
-
- @Before
- public void setup() throws ConfigurationException
- {
- configTree = new ConfigTree("junit");
- bpmProcessor = new BpmProcessor(configTree);
- message = MessageFactory.getInstance().getMessage();
- }
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(BpmProcessorUnitTest.class);
- }
-
- private SealedObject createSealedObject(final Serializable ser) throws NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException, InvalidKeyException
- {
- final KeyGenerator kpg = KeyGenerator.getInstance("TripleDES");
- kpg.init(112);
- final SecretKey secretKey = kpg.generateKey();
- final Cipher cipher = Cipher.getInstance("TripleDES");
- cipher.init(Cipher.ENCRYPT_MODE, secretKey);
-
- return new SealedObject(ser, cipher);
- }
-}
Copied: labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/services/jbpm/src/test/java/org/jboss/soa/esb/services/jbpm/actions/BpmProcessorUnitTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -0,0 +1,126 @@
+/*
+ * 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.jbpm.actions;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.KeyGenerator;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SealedObject;
+import javax.crypto.SecretKey;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.security.SecurityContext;
+import org.jboss.soa.esb.services.security.SecurityService;
+import org.jboss.soa.esb.services.security.auth.AuthenticationRequestImpl;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Unit test for {@link BpmProcessor}.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class BpmProcessorUnitTest
+{
+ private BpmProcessor bpmProcessor;
+ private Message message;
+ private ConfigTree configTree;
+
+ @Test
+ public void verifyThatSecurityContextWasAddedToMesssageContext() throws ConfigurationException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException
+ {
+ final SealedObject securityContext = createSealedObject("dummy string");
+ SecurityContext.setSecurityContext(securityContext);
+ bpmProcessor.addSecurityContext(message);
+
+ assertNotNull(message.getContext().getContext(SecurityService.CONTEXT));
+ assertEquals(securityContext, message.getContext().getContext(SecurityService.CONTEXT));
+ }
+
+ @Test
+ public void verifyThatNullSecurityContextCanBeAddedToMesssageContext() throws ConfigurationException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException
+ {
+ SecurityContext.setSecurityContext(null);
+ bpmProcessor.addSecurityContext(message);
+
+ assertNull(message.getContext().getContext(SecurityService.CONTEXT));
+ }
+
+ @Test
+ public void verifyThatAuthenticationRequestWasAddedToMessageContext() throws ConfigurationException
+ {
+ // Doesn't need to be encrypted as this is only passed along and never descrypted.
+ byte[] encryptedAuthRequest = new byte[100];
+ AuthenticationRequestImpl.setEncryptedAuthRequest(encryptedAuthRequest);
+ bpmProcessor.addAuthenticationRequest(message);
+
+ assertNotNull(message.getContext().getContext(SecurityService.AUTH_REQUEST));
+ assertEquals(encryptedAuthRequest, message.getContext().getContext(SecurityService.AUTH_REQUEST));
+ }
+
+ @Test
+ public void verifyThatNullAuthenticationRequestCanBeAddedToMessageContext() throws ConfigurationException
+ {
+ AuthenticationRequestImpl.setEncryptedAuthRequest(null);
+ bpmProcessor.addAuthenticationRequest(message);
+ assertNull(message.getContext().getContext(SecurityService.AUTH_REQUEST));
+ }
+
+ @Before
+ public void setup() throws ConfigurationException
+ {
+ configTree = new ConfigTree("junit");
+ bpmProcessor = new BpmProcessor(configTree);
+ message = MessageFactory.getInstance().getMessage();
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(BpmProcessorUnitTest.class);
+ }
+
+ private SealedObject createSealedObject(final Serializable ser) throws NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, IOException, InvalidKeyException
+ {
+ final KeyGenerator kpg = KeyGenerator.getInstance("TripleDES");
+ kpg.init(112);
+ final SecretKey secretKey = kpg.generateKey();
+ final Cipher cipher = Cipher.getInstance("TripleDES");
+ cipher.init(Cipher.ENCRYPT_MODE, secretKey);
+
+ return new SealedObject(ser, cipher);
+ }
+}
Modified: labs/jbossesb/trunk/product/services/soap/src/test/resources/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/resources/log4j.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/services/soap/src/test/resources/log4j.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -34,14 +34,14 @@
<!-- Limit categories -->
<!-- ================ -->
- <category name="org.jbpm">
- <priority value="INFO"/>
+ <category name="org.milyn">
+ <priority value="ERROR"/>
</category>
<category name="org.hibernate">
<priority value="ERROR"/>
</category>
<category name="org.jboss">
- <priority value="WARN"/>
+ <priority value="ERROR"/>
</category>
<category name="org.jboss.soa.esb">
<priority value="ERROR"/>
@@ -53,8 +53,15 @@
<priority value="ERROR"/>
</category>
<category name="org.jboss.soa.esb.services.jbpm">
- <priority value="DEBUG"/>
+ <priority value="ERROR"/>
</category>
+ <category name="com.eviware.soapui">
+ <priority value="ERROR"/>
+ </category>
+ <category name="httpclient">
+ <priority value="ERROR"/>
+ </category>
+
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
Modified: labs/jbossesb/trunk/product/tools/console/management/monitoring-mappings.hbm.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/monitoring-mappings.hbm.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management/monitoring-mappings.hbm.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -17,6 +17,7 @@
</id>
<many-to-one name="attribute" column="STATID"/>
<property name="statdate" type="java.util.Date" column="STATDATE"/>
+ <property name="bytevalue" type="java.lang.Long" column="bytevalue"/>
<property name="timevalue" type="java.lang.Float" column="timevalue"/>
<property name="countvalue" type="java.lang.Integer" column="countvalue"/>
<property name="textvalue" type="java.lang.String" column="textvalue"/>
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/resources/hsqldb/monitoring-mappings.hbm.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/resources/hsqldb/monitoring-mappings.hbm.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/resources/hsqldb/monitoring-mappings.hbm.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -18,6 +18,7 @@
<many-to-one name="attribute" column="STATID"/>
<property name="server" type="java.lang.String" column="SERVER"/>
<property name="statdate" type="timestamp" column="STATDATE"/>
+ <property name="bytevalue" type="java.lang.Long" column="bytevalue"/>
<property name="timevalue" type="java.lang.Float" column="timevalue"/>
<property name="countvalue" type="java.lang.Integer" column="countvalue"/>
<property name="textvalue" type="java.lang.String" column="textvalue"/>
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/resources/mysql/monitoring-mappings.hbm.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/resources/mysql/monitoring-mappings.hbm.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/resources/mysql/monitoring-mappings.hbm.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -18,6 +18,7 @@
<many-to-one name="attribute" column="STATID"/>
<property name="server" type="java.lang.String" column="SERVER"/>
<property name="statdate" type="java.util.Date" column="STATDATE"/>
+ <property name="bytevalue" type="java.lang.Long" column="bytevalue"/>
<property name="timevalue" type="java.lang.Float" column="timevalue"/>
<property name="countvalue" type="java.lang.Integer" column="countvalue"/>
<property name="textvalue" type="java.lang.String" column="textvalue"/>
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/resources/oracle/monitoring-mappings.hbm.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/resources/oracle/monitoring-mappings.hbm.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/resources/oracle/monitoring-mappings.hbm.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -22,6 +22,7 @@
<many-to-one name="attribute" column="STATID"/>
<property name="server" type="java.lang.String" column="SERVER"/>
<property name="statdate" type="java.util.Date" column="STATDATE"/>
+ <property name="bytevalue" type="java.lang.Long" column="bytevalue"/>
<property name="timevalue" type="java.lang.Float" column="timevalue"/>
<property name="countvalue" type="java.lang.Integer" column="countvalue"/>
<property name="textvalue" type="java.lang.String" column="textvalue"/>
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/resources/postgresql/monitoring-mappings.hbm.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/resources/postgresql/monitoring-mappings.hbm.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/resources/postgresql/monitoring-mappings.hbm.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -20,6 +20,7 @@
<many-to-one name="attribute" column="STATID"/>
<property name="server" type="java.lang.String" column="SERVER"/>
<property name="statdate" type="java.util.Date" column="STATDATE"/>
+ <property name="bytevalue" type="java.lang.Long" column="bytevalue"/>
<property name="timevalue" type="java.lang.Float" column="timevalue"/>
<property name="countvalue" type="java.lang.Integer" column="countvalue"/>
<property name="textvalue" type="java.lang.String" column="textvalue"/>
Modified: labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/hsqldb/create_database.sql
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/hsqldb/create_database.sql 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/hsqldb/create_database.sql 2009-01-27 13:29:49 UTC (rev 24944)
@@ -41,6 +41,7 @@
STATID INTEGER,
SERVER VARCHAR(255),
STATDATE TIMESTAMP,
+BYTEVALUE BIGINT,
TIMEVALUE FLOAT,
COUNTVALUE INT,
TEXTVALUE VARCHAR(255),
Modified: labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/mysql/create_database.sql
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/mysql/create_database.sql 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/mysql/create_database.sql 2009-01-27 13:29:49 UTC (rev 24944)
@@ -11,6 +11,7 @@
STATID bigint,
SERVER varchar(255),
STATDATE datetime,
+ bytevalue bigint,
timevalue float,
countvalue integer,
textvalue text,
Modified: labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/oracle/create_database.sql
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/oracle/create_database.sql 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/oracle/create_database.sql 2009-01-27 13:29:49 UTC (rev 24944)
@@ -18,9 +18,10 @@
STATID number(19,0),
SERVER varchar2(255 char),
STATDATE timestamp,
+ bytevalue long,
timevalue float,
countvalue number(10,0),
- textvalue varchar2(2000 char),
+ textvalue varchar2(4000 char),
primary key (id)
);
Modified: labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/postgresql/create_database.sql
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/postgresql/create_database.sql 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-esb/src/main/resources/postgresql/create_database.sql 2009-01-27 13:29:49 UTC (rev 24944)
@@ -10,6 +10,7 @@
STATID integer,
SERVER varchar(255),
STATDATE timestamp,
+ bytevalue bigint,
timevalue float,
countvalue integer,
textvalue text
Modified: labs/jbossesb/trunk/product/tools/console/management-web/build.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/build.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-web/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -37,6 +37,8 @@
<lib dir="${mgmt.web.dir}/lib">
<include name="jfreechart-1.0.6.jar"/>
<include name="jcommon-1.0.10.jar"/>
+ <include name="jstl.jar"/>
+ <include name="standard.jar"/>
</lib>
</war>
</target>
Copied: labs/jbossesb/trunk/product/tools/console/management-web/lib/jstl.jar (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/tools/console/management-web/lib/jstl.jar)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/trunk/product/tools/console/management-web/lib/standard.jar (from rev 24940, labs/jbossesb/tags/JBESB_4_4_GA_CP2_CR2/product/tools/console/management-web/lib/standard.jar)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/attribute.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/attribute.jsp 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/attribute.jsp 2009-01-27 13:29:49 UTC (rev 24944)
@@ -12,7 +12,8 @@
org.jboss.soa.esb.monitoring.server.StatisticsHelper,
org.jboss.soa.esb.monitoring.server.TimeSeriesChartProducer,
org.jfree.data.time.Minute,
- org.jfree.chart.JFreeChart
+ org.jfree.chart.JFreeChart,
+ org.apache.taglibs.standard.tag.common.core.Util
"%>
<%!
private static int imagecounter = 0;
@@ -45,7 +46,7 @@
<hr>
<%
Long id = new Long(request.getParameter("id"));
-String servername = request.getParameter("servername");
+String servername = Util.escapeXml(request.getParameter("servername"));
int maxrecords = 10;
try {
maxrecords = Integer.parseInt(request.getParameter("maxrecords"));
@@ -76,9 +77,11 @@
JMXData jmxd = (JMXData) dataList.get(i);
switch (attributeType) {
case StatisticsHelper.COUNT_ATTRIBUTE:
- case StatisticsHelper.BYTES_ATTRIBUTE:
tscp.addMinute(new Minute(jmxd.getStatdate()), jmxd.getCountvalue());
break;
+ case StatisticsHelper.BYTES_ATTRIBUTE:
+ tscp.addMinute(new Minute(jmxd.getStatdate()), jmxd.getBytevalue());
+ break;
case StatisticsHelper.TIME_ATTRIBUTE:
tscp.addMinute(new Minute(jmxd.getStatdate()), jmxd.getTimevalue());
break;
@@ -102,7 +105,7 @@
<%
} else {
%>
-<h1><code><%=attribute%></code></h1>
+<h1><code><%=Util.escapeXml(attribute)%></code></h1>
<%
}
%><br>
@@ -115,7 +118,7 @@
<option value="44640" <%=StatisticsHelper.getSelected(44640, timerange)%>>1 month
<option value="-1" <%=StatisticsHelper.getSelected(-1, timerange)%>>All
</select> and the
-list the last <input type="text" name="maxrecords" value="<%=maxrecords%>"></input> records
+list the last <input type="text" name="maxrecords" value="<%= maxrecords %>"></input> records
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="servername" value="<%=servername%>">
<input type="submit" value="submit">
@@ -125,7 +128,7 @@
<table>
<tr>
<th>Collection Date</th>
-<th><%=attribute%></th>
+<th><%=Util.escapeXml(attribute) %></th>
</tr>
<%
NumberFormat nf = NumberFormat.getInstance();
@@ -138,12 +141,18 @@
switch (attributeType) {
case StatisticsHelper.COUNT_ATTRIBUTE:
- case StatisticsHelper.BYTES_ATTRIBUTE:
%>
<tr>
<td><%=formatter.format(jmxd.getStatdate())%></td>
<td align="right"><%=jmxd.getCountvalue()%></td>
</tr>
+ <%
+ case StatisticsHelper.BYTES_ATTRIBUTE:
+ %>
+ <tr>
+ <td><%=formatter.format(jmxd.getStatdate())%></td>
+ <td align="right"><%=jmxd.getBytevalue()%></td>
+ </tr>
<%
break;
case StatisticsHelper.TIME_ATTRIBUTE:
Modified: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/index.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/index.jsp 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/index.jsp 2009-01-27 13:29:49 UTC (rev 24944)
@@ -6,7 +6,8 @@
org.hibernate.Transaction,
org.jboss.soa.esb.monitoring.MonitoringSessionFactory,
org.jboss.soa.esb.monitoring.pojo.*,
- org.jboss.soa.esb.monitoring.server.StatisticsHelper
+ org.jboss.soa.esb.monitoring.server.StatisticsHelper,
+ org.apache.taglibs.standard.tag.common.core.Util
"%>
<html>
<head>
@@ -46,7 +47,7 @@
String serverName = (String) serverNames.get(i);
%>
<hr>
- <h1><code><%=serverName%></code></h1>
+ <h1><code><%=Util.escapeXml(serverName)%></code></h1>
<%
List objectNames = StatisticsHelper.getObjectNamesForServer(sess, serverName);
for (int j = 0; j < objectNames.size(); j++) {
@@ -58,7 +59,7 @@
List attributeNames = StatisticsHelper.getAttributes(sess, serverName, objectName);
for (int k = 0; k < attributeNames.size(); k++) {
JMXAttribute jmxattr = (JMXAttribute) attributeNames.get(k);
- String attributeName = jmxattr.getAttribute();
+ String attributeName = Util.escapeXml(jmxattr.getAttribute());
%>
<li><a href="attribute.jsp?servername=<%=serverName%>&id=<%=jmxattr.getId()%>"><%=attributeName%></a></li>
<%
Modified: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/invoke.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/invoke.jsp 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/invoke.jsp 2009-01-27 13:29:49 UTC (rev 24944)
@@ -42,8 +42,7 @@
</table>
<hr>
<%
-String idString = request.getParameter("id");
-Long id = new Long(idString);
+Long id = new Long(request.getParameter("id"));
Session sess = null;
Transaction tx = null;
ServiceControlCommand obean = null;
Modified: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/operations.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/operations.jsp 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/operations.jsp 2009-01-27 13:29:49 UTC (rev 24944)
@@ -7,7 +7,8 @@
org.jboss.soa.esb.monitoring.MonitoringSessionFactory,
org.jboss.soa.esb.monitoring.pojo.*,
org.jboss.soa.esb.monitoring.server.StatisticsHelper,
- org.jboss.soa.esb.monitoring.server.OperationsHelper
+ org.jboss.soa.esb.monitoring.server.OperationsHelper,
+ org.apache.taglibs.standard.tag.common.core.Util
"%>
<html>
<head>
@@ -48,13 +49,13 @@
String serverName = (String) serverNames.get(i);
%>
<hr>
- <h1><code><%=serverName%></code></h1>
+ <h1><code><%=Util.escapeXml(serverName)%></code></h1>
<%
List objectNames = OperationsHelper.getObjectNamesForServer(sess, serverName);
for (int j = 0; j < objectNames.size(); j++) {
String objectName= (String) objectNames.get(j);
%>
- <li><b><%=objectName%></b></li>
+ <li><b><%=Util.escapeXml(objectName)%></b></li>
<ul>
<%
List operations = OperationsHelper.getOperations(sess, serverName, objectName);
@@ -63,7 +64,7 @@
String operation = jmxoper.getReturntype() + " " + jmxoper.getOperation()
+ " (" + jmxoper.getDescription() + ")";
%>
- <li><a href="invoke.jsp?id=<%=jmxoper.getId()%>"><%=operation%></a></li>
+ <li><a href="invoke.jsp?id=<%=jmxoper.getId()%>"><%=Util.escapeXml(operation)%></a></li>
<%
}
%>
Modified: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/results.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/results.jsp 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/results.jsp 2009-01-27 13:29:49 UTC (rev 24944)
@@ -7,7 +7,8 @@
org.jboss.soa.esb.monitoring.MonitoringSessionFactory,
org.jboss.soa.esb.monitoring.pojo.*,
org.jboss.soa.esb.monitoring.server.StatisticsHelper,
- org.jboss.soa.esb.monitoring.server.OperationsHelper
+ org.jboss.soa.esb.monitoring.server.OperationsHelper,
+ org.apache.taglibs.standard.tag.common.core.Util
"%>
<html>
<head>
@@ -48,7 +49,7 @@
String serverName = (String) serverNames.get(i);
%>
<hr>
- <h1><code><%=serverName%></code></h1>
+ <h1><code><%=Util.escapeXml(serverName)%></code></h1>
<%
List results = OperationsHelper.getOperationResults(sess, serverName);
for (int j = 0; j < results.size(); j++) {
@@ -56,9 +57,9 @@
%>
<li><b><%=jmxor.getStatdate()%></b></li>
<ul>
- <li><b>Result:</b> <%=jmxor.getResult() %>
- <li><b>Object name:</b> <%=jmxor.getOperation().getObjectname() %>
- <li><b>Operation:</b> <%=jmxor.getOperation().getReturntype()%> <%=jmxor.getOperation().getOperation() %>
+ <li><b>Result:</b> <%=Util.escapeXml(jmxor.getResult())%>
+ <li><b>Object name:</b> <%=Util.escapeXml(jmxor.getOperation().getObjectname()) %>
+ <li><b>Operation:</b> <%=Util.escapeXml(jmxor.getOperation().getReturntype())%> <%=Util.escapeXml(jmxor.getOperation().getOperation()) %>
</ul>
<%
}
Modified: labs/jbossesb/trunk/product/tools/console/management-web/web.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/web.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/console/management-web/web.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,7 +1,5 @@
-<!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd" >
-
-<web-app>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
<display-name>Archetype Created Web Application</display-name>
</web-app>
Modified: labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -56,7 +56,6 @@
<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"/>
<content name="library" displayName="Jar Library" category="deployable"
description="Library Jar files deployed in JBoss AS">
<configuration>
@@ -119,7 +118,7 @@
</plugin-configuration>
<operation name="resetCounter" displayName="Reset the message counter" description="Reset the message counter"/>
<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="Message Count (avg)" property="overallMessageCountByMinute" category="utilization" displayType="summary" measurementType="trendsup" 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"/>
@@ -169,11 +168,11 @@
</plugin-configuration>
<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"/>
+displayType="summary" defaultOn="true" measurementType="trendsup"/>
<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 Failed (avg)" property="failedProcessedCountMinute" category="utilization" displayType="summary" defaultOn="true" measurementType="trendsup"/>
<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="Messages Successfully Processed (avg)" property="successProcessedCountMinute" category="utilization" displayType="summary" defaultOn="true" measurementType="trendsup"/>
<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"/>
@@ -189,4 +188,3 @@
</service>
</service>
</plugin>
-
Modified: labs/jbossesb/trunk/qa/quickstarts/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/build.xml 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/qa/quickstarts/build.xml 2009-01-27 13:29:49 UTC (rev 24944)
@@ -63,7 +63,6 @@
<include name="fun_cbr/lib/**/*.jar"/>
<include name="helloworld/lib/**/*.jar"/>
<include name="helloworld_action/lib/**/*.jar"/>
- <include name="helloworld_db_registration/lib/**/*.jar"/>
<include name="helloworld_file_action/lib/**/*.jar"/>
<include name="helloworld_sql_action/lib/**/*.jar"/>
<include name="recipient_list/lib/**/*.jar"/>
@@ -95,7 +94,6 @@
<include name="groovy_gateway/build/classes"/>
<include name="helloworld/build/classes"/>
<include name="helloworld_action/build/classes"/>
- <include name="helloworld_db_registration/build/classes"/>
<include name="helloworld_file_action/build/classes"/>
<include name="helloworld_file_notifier/build/classes"/>
<include name="helloworld_sql_action/build/classes"/>
@@ -199,7 +197,6 @@
<exec-quickstart quickstart="groovy_gateway" target="clean"/>
<exec-quickstart quickstart="helloworld" target="clean"/>
<exec-quickstart quickstart="helloworld_action" target="clean"/>
- <exec-quickstart quickstart="helloworld_db_registration" target="clean"/>
<exec-quickstart quickstart="helloworld_file_action" target="clean"/>
<exec-quickstart quickstart="helloworld_file_notifier" target="clean"/>
<exec-quickstart quickstart="helloworld_sql_action" target="clean"/>
@@ -243,7 +240,6 @@
<exec-quickstart quickstart="groovy_gateway" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_action" target="prepare-deployment"/>
- <exec-quickstart quickstart="helloworld_db_registration" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_file_action" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_file_notifier" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_sql_action" target="prepare-deployment"/>
@@ -283,7 +279,6 @@
<include name="groovy_gateway/build/*.esb"/>
<include name="helloworld/build/*.esb"/>
<include name="helloworld_action/build/*.esb"/>
- <include name="helloworld_db_registration/build/*.esb"/>
<include name="helloworld_file_action/build/*.esb"/>
<include name="helloworld_file_notifier/build/*.esb"/>
<include name="helloworld_sql_action/build/*.esb"/>
Deleted: labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2009-01-27 11:44:29 UTC (rev 24943)
+++ labs/jbossesb/trunk/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2009-01-27 13:29:49 UTC (rev 24944)
@@ -1,57 +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,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.quickstart.test;
-
-import junit.framework.Test;
-
-import org.jboss.soa.esb.samples.quickstart.helloworlddbregistration.test.SendJMSMessage;
-
-/**
- * CI test for the helloworlddbregistration quickstart.
- *
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- */
-public class HelloWorldDBRegistrationTest extends AbstractQuickstartTestCase {
- private static final String JMS_MESSAGE = "HelloWorldDBRegistrationTest message";
-
- public HelloWorldDBRegistrationTest(String name) {
- super(name);
- }
-
- public void testMessage() throws Exception {
- clearMessages() ;
- sendMessage() ;
- checkMessages(30000, JMS_MESSAGE) ;
- }
-
- public void sendMessage() throws Exception {
- SendJMSMessage sm = new SendJMSMessage();
- sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE);
- sm.stop();
- }
-
- public static Test suite() throws Exception {
- return getDeploySetup(HelloWorldDBRegistrationTest.class,
- "QuickstartMessageStoreServer.sar, Quickstart_db_registration.esb");
- }
-}
More information about the jboss-svn-commits
mailing list