├── .gitattributes ├── .github └── workflows │ └── reduce_readme.yml ├── .gitignore ├── LICENSE.txt ├── README-source.adoc ├── README.adoc ├── README.html ├── cmt ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml ├── scripts │ └── embedded-broker.cli └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── cmt │ │ │ ├── controller │ │ │ ├── CustomerManager.java │ │ │ └── LogMessageManager.java │ │ │ ├── ejb │ │ │ ├── CustomerManagerEJB.java │ │ │ ├── InvoiceManagerEJB.java │ │ │ └── LogMessageManagerEJB.java │ │ │ ├── mdb │ │ │ └── HelloWorldMDB.java │ │ │ └── model │ │ │ ├── Customer.java │ │ │ └── LogMessage.java │ ├── resources │ │ ├── META-INF │ │ │ └── persistence.xml │ │ └── import.sql │ └── webapp │ │ ├── WEB-INF │ │ ├── activemq-jms.xml │ │ ├── beans.xml │ │ └── faces-config.xml │ │ ├── addCustomer.xhtml │ │ ├── customers.xhtml │ │ ├── duplicate.xhtml │ │ ├── index.html │ │ ├── invalidName.xhtml │ │ ├── logMessages.xhtml │ │ └── template.xhtml │ └── test │ └── java │ └── org │ └── jboss │ └── as │ └── quickstarts │ └── cmt │ ├── ProvisionedManagedCustomerIT.java │ ├── RemoteCustomerIT.java │ └── ejb │ └── CustomerManagerEJBTest.java ├── ee-security ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── configure-elytron.cli ├── pom.xml ├── restore-configuration.cli └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── ee_security │ │ │ ├── ElytronIdentityStore.java │ │ │ ├── SecuredServlet.java │ │ │ ├── SecurityFactory.java │ │ │ └── TestAuthenticationMechanism.java │ └── webapp │ │ └── WEB-INF │ │ └── beans.xml │ └── test │ └── java │ └── org │ └── jboss │ └── as │ └── quickstarts │ └── ee_security │ ├── ProvisionedManagedSecureIT.java │ └── RemoteSecureIT.java ├── helloworld-ws ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── wshelloworld │ │ │ ├── HelloWorldService.java │ │ │ └── HelloWorldServiceImpl.java │ └── webapp │ │ ├── WEB-INF │ │ └── beans.xml │ │ └── index.html │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── as │ │ └── quickstarts │ │ └── wshelloworld │ │ ├── Client.java │ │ ├── ClientArqIT.java │ │ ├── ClientIT.java │ │ └── RemoteClientIT.java │ └── resources │ └── arquillian.xml ├── helloworld ├── .cheatsheet.xml ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── helloworld │ │ │ └── HelloWorldServlet.java │ └── webapp │ │ └── index.html │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── as │ │ └── quickstarts │ │ └── helloworld │ │ ├── HelloWorldServletIT.java │ │ └── managed │ │ └── ManagedHelloWorldServletIT.java │ └── resources │ └── arquillian.xml ├── jaxrs-client ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── jaxrsclient │ │ │ ├── model │ │ │ └── Contact.java │ │ │ └── rest │ │ │ ├── ContactResourceRESTService.java │ │ │ └── JaxRsActivator.java │ └── webapp │ │ └── WEB-INF │ │ └── beans.xml │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── as │ │ └── quickstarts │ │ └── jaxrsclient │ │ └── test │ │ ├── AbstractContactsRestClient.java │ │ ├── ContactsRestClient.java │ │ ├── LogResponseFilter.java │ │ ├── ManagedContactsRestClientIT.java │ │ ├── ProvisionedManagedContactRestClientIT.java │ │ ├── RemoteContactsRestClientIT.java │ │ └── SavedByClientRequestFilter.java │ └── resources │ └── arquillian.xml ├── kitchensink ├── .cheatsheet.xml ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── kitchensink │ │ │ ├── controller │ │ │ └── MemberController.java │ │ │ ├── data │ │ │ ├── MemberListProducer.java │ │ │ └── MemberRepository.java │ │ │ ├── model │ │ │ └── Member.java │ │ │ ├── rest │ │ │ ├── JaxRsActivator.java │ │ │ └── MemberResourceRESTService.java │ │ │ ├── service │ │ │ └── MemberRegistration.java │ │ │ └── util │ │ │ └── Resources.java │ ├── resources │ │ ├── META-INF │ │ │ └── persistence.xml │ │ └── import.sql │ └── webapp │ │ ├── WEB-INF │ │ ├── beans.xml │ │ ├── faces-config.xml │ │ ├── kitchensink-quickstart-ds.xml │ │ └── templates │ │ │ └── default.xhtml │ │ ├── index.html │ │ ├── index.xhtml │ │ └── resources │ │ ├── css │ │ └── screen.css │ │ └── gfx │ │ ├── asidebkg.png │ │ ├── banner.png │ │ ├── bkg-blkheader.png │ │ ├── headerbkg.png │ │ ├── rhjb_eap_logo.png │ │ └── wildfly_400x130.jpg │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── as │ │ └── quickstarts │ │ └── kitchensink │ │ └── test │ │ ├── MemberRegistrationIT.java │ │ └── RemoteMemberRegistrationIT.java │ └── resources │ ├── META-INF │ └── test-persistence.xml │ ├── arquillian.xml │ └── test-ds.xml ├── numberguess ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── numberguess │ │ │ ├── Game.java │ │ │ ├── Generator.java │ │ │ ├── MaxNumber.java │ │ │ └── Random.java │ └── webapp │ │ ├── WEB-INF │ │ ├── beans.xml │ │ └── faces-config.xml │ │ ├── home.xhtml │ │ └── index.html │ └── test │ └── java │ └── org │ └── jboss │ └── as │ └── quickstarts │ └── numberguess │ ├── ProvisionedManagedNumberGuessIT.java │ └── RemoteNumberGuessIT.java ├── pom.xml ├── remote-helloworld-mdb ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── configure-remote-broker.cli ├── pom.xml ├── remove-remote-broker.cli └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ ├── mdb │ │ │ ├── HelloWorldQueueMDB.java │ │ │ └── HelloWorldTopicMDB.java │ │ │ └── servlet │ │ │ └── HelloWorldMDBServletClient.java │ └── webapp │ │ ├── WEB-INF │ │ └── beans.xml │ │ └── index.html │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── as │ │ └── quickstarts │ │ └── mdb │ │ ├── AbstractMDBServletIT.java │ │ ├── ProvisionedManagedMDBServletIT.java │ │ └── RemoteMDBServletIT.java │ └── resources │ └── arquillian.xml ├── servlet-security ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── configure-server.cli ├── pom.xml ├── restore-configuration.cli └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── servlet_security │ │ │ ├── DummyEntity.java │ │ │ └── SecuredServlet.java │ ├── resources │ │ ├── META-INF │ │ │ └── persistence.xml │ │ └── import.sql │ └── webapp │ │ ├── WEB-INF │ │ ├── beans.xml │ │ ├── jboss-web.xml │ │ └── web.xml │ │ └── index.html │ └── test │ └── java │ └── org │ └── jboss │ └── as │ └── quickstarts │ └── servlet_security │ ├── ProvisionedManagedSecureIT.java │ └── RemoteSecureIT.java ├── shared-doc ├── add-application-and-management-users.adoc ├── add-application-user.adoc ├── attributes.adoc ├── available-quickstarts.adoc ├── back-up-managed-domain-configuration.adoc ├── back-up-server-standalone-configuration.adoc ├── build-and-deploy-the-quickstart.adoc ├── build-and-run-the-quickstart-with-bootable-jar.adoc ├── build-and-run-the-quickstart-with-openshift.adoc ├── build-and-run-the-quickstart-with-provisioned-server.adoc ├── build-the-quickstart-for-openshift.adoc ├── cd-create-project.adoc ├── cd-deploy-project.adoc ├── cd-import-imagestreams-templates.adoc ├── cd-openshift-getting-started-overview.adoc ├── cd-post-deployment-tasks.adoc ├── debug-the-application.adoc ├── define-standalone-server-attributes.adoc ├── deploy-to-openshift-online.adoc ├── development-shortcuts.adoc ├── helm-deploy-project.adoc ├── helm-getting-started-overview.adoc ├── helm-pre-requisites.adoc ├── openshift-create-project.adoc ├── openshift-deploy-project.adoc ├── openshift-getting-started-overview.adoc ├── openshift-getting-started.adoc ├── openshift-import-imagestreams-templates.adoc ├── openshift-incompatibility.adoc ├── openshift-post-deployment-tasks.adoc ├── restore-managed-domain-configuration-manual.adoc ├── restore-standalone-server-configuration-manual.adoc ├── restore-standalone-server-configuration.adoc ├── run-arquillian-functional-tests-remote.adoc ├── run-arquillian-functional-tests.adoc ├── run-arquillian-integration-tests-with-openshift.adoc ├── run-arquillian-integration-tests-with-provisioned-server.adoc ├── run-arquillian-integration-tests-with-server-distribution.adoc ├── run-arquillian-tests.adoc ├── run-the-quickstart-in-jboss-developer-studio.adoc ├── setup-repositories.adoc ├── start-the-managed-domain.adoc ├── start-the-standalone-server.adoc ├── system-requirements.adoc ├── undeploy-the-quickstart.adoc ├── use-of-jboss-home-name.adoc ├── xp-create-project.adoc ├── xp-deploy-project.adoc ├── xp-import-imagestreams-templates.adoc ├── xp-install-amq-streams.adoc ├── xp-install-jaeger.adoc ├── xp-openshift-getting-started.adoc └── xp-post-deployment-tasks.adoc ├── temperature-converter ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── temperatureconverter │ │ │ ├── controller │ │ │ ├── ScaleConverter.java │ │ │ └── TemperatureConverter.java │ │ │ └── ejb │ │ │ ├── Scale.java │ │ │ ├── Temperature.java │ │ │ └── TemperatureConvertEJB.java │ └── webapp │ │ ├── WEB-INF │ │ ├── beans.xml │ │ └── faces-config.xml │ │ ├── index.html │ │ └── temperatureconvert.xhtml │ └── test │ └── java │ └── org │ └── jboss │ └── as │ └── quickstarts │ └── temperatureconverter │ ├── ProvisionedManagedTemperatureConverterIT.java │ └── RemoteTemperatureConverterIT.java ├── thread-racing ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml ├── scripts │ └── embedded-broker.cli └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── as │ │ │ └── quickstarts │ │ │ └── threadracing │ │ │ ├── EnvironmentProperties.java │ │ │ ├── Race.java │ │ │ ├── RaceBroadcaster.java │ │ │ ├── Racer.java │ │ │ ├── WebSocketRace.java │ │ │ ├── WebSocketRaceBroadcaster.java │ │ │ ├── legends │ │ │ ├── JimmieThronson.java │ │ │ ├── MichaelThrumacher.java │ │ │ ├── SebastienThroeb.java │ │ │ └── ValentinoThrossi.java │ │ │ ├── results │ │ │ ├── ChampionshipStandings.java │ │ │ ├── RaceResult.java │ │ │ └── RaceResults.java │ │ │ └── stage │ │ │ ├── RaceStage.java │ │ │ ├── batch │ │ │ ├── BatchRaceStage.java │ │ │ ├── BatchRaceStageItemProcessor.java │ │ │ ├── BatchRaceStageItemReader.java │ │ │ └── BatchRaceStageItemWriter.java │ │ │ ├── concurrency │ │ │ └── EEConcurrencyRaceStage.java │ │ │ ├── jaxrs │ │ │ ├── BoxApplication.java │ │ │ ├── BoxService.java │ │ │ └── JAXRSRaceStage.java │ │ │ ├── jms │ │ │ ├── JMSRaceStage.java │ │ │ └── JMSRaceStageMessageListener.java │ │ │ └── json │ │ │ └── JSONRaceStage.java │ ├── resources │ │ └── META-INF │ │ │ ├── batch-jobs │ │ │ ├── race.xml │ │ │ └── race.xsd │ │ │ └── persistence.xml │ └── webapp │ │ ├── WEB-INF │ │ └── beans.xml │ │ └── index.html │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── as │ │ └── quickstarts │ │ └── threadracing │ │ ├── EchoListener.java │ │ ├── ProvisionedManagedThreadRacingIT.java │ │ └── RemoteThreadRacingIT.java │ └── resources │ └── arquillian.xml ├── todo-backend ├── README-source.adoc ├── README.adoc ├── README.html ├── charts │ └── helm.yaml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── wildfly │ │ │ └── quickstarts │ │ │ └── todos │ │ │ ├── Resources.java │ │ │ ├── ToDo.java │ │ │ ├── ToDoBackendApplication.java │ │ │ ├── ToDoController.java │ │ │ ├── ToDoDAO.java │ │ │ └── ToDoDAOImpl.java │ ├── resources │ │ └── META-INF │ │ │ └── persistence.xml │ ├── scripts │ │ └── cors_filters.cli │ └── webapp │ │ └── WEB-INF │ │ └── beans.xml │ └── test │ ├── java │ └── org │ │ └── wildfly │ │ └── quickstarts │ │ └── todos │ │ ├── AbstractToDoIT.java │ │ ├── ProvisionedManagedToDoIT.java │ │ └── RemoteToDoIT.java │ └── resources │ └── arquillian.xml └── websocket-hello ├── README-source.adoc ├── README.adoc ├── README.html ├── charts └── helm.yaml ├── pom.xml └── src ├── main ├── java │ └── org │ │ └── jboss │ │ └── as │ │ └── quickstarts │ │ └── websocket_hello │ │ └── HelloName.java └── webapp │ ├── index.html │ └── resources │ └── css │ └── hello.css └── test ├── java └── org │ └── jboss │ └── as │ └── quickstarts │ └── websocket_hello │ ├── EchoListener.java │ ├── ProvisionedManagedWebsocketIT.java │ └── RemoteWebSocketIT.java └── resources └── arquillian.xml /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf 2 | *.bat text eol=crlf 3 | -------------------------------------------------------------------------------- /.github/workflows/reduce_readme.yml: -------------------------------------------------------------------------------- 1 | name: JBoss EAP 8.0 Quickstarts Update 'README.adoc's 2 | 3 | on: 4 | push: 5 | branches: 6 | - 8.0.x 7 | 8 | # Only run the latest job 9 | concurrency: 10 | group: '${{ github.workflow }} @ ${{ github.ref || github.run_id }}' 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout Repository 18 | uses: actions/checkout@v4 19 | - name: Install Asciidoctor Reducer 20 | run: sudo gem install asciidoctor-reducer 21 | - name: Reduce README 22 | run: | 23 | CURRENT_DIR="$( pwd -P)" 24 | #Get a list of subdirectories that don't start with a . 25 | subdirs=`find . -maxdepth 1 -type d ! -iname ".*"` 26 | #Loop over the subdirectories 27 | for subdir in $subdirs 28 | do 29 | cd $subdir 30 | #Check if the directory contains README-source.adoc 31 | if [ -e README-source.adoc ] 32 | then 33 | #Get the dirname to define artifactId in the adoc 34 | ARTIFACT_ID=":artifactId: $(basename `pwd`)" 35 | #Use asciidoctor-reducer to create a flattened README.adoc 36 | asciidoctor-reducer --preserve-conditionals -o README.adoc README-source.adoc 37 | #Insert the directory name with env-github def so that this only affects GitHub rendering 38 | sed -i "1s/^/ifdef::env-github[]\n$ARTIFACT_ID\nendif::[]\n\n/" README.adoc 39 | fi 40 | cd $CURRENT_DIR 41 | done 42 | #Reduce root README 43 | asciidoctor-reducer --preserve-conditionals -o README.adoc README-source.adoc 44 | - name: Commit and Push README 45 | uses: EndBug/add-and-commit@v9 46 | with: 47 | add: '*.adoc' 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | build 3 | target 4 | .DS_Store 5 | bin 6 | .openshift 7 | */.gitignore 8 | .gitkeep 9 | /helloworld-jsp 10 | SERVICES.html 11 | CHANGES.html 12 | CONTRIBUTING.html 13 | RELEASE_PROCEDURE.html 14 | guide/*.html 15 | shared-doc/*.html 16 | out 17 | nb-configuration.xml 18 | nbactions.xml 19 | .idea 20 | *.ipr 21 | *.iws 22 | *.iml 23 | atlassian-ide-plugin.xml 24 | .checkstyle 25 | .classpath 26 | .project 27 | .settings 28 | .metadata 29 | .factorypath 30 | .nbattrs 31 | *.log 32 | build.metadata 33 | 34 | -------------------------------------------------------------------------------- /cmt/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: cmt 5 | deploy: 6 | replicas: 1 -------------------------------------------------------------------------------- /cmt/scripts/embedded-broker.cli: -------------------------------------------------------------------------------- 1 | if (outcome == success) of /subsystem=messaging-activemq:read-resource 2 | /subsystem=messaging-activemq/server=default:add(elytron-domain=ApplicationDomain) 3 | end-if 4 | if (outcome == success) of /subsystem=messaging-activemq/server=default:read-resource 5 | /subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id=0, params=[buffer-pooling=false]) 6 | /subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id=0, params=[buffer-pooling=false]) 7 | /subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:add(connectors=[in-vm], transaction=xa, entries=[java:/JmsXA,java:jboss/DefaultJMSConnectionFactory]) 8 | /subsystem=messaging-activemq/server=default/jms-queue=DLQ:add(entries=[java:/jms/queue/DLQ]) 9 | /subsystem=messaging-activemq/server=default/jms-queue=ExpiryQueue:add(entries=[java:/jms/queue/ExpiryQueue]) 10 | /subsystem=messaging-activemq/server=default/address-setting=#:add(dead-letter-address=jms.queue.DLQ, expiry-address=jms.queue.ExpiryQueue) 11 | end-if 12 | if (outcome == success) of /subsystem=ee/service=default-bindings:read-resource 13 | /subsystem=ee/service=default-bindings:write-attribute(name="jms-connection-factory", value="java:jboss/DefaultJMSConnectionFactory") 14 | end-if -------------------------------------------------------------------------------- /cmt/src/main/java/org/jboss/as/quickstarts/cmt/controller/LogMessageManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.cmt.controller; 18 | 19 | import java.util.List; 20 | 21 | import jakarta.enterprise.context.RequestScoped; 22 | import jakarta.inject.Inject; 23 | import jakarta.inject.Named; 24 | import javax.naming.NamingException; 25 | import jakarta.transaction.HeuristicMixedException; 26 | import jakarta.transaction.HeuristicRollbackException; 27 | import jakarta.transaction.NotSupportedException; 28 | import jakarta.transaction.RollbackException; 29 | import jakarta.transaction.SystemException; 30 | 31 | import org.jboss.as.quickstarts.cmt.ejb.LogMessageManagerEJB; 32 | import org.jboss.as.quickstarts.cmt.model.LogMessage; 33 | 34 | @Named("logMessageManager") 35 | @RequestScoped 36 | public class LogMessageManager { 37 | @Inject 38 | private LogMessageManagerEJB logMessageManager; 39 | 40 | public List getLogMessages() throws SecurityException, IllegalStateException, 41 | NamingException, NotSupportedException, SystemException, RollbackException, 42 | HeuristicMixedException, HeuristicRollbackException { 43 | return logMessageManager.listLogMessages(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /cmt/src/main/java/org/jboss/as/quickstarts/cmt/ejb/InvoiceManagerEJB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.cmt.ejb; 18 | 19 | import jakarta.annotation.Resource; 20 | import jakarta.ejb.Stateless; 21 | import jakarta.ejb.TransactionAttribute; 22 | import jakarta.ejb.TransactionAttributeType; 23 | import jakarta.inject.Inject; 24 | import jakarta.jms.JMSConnectionFactory; 25 | import jakarta.jms.JMSContext; 26 | import jakarta.jms.Queue; 27 | 28 | @Stateless 29 | public class InvoiceManagerEJB { 30 | 31 | @Inject 32 | @JMSConnectionFactory("java:/JmsXA") 33 | private JMSContext jmsContext; 34 | 35 | @Resource(lookup = "java:/queue/CMTQueue") 36 | private Queue queue; 37 | 38 | @TransactionAttribute(TransactionAttributeType.MANDATORY) 39 | public void createInvoice(String name) { 40 | jmsContext.createProducer() 41 | .send(queue, "Created invoice for customer named: " + name); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/Customer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.cmt.model; 18 | 19 | import java.io.Serializable; 20 | 21 | import jakarta.persistence.Column; 22 | import jakarta.persistence.Entity; 23 | import jakarta.persistence.GeneratedValue; 24 | import jakarta.persistence.Id; 25 | import jakarta.persistence.Table; 26 | 27 | @Entity 28 | @Table(name = "Customer") 29 | public class Customer implements Serializable { 30 | 31 | /** Default value included to remove warning. **/ 32 | private static final long serialVersionUID = 1L; 33 | 34 | @Id 35 | @GeneratedValue 36 | private int id; 37 | 38 | @Column(unique = true, nullable = false) 39 | private String name; 40 | 41 | public int getId() { 42 | return id; 43 | } 44 | 45 | public void setId(int id) { 46 | this.id = id; 47 | } 48 | 49 | public String getName() { 50 | return name; 51 | } 52 | 53 | public void setName(String name) { 54 | this.name = name; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /cmt/src/main/java/org/jboss/as/quickstarts/cmt/model/LogMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.cmt.model; 18 | 19 | import java.io.Serializable; 20 | 21 | import jakarta.persistence.Column; 22 | import jakarta.persistence.Entity; 23 | import jakarta.persistence.GeneratedValue; 24 | import jakarta.persistence.Id; 25 | import jakarta.persistence.Table; 26 | 27 | @Entity 28 | @Table(name = "LogMessage") 29 | public class LogMessage implements Serializable { 30 | private static final long serialVersionUID = 1L; 31 | 32 | @Id 33 | @GeneratedValue 34 | private int id; 35 | 36 | @Column(unique = true, nullable = false) 37 | private String message; 38 | 39 | public int getId() { 40 | return id; 41 | } 42 | 43 | public void setId(int id) { 44 | this.id = id; 45 | } 46 | 47 | public String getMessage() { 48 | return message; 49 | } 50 | 51 | public void setMessage(String name) { 52 | this.message = name; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /cmt/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cmt/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- JBoss, Home of Professional Open Source 3 | -- Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | -- contributors by the @authors tag. See the copyright.txt in the 5 | -- distribution for a full listing of individual contributors. 6 | -- 7 | -- Licensed under the Apache License, Version 2.0 (the "License"); 8 | -- you may not use this file except in compliance with the License. 9 | -- You may obtain a copy of the License at 10 | -- http://www.apache.org/licenses/LICENSE-2.0 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | -- You can use this file to load seed data into the database using SQL statements 19 | insert into Customer (id, name) values (0, 'TomJ') 20 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/WEB-INF/activemq-jms.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/addCustomer.xhtml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | Name: 29 | 30 | 32 | 33 | 34 | 35 |
    36 |
  • List customers
  • 37 |
  • List log messages
  • 38 |
