Skip to content

Commit f564d71

Browse files
committed
java projects
0 parents  commit f564d71

File tree

168 files changed

+19005
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+19005
-0
lines changed

AsyncChat/docs/index.html

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2+
<html lang="en">
3+
<head>
4+
<!--
5+
6+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
7+
8+
Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
9+
10+
The contents of this file are subject to the terms of either the GNU
11+
General Public License Version 2 only ("GPL") or the Common Development
12+
and Distribution License("CDDL") (collectively, the "License"). You
13+
may not use this file except in compliance with the License. You can
14+
obtain a copy of the License at
15+
https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
16+
or packager/legal/LICENSE.txt. See the License for the specific
17+
language governing permissions and limitations under the License.
18+
19+
When distributing the software, include this License Header Notice in each
20+
file and include the License file at packager/legal/LICENSE.txt.
21+
22+
GPL Classpath Exception:
23+
Oracle designates this particular file as subject to the "Classpath"
24+
exception as provided by Oracle in the GPL Version 2 section of the License
25+
file that accompanied this code.
26+
27+
Modifications:
28+
If applicable, add the following below the License Header, with the fields
29+
enclosed by brackets [] replaced by your own identifying information:
30+
"Portions Copyright [year] [name of copyright owner]"
31+
32+
Contributor(s):
33+
If you wish your version of this file to be governed by only the CDDL or
34+
only the GPL Version 2, indicate your decision by adding "[Contributor]
35+
elects to include this software in this distribution under the [CDDL or GPL
36+
Version 2] license." If you don't indicate a single choice of license, a
37+
recipient has the option to distribute your version of this file under
38+
either the CDDL, the GPL Version 2 or to extend the choice of license to
39+
its licensees as provided above. However, if you add GPL Version 2 code
40+
and therefore, elected the GPL Version 2 license, then the option applies
41+
only if the new code is made subject to such option by the copyright
42+
holder.
43+
44+
-->
45+
46+
<title>The Asynchronous Chat JAX-RS Sample Application</title>
47+
<style type="text/css">
48+
body,th,td,p,div,span,a,ul,ul li, ol, ol li, ol li b, dl,h1,h2,h3,h4,h5,h6,li
49+
{font-family:geneva,helvetica,arial,"lucida sans",sans-serif; font-size:10pt}
50+
h1 {font-size:18pt}
51+
h2 {font-size:14pt}
52+
h3 {font-size:12pt}
53+
code,kbd,tt,pre {font-family:monaco,courier,"courier new";font-size:10pt;color:#666}
54+
li {padding-bottom: 8px}
55+
p.copy, p.copy a {font-family:geneva,helvetica,arial,"lucida sans",sans-serif; font-size:8pt}
56+
p.copy {text-align: center}
57+
</style>
58+
</head>
59+
<body style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"
60+
alink="#333366"
61+
link="#594fbf"
62+
marginwidth="10"
63+
vlink="#1005fb">
64+
<table border="0"
65+
cellpadding="2"
66+
cellspacing="4"
67+
width="100%">
68+
<tbody>
69+
<tr>
70+
<td align="right" bgcolor="#587993" valign="top"><font color="#ffffff" size="-1"><b>Java EE 7 SDK</b></font>&nbsp;</td>
71+
</tr>
72+
</tbody>
73+
</table>
74+
<!-- Don't modify anything above this line, except for the title tag -->
75+
<p><a href="../../../docs/list.html">Samples Main Page</a></p>
76+
<h1>The Asynchronous Chat JAX-RS Sample Application</h1>
77+
<p>This sample application uses JAX-RS asynchronous features to implement a simple
78+
producer/consumer chat.</p>
79+
80+
<h2>Description</h2>
81+
<p>This sample demonstrates how to use <code>javax.ws.rs.container.AsyncResponse</code>.
82+
The deployed resource (<code>ChatResource</code>) contains two asynchronous methods.
83+
These methods have a response annotated with <code>@AsyncResponse</code> and run
84+
in the suspended mode. In this mode, the response is not returned from the resource method
85+
as a return value but must be resumed by calling the <code>AsyncResponse.resume()</code> method.
86+
Before the response is resumed, the execution thread is returned back to container.
87+
</p>
88+
<p>
89+
The resource method that receives messages (<code>ChatResource.getMesssage()</code>) stores
90+
the asynchronous response in a blocking queue. After the message is sent to server
91+
(<code>ChatResource.posMesssage()</code>), the asynchronous response of the request that is waiting
92+
for message is taken from the queue and resumed with the message. Instead of keeping messages in
93+
the queue, the queue stores the responses waiting for these messages, and the messages are directly
94+
delivered to these response when they are available.
95+
</p>
96+
<p>The front page shows the text input field for a message. Enter a message and click on
97+
<code>POST MESSAGE</code>. The POST request is sent to the server where it is blocked in the
98+
queue until a message is requested.</p>
99+
<p>After sending a message, click on <code>GET MESSAGE</code>, which sends a
100+
background asynchronous GET request to the server. This request will be suspended and
101+
resumed later with the message from the POST request that is stored in the blocking queue.
102+
The message is sent back to the browser and displayed in the box below the
103+
<code>GET MESSAGE</code> button.</p>
104+
<p>If you click the buttons in the opposite order,
105+
the GET request is suspended waiting to be resumed by an incoming POST request.
106+
</p>
107+
<p>The page also contains the field with the status of an asynchronous queue
108+
that is stored in <code>ChatResource</code>. This
109+
field is automatically refreshed in short intervals by calling the GET method on
110+
<code>/chat/queue</code> from <code>ChatResource</code>.
111+
</p>
112+
<p>
113+
You can only send one GET and one POST request to the server from the page
114+
(the buttons are then disabled). To submit more
115+
GET and POST requests, open new browser windows. The screen also contains a
116+
log of the asynchronous requests submitted by the browser.</p>
117+
118+
119+
<h2>Key Features</h2>
120+
<p>This sample application demonstrates the following key features:</p>
121+
<ul>
122+
<li><code>@AsyncResponse</code></li>
123+
<li><code>@Path</code></li>
124+
<li><code>@Singleton</code></li>
125+
</ul>
126+
127+
<h2>Building, Deploying, and Running the Application</h2>
128+
<!-- Modify this section as needed -->
129+
<p>Perform the following steps to build, deploy, and run the application:</p>
130+
<ol>
131+
<li> Set up your build environment and configure the application server with which the build system has to work by following the <a href="../../../docs/UserREADME.html">common build instructions.</a></li>
132+
<li><code><i>samples_install_dir</i></code> is the sample application base directory. Go to: <code><i>samples_install_dir</i>/javaee7/rest/async-chat</code>.</li>
133+
<li>Build, deploy, and run the sample application using the <code>run</code> outcome.
134+
<p><code>mvn clean verify cargo:run</code></p>
135+
</li>
136+
<li>The front page of this sample is at
137+
<code>http://localhost:8080/async-chat</code>.<br/>
138+
(The port number might vary.)</li>
139+
<li>Use the <code>clean</code> outcome to undeploy the sample application and to remove the temporary directories such as <code>build</code> and <code>dist</code>.
140+
<p><code>mvn clean</code></p>
141+
</li>
142+
</ol>
143+
144+
<h2>Troubleshooting</h2>
145+
<p>If you have problems when running the application, refer to the <a href="../../../docs/UserTroubleShooting.html">troubleshooting document</a>.</p>
146+
<br>
147+
<!--- Do not modify the rest of the document -->
148+
<hr noshade="noshade" size="1">
149+
<!-- start copyright -->
150+
<p class="copy">Copyright &copy; 1997-2013 Oracle and/or its affiliates. All rights reserved. </p>
151+
<!-- end copyright -->
152+
</body>
153+
</html>

Hotel_Management/build.xml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- You may freely edit this file. See commented blocks below for -->
3+
<!-- some examples of how to customize the build. -->
4+
<!-- (If you delete it and reopen the project it will be recreated.) -->
5+
<!-- By default, only the Clean and Build commands use this build script. -->
6+
<!-- Commands such as Run, Debug, and Test only use this build script if -->
7+
<!-- the Compile on Save feature is turned off for the project. -->
8+
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
9+
<!-- in the project's Project Properties dialog box.-->
10+
<project name="Hotel_Management" default="default" basedir=".">
11+
<description>Builds, tests, and runs the project Hotel_Management.</description>
12+
<import file="nbproject/build-impl.xml"/>
13+
<!--
14+
15+
There exist several targets which are by default empty and which can be
16+
used for execution of your tasks. These targets are usually executed
17+
before and after some main targets. They are:
18+
19+
-pre-init: called before initialization of project properties
20+
-post-init: called after initialization of project properties
21+
-pre-compile: called before javac compilation
22+
-post-compile: called after javac compilation
23+
-pre-compile-single: called before javac compilation of single file
24+
-post-compile-single: called after javac compilation of single file
25+
-pre-compile-test: called before javac compilation of JUnit tests
26+
-post-compile-test: called after javac compilation of JUnit tests
27+
-pre-compile-test-single: called before javac compilation of single JUnit test
28+
-post-compile-test-single: called after javac compilation of single JUunit test
29+
-pre-jar: called before JAR building
30+
-post-jar: called after JAR building
31+
-post-clean: called after cleaning build products
32+
33+
(Targets beginning with '-' are not intended to be called on their own.)
34+
35+
Example of inserting an obfuscator after compilation could look like this:
36+
37+
<target name="-post-compile">
38+
<obfuscate>
39+
<fileset dir="${build.classes.dir}"/>
40+
</obfuscate>
41+
</target>
42+
43+
For list of available properties check the imported
44+
nbproject/build-impl.xml file.
45+
46+
47+
Another way to customize the build is by overriding existing main targets.
48+
The targets of interest are:
49+
50+
-init-macrodef-javac: defines macro for javac compilation
51+
-init-macrodef-junit: defines macro for junit execution
52+
-init-macrodef-debug: defines macro for class debugging
53+
-init-macrodef-java: defines macro for class execution
54+
-do-jar: JAR building
55+
run: execution of project
56+
-javadoc-build: Javadoc generation
57+
test-report: JUnit report generation
58+
59+
An example of overriding the target for project execution could look like this:
60+
61+
<target name="run" depends="Hotel_Management-impl.jar">
62+
<exec dir="bin" executable="launcher.exe">
63+
<arg file="${dist.jar}"/>
64+
</exec>
65+
</target>
66+
67+
Notice that the overridden target depends on the jar target and not only on
68+
the compile target as the regular run target does. Again, for a list of available
69+
properties which you can use, check the target you are overriding in the
70+
nbproject/build-impl.xml file.
71+
72+
-->
73+
</project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#Fri, 15 Jun 2018 20:43:07 +0530
2+
3+
4+
C\:\\Users\\sameer\\Documents\\NetBeansProjects\\Hotel_Management=

Hotel_Management/build/classes/.netbeans_automatic_build

Whitespace-only changes.

Hotel_Management/build/classes/.netbeans_update_resources

Whitespace-only changes.
4.15 KB
Binary file not shown.
Binary file not shown.
3.25 KB
Binary file not shown.
4.33 KB
Binary file not shown.

Hotel_Management/dist/README.TXT

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
========================
2+
BUILD OUTPUT DESCRIPTION
3+
========================
4+
5+
When you build an Java application project that has a main class, the IDE
6+
automatically copies all of the JAR
7+
files on the projects classpath to your projects dist/lib folder. The IDE
8+
also adds each of the JAR files to the Class-Path element in the application
9+
JAR files manifest file (MANIFEST.MF).
10+
11+
To run the project from the command line, go to the dist folder and
12+
type the following:
13+
14+
java -jar "Hotel_Management.jar"
15+
16+
To distribute this project, zip up the dist folder (including the lib folder)
17+
and distribute the ZIP file.
18+
19+
Notes:
20+
21+
* If two JAR files on the project classpath have the same name, only the first
22+
JAR file is copied to the lib folder.
23+
* Only JAR files are copied to the lib folder.
24+
If the classpath contains other types of files or folders, these files (folders)
25+
are not copied.
26+
* If a library on the projects classpath also has a Class-Path element
27+
specified in the manifest,the content of the Class-Path element has to be on
28+
the projects runtime path.
29+
* To set a main class in a standard Java project, right-click the project node
30+
in the Projects window and choose Properties. Then click Run and enter the
31+
class name in the Main Class field. Alternatively, you can manually type the
32+
class name in the manifest Main-Class element.

0 commit comments

Comments
 (0)