-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,890 changed files
with
62,339 additions
and
6,976 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
# ezyfox-server | ||
EzyFox Server | ||
|
||
#Synopsis | ||
# Synopsis | ||
|
||
#Code Example | ||
# Code Example | ||
|
||
#Motivation | ||
# Motivation | ||
|
||
#API Reference | ||
# API Reference | ||
|
||
#Tests | ||
# Tests | ||
|
||
mvn test | ||
|
||
#Contributors | ||
# Contributors | ||
|
||
#License | ||
# License | ||
|
||
- Apache License, Version 2.0 |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
mvn clean install | ||
mvn clean install -f ezyfox-server-util | ||
mvn clean install -f ezyfox-server-io | ||
mvn clean install -f ezyfox-server-concurrent | ||
mvn clean install -f ezyfox-server-security | ||
mvn clean install -f ezyfox-server-common | ||
mvn clean install -f ezyfox-server-binding | ||
mvn clean install -f ezyfox-server-bean | ||
mvn clean install -f ezyfox-server-mapping | ||
mvn clean install -f ezyfox-server-codec | ||
mvn clean install -f ezyfox-server-core | ||
mvn clean install -f ezyfox-server-databridge | ||
mvn clean install -f ezyfox-server-webapi | ||
mvn clean install -f ezyfox-server-httpserver | ||
mvn clean install -f ezyfox-server-boot | ||
mvn clean install -f ezyfox-server-netty | ||
mvn clean install -f ezyfox-server-nio | ||
mvn clean install -f ezyfox-server-jackson | ||
mvn clean install -f ezyfox-server-msgpack | ||
mvn clean install -f ezyfox-server-sfs2x | ||
mvn clean install -f ezyfox-server-nettycodec | ||
mvn clean install -f ezyfox-server-niocodec | ||
mvn clean install -f ezyfox-server-database | ||
mvn clean install -f ezyfox-server-mongodb | ||
mvn clean install -f ezyfox-server-morphia | ||
mvn clean install -f ezyfox-server-hazelcast | ||
mvn clean install -f ezyfox-server-hazelcast-mongodb | ||
mvn clean install -f ezyfox-server-hazelcast-morphia | ||
mvn clean install -f ezyfox-server-hazelcast-bean | ||
mvn clean install -f ezyfox-server-monitor | ||
mvn clean install -f ezyfox-server-admintools | ||
mvn clean install -f ezyfox-server-nettyrunner | ||
mvn clean install -f ezyfox-server-niorunner |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"plugins": { | ||
"guess-types": { | ||
|
||
}, | ||
"outline": { | ||
|
||
}, | ||
"angular": { | ||
|
||
} | ||
}, | ||
"libs": [ | ||
"ecma5", | ||
"browser" | ||
] | ||
} |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0"?> | ||
<project | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.tvd12</groupId> | ||
<artifactId>ezyfox-server</artifactId> | ||
<version>0.0.2</version> | ||
</parent> | ||
<artifactId>ezyfox-server-admintools</artifactId> | ||
<version>1.0.0</version> | ||
<packaging>war</packaging> | ||
|
||
<name>ezyfox-server-admintools</name> | ||
<url>http://maven.apache.org</url> | ||
|
||
<properties> | ||
<ezy.mongodb.version>1.0.0</ezy.mongodb.version> | ||
<ezy.hazelcast.version>1.0.0</ezy.hazelcast.version> | ||
<spring.version>4.3.8.RELEASE</spring.version> | ||
<struts.version>2.5.10.1</struts.version> | ||
<hibernate.version>5.2.10.Final</hibernate.version> | ||
<commons.dbcp2.version>2.1.1</commons.dbcp2.version> | ||
<mysqlconnector.version>6.0.6</mysqlconnector.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.tvd12</groupId> | ||
<artifactId>ezyfox-server-mongodb</artifactId> | ||
<version>${ezy.mongodb.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.tvd12</groupId> | ||
<artifactId>ezyfox-server-hazelcast</artifactId> | ||
<version>${ezy.hazelcast.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<version>${spring.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context-support</artifactId> | ||
<version>${spring.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-orm</artifactId> | ||
<version>${spring.version}</version> | ||
<type>jar</type> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.struts</groupId> | ||
<artifactId>struts2-core</artifactId> | ||
<version>${struts.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.struts</groupId> | ||
<artifactId>struts2-spring-plugin</artifactId> | ||
<version>${struts.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-core</artifactId> | ||
<version>${hibernate.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-dbcp2</artifactId> | ||
<version>${commons.dbcp2.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
<version>${mysqlconnector.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>javax.servlet-api</artifactId> | ||
<version>3.1.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet.jsp.jstl</groupId> | ||
<artifactId>jstl-api</artifactId> | ||
<version>1.2</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<sourceDirectory>src/main/java</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.4</version> | ||
<configuration> | ||
<warSourceDirectory>src/main/webapp</warSourceDirectory> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
USE `test`; | ||
|
||
CREATE TABLE `product` ( | ||
`product_id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(128) NOT NULL, | ||
`description` varchar(512) NOT NULL, | ||
`price` float NOT NULL, | ||
PRIMARY KEY (`product_id`) | ||
) |
26 changes: 26 additions & 0 deletions
26
ezyfox-server-admintools/src/main/java/com/tvd12/ezyfoxserver/adt/action/HomeAction.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.tvd12.ezyfoxserver.adt.action; | ||
|
||
import com.opensymphony.xwork2.ActionSupport; | ||
import com.tvd12.ezyfoxserver.hazelcast.service.EzyMaxIdService; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class HomeAction extends ActionSupport { | ||
private static final long serialVersionUID = -5885995144592628588L; | ||
|
||
private String random = "random"; | ||
|
||
@Getter(AccessLevel.NONE) | ||
private transient EzyMaxIdService maxIdService; | ||
|
||
@Override | ||
public String execute() throws Exception { | ||
setRandom(String.valueOf(maxIdService.incrementAndGet("count"))); | ||
return SUCCESS; | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...-server-admintools/src/main/java/com/tvd12/ezyfoxserver/adt/action/ListProductAction.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.tvd12.ezyfoxserver.adt.action; | ||
|
||
import java.util.List; | ||
|
||
import com.opensymphony.xwork2.ActionSupport; | ||
import com.tvd12.ezyfoxserver.adt.dao.ProductDAO; | ||
import com.tvd12.ezyfoxserver.adt.model.Product; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class ListProductAction extends ActionSupport { | ||
private static final long serialVersionUID = 8858337894805627088L; | ||
|
||
private ProductDAO productDAO; | ||
private List<Product> products; | ||
|
||
public String execute() { | ||
products = productDAO.list(); | ||
return SUCCESS; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
ezyfox-server-admintools/src/main/java/com/tvd12/ezyfoxserver/adt/dao/ProductDAO.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.tvd12.ezyfoxserver.adt.dao; | ||
|
||
/** | ||
* Copyright CodeJava.net To Present | ||
* All rights reserved. | ||
*/ | ||
import java.util.List; | ||
|
||
import com.tvd12.ezyfoxserver.adt.model.Product; | ||
|
||
public interface ProductDAO { | ||
|
||
List<Product> list(); | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
...x-server-admintools/src/main/java/com/tvd12/ezyfoxserver/adt/dao/impl/ProductDAOImpl.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.tvd12.ezyfoxserver.adt.dao.impl; | ||
|
||
/** | ||
* Copyright CodeJava.net To Present | ||
* All rights reserved. | ||
*/ | ||
import java.util.List; | ||
|
||
import javax.persistence.criteria.CriteriaBuilder; | ||
import javax.persistence.criteria.CriteriaQuery; | ||
import javax.transaction.Transactional; | ||
|
||
import org.hibernate.Session; | ||
import org.hibernate.SessionFactory; | ||
|
||
import com.tvd12.ezyfoxserver.adt.dao.ProductDAO; | ||
import com.tvd12.ezyfoxserver.adt.model.Product; | ||
|
||
public class ProductDAOImpl implements ProductDAO { | ||
|
||
private SessionFactory sessionFactory; | ||
|
||
public ProductDAOImpl(SessionFactory sessionFactory) { | ||
this.sessionFactory = sessionFactory; | ||
} | ||
|
||
@Transactional | ||
@Override | ||
public List<Product> list() { | ||
CriteriaQuery<Product> query = | ||
createQuery().distinct(true); | ||
query.from(Product.class); | ||
return getCurrentSession().createQuery(query).list(); | ||
} | ||
|
||
private Session getCurrentSession() { | ||
return sessionFactory.getCurrentSession(); | ||
} | ||
|
||
private CriteriaBuilder getCriteriaBuilder() { | ||
return getCurrentSession().getCriteriaBuilder(); | ||
} | ||
|
||
private CriteriaQuery<Product> createQuery() { | ||
return getCriteriaBuilder().createQuery(Product.class); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
ezyfox-server-admintools/src/main/java/com/tvd12/ezyfoxserver/adt/model/Product.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.tvd12.ezyfoxserver.adt.model; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* Copyright CodeJava.net To Present | ||
* All rights reserved. | ||
*/ | ||
@Getter | ||
@Setter | ||
public class Product { | ||
private long id; | ||
private String name; | ||
private String description; | ||
private float price; | ||
} |
12 changes: 12 additions & 0 deletions
12
ezyfox-server-admintools/src/main/resources/hibernate.cfg.xml
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!DOCTYPE hibernate-configuration PUBLIC | ||
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" | ||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> | ||
|
||
<hibernate-configuration> | ||
<session-factory> | ||
<property name="dialect">org.hibernate.dialect.MySQLDialect</property> | ||
<property name="show_sql">true</property> | ||
<mapping resource="hibernate/mapping/product.hbm.xml"/> | ||
</session-factory> | ||
</hibernate-configuration> |
14 changes: 14 additions & 0 deletions
14
ezyfox-server-admintools/src/main/resources/hibernate/mapping/product.hbm.xml
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE hibernate-mapping PUBLIC | ||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN" | ||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> | ||
<hibernate-mapping package="com.tvd12.ezyfoxserver.adt.model"> | ||
<class name="Product" table="product"> | ||
<id name="id" column="product_id"> | ||
<generator class="native"/> | ||
</id> | ||
<property name="name" /> | ||
<property name="description" /> | ||
<property name="price" /> | ||
</class> | ||
</hibernate-mapping> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE struts PUBLIC | ||
"-//Apache Software Foundation//DTD Struts Configuration //EN" | ||
"http://struts.apache.org/dtds/struts-2.3.dtd"> | ||
<struts> | ||
<package name="ezyfox-server-admintools" extends="struts-default"> | ||
<default-action-ref name="home" /> | ||
|
||
<action name="home" class="HomeAction"> | ||
<result name="success">/WEB-INF/views/jsp/home.jsp</result> | ||
</action> | ||
|
||
<action name="home/ftl" class="HomeAction"> | ||
<result name="success" type="freemarker">/WEB-INF/views/ftl/home.ftl</result> | ||
</action> | ||
|
||
<action name="home/vm" class="HomeAction"> | ||
<result name="success" type="velocity">/WEB-INF/views/vm/home.vm</result> | ||
</action> | ||
|
||
<action name="list-product" class="ListProductAction"> | ||
<result name="success">/WEB-INF/views/jsp/list_product.jsp</result> | ||
</action> | ||
</package> | ||
</struts> |
Oops, something went wrong.