parent
7b402a3c8b
commit
0f4c412fcd
@ -0,0 +1,18 @@
|
|||||||
|
package com.xxl.job.client.handler;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* annotation for job handler
|
||||||
|
* @author 2016-5-17 21:06:49
|
||||||
|
*/
|
||||||
|
@Target({ElementType.TYPE})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface JobHander {
|
||||||
|
|
||||||
|
String jobName();
|
||||||
|
|
||||||
|
}
|
@ -1,60 +1,61 @@
|
|||||||
package com.xxl.job.client.netcom.servlet;
|
//package com.xxl.job.client.netcom.servlet;
|
||||||
|
//
|
||||||
|
//
|
||||||
import java.io.IOException;
|
//import java.io.IOException;
|
||||||
import java.util.HashMap;
|
//import java.util.HashMap;
|
||||||
import java.util.Map;
|
//import java.util.Map;
|
||||||
|
//
|
||||||
import javax.servlet.ServletException;
|
//import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServlet;
|
//import javax.servlet.http.HttpServlet;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
//import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
//import javax.servlet.http.HttpServletResponse;
|
||||||
|
//
|
||||||
import com.xxl.job.client.handler.HandlerRepository;
|
//import com.xxl.job.client.handler.HandlerRepository;
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* remote job client on http
|
// * remote job client on http
|
||||||
* @author xuxueli 2015-12-19 18:36:47
|
// * @author xuxueli 2015-12-19 18:36:47
|
||||||
*/
|
// */
|
||||||
public class XxlJobServlet extends HttpServlet {
|
//@Deprecated
|
||||||
private static final long serialVersionUID = 1L;
|
//public class XxlJobServlet extends HttpServlet {
|
||||||
|
// private static final long serialVersionUID = 1L;
|
||||||
/**
|
//
|
||||||
* Default constructor.
|
// /**
|
||||||
*/
|
// * Default constructor.
|
||||||
public XxlJobServlet() {
|
// */
|
||||||
// TODO Auto-generated constructor stub
|
// public XxlJobServlet() {
|
||||||
}
|
// // TODO Auto-generated constructor stub
|
||||||
|
// }
|
||||||
/**
|
//
|
||||||
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
|
// /**
|
||||||
*/
|
// * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
// */
|
||||||
request.setCharacterEncoding("UTF-8");
|
// protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
response.setCharacterEncoding("UTF-8");
|
// request.setCharacterEncoding("UTF-8");
|
||||||
|
// response.setCharacterEncoding("UTF-8");
|
||||||
Map<String, String> _param = new HashMap<String, String>();
|
//
|
||||||
if (request.getParameterMap()!=null && request.getParameterMap().size()>0) {
|
// Map<String, String> _param = new HashMap<String, String>();
|
||||||
for (Object paramKey : request.getParameterMap().keySet()) {
|
// if (request.getParameterMap()!=null && request.getParameterMap().size()>0) {
|
||||||
if (paramKey!=null) {
|
// for (Object paramKey : request.getParameterMap().keySet()) {
|
||||||
String paramKeyStr = paramKey.toString();
|
// if (paramKey!=null) {
|
||||||
_param.put(paramKeyStr, request.getParameter(paramKeyStr));
|
// String paramKeyStr = paramKey.toString();
|
||||||
}
|
// _param.put(paramKeyStr, request.getParameter(paramKeyStr));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
String resp = HandlerRepository.service(_param);
|
//
|
||||||
response.getWriter().append(resp);
|
// String resp = HandlerRepository.service(_param);
|
||||||
return;
|
// response.getWriter().append(resp);
|
||||||
}
|
// return;
|
||||||
|
// }
|
||||||
/**
|
//
|
||||||
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
// /**
|
||||||
*/
|
// * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
||||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
// */
|
||||||
// TODO Auto-generated method stub
|
// protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
doGet(request, response);
|
// // TODO Auto-generated method stub
|
||||||
}
|
// doGet(request, response);
|
||||||
|
// }
|
||||||
}
|
//
|
||||||
|
//}
|
||||||
|
Loading…
Reference in new issue