Hello. Today I release a Framework for Java servers for Post-Shuffled SWF.
This framework is unique due to one specific reason: It uses a special message handling with reflection Method except of implementing interface.
Pros:
- No need for 10000 classes, you can use 10 packets or more in 1 class.
- It's something unique
Cons:
- I don't know if this is slower or not or if this is better or worse.
It uses Netty for connection management and BoneCP for MySQL connection management.
BoneCP is focused on Prepared Statements.
It's completely from scratch.
Link: Framework.rar
Snippet:
PHP Code:package framework.messages;
import java.lang.reflect.Method;
import framework.messages.requests.Handshake;
import framework.sessions.Session;
public class MessageHandler {
private Method[] Packets;
public MessageHandler() {
this.Packets = new Method[15000];
}
public void AddPackets() throws Exception {
this.Packets[6428] = Handshake.class.getMethod("CheckRevision", Session.class);
}
public void HandleRequest(Session Session) throws Exception {
Short Header = Session.GetRequest().GetHeader();
if (this.Packets[Header] != null)
this.Packets[Header].invoke(this.Packets[Header], Session);
else
Session.Write(Header + ": " + Session.GetRequest().GetContent());
}
}
Kind regards,PHP Code:package framework.storage;
import framework.Framework;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class DatabaseClient {
private String Query;
private Connection Connection;
private PreparedStatement Statement;
private Integer ParamCounter = 1;
public void SetQuery(String Query) {
this.Query = Query;
try {
this.Connection = Framework.GetDatabaseManager().GetBone().getConnection();
this.Statement = this.Connection.prepareStatement(this.Query);
}
catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
public void AddParameter(Object Value) throws Exception {
if (Value instanceof Integer) {
this.Statement.setInt(this.ParamCounter++, (Integer)Value);
}
else if (Value instanceof String) {
this.Statement.setString(this.ParamCounter++, (String)Value);
}
else if (Value instanceof Boolean) {
this.Statement.setBoolean(this.ParamCounter++, (Boolean)Value);
}
}
public ResultSet GetTable() {
try {
return this.Statement.executeQuery();
} catch (SQLException e) {
System.out.println(e.getMessage());
return null;
}
}
public ResultSet GetRow() {
try {
ResultSet set = this.Statement.executeQuery();
while (set.next())
return set;
return set;
} catch (SQLException e) {
System.out.println(e.getMessage());
return null;
}
}
public Integer GetInteger() {
try {
ResultSet set = this.Statement.executeQuery();
return set.getInt(0);
} catch (SQLException e) {
System.out.println(e.getMessage());
return null;
}
}
}
Tha.


![[Java] [Netty] [BoneCP] [Base] [Post-Shuffle] [Unique] Framework](http://ragezone.com/hyper728.png)



