public void destroy() throws Exception {
   serviceRouter.shutdown();
 }
  public void afterPropertiesSet() throws Exception {
    // 实例化一个AnnotationServletServiceRouter
    serviceRouter = new AnnotationServletServiceRouter();

    // 设置国际化错误资源
    if (extErrorBasename != null) {
      serviceRouter.setExtErrorBasename(extErrorBasename);
    }

    if (extErrorBasenames != null) {
      serviceRouter.setExtErrorBasenames(extErrorBasenames);
    }

    DefaultSecurityManager securityManager = BeanUtils.instantiate(DefaultSecurityManager.class);

    securityManager.setSessionManager(sessionManager);
    securityManager.setAppSecretManager(appSecretManager);
    securityManager.setServiceAccessController(serviceAccessController);
    securityManager.setInvokeTimesController(invokeTimesController);
    securityManager.setFileUploadController(buildFileUploadController());

    serviceRouter.setSecurityManager(securityManager);
    serviceRouter.setThreadPoolExecutor(threadPoolExecutor);
    serviceRouter.setSignEnable(signEnable);
    serviceRouter.setServiceTimeoutSeconds(serviceTimeoutSeconds);
    serviceRouter.setFormattingConversionService(formattingConversionService);
    serviceRouter.setSessionManager(sessionManager);
    serviceRouter.setThreadFerryClass(threadFerryClass);
    serviceRouter.setInvokeTimesController(invokeTimesController);

    // 注册拦截器
    ArrayList<Interceptor> interceptors = getInterceptors();
    if (interceptors != null) {
      for (Interceptor interceptor : interceptors) {
        serviceRouter.addInterceptor(interceptor);
      }
      if (logger.isInfoEnabled()) {
        logger.info("register total {} interceptors", interceptors.size());
      }
    }

    // 注册监听器
    ArrayList<RopEventListener> listeners = getListeners();
    if (listeners != null) {
      for (RopEventListener listener : listeners) {
        serviceRouter.addListener(listener);
      }
      if (logger.isInfoEnabled()) {
        logger.info("register total {} listeners", listeners.size());
      }
    }

    // 设置Spring上下文信息
    serviceRouter.setApplicationContext(this.applicationContext);

    // 启动之
    serviceRouter.startup();
  }