Skip to content

Commit 9be7b58

Browse files
committed
First commit
0 parents  commit 9be7b58

File tree

224 files changed

+21679
-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.

224 files changed

+21679
-0
lines changed

faces-config.NavData

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scene Scope="Project" version="2">
3+
<Scope Scope="Faces Configuration Only"/>
4+
<Scope Scope="Project"/>
5+
<Scope Scope="All Faces Configurations"/>
6+
</Scene>

nb-configuration.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project-shared-configuration>
3+
<!--
4+
This file contains additional configuration written by modules in the NetBeans IDE.
5+
The configuration is intended to be shared among all the users of project and
6+
therefore it is assumed to be part of version control checkout.
7+
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
8+
-->
9+
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
10+
<!--
11+
Properties that influence various parts of the IDE, especially code formatting and the like.
12+
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
13+
That way multiple projects can share the same settings (useful for formatting rules for example).
14+
Any value defined here will override the pom.xml file value but is only applicable to the current project.
15+
-->
16+
<netbeans.hint.j2eeVersion>1.6-web</netbeans.hint.j2eeVersion>
17+
<org-netbeans-modules-projectapi.jsf_2e_language>Facelets</org-netbeans-modules-projectapi.jsf_2e_language>
18+
</properties>
19+
</project-shared-configuration>

