Package com.foxinmy.weixin4j.listener
Class AbstractWeixinServerStartupListener
- java.lang.Object
-
- com.foxinmy.weixin4j.listener.AbstractWeixinServerStartupListener
-
- All Implemented Interfaces:
EventListener
,javax.servlet.ServletContextListener
public abstract class AbstractWeixinServerStartupListener extends Object implements javax.servlet.ServletContextListener
监听器方式新线程启动微信服务(适用于与web集成- Since:
- JDK 1.6
- Author:
- jinyu
-
-
Constructor Summary
Constructors Constructor Description AbstractWeixinServerStartupListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextDestroyed(javax.servlet.ServletContextEvent sce)
void
contextInitialized(javax.servlet.ServletContextEvent sce)
String[]
getInterceptorToScan()
拦截微信消息的全限包名(也可通过addInterceptor方式一个一个添加)protected boolean
getOpenAlwaysResponse()
当没有匹配到消息处理时输出空白回复(公众号不会出现「该公众号无法提供服务的提示」)protected boolean
getOpenDebugResponse()
打开调试回复protected int
getPort()
服务监听端口,目前微信只支持80端口,可以考虑用nginx做转发到此端口protected AesToken
getToken()
明文模式:String aesToken = ""; 密文模式:AesToken aesToken = new AesToken("公众号appid", "公众号token","公众号加密/解密消息的密钥");
-
-
-
Method Detail
-
getPort
protected int getPort()
服务监听端口,目前微信只支持80端口,可以考虑用nginx做转发到此端口- Returns:
-
getToken
protected AesToken getToken()
明文模式:String aesToken = ""; 密文模式:AesToken aesToken = new AesToken("公众号appid", "公众号token","公众号加密/解密消息的密钥");
-
getInterceptorToScan
public String[] getInterceptorToScan()
拦截微信消息的全限包名(也可通过addInterceptor方式一个一个添加)- Returns:
-
getOpenAlwaysResponse
protected boolean getOpenAlwaysResponse()
当没有匹配到消息处理时输出空白回复(公众号不会出现「该公众号无法提供服务的提示」)- Returns:
-
getOpenDebugResponse
protected boolean getOpenDebugResponse()
打开调试回复- Returns:
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent sce)
- Specified by:
contextInitialized
in interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
- Specified by:
contextDestroyed
in interfacejavax.servlet.ServletContextListener
-
-