Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JBEAP-12896: Fix typos in messaging output for messaging-clustering-s…
…ingleton, helloworld-mdb, and helloworld-mdb-propertysubstitution quickstarts
- Loading branch information
Showing
3 changed files
with
115 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
222 changes: 111 additions & 111 deletions
222
...oworld-mdb/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,111 +1,111 @@ | |||
/* | /* | ||
* JBoss, Home of Professional Open Source | * JBoss, Home of Professional Open Source | ||
* Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual | * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual | ||
* contributors by the @authors tag. See the copyright.txt in the | * contributors by the @authors tag. See the copyright.txt in the | ||
* distribution for a full listing of individual contributors. | * distribution for a full listing of individual contributors. | ||
* | * | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | * You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | * Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | * distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||
* limitations under the License. | * limitations under the License. | ||
*/ | */ | ||
package org.jboss.as.quickstarts.servlet; | package org.jboss.as.quickstarts.servlet; | ||
|
|
||
import java.io.IOException; | import java.io.IOException; | ||
import java.io.PrintWriter; | import java.io.PrintWriter; | ||
|
|
||
import javax.annotation.Resource; | import javax.annotation.Resource; | ||
import javax.inject.Inject; | import javax.inject.Inject; | ||
import javax.jms.Destination; | import javax.jms.Destination; | ||
import javax.jms.JMSContext; | import javax.jms.JMSContext; | ||
import javax.jms.JMSDestinationDefinition; | import javax.jms.JMSDestinationDefinition; | ||
import javax.jms.JMSDestinationDefinitions; | import javax.jms.JMSDestinationDefinitions; | ||
import javax.jms.Queue; | import javax.jms.Queue; | ||
import javax.jms.Topic; | import javax.jms.Topic; | ||
import javax.servlet.ServletException; | import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||
|
|
||
/** | /** | ||
* Definition of the two JMS destinations used by the quickstart | * Definition of the two JMS destinations used by the quickstart | ||
* (one queue and one topic). | * (one queue and one topic). | ||
*/ | */ | ||
@JMSDestinationDefinitions( | @JMSDestinationDefinitions( | ||
value = { | value = { | ||
@JMSDestinationDefinition( | @JMSDestinationDefinition( | ||
name = "java:/queue/HELLOWORLDMDBQueue", | name = "java:/queue/HELLOWORLDMDBQueue", | ||
interfaceName = "javax.jms.Queue", | interfaceName = "javax.jms.Queue", | ||
destinationName = "HelloWorldMDBQueue" | destinationName = "HelloWorldMDBQueue" | ||
), | ), | ||
@JMSDestinationDefinition( | @JMSDestinationDefinition( | ||
name = "java:/topic/HELLOWORLDMDBTopic", | name = "java:/topic/HELLOWORLDMDBTopic", | ||
interfaceName = "javax.jms.Topic", | interfaceName = "javax.jms.Topic", | ||
destinationName = "HelloWorldMDBTopic" | destinationName = "HelloWorldMDBTopic" | ||
) | ) | ||
} | } | ||
) | ) | ||
|
|
||
/** | /** | ||
* <p> | * <p> | ||
* A simple servlet 3 as client that sends several messages to a queue or a topic. | * A simple servlet 3 as client that sends several messages to a queue or a topic. | ||
* </p> | * </p> | ||
* | * | ||
* <p> | * <p> | ||
* The servlet is registered and mapped to /HelloWorldMDBServletClient using the {@linkplain WebServlet | * The servlet is registered and mapped to /HelloWorldMDBServletClient using the {@linkplain WebServlet | ||
* @HttpServlet}. | * @HttpServlet}. | ||
* </p> | * </p> | ||
* | * | ||
* @author Serge Pagop (spagop@redhat.com) | * @author Serge Pagop (spagop@redhat.com) | ||
* | * | ||
*/ | */ | ||
@WebServlet("/HelloWorldMDBServletClient") | @WebServlet("/HelloWorldMDBServletClient") | ||
public class HelloWorldMDBServletClient extends HttpServlet { | public class HelloWorldMDBServletClient extends HttpServlet { | ||
|
|
||
private static final long serialVersionUID = -8314035702649252239L; | private static final long serialVersionUID = -8314035702649252239L; | ||
|
|
||
private static final int MSG_COUNT = 5; | private static final int MSG_COUNT = 5; | ||
|
|
||
@Inject | @Inject | ||
private JMSContext context; | private JMSContext context; | ||
|
|
||
@Resource(lookup = "java:/queue/HELLOWORLDMDBQueue") | @Resource(lookup = "java:/queue/HELLOWORLDMDBQueue") | ||
private Queue queue; | private Queue queue; | ||
|
|
||
@Resource(lookup = "java:/topic/HELLOWORLDMDBTopic") | @Resource(lookup = "java:/topic/HELLOWORLDMDBTopic") | ||
private Topic topic; | private Topic topic; | ||
|
|
||
@Override | @Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | ||
resp.setContentType("text/html"); | resp.setContentType("text/html"); | ||
PrintWriter out = resp.getWriter(); | PrintWriter out = resp.getWriter(); | ||
out.write("<h1>Quickstart: Example demonstrates the use of <strong>JMS 2.0</strong> and <strong>EJB 3.2 Message-Driven Bean</strong> in JBoss EAP.</h1>"); | out.write("<h1>Quickstart: Example demonstrates the use of <strong>JMS 2.0</strong> and <strong>EJB 3.2 Message-Driven Bean</strong> in JBoss EAP.</h1>"); | ||
try { | try { | ||
boolean useTopic = req.getParameterMap().keySet().contains("topic"); | boolean useTopic = req.getParameterMap().keySet().contains("topic"); | ||
final Destination destination = useTopic ? topic : queue; | final Destination destination = useTopic ? topic : queue; | ||
|
|
||
out.write("<p>Sending messages to <em>" + destination + "</em></p>"); | out.write("<p>Sending messages to <em>" + destination + "</em></p>"); | ||
out.write("<h2>Following messages will be send to the destination:</h2>"); | out.write("<h2>The following messages will be sent to the destination:</h2>"); | ||
for (int i = 0; i < MSG_COUNT; i++) { | for (int i = 0; i < MSG_COUNT; i++) { | ||
String text = "This is message " + (i + 1); | String text = "This is message " + (i + 1); | ||
context.createProducer().send(destination, text); | context.createProducer().send(destination, text); | ||
out.write("Message (" + i + "): " + text + "</br>"); | out.write("Message (" + i + "): " + text + "</br>"); | ||
} | } | ||
out.write("<p><i>Go to your JBoss EAP Server console or Server log to see the result of messages processing</i></p>"); | out.write("<p><i>Go to your JBoss EAP server console or server log to see the result of messages processing.</i></p>"); | ||
} finally { | } finally { | ||
if (out != null) { | if (out != null) { | ||
out.close(); | out.close(); | ||
} | } | ||
} | } | ||
} | } | ||
|
|
||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | ||
doGet(req, resp); | doGet(req, resp); | ||
} | } | ||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters