Class Weixin4jServerStartupListener
- java.lang.Object
-
- com.foxinmy.weixin4j.example.server.Weixin4jServerStartupListener
-
- All Implemented Interfaces:
EventListener
,javax.servlet.ServletContextListener
public class Weixin4jServerStartupListener extends Object implements javax.servlet.ServletContextListener
微信消息服务:需要另外开启一个线程去启动服务,这里值得注意的时:weixin4j-serve本身是作为一个单独的服务来启动的,可以不依赖Spring容器, 但考虑到目前都是Spring mvc的架构,这里就需要使用一个独立的线程去启动服务,其实本身没有使用spring mvc的API, 以后会考虑支持servlet api去集成不同的web框架。- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description Weixin4jServerStartupListener()
-
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)
void
start(org.springframework.context.ApplicationContext applicationContext)
启动服务void
stop()
关闭服务
-
-
-
Method Detail
-
start
public void start(org.springframework.context.ApplicationContext applicationContext)
启动服务- Parameters:
applicationContext
-
-
stop
public void stop()
关闭服务
-
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
-
-