39 |
40 |
41 | 42 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/customers.xhtml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 22 | 23 | 24 | 25 | 26 |

List of customers

27 | 28 | 29 | 30 | Name 31 | 32 | 33 | 34 | 35 | 36 | Id 37 | 38 | 39 | 40 | 41 | Go Back 42 |
43 |
44 | 45 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/duplicate.xhtml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 22 | 23 | 24 | 25 |

Customer Already Existed

26 | 27 | Go back 28 |
29 |
30 | 31 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/invalidName.xhtml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 22 | 23 | 24 | 25 |

Name of the customer is invalid

26 | 27 | Go back 28 |
29 |
30 | 31 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/logMessages.xhtml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 22 | 23 | 24 | 25 | 26 |

List of log-messages

27 | 28 | 29 | 30 | Message 31 | 32 | 33 | 34 | 35 | 36 | Id 37 | 38 | 39 | 40 | 41 | Go Back 42 |
43 |
44 | 45 | -------------------------------------------------------------------------------- /cmt/src/main/webapp/template.xhtml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | cmt 28 | 29 | 30 | 31 | 32 | 33 |

Customer Database

34 |
35 | 36 | 37 | 38 | 39 |
40 | 41 |
42 | 43 |
44 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /cmt/src/test/java/org/jboss/as/quickstarts/cmt/ProvisionedManagedCustomerIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.cmt; 18 | 19 | 20 | import java.net.URI; 21 | import java.net.URISyntaxException; 22 | import org.jboss.arquillian.container.test.api.RunAsClient; 23 | import org.jboss.arquillian.junit.Arquillian; 24 | import org.junit.Test; 25 | 26 | import org.junit.runner.RunWith; 27 | 28 | @RunWith(Arquillian.class) 29 | @RunAsClient 30 | public class ProvisionedManagedCustomerIT extends RemoteCustomerIT { 31 | 32 | @Override 33 | protected URI getHTTPEndpoint(String path) { 34 | String host = getServerHost(); 35 | if (host == null) { 36 | host = "http://localhost:8080/"; 37 | } 38 | try { 39 | return new URI(host + path); 40 | } catch (URISyntaxException ex) { 41 | throw new RuntimeException(ex); 42 | } 43 | } 44 | 45 | @Test 46 | @Override 47 | public void testAddCustomer() throws Exception { 48 | addCustomer("LisaS"); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /cmt/src/test/java/org/jboss/as/quickstarts/cmt/ejb/CustomerManagerEJBTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.cmt.ejb; 18 | 19 | import static org.junit.Assert.assertFalse; 20 | import static org.junit.Assert.assertTrue; 21 | 22 | import org.junit.Test; 23 | 24 | public class CustomerManagerEJBTest { 25 | @Test 26 | public void testNameIsValid() { 27 | assertTrue(CustomerManagerEJB.nameIsValid("Jan")); 28 | assertFalse(CustomerManagerEJB.nameIsValid("Jan1")); 29 | assertTrue(CustomerManagerEJB.nameIsValid("Jan-Piet")); 30 | assertFalse(CustomerManagerEJB.nameIsValid("Jan_Piet")); 31 | assertTrue(CustomerManagerEJB.nameIsValid("gefräßig")); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ee-security/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: ee-security 5 | deploy: 6 | replicas: 1 -------------------------------------------------------------------------------- /ee-security/configure-elytron.cli: -------------------------------------------------------------------------------- 1 | # CLI script to enable elytron for the quickstart application in the application server 2 | 3 | # Disable 'integrated-jaspi' as the quickstart will be managing it's own identities 4 | /subsystem=undertow/application-security-domain=other:write-attribute(name=integrated-jaspi, value=false) 5 | 6 | # Reload the server configuration 7 | #reload 8 | -------------------------------------------------------------------------------- /ee-security/restore-configuration.cli: -------------------------------------------------------------------------------- 1 | # CLI script to restore the application server configuration that was modified to run the quickstart 2 | 3 | # Activate 'integrated-jaspi' for the 'other' application-security-domain again. 4 | /subsystem=undertow/application-security-domain=other:write-attribute(name=integrated-jaspi, value=true) 5 | 6 | # Remove the WildFly Elytron JACC policy 7 | /subsystem=elytron/policy=jacc:remove 8 | 9 | # Reload the server configuration 10 | reload 11 | -------------------------------------------------------------------------------- /ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecuredServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.as.quickstarts.ee_security; 18 | 19 | import java.io.IOException; 20 | import java.io.PrintWriter; 21 | 22 | import jakarta.inject.Inject; 23 | import jakarta.security.enterprise.SecurityContext; 24 | import jakarta.servlet.ServletException; 25 | import jakarta.servlet.annotation.WebServlet; 26 | import jakarta.servlet.http.HttpServlet; 27 | import jakarta.servlet.http.HttpServletRequest; 28 | import jakarta.servlet.http.HttpServletResponse; 29 | 30 | import org.wildfly.security.auth.server.SecurityIdentity; 31 | 32 | /** 33 | * 34 | * @author Darran Lofthouse 35 | */ 36 | @WebServlet(value="/secured") 37 | public class SecuredServlet extends HttpServlet { 38 | 39 | @Inject 40 | private SecurityContext securityContext; 41 | 42 | @Inject 43 | private SecurityIdentity securityIdentity; 44 | 45 | @Override 46 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 47 | PrintWriter pw = resp.getWriter(); 48 | pw.println("SecuredServlet - doGet()"); 49 | pw.println(String.format("Identity as available from SecurityContext '%s'", securityContext.getCallerPrincipal().getName())); 50 | pw.println(String.format("Identity as available from injection '%s'", securityIdentity.getPrincipal().getName())); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /ee-security/src/main/java/org/jboss/as/quickstarts/ee_security/SecurityFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Red Hat, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.as.quickstarts.ee_security; 18 | 19 | import jakarta.enterprise.inject.Produces; 20 | 21 | import org.wildfly.security.auth.server.SecurityDomain; 22 | import org.wildfly.security.auth.server.SecurityIdentity; 23 | 24 | /** 25 | * 26 | * @author Darran Lofthouse 27 | */ 28 | public class SecurityFactory { 29 | 30 | @Produces 31 | public SecurityDomain getSecurityDomain() { 32 | return SecurityDomain.getCurrent(); 33 | } 34 | 35 | @Produces 36 | public SecurityIdentity getSecurityIdentity(SecurityDomain securityDomain) { 37 | return securityDomain.getCurrentSecurityIdentity(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ee-security/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /ee-security/src/test/java/org/jboss/as/quickstarts/ee_security/ProvisionedManagedSecureIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Red Hat, Inc. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | package org.jboss.as.quickstarts.ee_security; 22 | 23 | import java.net.URI; 24 | import java.net.URISyntaxException; 25 | import org.jboss.arquillian.container.test.api.RunAsClient; 26 | import org.jboss.arquillian.junit.Arquillian; 27 | import org.junit.runner.RunWith; 28 | 29 | /** 30 | * 31 | * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. 32 | */ 33 | @RunWith(Arquillian.class) 34 | @RunAsClient 35 | public class ProvisionedManagedSecureIT extends RemoteSecureIT { 36 | 37 | @Override 38 | protected URI getHTTPEndpoint() { 39 | String host = getServerHost(); 40 | if (host == null) { 41 | host = "http://localhost:8080"; 42 | } 43 | try { 44 | return new URI(host + "/secured"); 45 | } catch (URISyntaxException ex) { 46 | throw new RuntimeException(ex); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /helloworld-ws/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: helloworld-ws 5 | deploy: 6 | replicas: 1 -------------------------------------------------------------------------------- /helloworld-ws/src/main/java/org/jboss/as/quickstarts/wshelloworld/HelloWorldService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.wshelloworld; 18 | 19 | import java.util.List; 20 | import jakarta.jws.WebMethod; 21 | import jakarta.jws.WebService; 22 | 23 | /** 24 | * A simple example of how to setup a JAX-WS Web Service. It can say hello to everyone or to someone in particular. 25 | * 26 | * @author lnewson@redhat.com 27 | */ 28 | 29 | @WebService(targetNamespace = "http://www.jboss.org/eap/quickstarts/wshelloworld/HelloWorld") 30 | public interface HelloWorldService { 31 | 32 | /** 33 | * Say hello as a response 34 | * 35 | * @return A simple hello world message 36 | */ 37 | @WebMethod 38 | String sayHello(); 39 | 40 | /** 41 | * Say hello to someone precisely 42 | * 43 | * @param name The name of the person to say hello to 44 | * @return the number of current bookings 45 | */ 46 | @WebMethod 47 | String sayHelloToName(String name); 48 | 49 | /** 50 | * Say hello to a list of people 51 | * 52 | * @param names The list of names to say hello to 53 | * @return the number of current bookings 54 | */ 55 | @WebMethod 56 | String sayHelloToNames(List names); 57 | } 58 | -------------------------------------------------------------------------------- /helloworld-ws/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /helloworld-ws/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | helloworld-ws Quickstart 19 | 20 | 21 | 22 |

helloworld-ws Quickstart

23 |

24 | The helloworld-ws quickstart demonstrates the use of JAX-WS in 25 | Red Hat JBoss Enterprise Application Platform as a simple Hello World application. 26 |

27 |

28 | There is no user interface for this quickstart. Instead, you can verify the 29 | Web Service is running and deployed correctly by accessing the following URL: 30 |

31 |
32 | HelloWorldService?wsdl 33 |
34 |

35 | This URL will display the WSDL definition for the deployed Web Service endpoint. 36 |

37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /helloworld-ws/src/test/java/org/jboss/as/quickstarts/wshelloworld/RemoteClientIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Red Hat, Inc. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | package org.jboss.as.quickstarts.wshelloworld; 22 | 23 | import org.jboss.arquillian.container.test.api.RunAsClient; 24 | import org.jboss.arquillian.junit.Arquillian; 25 | import org.junit.runner.RunWith; 26 | 27 | /** 28 | * 29 | * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. 30 | */ 31 | @RunWith(Arquillian.class) 32 | @RunAsClient 33 | public class RemoteClientIT extends ClientIT { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /helloworld-ws/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /helloworld/README-source.adoc: -------------------------------------------------------------------------------- 1 | include::../shared-doc/attributes.adoc[] 2 | 3 | = helloworld: Helloworld Example 4 | :author: Pete Muir 5 | :level: Beginner 6 | :technologies: Servlet 7 | :openshift: true 8 | 9 | [abstract] 10 | The `helloworld` quickstart demonstrates the use of Servlet 6 and is a good starting point to verify {productName} is configured correctly. 11 | 12 | :standalone-server-type: default 13 | :archiveType: war 14 | 15 | == What is it? 16 | 17 | The `helloworld` quickstart demonstrates the use of _Servlet 6_ in {productNameFull} {productVersion}. 18 | 19 | // System Requirements 20 | include::../shared-doc/system-requirements.adoc[leveloffset=+1] 21 | // Use of {jbossHomeName} 22 | include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] 23 | 24 | // build and run with standard server distribution 25 | [[build_and_run_the_quickstart_with_server_dist]] 26 | == Building and running the quickstart application with a {productName} server distribution 27 | // Start the {productName} Standalone Server 28 | include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] 29 | // Build and Deploy the Quickstart 30 | include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] 31 | 32 | === Access the Application 33 | The application will be running at the following URL: http://localhost:8080/{artifactId}/. 34 | 35 | // Testing with Arquillian 36 | include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] 37 | // Undeploy the Quickstart 38 | include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] 39 | 40 | // Build and run sections for other environments/builds 41 | ifndef::ProductRelease,EAPXPRelease[] 42 | include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] 43 | endif::[] 44 | include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] -------------------------------------------------------------------------------- /helloworld/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: helloworld 5 | deploy: 6 | replicas: 1 -------------------------------------------------------------------------------- /helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.helloworld; 18 | 19 | import jakarta.servlet.annotation.WebServlet; 20 | import jakarta.servlet.http.HttpServlet; 21 | import jakarta.servlet.http.HttpServletRequest; 22 | import jakarta.servlet.http.HttpServletResponse; 23 | 24 | import java.io.IOException; 25 | import java.io.PrintWriter; 26 | 27 | /** 28 | * 29 | *

30 | * The servlet is registered and mapped to /HelloServlet using the {@linkplain WebServlet 31 | * @HttpServlet}. 32 | *

33 | * 34 | * @author Pete Muir 35 | * 36 | */ 37 | @SuppressWarnings("serial") 38 | @WebServlet("/HelloWorld") 39 | public class HelloWorldServlet extends HttpServlet { 40 | 41 | static String PAGE_HEADER = "helloworld"; 42 | 43 | static String PAGE_FOOTER = ""; 44 | 45 | @Override 46 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { 47 | resp.setContentType("text/html"); 48 | PrintWriter writer = resp.getWriter(); 49 | writer.println(PAGE_HEADER); 50 | writer.println("

Hello World!

"); 51 | writer.println(PAGE_FOOTER); 52 | writer.close(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /helloworld/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /helloworld/src/test/java/org/jboss/as/quickstarts/helloworld/managed/ManagedHelloWorldServletIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 JBoss by Red Hat. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jboss.as.quickstarts.helloworld.managed; 17 | 18 | import java.net.URI; 19 | import org.jboss.arquillian.container.test.api.RunAsClient; 20 | import org.jboss.arquillian.junit.Arquillian; 21 | import org.jboss.as.arquillian.api.ContainerResource; 22 | import org.jboss.as.arquillian.container.ManagementClient; 23 | import org.jboss.as.quickstarts.helloworld.HelloWorldServletIT; 24 | import org.junit.runner.RunWith; 25 | 26 | 27 | /** 28 | * 29 | * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. 30 | */ 31 | @RunWith(Arquillian.class) 32 | @RunAsClient 33 | public class ManagedHelloWorldServletIT extends HelloWorldServletIT { 34 | @ContainerResource 35 | private ManagementClient managementClient; 36 | 37 | @Override 38 | protected URI getHTTPEndpoint() { 39 | return managementClient.getWebUri().resolve("/HelloWorld"); 40 | } 41 | 42 | @Override 43 | protected String getLineSeparator() { 44 | return System.lineSeparator(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /helloworld/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /jaxrs-client/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: jaxrs-client 5 | deploy: 6 | replicas: 1 -------------------------------------------------------------------------------- /jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/model/Contact.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.jaxrsclient.model; 18 | 19 | public class Contact { 20 | 21 | private Long id; 22 | 23 | private String name; 24 | 25 | private String phoneNumber; 26 | 27 | private String savedBy; 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | public String getPhoneNumber() { 46 | return phoneNumber; 47 | } 48 | 49 | public void setPhoneNumber(String phoneNumber) { 50 | this.phoneNumber = phoneNumber; 51 | } 52 | 53 | public String getSavedBy() { 54 | return savedBy; 55 | } 56 | 57 | public void setSavedBy(String savedBy) { 58 | this.savedBy = savedBy; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /jaxrs-client/src/main/java/org/jboss/as/quickstarts/jaxrsclient/rest/JaxRsActivator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.jaxrsclient.rest; 18 | 19 | import jakarta.ws.rs.ApplicationPath; 20 | import jakarta.ws.rs.core.Application; 21 | 22 | /** 23 | * A class extending {@link Application} and annotated with @ApplicationPath is the Jakarta EE "no XML" approach to activating 24 | * JAX-RS. 25 | *

26 | *

27 | * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. 28 | *

29 | */ 30 | @ApplicationPath("/rest") 31 | public class JaxRsActivator extends Application { 32 | /* class body intentionally left blank */ 33 | } 34 | -------------------------------------------------------------------------------- /jaxrs-client/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/ContactsRestClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.jaxrsclient.test; 18 | 19 | public class ContactsRestClient extends AbstractContactsRestClient { 20 | 21 | private static final String REST_TARGET_URL = "http://localhost:8080/jaxrs-client/rest/contacts"; 22 | 23 | public static void main(String[] args) throws Exception { 24 | ContactsRestClient client = new ContactsRestClient(); 25 | client.cruedTest(); 26 | client.asyncCrudTest(); 27 | client.delayedInvocationTest(); 28 | client.invocationCallBackTest(); 29 | client.requestResponseFiltersTest(); 30 | 31 | } 32 | 33 | private String getServerHost() { 34 | String host = System.getenv("SERVER_HOST"); 35 | if (host == null) { 36 | host = System.getProperty("server.host"); 37 | } 38 | return host; 39 | } 40 | 41 | ; 42 | 43 | @Override 44 | String getRequestUrl() { 45 | String host = getServerHost(); 46 | if (host == null) { 47 | host = REST_TARGET_URL; 48 | } 49 | return "http://" + host + "/jaxrs-client/rest/contacts"; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/LogResponseFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.jaxrsclient.test; 18 | 19 | import java.io.IOException; 20 | import java.util.logging.Logger; 21 | 22 | import jakarta.ws.rs.client.ClientRequestContext; 23 | import jakarta.ws.rs.client.ClientResponseContext; 24 | import jakarta.ws.rs.client.ClientResponseFilter; 25 | import java.util.logging.Level; 26 | 27 | //This filter will log response date and status 28 | public class LogResponseFilter implements ClientResponseFilter { 29 | 30 | private static final Logger log = Logger.getLogger(LogResponseFilter.class.getName()); 31 | 32 | @Override 33 | public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException { 34 | log.log(Level.INFO, "Date: {0}- Status: {1}", new Object[]{responseContext.getDate(), responseContext.getStatus()}); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /jaxrs-client/src/test/java/org/jboss/as/quickstarts/jaxrsclient/test/SavedByClientRequestFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.jaxrsclient.test; 18 | 19 | import static jakarta.ws.rs.HttpMethod.POST; 20 | import java.io.IOException; 21 | 22 | import jakarta.ws.rs.client.ClientRequestContext; 23 | import jakarta.ws.rs.client.ClientRequestFilter; 24 | 25 | import org.jboss.as.quickstarts.jaxrsclient.model.Contact; 26 | 27 | //This filter adds a username to SavedBy field 28 | public class SavedByClientRequestFilter implements ClientRequestFilter { 29 | 30 | public static final String USERNAME = "quickstartUser"; 31 | 32 | @Override 33 | public void filter(ClientRequestContext requestContext) throws IOException { 34 | String method = requestContext.getMethod(); 35 | if (POST.equals(method) && requestContext.hasEntity()) { 36 | Contact contact = (Contact) requestContext.getEntity(); 37 | contact.setSavedBy(USERNAME); 38 | requestContext.setEntity(contact); 39 | } 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /jaxrs-client/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /kitchensink/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: kitchensink 5 | deploy: 6 | replicas: 1 -------------------------------------------------------------------------------- /kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/JaxRsActivator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.kitchensink.rest; 18 | 19 | import jakarta.ws.rs.ApplicationPath; 20 | import jakarta.ws.rs.core.Application; 21 | 22 | /** 23 | * A class extending {@link Application} and annotated with @ApplicationPath is the Jakarta EE "no XML" approach to activating 24 | * JAX-RS. 25 | *

26 | *

27 | * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. 28 | *

29 | */ 30 | @ApplicationPath("/rest") 31 | public class JaxRsActivator extends Application { 32 | /* class body intentionally left blank */ 33 | } 34 | -------------------------------------------------------------------------------- /kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/service/MemberRegistration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.kitchensink.service; 18 | 19 | import org.jboss.as.quickstarts.kitchensink.model.Member; 20 | 21 | import jakarta.ejb.Stateless; 22 | import jakarta.enterprise.event.Event; 23 | import jakarta.inject.Inject; 24 | import jakarta.persistence.EntityManager; 25 | import java.util.logging.Logger; 26 | 27 | // The @Stateless annotation eliminates the need for manual transaction demarcation 28 | @Stateless 29 | public class MemberRegistration { 30 | 31 | @Inject 32 | private Logger log; 33 | 34 | @Inject 35 | private EntityManager em; 36 | 37 | @Inject 38 | private Event memberEventSrc; 39 | 40 | public void register(Member member) throws Exception { 41 | log.info("Registering " + member.getName()); 42 | em.persist(member); 43 | memberEventSrc.fire(member); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/util/Resources.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.kitchensink.util; 18 | 19 | import java.util.logging.Logger; 20 | 21 | import jakarta.enterprise.inject.Produces; 22 | import jakarta.enterprise.inject.spi.InjectionPoint; 23 | import jakarta.persistence.EntityManager; 24 | import jakarta.persistence.PersistenceContext; 25 | 26 | /** 27 | * This class uses CDI to alias Jakarta EE resources, such as the persistence context, to CDI beans 28 | * 29 | *

30 | * Example injection on a managed bean field: 31 | *

32 | * 33 | *
34 |  * @Inject
35 |  * private EntityManager em;
36 |  * 
37 | */ 38 | public class Resources { 39 | @Produces 40 | @PersistenceContext 41 | private EntityManager em; 42 | 43 | @Produces 44 | public Logger produceLog(InjectionPoint injectionPoint) { 45 | return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /kitchensink/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | 26 | 28 | java:jboss/datasources/KitchensinkQuickstartDS 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /kitchensink/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- JBoss, Home of Professional Open Source 3 | -- Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | -- contributors by the @authors tag. See the copyright.txt in the 5 | -- distribution for a full listing of individual contributors. 6 | -- 7 | -- Licensed under the Apache License, Version 2.0 (the "License"); 8 | -- you may not use this file except in compliance with the License. 9 | -- You may obtain a copy of the License at 10 | -- http://www.apache.org/licenses/LICENSE-2.0 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | -- You can use this file to load seed data into the database using SQL statements 19 | insert into Member (id, name, email, phone_number) values (0, 'John Smith', 'john.smith@mailinator.com', '2125551212') -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/WEB-INF/faces-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 25 | 26 | 27 | 28 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/resources/gfx/asidebkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jboss-developer/jboss-eap-quickstarts/c4f466f6c45b7ef34111884cd9537169835cba3c/kitchensink/src/main/webapp/resources/gfx/asidebkg.png -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/resources/gfx/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jboss-developer/jboss-eap-quickstarts/c4f466f6c45b7ef34111884cd9537169835cba3c/kitchensink/src/main/webapp/resources/gfx/banner.png -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/resources/gfx/bkg-blkheader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jboss-developer/jboss-eap-quickstarts/c4f466f6c45b7ef34111884cd9537169835cba3c/kitchensink/src/main/webapp/resources/gfx/bkg-blkheader.png -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/resources/gfx/headerbkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jboss-developer/jboss-eap-quickstarts/c4f466f6c45b7ef34111884cd9537169835cba3c/kitchensink/src/main/webapp/resources/gfx/headerbkg.png -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/resources/gfx/rhjb_eap_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jboss-developer/jboss-eap-quickstarts/c4f466f6c45b7ef34111884cd9537169835cba3c/kitchensink/src/main/webapp/resources/gfx/rhjb_eap_logo.png -------------------------------------------------------------------------------- /kitchensink/src/main/webapp/resources/gfx/wildfly_400x130.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jboss-developer/jboss-eap-quickstarts/c4f466f6c45b7ef34111884cd9537169835cba3c/kitchensink/src/main/webapp/resources/gfx/wildfly_400x130.jpg -------------------------------------------------------------------------------- /kitchensink/src/test/resources/META-INF/test-persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | 27 | 29 | java:jboss/datasources/KitchensinkQuickstartTestDS 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /kitchensink/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /kitchensink/src/test/resources/test-ds.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 25 | 27 | 30 | jdbc:h2:mem:kitchensink-quickstart-test;DB_CLOSE_DELAY=-1 31 | h2 32 | 33 | sa 34 | sa 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /numberguess/README-source.adoc: -------------------------------------------------------------------------------- 1 | include::../shared-doc/attributes.adoc[] 2 | 3 | = numberguess: Example Using CDI and JSF 4 | :author: Pete Muir 5 | :level: Beginner 6 | :technologies: CDI, JSF 7 | :openshift: true 8 | 9 | [abstract] 10 | The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productName}. 11 | 12 | :standalone-server-type: default 13 | :archiveType: war 14 | 15 | == What is it? 16 | 17 | The `numberguess` quickstart demonstrates the use of CDI (Contexts and Dependency Injection) and JSF (JavaServer Faces) in {productNameFull}. 18 | 19 | // System Requirements 20 | include::../shared-doc/system-requirements.adoc[leveloffset=+1] 21 | // Use of {jbossHomeName} 22 | include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] 23 | 24 | // build and run with standard server distribution 25 | [[build_and_run_the_quickstart_with_server_dist]] 26 | == Building and running the quickstart application with a {productName} server distribution 27 | // Start the {productName} Standalone Server 28 | include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+2] 29 | // Build and Deploy the Quickstart 30 | include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+2] 31 | 32 | === Access the Application 33 | 34 | The application will be running at the following URL: http://localhost:8080/{artifactId}/. 35 | 36 | // Testing with Arquillian 37 | include::../shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc[leveloffset=+2] 38 | // Undeploy the Quickstart 39 | include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2] 40 | 41 | // Build and run sections for other environments/builds 42 | ifndef::ProductRelease,EAPXPRelease[] 43 | include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] 44 | endif::[] 45 | include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] -------------------------------------------------------------------------------- /numberguess/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: numberguess 5 | deploy: 6 | replicas: 1 -------------------------------------------------------------------------------- /numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.numberguess; 18 | 19 | import static java.lang.annotation.ElementType.FIELD; 20 | import static java.lang.annotation.ElementType.METHOD; 21 | import static java.lang.annotation.ElementType.PARAMETER; 22 | import static java.lang.annotation.ElementType.TYPE; 23 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 24 | 25 | import java.lang.annotation.Documented; 26 | import java.lang.annotation.Retention; 27 | import java.lang.annotation.Target; 28 | 29 | import jakarta.inject.Qualifier; 30 | 31 | /** 32 | * Qualifier for the maximum number 33 | * 34 | * @author Pete Muir 35 | * 36 | */ 37 | @Target({ TYPE, METHOD, PARAMETER, FIELD }) 38 | @Retention(RUNTIME) 39 | @Documented 40 | @Qualifier 41 | public @interface MaxNumber { 42 | 43 | } 44 | -------------------------------------------------------------------------------- /numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.numberguess; 18 | 19 | import static java.lang.annotation.ElementType.FIELD; 20 | import static java.lang.annotation.ElementType.METHOD; 21 | import static java.lang.annotation.ElementType.PARAMETER; 22 | import static java.lang.annotation.ElementType.TYPE; 23 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 24 | 25 | import java.lang.annotation.Documented; 26 | import java.lang.annotation.Retention; 27 | import java.lang.annotation.Target; 28 | 29 | import jakarta.inject.Qualifier; 30 | 31 | /** 32 | * Qualifier for random numbers 33 | * 34 | * @author Pete Muir 35 | * 36 | */ 37 | @Target({ TYPE, METHOD, PARAMETER, FIELD }) 38 | @Retention(RUNTIME) 39 | @Documented 40 | @Qualifier 41 | public @interface Random { 42 | 43 | } 44 | -------------------------------------------------------------------------------- /numberguess/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /numberguess/src/main/webapp/WEB-INF/faces-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 26 | 27 | -------------------------------------------------------------------------------- /numberguess/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /numberguess/src/test/java/org/jboss/as/quickstarts/numberguess/ProvisionedManagedNumberGuessIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.numberguess; 18 | 19 | 20 | import java.net.URI; 21 | import java.net.URISyntaxException; 22 | import org.jboss.arquillian.container.test.api.RunAsClient; 23 | import org.jboss.arquillian.junit5.ArquillianExtension; 24 | 25 | import org.junit.jupiter.api.Test; 26 | import org.junit.jupiter.api.extension.ExtendWith; 27 | 28 | @ExtendWith(ArquillianExtension.class) 29 | @RunAsClient 30 | public class ProvisionedManagedNumberGuessIT extends RemoteNumberGuessIT { 31 | 32 | @Override 33 | protected URI getHTTPEndpoint(String path) { 34 | String host = getServerHost(); 35 | if (host == null) { 36 | host = "http://localhost:8080/"; 37 | } 38 | try { 39 | return new URI(host + path); 40 | } catch (URISyntaxException ex) { 41 | throw new RuntimeException(ex); 42 | } 43 | } 44 | 45 | @Test 46 | @Override 47 | public void testGuessNumber() throws Exception { 48 | guessNumber(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /remote-helloworld-mdb/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: remote-helloworld-mdb 5 | deploy: 6 | replicas: 1 7 | env: 8 | # Env vars to connect to Artemis 9 | - name: JBOSS_MESSAGING_CONNECTOR_HOST 10 | value: "artemis" 11 | - name: JBOSS_MESSAGING_CONNECTOR_PORT 12 | value: "61616" -------------------------------------------------------------------------------- /remote-helloworld-mdb/configure-remote-broker.cli: -------------------------------------------------------------------------------- 1 | echo Adding configuration to connect to remote broker 2 | # Define a socket binding to the remote broker 3 | /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=remote-artemis:add(host=localhost, port=61616) 4 | # Removing the internal broker 5 | /subsystem=messaging-activemq/server=default:remove 6 | # Define the connector to the remote broker 7 | /subsystem=messaging-activemq/remote-connector=artemis:add(socket-binding=remote-artemis) 8 | # Add a resource adapter to the remote broker with the 'enable-amq1-prefix' set to false (since we are not connecting to a legacy broker). 9 | /subsystem=messaging-activemq/pooled-connection-factory=RemoteConnectionFactory:add(connectors=[artemis],entries=[java:jboss/RemoteConnectionFactory,java:jboss/exported/jms/RemoteConnectionFactory],enable-amq1-prefix=false, user=admin, password=admin) 10 | # Ensure that the resource adapter to the remote broker is used by default by EJBs 11 | /subsystem=ejb3:write-attribute(name=default-resource-adapter-name, value=RemoteConnectionFactory) 12 | # Ensure that the default resource adapter used for JMS is the resource adapter to the remote broker 13 | /subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value=java:jboss/RemoteConnectionFactory) -------------------------------------------------------------------------------- /remote-helloworld-mdb/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /remote-helloworld-mdb/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/ProvisionedManagedMDBServletIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 JBoss by Red Hat. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jboss.as.quickstarts.mdb; 17 | 18 | import java.net.URI; 19 | import java.net.URISyntaxException; 20 | import org.jboss.arquillian.container.test.api.RunAsClient; 21 | import org.jboss.arquillian.junit.Arquillian; 22 | import org.junit.runner.RunWith; 23 | 24 | /** 25 | * 26 | * @author Emmanuel Hugonnet (c) 2023 Red Hat, Inc. 27 | */ 28 | @RunWith(Arquillian.class) 29 | @RunAsClient 30 | public class ProvisionedManagedMDBServletIT extends AbstractMDBServletIT { 31 | 32 | @Override 33 | protected URI getHTTPEndpoint() { 34 | String host = getServerHost(); 35 | if (host == null) { 36 | host = "http://localhost:8080"; 37 | } 38 | try { 39 | return new URI(host + "/HelloWorldMDBServletClient"); 40 | } catch (URISyntaxException ex) { 41 | throw new RuntimeException(ex); 42 | } 43 | } 44 | 45 | private String getServerHost() { 46 | String host = System.getenv("SERVER_HOST"); 47 | if (host == null) { 48 | host = System.getProperty("server.host"); 49 | } 50 | return host; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /remote-helloworld-mdb/src/test/java/org/jboss/as/quickstarts/mdb/RemoteMDBServletIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 JBoss by Red Hat. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jboss.as.quickstarts.mdb; 17 | 18 | import java.net.URI; 19 | import java.net.URISyntaxException; 20 | import org.jboss.arquillian.container.test.api.RunAsClient; 21 | import org.jboss.arquillian.junit.Arquillian; 22 | import org.junit.runner.RunWith; 23 | 24 | /** 25 | * 26 | * @author Emmanuel Hugonnet (c) 2023 Red Hat, Inc. 27 | */ 28 | @RunWith(Arquillian.class) 29 | @RunAsClient 30 | public class RemoteMDBServletIT extends AbstractMDBServletIT { 31 | 32 | 33 | private String getServerHost() { 34 | String host = System.getenv("SERVER_HOST"); 35 | if (host == null) { 36 | host = System.getProperty("server.host", "http://localhost:8080/remote-helloworld-mdb"); 37 | } 38 | return host; 39 | } 40 | 41 | @Override 42 | protected URI getHTTPEndpoint() { 43 | try { 44 | return new URI(getServerHost() + "/HelloWorldMDBServletClient"); 45 | } catch (URISyntaxException ex) { 46 | throw new RuntimeException(ex); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /remote-helloworld-mdb/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /servlet-security/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: servlet-security 5 | deploy: 6 | replicas: 1 7 | -------------------------------------------------------------------------------- /servlet-security/configure-server.cli: -------------------------------------------------------------------------------- 1 | # Batch script to configure the security domain and define the database query used to authenticate users 2 | batch 3 | 4 | 5 | # Start by creating the JDBC datasource 6 | /subsystem=datasources/data-source=ServletSecurityDS:add(connection-url="jdbc:h2:mem:servlet-security;DB_CLOSE_ON_EXIT=FALSE", jndi-name="java:jboss/datasources/ServletSecurityDS", driver-name=h2, user-name="sa", password="sa") 7 | 8 | # Add the JDBC security realm creation 9 | /subsystem=elytron/jdbc-realm=servlet-security-jdbc-realm:add(principal-query=[{sql="SELECT PASSWORD FROM USERS WHERE USERNAME = ?", data-source="ServletSecurityDS", clear-password-mapper={password-index=1}},{sql="SELECT R.NAME, 'Roles' FROM USERS_ROLES UR INNER JOIN ROLES R ON R.ID = UR.ROLE_ID INNER JOIN USERS U ON U.ID = UR.USER_ID WHERE U.USERNAME = ?", data-source="ServletSecurityDS", attribute-mapping=[{index=1, to=Roles}]}]) 10 | 11 | # Configure the servlet-security-quickstart security domain 12 | /subsystem=elytron/security-domain=servlet-security-quickstart-sd:add(default-realm=servlet-security-jdbc-realm, realms=[{realm=servlet-security-jdbc-realm}], permission-mapper=default-permission-mapper) 13 | 14 | # Configure Undertow's application security domain 15 | /subsystem=undertow/application-security-domain=servlet-security-quickstart:add(security-domain=servlet-security-quickstart-sd) 16 | 17 | # Run the batch commands 18 | run-batch 19 | 20 | # Reload the server configuration 21 | #reload 22 | 23 | 24 | -------------------------------------------------------------------------------- /servlet-security/restore-configuration.cli: -------------------------------------------------------------------------------- 1 | # Batch script to remove the servlet-security-quickstart domain from the server configuration file 2 | 3 | # Start batching commands 4 | batch 5 | 6 | # Remove Undertow's application security domain 7 | /subsystem=undertow/application-security-domain=servlet-security-quickstart:remove() 8 | 9 | # Remove the servlet-security-quickstart security domain 10 | /subsystem=elytron/security-domain=servlet-security-quickstart-sd:remove() 11 | 12 | # Remove the JDBC security realm creation 13 | /subsystem=elytron/jdbc-realm=servlet-security-jdbc-realm:remove() 14 | 15 | # Remove the JDBC datasource 16 | /subsystem=datasources/data-source=ServletSecurityDS:remove() 17 | 18 | # The README file contains instructions to undeploy the application. 19 | # If you prefer, you can uncomment the following to undeploy the application using this script. 20 | # undeploy jboss-servlet-security.war 21 | 22 | # Run the batch commands 23 | run-batch 24 | 25 | # Reload the server configuration 26 | reload 27 | 28 | -------------------------------------------------------------------------------- /servlet-security/src/main/java/org/jboss/as/quickstarts/servlet_security/DummyEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2022, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.servlet_security; 18 | 19 | import java.io.Serializable; 20 | 21 | import jakarta.persistence.Entity; 22 | import jakarta.persistence.GeneratedValue; 23 | import jakarta.persistence.Id; 24 | 25 | @SuppressWarnings("serial") 26 | @Entity 27 | // This class should be removed once https://issues.redhat.com/browse/WFLY-16871 is resolved 28 | public class DummyEntity implements Serializable { 29 | 30 | @Id 31 | @GeneratedValue 32 | private Long id; 33 | } 34 | -------------------------------------------------------------------------------- /servlet-security/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | 26 | 28 | java:jboss/datasources/ServletSecurityDS 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /servlet-security/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- JBoss, Home of Professional Open Source 3 | -- Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | -- contributors by the @authors tag. See the copyright.txt in the 5 | -- distribution for a full listing of individual contributors. 6 | -- 7 | -- Licensed under the Apache License, Version 2.0 (the "License"); 8 | -- you may not use this file except in compliance with the License. 9 | -- You may obtain a copy of the License at 10 | -- http://www.apache.org/licenses/LICENSE-2.0 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | CREATE TABLE USERS (ID INT, USERNAME VARCHAR(20), PASSWORD VARCHAR(20)); 19 | CREATE TABLE ROLES (ID INT, NAME VARCHAR(20)); 20 | CREATE TABLE USERS_ROLES (USER_ID INT, ROLE_ID INT); 21 | 22 | INSERT INTO USERS (ID, USERNAME, PASSWORD) VALUES (1, 'quickstartUser', 'quickstartPwd1!'); 23 | INSERT INTO USERS (ID, USERNAME, PASSWORD) VALUES (2, 'guest', 'guestPwd1!'); 24 | 25 | INSERT INTO ROLES (ID, NAME) VALUES (1, 'quickstarts'); 26 | INSERT INTO ROLES (ID, NAME) VALUES (2, 'guest'); 27 | 28 | INSERT INTO USERS_ROLES (USER_ID, ROLE_ID) VALUES (1,1); 29 | INSERT INTO USERS_ROLES (USER_ID, ROLE_ID) VALUES (2,2); 30 | -------------------------------------------------------------------------------- /servlet-security/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /servlet-security/src/main/webapp/WEB-INF/jboss-web.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 23 | 24 | servlet-security-quickstart 25 | true 26 | 27 | -------------------------------------------------------------------------------- /servlet-security/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 20 | 21 | 22 | 23 | BASIC 24 | RealmUsersRoles 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /servlet-security/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /servlet-security/src/test/java/org/jboss/as/quickstarts/servlet_security/ProvisionedManagedSecureIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Red Hat, Inc. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | package org.jboss.as.quickstarts.servlet_security; 22 | 23 | import java.net.URI; 24 | import java.net.URISyntaxException; 25 | import org.jboss.arquillian.container.test.api.RunAsClient; 26 | import org.jboss.arquillian.junit.Arquillian; 27 | import org.junit.runner.RunWith; 28 | 29 | /** 30 | * 31 | * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. 32 | */ 33 | @RunWith(Arquillian.class) 34 | @RunAsClient 35 | public class ProvisionedManagedSecureIT extends RemoteSecureIT { 36 | 37 | @Override 38 | protected URI getHTTPEndpoint() { 39 | String host = getServerHost(); 40 | if (host == null) { 41 | host = "http://localhost:8080"; 42 | } 43 | try { 44 | return new URI(host + "/SecuredServlet"); 45 | } catch (URISyntaxException ex) { 46 | throw new RuntimeException(ex); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /shared-doc/add-application-and-management-users.adoc: -------------------------------------------------------------------------------- 1 | [[add_the_application_management_users]] 2 | = Add the Authorized Application and Management Users 3 | 4 | // Note: The group ID syntax must be defined in the calling topic. 5 | // using the document attribute :app-user-groups: 6 | // Use a comma-delimited list to define more than one group. 7 | // 8 | // :app-user-groups: guest, users 9 | // :admin-user-groups: admin, superusers 10 | 11 | ifdef::app-user-groups[] 12 | :app-group-list: {app-user-groups} 13 | :app-group-command: -g '{app-user-groups}' 14 | endif::app-user-groups[] 15 | 16 | ifndef::app-user-groups[] 17 | :app-group-list: 18 | :app-group-command: 19 | endif::app-user-groups[] 20 | 21 | ifdef::admin-user-groups[] 22 | :admin-group-list: {admin-user-groups} 23 | :admin-group-command: -g '{admin-user-groups}' 24 | endif::admin-user-groups[] 25 | 26 | ifndef::admin-user-groups[] 27 | :admin-group-list: 28 | :admin-group-command: 29 | endif::admin-user-groups[] 30 | This quickstart uses secured management interfaces and requires that you create the following application user to access the running application. 31 | 32 | [cols="20%,20%,20%,40%",options="headers"] 33 | |=== 34 | |UserName |Realm |Password |Roles 35 | 36 | |quickstartUser |ApplicationRealm |quickstartPwd1! |{app-group-list} 37 | |quickstartAdmin | ManagementRealm | adminPwd1! | {admin-group-list} 38 | |=== 39 | 40 | To add the application user, open a terminal and type the following command: 41 | [source,subs="+quotes,attributes+",options="nowrap"] 42 | ---- 43 | $ __{jbossHomeName}__/bin/add-user.sh -a -u 'quickstartUser' -p 'quickstartPwd1!' {app-group-command} 44 | $ __{jbossHomeName}__/bin/add-user.sh -a -u 'quickstartAdmin' -p 'adminPwd1!' {admin-group-command} 45 | ---- 46 | NOTE: For Windows, use the `__{jbossHomeName}__\bin\add-user.bat` script. 47 | 48 | If you prefer, you can use the `add-user` utility interactively. 49 | For an example of how to use the add-user utility, see the instructions located here: link:{addApplicationUserDocUrl}[Add an Application User]. 50 | -------------------------------------------------------------------------------- /shared-doc/add-application-user.adoc: -------------------------------------------------------------------------------- 1 | [[add_the_application_user]] 2 | = Add the Authorized Application User 3 | 4 | // Note: The group ID syntax must be defined in the calling topic. 5 | // using the document attribute :app-user-groups: 6 | // Use a comma-delimited list to define more than one group. 7 | // 8 | // :app-user-groups: guest, users 9 | 10 | ifdef::app-user-groups[] 11 | :app-group-list: {app-user-groups} 12 | :app-group-command: -g '{app-user-groups}' 13 | endif::app-user-groups[] 14 | 15 | ifndef::app-user-groups[] 16 | :app-group-list: 17 | :app-group-command: 18 | endif::app-user-groups[] 19 | 20 | This quickstart uses secured application interfaces and requires that you create the following application user to access the running application. 21 | 22 | [cols="20%,20%,20%,40%",options="headers"] 23 | |=== 24 | |UserName |Realm |Password |Roles 25 | 26 | |quickstartUser |ApplicationRealm |quickstartPwd1! |{app-group-list} 27 | |=== 28 | 29 | To add the application user, open a terminal and type the following command: 30 | [source,subs="+quotes,attributes+",options="nowrap"] 31 | ---- 32 | $ __{jbossHomeName}__/bin/add-user.sh -a -u 'quickstartUser' -p 'quickstartPwd1!' {app-group-command} 33 | ---- 34 | NOTE: For Windows, use the `__{jbossHomeName}__\bin\add-user.bat` script. 35 | 36 | If you prefer, you can use the `add-user` utility interactively. 37 | For an example of how to use the add-user utility, see the instructions located here: link:{addApplicationUserDocUrl}[Add an Application User]. 38 | -------------------------------------------------------------------------------- /shared-doc/back-up-managed-domain-configuration.adoc: -------------------------------------------------------------------------------- 1 | [[back_up_managed_domain_configuration]] 2 | = Back Up the {productName} Managed Domain Configuration 3 | //****************************************************************************** 4 | // Include this template if your quickstart runs in a managed domain and 5 | // needs to back up the server configuration files before running 6 | // a CLI script to modify the server. 7 | //****************************************************************************** 8 | 9 | Before you begin, back up your server configuration files. 10 | 11 | . If it is running, stop the {productName} server. 12 | . Back up the following files: 13 | + 14 | [source,subs="+quotes,attributes+",options="nowrap"] 15 | ---- 16 | __{jbossHomeName}__/domain/configuration/domain.xml 17 | __{jbossHomeName}__/domain/configuration/host.xml 18 | ---- 19 | 20 | After you have completed testing this quickstart, you can replace these file to restore the server to its original configuration. 21 | -------------------------------------------------------------------------------- /shared-doc/back-up-server-standalone-configuration.adoc: -------------------------------------------------------------------------------- 1 | [[back_up_standalone_server_configuration]] 2 | = Back Up the {productName} Standalone Server Configuration 3 | //****************************************************************************** 4 | // Include this template if your quickstart runs in a standalone server and 5 | // needs to back up the server configuration file before running 6 | // a CLI script to modify the server. 7 | //****************************************************************************** 8 | // Define the attributes needed for this topic. 9 | include::define-standalone-server-attributes.adoc[] 10 | 11 | Before you begin, back up your server configuration file. 12 | 13 | . If it is running, stop the {productName} server. 14 | . Back up the `__{jbossHomeName}__/{configFileName}` file. 15 | 16 | After you have completed testing this quickstart, you can replace this file to restore the server to its original configuration. 17 | -------------------------------------------------------------------------------- /shared-doc/build-and-run-the-quickstart-with-openshift.adoc: -------------------------------------------------------------------------------- 1 | [[build_and_run_the_quickstart_on_openshift]] 2 | = Building and running the quickstart application with OpenShift 3 | // The openshift profile 4 | include::../shared-doc/build-the-quickstart-for-openshift.adoc[leveloffset=+1] 5 | // Getting Started with Helm 6 | include::../shared-doc/helm-getting-started-overview.adoc[leveloffset=+1] 7 | //Prepare Helm for Quickstart Deployment 8 | include::../shared-doc/helm-deploy-project.adoc[leveloffset=+1] 9 | // Testing on Openshift 10 | include::../shared-doc/run-arquillian-integration-tests-with-openshift.adoc[leveloffset=+1] 11 | -------------------------------------------------------------------------------- /shared-doc/cd-create-project.adoc: -------------------------------------------------------------------------------- 1 | 2 | [[prepare_openshift_for_quickstart_deployment]] 3 | = Prepare OpenShift for Quickstart Deployment 4 | 5 | . Log in to your OpenShift instance using the `oc login` command. 6 | . Create a new project for the quickstart in OpenShift. You can create a project in OpenShift using the following command. 7 | + 8 | [options="nowrap",subs="attributes"] 9 | ---- 10 | $ oc new-project {artifactId}-project 11 | ---- 12 | //// 13 | . Create a keystore. 14 | + 15 | {xpaasproduct-shortname} requires a keystore to be imported to properly install and configure the image on your OpenShift instance. 16 | + 17 | [WARNING] 18 | ==== 19 | The following commands generate a self-signed certificate, but for production environments Red Hat recommends that you use your own SSL certificate purchased from a verified Certificate Authority (CA) for SSL-encrypted connections (HTTPS). 20 | ==== 21 | + 22 | You can use the Java `keytool` command to generate a keystore using the following command. 23 | + 24 | [options="nowrap",subs="attributes"] 25 | ---- 26 | $ keytool -genkey -keyalg RSA -alias {artifactId}-project-selfsigned -keystore keystore.jks -validity 360 -keysize 2048 27 | ---- 28 | . Create a secret from the previously created keystore using the following command. 29 | + 30 | [options="nowrap",subs="attributes"] 31 | ---- 32 | $ oc secrets new eap7-app-secret keystore.jks 33 | ---- 34 | //// -------------------------------------------------------------------------------- /shared-doc/cd-openshift-getting-started-overview.adoc: -------------------------------------------------------------------------------- 1 | [[getting_started_with_openshift_overview]] 2 | = Getting Started with {xpaasproduct-shortname} 3 | 4 | Each quickstart `README{outfilesuffix}` file contains the basic instructions to build and deploy the quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname}. 5 | 6 | See link:{LinkOpenShiftGuide}[_{EapForOpenshiftBookName}_] for more detailed information about building and running applications on {xpaasproduct-shortname}. 7 | 8 | See link:{LinkOpenShiftOnlineGuide}[_{EapForOpenshiftOnlineBookName}_] for more detailed information about building and running applications on {xpaasproductOpenShiftOnline-shortname}. 9 | -------------------------------------------------------------------------------- /shared-doc/cd-post-deployment-tasks.adoc: -------------------------------------------------------------------------------- 1 | [[post_deployment]] 2 | = OpenShift Post Deployment Tasks 3 | 4 | Depending on your application, some tasks might need to be performed after your OpenShift application has been built and deployed. This might include exposing a service so that the application is viewable from outside of OpenShift, or scaling your application to a specific number of replicas. 5 | 6 | . Get the service name of the quickstart application using the following command. 7 | + 8 | [options="nowrap",subs="+quotes"] 9 | ---- 10 | $ oc get service 11 | ---- 12 | . Expose the main service as a route so you can access the application from outside of OpenShift. For example, for the `{artifactId}` quickstart, use the following command to expose the required service and port. 13 | + 14 | [options="nowrap",subs="+quotes"] 15 | ---- 16 | $ oc expose service/__eap-app__ --port=__8080__ 17 | ---- 18 | + 19 | [NOTE] 20 | ==== 21 | If you used a template to create the application, the route might already exist. If it does, continue on to the next step. 22 | ==== 23 | . Get the URL of the route. 24 | + 25 | [options="nowrap"] 26 | ---- 27 | $ oc get route 28 | ---- 29 | . Access the application in your web browser using the URL. The URL is the value of the `HOST/PORT` field from previous command's output. 30 | + 31 | If your application does not use the {ProductShortName} root context, append the context of the application to the URL. For example, for the `kitchensink` quickstart, the URL might be `http://__HOST_PORT_VALUE__/{artifactId}/`. 32 | . Optionally, you can also scale up the application instance by running the following command. This increases the number of replicas to `3`. 33 | + 34 | [options="nowrap",subs="+quotes"] 35 | ---- 36 | $ oc scale deploymentconfig eap-app --replicas=3 37 | ---- 38 | -------------------------------------------------------------------------------- /shared-doc/debug-the-application.adoc: -------------------------------------------------------------------------------- 1 | [[debug_the_application]] 2 | = Debug the Application 3 | //****************************************************************************** 4 | // Include this template to provide debugging information. 5 | //****************************************************************************** 6 | 7 | If you want to debug the source code of any library in the project, run the following command to pull the source into your local repository. The IDE should then detect it. 8 | 9 | ---- 10 | $ mvn dependency:sources 11 | ---- 12 | 13 | //// 14 | TODO: I need to investigate whether the following version can be used across all quickstarts. 15 | 16 | If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them. 17 | 18 | [source,options="nowrap"] 19 | ---- 20 | $ mvn dependency:sources 21 | $ mvn dependency:resolve -Dclassifier=javadoc 22 | ---- 23 | //// 24 | -------------------------------------------------------------------------------- /shared-doc/development-shortcuts.adoc: -------------------------------------------------------------------------------- 1 | [[considerations_for_use_in_a_production_environment]] 2 | = Considerations for Use in a Production Environment 3 | //****************************************************************************** 4 | // Include this template if your quickstart: 5 | // * Uses the h2 database: Be sure to define the `uses-h2` attribute. 6 | // * Uses an `*-ds.xml file`: Be sure to define the `uses-ds-xml` attribute. 7 | // * Has performance or scalability concerns: Be sure to define the `uses-ds-xml` attribute. 8 | //****************************************************************************** 9 | 10 | ifdef::uses-h2[] 11 | 12 | H2 Database:: This quickstart uses the H2 database included with {productNameFull} {productVersion}. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment. 13 | 14 | endif::uses-h2[] 15 | 16 | ifdef::uses-ds-xml[] 17 | 18 | Datasource Configuration File:: This quickstart uses a `*-ds.xml` datasource configuration file for convenience and ease of database configuration. These files are deprecated in {productName} and should not be used in a production environment. Instead, you should configure the datasource using the Management CLI or Management Console. Datasource configuration is documented in the {LinkConfigGuide}[__{ConfigBookName}__]. 19 | 20 | endif::uses-ds-xml[] 21 | 22 | ifdef::performance-scalability[] 23 | 24 | Performance and Scalability:: A Jakarta EE container is designed with robustness in mind, so you should carefully analyze the scalabiltiy, concurrency, and performance needs of your application before taking advantage of these techniques in your own applications. 25 | 26 | endif::performance-scalability[] 27 | -------------------------------------------------------------------------------- /shared-doc/helm-getting-started-overview.adoc: -------------------------------------------------------------------------------- 1 | [[getting_started_with_helm]] 2 | = Getting Started with {xpaasproduct-shortname} and Helm Charts 3 | 4 | This section contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} using Helm Charts. 5 | 6 | include::../shared-doc/helm-pre-requisites.adoc[] -------------------------------------------------------------------------------- /shared-doc/helm-pre-requisites.adoc: -------------------------------------------------------------------------------- 1 | [[prerequisites_helm_openshift]] 2 | == Prerequisites 3 | 4 | * You must be logged in OpenShift and have an `oc` client to connect to OpenShift 5 | * https://helm.sh[Helm] must be installed to deploy the backend on OpenShift. 6 | 7 | Once you have installed Helm, you need to add the repository that provides Helm Charts for {productName}. 8 | 9 | ifndef::ProductRelease,EAPXPRelease[] 10 | [source,options="nowrap"] 11 | ---- 12 | $ helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ 13 | "wildfly" has been added to your repositories 14 | $ helm search repo wildfly 15 | NAME CHART VERSION APP VERSION DESCRIPTION 16 | wildfly/wildfly ... ... Build and Deploy WildFly applications on OpenShift 17 | wildfly/wildfly-common ... ... A library chart for WildFly-based applications 18 | ---- 19 | endif::[] 20 | ifdef::ProductRelease[] 21 | [source,options="nowrap",subs="+attributes"] 22 | ---- 23 | $ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ 24 | "jboss-eap" has been added to your repositories 25 | $ helm search repo jboss-eap 26 | NAME CHART VERSION APP VERSION DESCRIPTION 27 | {helmChartName} ... ... A Helm chart to build and deploy EAP {productVersion} applications 28 | ---- 29 | endif::[] 30 | ifdef::EAPXPRelease[] 31 | [source,options="nowrap",subs="+attributes"] 32 | ---- 33 | $ helm repo add jboss-eap https://jbossas.github.io/eap-charts/ 34 | "jboss-eap" has been added to your repositories 35 | $ helm search repo jboss-eap 36 | NAME CHART VERSION APP VERSION DESCRIPTION 37 | {helmChartName} ... ... A Helm chart to build and deploy EAP XP {productVersion} applications 38 | ---- 39 | endif::[] 40 | -------------------------------------------------------------------------------- /shared-doc/openshift-getting-started-overview.adoc: -------------------------------------------------------------------------------- 1 | [[getting_started_with_openshift_overview]] 2 | = Getting Started with {xpaasproduct-shortname} 3 | 4 | Each quickstart `README{outfilesuffix}` file contains the basic instructions to build and deploy the quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname}. 5 | 6 | See link:{LinkOpenShiftGuide}[_{EapForOpenshiftBookName}_] for more detailed information about building and running applications on {xpaasproduct-shortname}. 7 | 8 | See link:{LinkOpenShiftOnlineGuide}[_{EapForOpenshiftOnlineBookName}_] for more detailed information about building and running applications on {xpaasproductOpenShiftOnline-shortname}. 9 | -------------------------------------------------------------------------------- /shared-doc/openshift-getting-started.adoc: -------------------------------------------------------------------------------- 1 | [[getting_started_with_openshift]] 2 | = Getting Started with {xpaasproduct-shortname} 3 | 4 | This document contains the basic instructions to build and deploy this quickstart to {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname}. 5 | 6 | See link:{LinkOpenShiftGuide}[_{EapForOpenshiftBookName}_] for more detailed information about building and running applications on {xpaasproduct-shortname}. 7 | 8 | See link:{LinkOpenShiftOnlineGuide}[_{EapForOpenshiftOnlineBookName}_] for more detailed information about building and running applications on {xpaasproductOpenShiftOnline-shortname}. 9 | -------------------------------------------------------------------------------- /shared-doc/openshift-incompatibility.adoc: -------------------------------------------------------------------------------- 1 | [[openshift_incompatibility]] 2 | = {xpaasproduct-shortname} Incompatibility 3 | 4 | This quickstart is not compatible with {xpaasproduct-shortname} or {xpaasproductOpenShiftOnline-shortname} templates. -------------------------------------------------------------------------------- /shared-doc/restore-managed-domain-configuration-manual.adoc: -------------------------------------------------------------------------------- 1 | [[restore_managed_domain_configuration_manually]] 2 | = Restore the {productName} Managed Domain Configuration Manually 3 | //****************************************************************************** 4 | // Include this template to restore the server configuration if your 5 | // quickstart modified the managed domain configuration files. 6 | //****************************************************************************** 7 | 8 | When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copies the configuration files. 9 | 10 | * If it is running, stop the {productName} server. 11 | * Replace the following files with the backup copies of the files. 12 | + 13 | [source,subs="+quotes,attributes+",options="nowrap"] 14 | ---- 15 | __{jbossHomeName}__/domain/configuration/domain.xml 16 | __{jbossHomeName}__/domain/configuration/host.xml 17 | ---- 18 | -------------------------------------------------------------------------------- /shared-doc/restore-standalone-server-configuration-manual.adoc: -------------------------------------------------------------------------------- 1 | [[restore_standalone_server_configuration_manually]] 2 | = Restore the {productName} Standalone Server Configuration Manually 3 | //****************************************************************************** 4 | // Include this template if your quickstart does a normal manual restoration 5 | // of a single standalone server. 6 | //****************************************************************************** 7 | 8 | include::define-standalone-server-attributes.adoc[] 9 | 10 | When you have completed testing the quickstart, you can restore the original server configuration by manually restoring the backup copy the configuration file. 11 | 12 | . If it is running, stop the {productName} server. 13 | . Replace the `__{jbossHomeName}__/{configFileName}` file with the backup copy of the file. 14 | -------------------------------------------------------------------------------- /shared-doc/restore-standalone-server-configuration.adoc: -------------------------------------------------------------------------------- 1 | [[restore_the_standalone_server_configuration]] 2 | = Restore the {productName} Standalone Server Configuration 3 | //****************************************************************************** 4 | // Include this template if your quickstart does a normal restoration of a single 5 | // standalone server configuration. 6 | // * It provides a CLI script. 7 | // * You can manually restore the backup copy. 8 | // 9 | // You must define the script file name using the `restoreScriptName` attribute. 10 | // For example: 11 | // :restoreScriptName: remove-configuration.cli 12 | //****************************************************************************** 13 | 14 | You can restore the original server configuration using either of the following methods. 15 | 16 | * You can xref:restore_standalone_server_configuration_using_cli[run the `{restoreScriptName}` script] provided in the root directory of this quickstart. 17 | * You can xref:restore_standalone_server_configuration_manually[manually restore the configuration] using the backup copy of the configuration file. 18 | 19 | [[restore_standalone_server_configuration_using_cli]] 20 | == Restore the {productName} Standalone Server Configuration by Running the JBoss CLI Script 21 | 22 | . xref:start_the_eap_standalone_server[Start the {productName} server] as described above. 23 | . Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: 24 | + 25 | [source,subs="+quotes,attributes+",options="nowrap"] 26 | ---- 27 | $ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file={restoreScriptName} 28 | ---- 29 | + 30 | NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. 31 | -------------------------------------------------------------------------------- /shared-doc/run-arquillian-functional-tests-remote.adoc: -------------------------------------------------------------------------------- 1 | [[run_the_arquillian_functional_tests-remote]] 2 | = Run the Arquillian Functional Tests 3 | //****************************************************************************** 4 | // Include this template if your quickstart provides standard Arquillian 5 | // functional tests. 6 | //****************************************************************************** 7 | 8 | This quickstart provides Arquillian functional tests. They are located under the `src/tests/` directory. Functional tests verify that your application behaves correctly from the user's point of view and simulate clicking around the web page as a normal user would do. 9 | 10 | Follow these steps to run the functional tests. 11 | 12 | ifdef::standalone-server-type[] 13 | . xref:start_the_eap_standalone_server[Start the {productName} server] as described above. 14 | 15 | endif::[] 16 | 17 | ifdef::managed-domain-type[] 18 | . xref:start_the_eap_managed_domain[Start the {productName} server] as described above. 19 | endif::[] 20 | 21 | ifdef::standalone-server-type,managed-domain-type[] 22 | . Type the following command to run the `verify` goal with the `arq-remote` profile activated. 23 | endif::[] 24 | ifndef::standalone-server-type,managed-domain-type[] 25 | . You need to start the provisioned server or the bootable jar server, as previously described. 26 | . Type the following command to run the `verify` goal with the `arq-remote` profile activated. 27 | endif::[] 28 | 29 | [source,options="nowrap"] 30 | ---- 31 | $ mvn verify -Parq-remote 32 | ---- 33 | 34 | [NOTE] 35 | ==== 36 | You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. 37 | ==== 38 | -------------------------------------------------------------------------------- /shared-doc/run-arquillian-integration-tests-with-openshift.adoc: -------------------------------------------------------------------------------- 1 | [[run_the_arquillian_integration_tests_with_openshift]] 2 | = Run the Arquillian Integration Tests with OpenShift 3 | //****************************************************************************** 4 | // Include this template if your quickstart provides Openshift Arquillian 5 | // integration tests. 6 | //****************************************************************************** 7 | 8 | This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. 9 | 10 | [NOTE] 11 | ==== 12 | The Arquillian integration tests expect a deployed application, so make sure you have deployed the quickstart on OpenShift before you begin. 13 | ==== 14 | 15 | Run the integration tests using the following command to run the `verify` goal with the `arq-remote` profile activated and the proper URL: 16 | [source,options="nowrap",subs="+attributes"] 17 | ---- 18 | $ mvn clean verify -Parq-remote -Dserver.host=https://$(oc get route {artifactId} --template='{{ .spec.host }}') 19 | ---- 20 | 21 | [NOTE] 22 | ==== 23 | The tests are using SSL to connect to the quickstart running on OpenShift. So you need the certificates to be trusted by the machine the tests are run from. 24 | ==== -------------------------------------------------------------------------------- /shared-doc/run-arquillian-integration-tests-with-provisioned-server.adoc: -------------------------------------------------------------------------------- 1 | [[run_the_arquillian_integration_tests_with_provisioned_server_]] 2 | = Run the Arquillian Integration Tests with a provisioned server 3 | //****************************************************************************** 4 | // Include this template if your quickstart provides standard Arquillian 5 | // integration tests. 6 | //****************************************************************************** 7 | 8 | This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. 9 | 10 | . Type the following command to run the `verify` goal with the `provisioned-server` profile activated. 11 | + 12 | [source,options="nowrap"] 13 | ---- 14 | $ mvn clean verify -Pprovisioned-server 15 | ---- 16 | 17 | This will build the provisioned server with the quickstart application, start it, run the integration tests and stop the server. -------------------------------------------------------------------------------- /shared-doc/run-arquillian-integration-tests-with-server-distribution.adoc: -------------------------------------------------------------------------------- 1 | [[run_the_arquillian_integration_tests_with_server_distribution]] 2 | = Run the Arquillian Integration Tests 3 | //****************************************************************************** 4 | // Include this template if your quickstart provides standard Arquillian 5 | // integration tests. 6 | //****************************************************************************** 7 | 8 | This quickstart includes Arquillian integration tests. They are located under the `src/test/` directory. The integration tests verify that the quickstart runs correctly when deployed on the server. 9 | 10 | Follow these steps to run the integration tests. 11 | 12 | . Make sure you start the {productName} server, as previously described. 13 | 14 | . Make sure you build and deploy the quickstart, as previously described. 15 | 16 | . Type the following command to run the `verify` goal with the `arq-remote` profile activated. 17 | + 18 | [source,options="nowrap"] 19 | ---- 20 | $ mvn verify -Parq-remote 21 | ---- 22 | 23 | [NOTE] 24 | ==== 25 | You may also use the environment variable `SERVER_HOST` or the system property `server.host` to define the target host of the tests. 26 | ==== -------------------------------------------------------------------------------- /shared-doc/run-arquillian-tests.adoc: -------------------------------------------------------------------------------- 1 | [[run_the_arquillian_tests]] 2 | = Run the Arquillian Tests 3 | //****************************************************************************** 4 | // Include this template if your quickstart provides standard Arquillian tests. 5 | //****************************************************************************** 6 | 7 | This quickstart provides Arquillian tests. By default, these tests are configured to be skipped since Arquillian tests require the use of a container. 8 | 9 | NOTE: The Arquillian tests deploy the application, so make sure you undeploy the quickstart before you begin. 10 | 11 | ifdef::arq-prerequisities[] 12 | == Arquillian Tests prerequisities 13 | 14 | {arq-prerequisities} 15 | endif::[] 16 | 17 | Follow these steps to run the tests. 18 | 19 | ifdef::standalone-server-type[] 20 | . xref:start_the_eap_standalone_server[Start the {productName} server] as described above. 21 | endif::[] 22 | 23 | ifdef::managed-domain-type[] 24 | . xref:start_the_eap_managed_domain[Start the {productName} server] as described above. 25 | endif::[] 26 | 27 | . Open a terminal and navigate to the root directory of this quickstart. 28 | . Type the following command to run the `verify` goal with the `arq-remote` profile activated. 29 | + 30 | [source,options="nowrap"] 31 | ---- 32 | $ mvn clean verify -Parq-remote 33 | ---- 34 | ifdef::arquillianTestResults[] 35 | You should see the following results: 36 | + 37 | [source,subs=attributes+,options="nowrap"] 38 | ---- 39 | Results : 40 | 41 | {arquillianTestResults} 42 | ---- 43 | endif::[] 44 | 45 | [NOTE] 46 | ==== 47 | You can also let Arquillian manage the {productName} server by using the `arq-managed` profile, meaning the tests will start the server for you. This profile requires that you provide Arquillian with the location of the {productName} server, either by setting the `JBOSS_HOME` environment variable, or by setting the `jbossHome` property in the `arquillian.xml` file. For more information, see link:{arquillianTestsDocUrl}[Run the Arquillian Tests]. 48 | ==== 49 | -------------------------------------------------------------------------------- /shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc: -------------------------------------------------------------------------------- 1 | [[run_the_quickstart_in_redhat_codeready_studio_or_eclipse]] 2 | = Run the Quickstart in {JBDSProductName} or Eclipse 3 | //****************************************************************************** 4 | // Include this template to provide instructions to run the quickstart 5 | // in Red Hat CodeReady Studio. 6 | // 7 | // If the quickstart is not supported, create the `jbds-not-supported` attribute. 8 | //****************************************************************************** 9 | ifdef::jbds-not-supported[] 10 | This quickstart is not supported in {JBDSProductName}. 11 | endif::jbds-not-supported[] 12 | 13 | ifndef::jbds-not-supported[] 14 | You can also start the server and deploy the quickstarts or run the Arquillian tests in {JBDSProductName} or from Eclipse using JBoss tools. For general information about how to import a quickstart, add a {productName} server, and build and deploy a quickstart, see link:{useEclipseUrl}[Use {JBDSProductName} or Eclipse to Run the Quickstarts]. 15 | endif::jbds-not-supported[] 16 | 17 | // Add additional instructions specific to running this quickstart in an IDE here. 18 | -------------------------------------------------------------------------------- /shared-doc/setup-repositories.adoc: -------------------------------------------------------------------------------- 1 | Setup the required Maven repositories (if you don't have them set up in Maven global settings): 2 | 3 | [source,xml] 4 | ---- 5 | 6 | 7 | jboss-public-maven-repository 8 | JBoss Public Maven Repository 9 | https://repository.jboss.org/nexus/content/groups/public 10 | default 11 | 12 | true 13 | never 14 | 15 | 16 | true 17 | never 18 | 19 | 20 | 21 | redhat-ga-maven-repository 22 | Red Hat GA Maven Repository 23 | https://maven.repository.redhat.com/ga/ 24 | default 25 | 26 | true 27 | never 28 | 29 | 30 | true 31 | never 32 | 33 | 34 | 35 | 36 | 37 | jboss-public-maven-repository 38 | JBoss Public Maven Repository 39 | https://repository.jboss.org/nexus/content/groups/public 40 | 41 | true 42 | 43 | 44 | true 45 | 46 | 47 | 48 | redhat-ga-maven-repository 49 | Red Hat GA Maven Repository 50 | https://maven.repository.redhat.com/ga/ 51 | 52 | true 53 | 54 | 55 | true 56 | 57 | 58 | 59 | ---- 60 | -------------------------------------------------------------------------------- /shared-doc/start-the-managed-domain.adoc: -------------------------------------------------------------------------------- 1 | [[start_the_eap_managed_domain]] 2 | = Start the {productName} Managed Domain 3 | //****************************************************************************** 4 | // Include this template if your quickstart requires a normal start of a 5 | // managed domain. 6 | // 7 | // This template does not currently support passing arguments for starting 8 | // the domain, but it could be added. 9 | // 10 | // * Define the managed domain profile type. Supported values are: 11 | // :managed-domain-type: default 12 | // 13 | //****************************************************************************** 14 | 15 | . Open a terminal and navigate to the root of the {productName} directory. 16 | . Start the {productName} managed domain by typing the following command. 17 | + 18 | [source,subs="+quotes,attributes+",options="nowrap"] 19 | ---- 20 | $ __{jbossHomeName}__/bin/domain.sh 21 | ---- 22 | + 23 | NOTE: For Windows, use the `__{jbossHomeName}__\bin\domain.bat` script. 24 | -------------------------------------------------------------------------------- /shared-doc/start-the-standalone-server.adoc: -------------------------------------------------------------------------------- 1 | [[start_the_eap_standalone_server]] 2 | = Start the {productName} Standalone Server 3 | //****************************************************************************** 4 | // Include this template if your quickstart requires a normal start of a single 5 | // standalone server. 6 | // 7 | // You must define the `standalone-server-type`. Supported values are: 8 | // default 9 | // full 10 | // full-ha 11 | // ha 12 | // custom 13 | // 14 | // * For mobile applications, you can define the `mobileApp` variable in the 15 | // `README.adoc` file to add `-b 0.0.0.0` to the command line. This allows 16 | // external clients, such as phones, tablets, and desktops, to connect 17 | // to the application through through your local network 18 | // ::mobileApp: {artifactId}-service 19 | // 20 | //****************************************************************************** 21 | 22 | include::define-standalone-server-attributes.adoc[] 23 | 24 | . Open a terminal and navigate to the root of the {productName} directory. 25 | . Start the {productName} server with the {serverProfile} by typing the following command. 26 | + 27 | ifdef::uses-jaeger[] 28 | [source,subs="+quotes,attributes+",options="nowrap"] 29 | ---- 30 | $ __JAEGER_REPORTER_LOG_SPANS=true JAEGER_SAMPLER_TYPE=const JAEGER_SAMPLER_PARAM=1__ __{jbossHomeName}__/bin/standalone.sh {serverArguments} 31 | ---- 32 | endif::[] 33 | ifndef::uses-jaeger[] 34 | [source,subs="+quotes,attributes+",options="nowrap"] 35 | ---- 36 | $ __{jbossHomeName}__/bin/standalone.sh {serverArguments} 37 | ---- 38 | endif::[] 39 | + 40 | NOTE: For Windows, use the `__{jbossHomeName}__\bin\standalone.bat` script. 41 | 42 | ifdef::mobileApp[] 43 | + 44 | Adding `-b 0.0.0.0` to the above command allows external clients, such as phones, tablets, and desktops, to connect through your local network. For example: 45 | + 46 | [source,subs="+quotes,attributes+",options="nowrap"] 47 | ---- 48 | $ __{jbossHomeName}__/bin/standalone.sh {serverArguments} -b 0.0.0.0 49 | ---- 50 | endif::[] 51 | -------------------------------------------------------------------------------- /shared-doc/system-requirements.adoc: -------------------------------------------------------------------------------- 1 | [[system_requirements]] 2 | = System Requirements 3 | //****************************************************************************** 4 | // Include this template to describe the standard system requirements for 5 | // running the quickstarts. 6 | // 7 | // The Forge quickstarts define a `forge-from-scratch` attribute because they 8 | // run entirely in CodeReady Studio and have different requirements . 9 | //****************************************************************************** 10 | 11 | The application this project produces is designed to be run on {productNameFull} {productVersion} or later. 12 | 13 | All you need to build this project is {buildRequirements}. See link:{configureMavenDocUrl}[Configure Maven to Build and Deploy the Quickstarts] to make sure you are configured correctly for testing the quickstarts. 14 | -------------------------------------------------------------------------------- /shared-doc/undeploy-the-quickstart.adoc: -------------------------------------------------------------------------------- 1 | [[undeploy_the_quickstart]] 2 | = Undeploy the Quickstart 3 | 4 | //******************************************************************************* 5 | // Include this template if your quickstart does a normal undeployment of an archive. 6 | //******************************************************************************* 7 | When you are finished testing the quickstart, follow these steps to undeploy the archive. 8 | 9 | . Make sure you xref:start_the_eap_standalone_server[start the {productName} server] as described above. 10 | . Open a terminal and navigate to the root directory of this quickstart. 11 | . Type this command to undeploy the archive: 12 | + 13 | [source,options="nowrap"] 14 | ---- 15 | $ mvn wildfly:undeploy 16 | ---- 17 | -------------------------------------------------------------------------------- /shared-doc/xp-install-amq-streams.adoc: -------------------------------------------------------------------------------- 1 | :strimzi-version: v1beta2 2 | [[install_amq_streams]] 3 | = Install AMQ Streams on Openshift 4 | 5 | The functionality of this quickstart depends on a running instance of the 6 | https://access.redhat.com/products/red-hat-amq#streams[AMQ Streams] Operator. AMQ Streams is a Red Hat project based on Apache Kafka. To deploy AMQ Streams in the Openshift environment: 7 | 8 | . Log in into the Openshift console as `kubeadmin` user (or any cluster administrator). 9 | . Navigate to `Operators` -> `OperatorHub`. 10 | . Search for `AMQ Streams` - click on the 'Red Hat Integration - AMQ Streams' operator (works with both community and Red Hat). 11 | Install it with the default values. 12 | . Run the following command to set up a Kafka cluster called `my-cluster` in your project: 13 | + 14 | [options="nowrap",subs="+attributes"] 15 | ---- 16 | $ oc apply -n {artifactId}-project -f - < `OperatorHub`. 10 | . Search for `Jaeger` - click on the Jaeger operator (works with both community and Red Hat). 11 | Install it with the default values. 12 | . Run the following command: 13 | + 14 | [options="nowrap",subs="+attributes"] 15 | ---- 16 | $ oc apply -n {artifactId}-project -f - < 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /temperature-converter/src/main/webapp/WEB-INF/faces-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 26 | 27 | -------------------------------------------------------------------------------- /temperature-converter/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /temperature-converter/src/test/java/org/jboss/as/quickstarts/temperatureconverter/ProvisionedManagedTemperatureConverterIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.temperatureconverter; 18 | 19 | 20 | import java.net.URI; 21 | import java.net.URISyntaxException; 22 | import org.jboss.arquillian.container.test.api.RunAsClient; 23 | import org.jboss.arquillian.junit5.ArquillianExtension; 24 | 25 | import org.junit.jupiter.api.Test; 26 | import org.junit.jupiter.api.extension.ExtendWith; 27 | 28 | @ExtendWith(ArquillianExtension.class) 29 | @RunAsClient 30 | public class ProvisionedManagedTemperatureConverterIT extends RemoteTemperatureConverterIT { 31 | 32 | @Override 33 | protected URI getHTTPEndpoint(String path) { 34 | String host = getServerHost(); 35 | if (host == null) { 36 | host = "http://localhost:8080/"; 37 | } 38 | try { 39 | return new URI(host + path); 40 | } catch (URISyntaxException ex) { 41 | throw new RuntimeException(ex); 42 | } 43 | } 44 | 45 | @Test 46 | @Override 47 | public void testConvertTemperature() throws Exception { 48 | convertTemperature(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /thread-racing/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: thread-racing 5 | deploy: 6 | replicas: 1 -------------------------------------------------------------------------------- /thread-racing/scripts/embedded-broker.cli: -------------------------------------------------------------------------------- 1 | if (outcome == success) of /subsystem=messaging-activemq:read-resource 2 | /subsystem=messaging-activemq/server=default:add(elytron-domain=ApplicationDomain) 3 | end-if 4 | if (outcome == success) of /subsystem=messaging-activemq/server=default:read-resource 5 | /subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id=0, params=[buffer-pooling=false]) 6 | /subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id=0, params=[buffer-pooling=false]) 7 | /subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:add(connectors=[in-vm], transaction=xa, entries=[java:/JmsXA,java:jboss/DefaultJMSConnectionFactory]) 8 | /subsystem=messaging-activemq/server=default/jms-queue=DLQ:add(entries=[java:/jms/queue/DLQ]) 9 | /subsystem=messaging-activemq/server=default/jms-queue=ExpiryQueue:add(entries=[java:/jms/queue/ExpiryQueue]) 10 | /subsystem=messaging-activemq/server=default/address-setting=#:add(dead-letter-address=jms.queue.DLQ, expiry-address=jms.queue.ExpiryQueue) 11 | end-if 12 | if (outcome == success) of /subsystem=ee/service=default-bindings:read-resource 13 | /subsystem=ee/service=default-bindings:write-attribute(name="jms-connection-factory", value="java:jboss/DefaultJMSConnectionFactory") 14 | end-if -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/EnvironmentProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing; 18 | 19 | /** 20 | * The name of each race's environment property. 21 | * 22 | * @author Eduardo Martins 23 | */ 24 | public interface EnvironmentProperties { 25 | 26 | /** 27 | * the server/host name, e.g. localhost 28 | */ 29 | String SERVER_NAME = "SERVER_NAME"; 30 | 31 | /** 32 | * the server port, e.g. 8080 33 | */ 34 | String SERVER_PORT = "SERVER_PORT"; 35 | 36 | /** 37 | * the app's root path, e.g. /thread-racing 38 | */ 39 | String ROOT_PATH = "ROOT_PATH"; 40 | 41 | /** 42 | * the app's protocol 43 | */ 44 | String PROTOCOL = "PROTOCOL"; 45 | } 46 | -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/JimmieThronson.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing.legends; 18 | 19 | import org.jboss.as.quickstarts.threadracing.Racer; 20 | 21 | /** 22 | * A NASCAR legend. 23 | * 24 | * @author Eduardo Martins 25 | */ 26 | public class JimmieThronson extends Racer { 27 | 28 | public JimmieThronson() { 29 | super("Jimmie Thronson"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/MichaelThrumacher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing.legends; 18 | 19 | import org.jboss.as.quickstarts.threadracing.Racer; 20 | 21 | /** 22 | * A F1 legend. 23 | * 24 | * @author Eduardo Martins 25 | */ 26 | public class MichaelThrumacher extends Racer { 27 | 28 | public MichaelThrumacher() { 29 | super("Michael Thrumacher"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/SebastienThroeb.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing.legends; 18 | 19 | import org.jboss.as.quickstarts.threadracing.Racer; 20 | 21 | /** 22 | * A rally legend. 23 | * 24 | * @author Eduardo Martins 25 | */ 26 | public class SebastienThroeb extends Racer { 27 | 28 | public SebastienThroeb() { 29 | super("Sebastien Throeb"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/legends/ValentinoThrossi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing.legends; 18 | 19 | import org.jboss.as.quickstarts.threadracing.Racer; 20 | 21 | /** 22 | * A MotoGP legend. 23 | * 24 | * @author Eduardo Martins 25 | */ 26 | public class ValentinoThrossi extends Racer { 27 | 28 | public ValentinoThrossi() { 29 | super("Valentino Throssi"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/RaceStage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing.stage; 18 | 19 | import org.jboss.as.quickstarts.threadracing.Race; 20 | 21 | /** 22 | * 23 | * A stage of a {@link org.jboss.as.quickstarts.threadracing.Race}, which are run by {@link org.jboss.as.quickstarts.threadracing.Racer}s. 24 | * 25 | * @author Eduardo Martins 26 | */ 27 | public interface RaceStage { 28 | 29 | /** 30 | * Runs the stage. 31 | * @param registration the racer's race registration 32 | * @throws Exception 33 | */ 34 | void run(Race.Registration registration) throws Exception; 35 | } 36 | -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing.stage.batch; 18 | 19 | import jakarta.batch.api.chunk.ItemProcessor; 20 | import jakarta.inject.Named; 21 | 22 | /** 23 | * The batch component that processes/filters read items, one by one. 24 | * @author Eduardo Martins 25 | */ 26 | @Named 27 | public class BatchRaceStageItemProcessor implements ItemProcessor { 28 | 29 | @Override 30 | public Object processItem(Object item) { 31 | // TODO this app must have one, but here you process a read item, in case the item should be discarded just return null 32 | return item; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/batch/BatchRaceStageItemWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing.stage.batch; 18 | 19 | import jakarta.batch.api.chunk.AbstractItemWriter; 20 | import jakarta.inject.Named; 21 | import java.util.List; 22 | 23 | /** 24 | * The race batch job component that writes a chunk of processed items. 25 | * @author Eduardo Martins 26 | */ 27 | @Named 28 | public class BatchRaceStageItemWriter extends AbstractItemWriter { 29 | 30 | @Override 31 | public void writeItems(List list) { 32 | // simulate a item write op, sleep 10ms for each item to write 33 | try { 34 | Thread.sleep(10 * list.size()); 35 | } catch (InterruptedException e) { 36 | e.printStackTrace(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /thread-racing/src/main/java/org/jboss/as/quickstarts/threadracing/stage/jaxrs/BoxApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing.stage.jaxrs; 18 | 19 | import jakarta.ws.rs.ApplicationPath; 20 | import jakarta.ws.rs.core.Application; 21 | 22 | /** 23 | * A class extending {@link jakarta.ws.rs.core.Application} is the portable way to define JAX-RS 2.0 REST Services, and the {@link jakarta.ws.rs.ApplicationPath} defines the common path of such services. 24 | * @author Eduardo Martins 25 | */ 26 | @ApplicationPath(BoxApplication.PATH) 27 | public class BoxApplication extends Application { 28 | 29 | /** 30 | * the jaxrs app path 31 | */ 32 | public static final String PATH = "box"; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /thread-racing/src/main/resources/META-INF/batch-jobs/race.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /thread-racing/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /thread-racing/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /thread-racing/src/test/java/org/jboss/as/quickstarts/threadracing/ProvisionedManagedThreadRacingIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.threadracing; 18 | 19 | import java.net.URI; 20 | import java.net.URISyntaxException; 21 | import org.jboss.arquillian.container.test.api.RunAsClient; 22 | import org.jboss.arquillian.junit5.ArquillianExtension; 23 | 24 | import org.junit.jupiter.api.Test; 25 | import org.junit.jupiter.api.extension.ExtendWith; 26 | 27 | @RunAsClient 28 | @ExtendWith(ArquillianExtension.class) 29 | public class ProvisionedManagedThreadRacingIT extends RemoteThreadRacingIT { 30 | 31 | @Override 32 | protected URI getWebSocketEndpoint() { 33 | String host = getServerHost(); 34 | if (host == null) { 35 | host = "ws://localhost:8080"; 36 | } 37 | try { 38 | return new URI(host + "/race"); 39 | } catch (URISyntaxException ex) { 40 | throw new RuntimeException(ex); 41 | } 42 | } 43 | 44 | @Test 45 | public void testRace() throws Exception { 46 | race(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /thread-racing/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /todo-backend/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | # This configuration file can be used to build and deploy the todo-backend 2 | # quickstart on OpenShift with the Helm Chart for EAP. 3 | build: 4 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 5 | ref: 8.0.x 6 | contextDir: todo-backend 7 | env: 8 | - name: POSTGRESQL_DRIVER_VERSION 9 | value: '42.6.0' 10 | deploy: 11 | replicas: 1 12 | env: 13 | # Env vars to connect to PostgreSQL DB 14 | - name: POSTGRESQL_DATABASE 15 | valueFrom: 16 | secretKeyRef: 17 | key: database-name 18 | name: todo-backend-db 19 | - name: POSTGRESQL_USER 20 | valueFrom: 21 | secretKeyRef: 22 | key: database-user 23 | name: todo-backend-db 24 | - name: POSTGRESQL_PASSWORD 25 | valueFrom: 26 | secretKeyRef: 27 | key: database-password 28 | name: todo-backend-db 29 | - name: POSTGRESQL_DATASOURCE 30 | value: ToDos 31 | - name: POSTGRESQL_SERVICE_HOST 32 | value: todo-backend-db 33 | - name: POSTGRESQL_SERVICE_PORT 34 | value: "5432" 35 | -------------------------------------------------------------------------------- /todo-backend/src/main/java/org/wildfly/quickstarts/todos/Resources.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2020, Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. See the copyright.txt file in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * This is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation; either version 2.1 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * This software is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this software; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 20 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. 21 | */ 22 | package org.wildfly.quickstarts.todos; 23 | 24 | import jakarta.ejb.Stateful; 25 | import jakarta.enterprise.context.RequestScoped; 26 | import jakarta.enterprise.inject.Produces; 27 | import jakarta.persistence.EntityManager; 28 | import jakarta.persistence.PersistenceContext; 29 | import jakarta.persistence.PersistenceContextType; 30 | 31 | @Stateful 32 | @RequestScoped 33 | public class Resources { 34 | 35 | @PersistenceContext(type = PersistenceContextType.EXTENDED) 36 | private EntityManager em; 37 | 38 | @Produces 39 | public EntityManager getEm() { 40 | return em; 41 | } 42 | } -------------------------------------------------------------------------------- /todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoBackendApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2020, Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. See the copyright.txt file in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * This is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation; either version 2.1 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * This software is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this software; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 20 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. 21 | */ 22 | package org.wildfly.quickstarts.todos; 23 | 24 | import jakarta.ws.rs.ApplicationPath; 25 | import jakarta.ws.rs.core.Application; 26 | 27 | @ApplicationPath("") 28 | public class ToDoBackendApplication extends Application{ 29 | } 30 | -------------------------------------------------------------------------------- /todo-backend/src/main/java/org/wildfly/quickstarts/todos/ToDoDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2020, Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. See the copyright.txt file in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * This is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation; either version 2.1 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * This software is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this software; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 20 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. 21 | */ 22 | package org.wildfly.quickstarts.todos; 23 | 24 | import java.util.List; 25 | import java.util.Optional; 26 | 27 | import jakarta.ejb.Local; 28 | 29 | @Local 30 | public interface ToDoDAO { 31 | 32 | List findAll(); 33 | 34 | Optional findById(Long id); 35 | 36 | void remove(ToDo todo); 37 | 38 | void insert(ToDo todo); 39 | 40 | Optional update(Long id, ToDo todo); 41 | } -------------------------------------------------------------------------------- /todo-backend/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | java:jboss/datasources/ToDos 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /todo-backend/src/main/scripts/cors_filters.cli: -------------------------------------------------------------------------------- 1 | echo Adding Undertow Filters for CORS 2 | # Access-Control-Allow-Origin 3 | /subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Allow-Origin":add() 4 | /subsystem=undertow/configuration=filter/response-header="Access-Control-Allow-Origin":add(header-name="Access-Control-Allow-Origin",header-value="${env.CORS_ORIGIN:*}") 5 | # Access-Control-Allow-Methods 6 | /subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Allow-Methods":add() 7 | /subsystem=undertow/configuration=filter/response-header="Access-Control-Allow-Methods":add(header-name="Access-Control-Allow-Methods",header-value="GET, POST, OPTION, PUT, DELETE, PATCH") 8 | # Access-Control-Allow-Headers 9 | /subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Allow-Headers":add() 10 | /subsystem=undertow/configuration=filter/response-header="Access-Control-Allow-Headers":add(header-name="Access-Control-Allow-Headers",header-value="accept, authorization, content-type, x-requested-with") 11 | # Access-Control-Allow-Credentials 12 | /subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Allow-Credentials":add() 13 | /subsystem=undertow/configuration=filter/response-header="Access-Control-Allow-Credentials":add(header-name="Access-Control-Allow-Credentials",header-value="true") 14 | # Access-Control-Max-Age 15 | /subsystem=undertow/server=default-server/host=default-host/filter-ref="Access-Control-Max-Age":add() 16 | /subsystem=undertow/configuration=filter/response-header="Access-Control-Max-Age":add(header-name="Access-Control-Max-Age",header-value="1") -------------------------------------------------------------------------------- /todo-backend/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /todo-backend/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 32 | 35 | 36 | -------------------------------------------------------------------------------- /websocket-hello/charts/helm.yaml: -------------------------------------------------------------------------------- 1 | build: 2 | uri: https://github.com/jboss-developer/jboss-eap-quickstarts.git 3 | ref: 8.0.x 4 | contextDir: websocket-hello 5 | deploy: 6 | replicas: 2 -------------------------------------------------------------------------------- /websocket-hello/src/main/java/org/jboss/as/quickstarts/websocket_hello/HelloName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jboss.as.quickstarts.websocket_hello; 18 | 19 | import jakarta.websocket.CloseReason; 20 | import jakarta.websocket.OnClose; 21 | import jakarta.websocket.OnMessage; 22 | import jakarta.websocket.OnOpen; 23 | import jakarta.websocket.Session; 24 | import jakarta.websocket.server.ServerEndpoint; 25 | 26 | @ServerEndpoint("/websocket/helloName") 27 | public class HelloName { 28 | 29 | @OnMessage 30 | public String sayHello(String name) { 31 | System.out.println("Say hello to '" + name + "'"); 32 | return ("Hello " + name + " from websocket endpoint"); 33 | } 34 | 35 | @OnOpen 36 | public void helloOnOpen(Session session) { 37 | System.out.println("WebSocket opened: " + session.getId()); 38 | } 39 | 40 | @OnClose 41 | public void helloOnClose(CloseReason reason) { 42 | System.out.println("WebSocket connection closed with CloseCode: " + reason.getCloseCode()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /websocket-hello/src/main/webapp/resources/css/hello.css: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source 3 | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual 4 | * contributors by the @authors tag. See the copyright.txt in the 5 | * distribution for a full listing of individual contributors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | /* Core styles for the page */ 18 | output.message { 19 | color: blue; 20 | font-style: italic; 21 | } 22 | 23 | output.success { 24 | color: green; 25 | font-style: normal; 26 | } 27 | 28 | output.error { 29 | color: red; 30 | font-weight: bold; 31 | font-style: normal; 32 | } 33 | 34 | div { 35 | padding: 10px; 36 | } 37 | 38 | fieldset { 39 | border-radius:10px; 40 | padding: 10px; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /websocket-hello/src/test/java/org/jboss/as/quickstarts/websocket_hello/ProvisionedManagedWebsocketIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Red Hat, Inc. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | package org.jboss.as.quickstarts.websocket_hello; 22 | 23 | import java.net.URI; 24 | import java.net.URISyntaxException; 25 | import org.jboss.arquillian.container.test.api.RunAsClient; 26 | import org.jboss.arquillian.junit5.ArquillianExtension; 27 | import org.junit.jupiter.api.Test; 28 | import org.junit.jupiter.api.extension.ExtendWith; 29 | 30 | /** 31 | * 32 | * @author Emmanuel Hugonnet (c) 2022 Red Hat, Inc. 33 | */ 34 | @ExtendWith(ArquillianExtension.class) 35 | @RunAsClient 36 | public class ProvisionedManagedWebsocketIT extends RemoteWebSocketIT { 37 | 38 | @Override 39 | protected URI getWebSocketEndpoint() { 40 | String host = getServerHost(); 41 | if (host == null) { 42 | host = "ws://localhost:8080"; 43 | } 44 | try { 45 | return new URI(host + "/websocket/helloName"); 46 | } catch (URISyntaxException ex) { 47 | throw new RuntimeException(ex); 48 | } 49 | } 50 | 51 | @Test 52 | public void testConnectOk() throws Exception { 53 | testWebSocket(500); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /websocket-hello/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | 23 | 24 | --------------------------------------------------------------------------------