Skip to content
This repository was archived by the owner on Jan 30, 2019. It is now read-only.

Commit b0667ff

Browse files
author
Arun Gupta
committed
Starting a sample on creating temporary destination
Former-commit-id: 74e3d068ff927bfd8735664534e7c09659dfa64d
1 parent 52ce003 commit b0667ff

File tree

4 files changed

+203
-0
lines changed

4 files changed

+203
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<artifactId>jms</artifactId>
6+
<groupId>org.sample</groupId>
7+
<version>1.0-SNAPSHOT</version>
8+
</parent>
9+
10+
<groupId>org.glassfish.sample</groupId>
11+
<artifactId>temp-destination</artifactId>
12+
<version>1.0-SNAPSHOT</version>
13+
<packaging>war</packaging>
14+
15+
<name>temp-destination</name>
16+
17+
<properties>
18+
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
19+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20+
</properties>
21+
22+
<dependencies>
23+
<dependency>
24+
<groupId>javax</groupId>
25+
<artifactId>javaee-web-api</artifactId>
26+
<version>6.0</version>
27+
<scope>provided</scope>
28+
</dependency>
29+
</dependencies>
30+
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-compiler-plugin</artifactId>
36+
<version>2.3.2</version>
37+
<configuration>
38+
<source>1.6</source>
39+
<target>1.6</target>
40+
<compilerArguments>
41+
<endorseddirs>${endorsed.dir}</endorseddirs>
42+
</compilerArguments>
43+
</configuration>
44+
</plugin>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-war-plugin</artifactId>
48+
<version>2.1.1</version>
49+
<configuration>
50+
<failOnMissingWebXml>false</failOnMissingWebXml>
51+
</configuration>
52+
</plugin>
53+
<plugin>
54+
<groupId>org.apache.maven.plugins</groupId>
55+
<artifactId>maven-dependency-plugin</artifactId>
56+
<version>2.1</version>
57+
<executions>
58+
<execution>
59+
<phase>validate</phase>
60+
<goals>
61+
<goal>copy</goal>
62+
</goals>
63+
<configuration>
64+
<outputDirectory>${endorsed.dir}</outputDirectory>
65+
<silent>true</silent>
66+
<artifactItems>
67+
<artifactItem>
68+
<groupId>javax</groupId>
69+
<artifactId>javaee-endorsed-api</artifactId>
70+
<version>6.0</version>
71+
<type>jar</type>
72+
</artifactItem>
73+
</artifactItems>
74+
</configuration>
75+
</execution>
76+
</executions>
77+
</plugin>
78+
</plugins>
79+
</build>
80+
81+
</project>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
package org.glassfish.sample.temp.destination;
41+
42+
import javax.ejb.Stateless;
43+
import javax.inject.Inject;
44+
import javax.jms.JMSContext;
45+
import javax.jms.TemporaryQueue;
46+
import javax.jms.TemporaryTopic;
47+
48+
/**
49+
* @author Arun Gupta
50+
*/
51+
@Stateless
52+
public class MessageSender {
53+
54+
@Inject
55+
JMSContext context;
56+
57+
public void sendMessage(String message) {
58+
TemporaryQueue tempQueue = context.createTemporaryQueue();
59+
TemporaryTopic tempTopic = context.createTemporaryTopic();
60+
}
61+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://java.sun.com/xml/ns/javaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
5+
</beans>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!--
2+
/*
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4+
*
5+
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
6+
*
7+
* The contents of this file are subject to the terms of either the GNU
8+
* General Public License Version 2 only ("GPL") or the Common Development
9+
* and Distribution License("CDDL") (collectively, the "License"). You
10+
* may not use this file except in compliance with the License. You can
11+
* obtain a copy of the License at
12+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
13+
* or packager/legal/LICENSE.txt. See the License for the specific
14+
* language governing permissions and limitations under the License.
15+
*
16+
* When distributing the software, include this License Header Notice in each
17+
* file and include the License file at packager/legal/LICENSE.txt.
18+
*
19+
* GPL Classpath Exception:
20+
* Oracle designates this particular file as subject to the "Classpath"
21+
* exception as provided by Oracle in the GPL Version 2 section of the License
22+
* file that accompanied this code.
23+
*
24+
* Modifications:
25+
* If applicable, add the following below the License Header, with the fields
26+
* enclosed by brackets [] replaced by your own identifying information:
27+
* "Portions Copyright [year] [name of copyright owner]"
28+
*
29+
* Contributor(s):
30+
* If you wish your version of this file to be governed by only the CDDL or
31+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
32+
* elects to include this software in this distribution under the [CDDL or GPL
33+
* Version 2] license." If you don't indicate a single choice of license, a
34+
* recipient has the option to distribute your version of this file under
35+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
36+
* its licensees as provided above. However, if you add GPL Version 2 code
37+
* and therefore, elected the GPL Version 2 license, then the option applies
38+
* only if the new code is made subject to such option by the copyright
39+
* holder.
40+
*/
41+
-->
42+
<%@page contentType="text/html" pageEncoding="UTF-8"%>
43+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
44+
"http://www.w3.org/TR/html4/loose.dtd">
45+
46+
<html>
47+
<head>
48+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
49+
<title>JSP Page</title>
50+
</head>
51+
<body>
52+
<h1>JMS 2 Send Message</h1>
53+
<a href="${pageContext.request.contextPath}/TestServletSendSync">Send synchronously</a> and receive message<br/>
54+
<a href="${pageContext.request.contextPath}/TestServletSendAsync">Send asynchronously</a> and receive message<br/>
55+
</body>
56+
</html>

0 commit comments

Comments
 (0)