package com.ikasoa.core.thrift.server;

import org.apache.thrift.server.TServlet;

/**
 * ThriftServlet
 * <p>
 * 通过Servlet来提供服务.
 * 
 * @author <a href="mailto:larry7696@gmail.com">Larry</a>
 * @version 0.2
 */
@SuppressWarnings("serial")
public class ThriftServlet extends TServlet {

	/**
	 * 构造方法
	 * 
	 * @param server
	 *            ThriftServer对象(这里一般用<i>ServletThriftServerImpl</i>实现)
	 */
	public ThriftServlet(ThriftServer server) {
		super(server.getProcessor(), server.getThriftServerConfiguration().getProtocolFactory());
	}

}

@@ -35,16 +35,213 @@
 ver;%0D%0A%0D%0A
+import java.io.IOException;%0D%0Aimport java.io.PrintWriter;%0D%0A%0D%0Aimport javax.servlet.ServletException;%0D%0Aimport javax.servlet.http.HttpServletRequest;%0D%0Aimport javax.servlet.http.HttpServletResponse;%0D%0A%0D%0A
 import o
@@ -275,16 +275,16 @@
 rvlet;%0D%0A
-
 %0D%0A/**%0D%0A 
@@ -418,37 +418,8 @@
 */%0D%0A
-@SuppressWarnings(%22serial%22)%0D%0A
 publ
@@ -463,16 +463,100 @@
 et %7B%0D%0A%0D%0A
+%09private static final long serialVersionUID = 1L;%0D%0A%0D%0A%09private String serverName;%0D%0A%0D%0A
 %09/**%0D%0A%09 
@@ -710,16 +710,16 @@
 ver) %7B%0D%0A
-
 %09%09super(
@@ -803,16 +803,461 @@
 ry());%0D%0A
+%09%09this.serverName = server.getServerName();%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * %0D%0A%09 * @author %3Ca href=%22mailto:larry7696@gmail.com%22%3ELarry%3C/a%3E%0D%0A%09 * @version 0.5.1%0D%0A%09 */%0D%0A%09@Override%0D%0A%09protected void doGet(HttpServletRequest request, HttpServletResponse response)%0D%0A%09%09%09throws ServletException, IOException %7B%0D%0A%09%09// super.doPost(request, response);%0D%0A%09%09PrintWriter w = response.getWriter();%0D%0A%09%09w.write(%22This is a ikasoa server! (%22 + this.serverName + %22)%22);%0D%0A%09%09w.close();%0D%0A
 %09%7D%0D%0A%0D%0A%7D%0D

optimize code