pom.xml

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.jsf</groupId>
7+
<artifactId>jsf-project-template</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
<packaging>war</packaging>
10+
11+
<name>jsf-project-template</name>
12+
<properties>
13+
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
16+
</properties>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.omnifaces</groupId>
21+
<artifactId>omnifaces</artifactId>
22+
<version>1.7</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.glassfish</groupId>
26+
<artifactId>javax.faces</artifactId>
27+
<version>2.2.6</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>javax.servlet</groupId>
31+
<artifactId>jstl</artifactId>
32+
<version>1.2</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>taglibs</groupId>
36+
<artifactId>standard</artifactId>
37+
<version>1.1.2</version>
38+
</dependency>
39+
<dependency>
40+
<groupId>javax</groupId>
41+
<artifactId>javaee-web-api</artifactId>
42+
<version>7.0</version>
43+
<scope>provided</scope>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.primefaces</groupId>
47+
<artifactId>primefaces</artifactId>
48+
<version>4.0</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>log4j</groupId>
52+
<artifactId>log4j</artifactId>
53+
<version>1.2.17</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>net.coobird</groupId>
57+
<artifactId>thumbnailator</artifactId>
58+
<version>0.4.7</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.slf4j</groupId>
62+
<artifactId>slf4j-api</artifactId>
63+
<version>1.7.6</version>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.slf4j</groupId>
67+
<artifactId>slf4j-simple</artifactId>
68+
<version>1.7.6</version>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.apache.commons</groupId>
72+
<artifactId>commons-io</artifactId>
73+
<version>1.3.2</version>
74+
</dependency>
75+
<dependency>
76+
<groupId>commons-fileupload</groupId>
77+
<artifactId>commons-fileupload</artifactId>
78+
<version>1.3.1</version>
79+
</dependency>
80+
<dependency>
81+
<groupId>commons-beanutils</groupId>
82+
<artifactId>commons-beanutils</artifactId>
83+
<version>1.9.1</version>
84+
</dependency>
85+
<dependency>
86+
<groupId>commons-collections</groupId>
87+
<artifactId>commons-collections</artifactId>
88+
<version>3.2.1</version>
89+
</dependency>
90+
<dependency>
91+
<groupId>javax.mail</groupId>
92+
<artifactId>mail</artifactId>
93+
<version>1.4.7</version>
94+
</dependency>
95+
<dependency>
96+
<groupId>rome</groupId>
97+
<artifactId>rome</artifactId>
98+
<version>1.0</version>
99+
</dependency>
100+
<dependency>
101+
<groupId>com.ocpsoft</groupId>
102+
<artifactId>prettyfaces-jsf2</artifactId>
103+
<version>3.3.3</version>
104+
</dependency>
105+
<dependency>
106+
<groupId>jstl</groupId>
107+
<artifactId>jstl</artifactId>
108+
<version>1.2</version>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.primefaces.extensions</groupId>
112+
<artifactId>primefaces-extensions</artifactId>
113+
<version>1.2.1</version>
114+
</dependency>
115+
<dependency>
116+
<groupId>org.primefaces.extensions</groupId>
117+
<artifactId>resources-ckeditor</artifactId>
118+
<version>1.2.1</version>
119+
</dependency>
120+
<dependency>
121+
<groupId>org.primefaces.extensions</groupId>
122+
<artifactId>resources-codemirror</artifactId>
123+
<version>1.2.1</version>
124+
</dependency>
125+
</dependencies>
126+
<build>
127+
<plugins>
128+
<plugin>
129+
<groupId>org.apache.maven.plugins</groupId>
130+
<artifactId>maven-compiler-plugin</artifactId>
131+
<version>2.3.2</version>
132+
<configuration>
133+
<source>1.6</source>
134+
<target>1.6</target>
135+
<compilerArguments>
136+
<endorseddirs>${endorsed.dir}</endorseddirs>
137+
</compilerArguments>
138+
</configuration>
139+
</plugin>
140+
<plugin>
141+
<groupId>org.apache.maven.plugins</groupId>
142+
<artifactId>maven-war-plugin</artifactId>
143+
<version>2.1.1</version>
144+
<configuration>
145+
<failOnMissingWebXml>false</failOnMissingWebXml>
146+
</configuration>
147+
</plugin>
148+
<plugin>
149+
<groupId>org.apache.maven.plugins</groupId>
150+
<artifactId>maven-dependency-plugin</artifactId>
151+
<version>2.1</version>
152+
<executions>
153+
<execution>
154+
<phase>validate</phase>
155+
<goals>
156+
<goal>copy</goal>
157+
</goals>
158+
<configuration>
159+
<outputDirectory>${endorsed.dir}</outputDirectory>
160+
<silent>true</silent>
161+
<artifactItems>
162+
<artifactItem>
163+
<groupId>javax</groupId>
164+
<artifactId>javaee-endorsed-api</artifactId>
165+
<version>6.0</version>
166+
<type>jar</type>
167+
</artifactItem>
168+
</artifactItems>
169+
</configuration>
170+
</execution>
171+
</executions>
172+
</plugin>
173+
</plugins>
174+
</build>
175+
176+
<repositories>
177+
<repository>
178+
<url>http://repository.primefaces.org/</url>
179+
<id>primefaces</id>
180+
<layout>default</layout>
181+
<name>Repository for library PrimeFaces 3.2</name>
182+
</repository>
183+
<repository>
184+
<id>sonatype-oss-repository</id>
185+
<url>https://oss.sonatype.org/content/groups/public/</url>
186+
<releases>
187+
<enabled>true</enabled>
188+
</releases>
189+
<snapshots>
190+
<enabled>true</enabled>
191+
</snapshots>
192+
</repository>
193+
<repository>
194+
<id>signpost-snapshots</id>
195+
<url>http://oss.sonatype.org/content/repositories/signpost-snapshots</url>
196+
<releases>
197+
<enabled>false</enabled>
198+
</releases>
199+
<snapshots>
200+
<enabled>true</enabled>
201+
</snapshots>
202+
</repository>
203+
</repositories>
204+
205+
</project>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* To change this template, choose Tools | Templates
3+
* and open the template in the editor.
4+
*/
5+
package com.mycompany.webql;
6+
7+
import java.io.Serializable;
8+
9+
import javax.faces.bean.ManagedBean;
10+
import javax.faces.bean.ViewScoped;
11+
12+
@ManagedBean
13+
@ViewScoped
14+
public class FunctionsBean implements Serializable {
15+
16+
private static final long serialVersionUID = 1L;
17+
18+
private int day = 1;
19+
private int year = 2003;
20+
private int month = 1;
21+
private int dayOfWeek = 1;
22+
23+
public int getDay() {
24+
return day;
25+
}
26+
27+
public void setDay(int day) {
28+
this.day = day;
29+
}
30+
31+
public int getYear() {
32+
return year;
33+
}
34+
35+
public void setYear(int year) {
36+
this.year = year;
37+
}
38+
39+
public int getMonth() {
40+
return month;
41+
}
42+
43+
public void setMonth(int month) {
44+
this.month = month;
45+
}
46+
47+
public int getDayOfWeek() {
48+
return dayOfWeek;
49+
}
50+
51+
public void setDayOfWeek(int dayOfWeek) {
52+
this.dayOfWeek = dayOfWeek;
53+
}
54+
55+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* To change this template, choose Tools | Templates
3+
* and open the template in the editor.
4+
*/
5+
package com.mycompany.webql;
6+
7+
import com.mycompany.webql.MemoryWarningSystem.Listener;
8+
import java.util.Collection;
9+
import java.util.LinkedList;
10+
import java.util.logging.Level;
11+
import java.util.logging.Logger;
12+
13+
/**
14+
*
15+
* @author Armen Arzumanyan
16+
*/
17+
public class MemoryTest {
18+
19+
public static void main(String[] args) {
20+
boolean check = true;
21+
MemoryWarningSystem system = new MemoryWarningSystem();
22+
MemoryWarningSystem.setPercentageUsageThreshold(0.8d);
23+
24+
25+
system.addListener(new Listener() {
26+
@Override
27+
public void memoryUsageLow(long usedMemory, long maxMemory) {
28+
long MB = 1048576L;
29+
System.out.println("low:MEMORY " + usedMemory / MB + " MB " + " / " + maxMemory / MB + " MB ");
30+
System.gc();
31+
System.out.println("low:after1 " + usedMemory / MB + " MB " + " / " + maxMemory / MB + " MB ");
32+
try {
33+
Thread.sleep(1000);
34+
System.gc();
35+
System.out.println("low:after " + usedMemory + " / " + maxMemory);
36+
} catch (InterruptedException ex) {
37+
Logger.getLogger(MemoryTest.class.getName()).log(Level.SEVERE, null, ex);
38+
}
39+
40+
41+
42+
43+
}
44+
});
45+
46+
47+
// MemoryWarningSystem.setPercentageUsageThreshold(0.6);
48+
//
49+
// MemoryWarningSystem mws = new MemoryWarningSystem();
50+
// mws.addListener(new MemoryWarningSystem.Listener() {
51+
// @Override
52+
// public void memoryUsageLow(long usedMemory, long maxMemory) {
53+
// System.out.println("Memory usage low!!!");
54+
// double percentageUsed = ((double) usedMemory) / maxMemory;
55+
// System.out.println("percentageUsed = " + percentageUsed);
56+
// MemoryWarningSystem.setPercentageUsageThreshold(0.8D);
57+
// }
58+
// });
59+
60+
try {
61+
Collection<Double> numbers = new LinkedList<Double>();
62+
int x = 25000000;
63+
64+
while (check) {
65+
--x;
66+
// System.out.println("Add memory");
67+
numbers.add(Math.random());
68+
69+
if (x == 1) {
70+
check = false;
71+
}
72+
}
73+
} catch (Exception e) {
74+
e.getLocalizedMessage();
75+
check = false;
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)