androidpn (Android Push Notification)是一个基于XMPP协议的java开源Android push notification实现。
它包含了完整的客户端和服务器端。
本文是在Tomcat下部署 androidpn server的启动日志的分析。
# tail -f logs/catalina.out
#启动Tomcat的服务:对应tomcat/conf/server.xml中的 <Service name="Catalina">
May 04, 2014 2:55:59 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
#启动 Tomcat servlet 引擎:对应 tomcat/conf/server.xml中的 <Engine name="Catalina" defaultHost="localhost">
May 04, 2014 2:55:59 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.39
#部署ROOT目录
May 04, 2014 2:56:03 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /app/apache-tomcat-7.0.39/webapps/ROOT
#验证jar包
May 04, 2014 2:56:03 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/app/apache-tomcat-7.0.39/webapps/ROOT/WEB-INF/lib/el-api-6.0.29.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
May 04, 2014 2:56:03 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/app/apache-tomcat-7.0.39/webapps/ROOT/WEB-INF/lib/jsp-api-2.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
May 04, 2014 2:56:03 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/app/apache-tomcat-7.0.39/webapps/ROOT/WEB-INF/lib/servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
#Spring ContextLoaderListener初始化开始
{INFO } [2014-05-04 14:56:04,977] <org.springframework.web.context.ContextLoader> : Root WebApplicationContext: initialization started
#使用 XmlWebApplicationContext ,XmlWebApplicationContext实现了WebApplicationContext接口,当前的servlet用它来创建上下文。
#如果之后还有其他继承的上下文的时候,这里创建的context作为内容上下文的根,称为 ROOT
#实际名称为 org.springframework.web.context.WebApplicationContext.ROOT
{INFO } [2014-05-04 14:56:05,001] <org.springframework.web.context.support.XmlWebApplicationContext> : Refreshing Root WebApplicationContext: startup date [Sun May 04 14:56:05 CST 2014]; root of context hierarchy
#开始加载web.xml 中 <context-param>标签 contextConfigLocation 配置的文件
{INFO } [2014-05-04 14:56:05,035] <org.springframework.beans.factory.xml.XmlBeanDefinitionReader> : Loading XML bean definitions from class path resource [conf/application-context.xml]
#开始加载 application-context.xml 中import引用的配置文件
{INFO } [2014-05-04 14:56:05,219] <org.springframework.beans.factory.xml.XmlBeanDefinitionReader> : Loading XML bean definitions from class path resource [conf/rest/rest-component-config.xml]
#IoC容器的实现类,列出所有的spring中配置的bean id,这些bean在 ROOT context上下文中
{INFO } [2014-05-04 14:56:05,326] <org.springframework.beans.factory.support.DefaultListableBeanFactory> : Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@14562294: defining beans [component,application,router,get,post]; root of factory hierarchy
#Spring ContextLoaderListener初始化完成
{INFO } [2014-05-04 14:56:05,408] <org.springframework.web.context.ContextLoader> : Root WebApplicationContext: initialization completed in 430 ms
#开始初始化 dispatcher
{INFO } [2014-05-04 14:56:05,446] <org.springframework.web.servlet.DispatcherServlet> : FrameworkServlet 'dispatcher': initialization started
#使用 XmlWebApplicationContext ,XmlWebApplicationContext实现了WebApplicationContext接口,当前的servlet用它来创建上下文。
#上级context上下文是 Root WebApplicationContext
{INFO } [2014-05-04 14:56:05,448] <org.springframework.web.context.support.XmlWebApplicationContext> : Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Sun May 04 14:56:05 CST 2014]; parent: Root WebApplicationContext
#加载 dispatcher-servlet.xml
{INFO } [2014-05-04 14:56:05,448] <org.springframework.beans.factory.xml.XmlBeanDefinitionReader> : Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
#IoC容器的实现类,列出所有的dispatcher-servlet中配置的bean id,上级的Ioc容器是在Spring中创建的。
{INFO } [2014-05-04 14:56:05,500] <org.springframework.beans.factory.support.DefaultListableBeanFactory> : Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2604a07d: defining beans [urlMapping,filenameController,userController,sessionController,notificationController,paramResolver,viewResolver,messageSource]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@14562294
#发现NotificationController中的方法
{DEBUG} [2014-05-04 14:56:05,526] <org.androidpn.server.console.controller.NotificationController> : Found action method [public org.springframework.web.servlet.ModelAndView org.androidpn.server.console.controller.NotificationController.send(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception]
{DEBUG} [2014-05-04 14:56:05,526] <org.androidpn.server.console.controller.NotificationController> : Found action method [public org.springframework.web.servlet.ModelAndView org.androidpn.server.console.controller.NotificationController.list(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception]
#此处实例化NotificationController ,调用 NotificationController 的无参数构造方法。
#NotificationController无参构造方法实例化 NotificationManager
#NotificationManager无参构造方法实例化 SessionManager
#SessionManager无参数构造方法实例化 XmppServer
#XmppServer 无参构造方法实例化并调用start()方法,初始化服务的路径读取配置文件.
#通过 Config 代理并实例化 ConfigManager 加载 config.xml 。
{DEBUG} [2014-05-04 14:56:05,580] <org.apache.commons.configuration.ConfigurationUtils> : ConfigurationUtils.locate(): base is /app/apache-tomcat-7.0.39, name is config.xml
{DEBUG} [2014-05-04 14:56:05,596] <org.apache.commons.configuration.ConfigurationUtils> : Loading configuration from the context classpath (config.xml)
#加载 config.xml中的配置文件 config.properties
{DEBUG} [2014-05-04 14:56:05,693] <org.apache.commons.configuration.ConfigurationUtils> : ConfigurationUtils.locate(): base is /app/apache-tomcat-7.0.39, name is config.properties
{DEBUG} [2014-05-04 14:56:05,693] <org.apache.commons.configuration.ConfigurationUtils> : Loading configuration from the context classpath (config.properties)
#config.xml加载完毕
{INFO } [2014-05-04 14:56:05,702] <org.androidpn.server.util.ConfigManager> : Configuration loaded: config.xml
#用 ClassPathXmlApplicationContext 加载 spring-config.xml配置文件
{INFO } [2014-05-04 14:56:05,712] <org.springframework.context.support.ClassPathXmlApplicationContext> : Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@359d9606: startup date [Sun May 04 14:56:05 CST 2014]; root of context hierarchy
{INFO } [2014-05-04 14:56:05,713] <org.springframework.beans.factory.xml.XmlBeanDefinitionReader> : Loading XML bean definitions from class path resource [spring-config.xml]
#加载 spring-config.xml 文件中的 jdbc.properties 配置文件。
{INFO } [2014-05-04 14:56:05,813] <org.springframework.beans.factory.config.PropertyPlaceholderConfigurer> : Loading properties file from class path resource [jdbc.properties]
# MINA Socket 配置
{WARN } [2014-05-04 14:56:05,830] <org.springframework.beans.factory.config.CustomEditorConfigurer> : Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [java.net.SocketAddress; offending editor instance: org.apache.mina.integration.beans.InetSocketAddressEditor@67b7d0fb
# Ioc 列表Spring beans id
{INFO } [2014-05-04 14:56:05,838] <org.springframework.beans.factory.support.DefaultListableBeanFactory> : Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@243e2c21: defining beans [propertyConfigurer,dataSource,sessionFactory,transactionManager,userDao,userService,org.springframework.beans.factory.config.CustomEditorConfigurer#0,xmppHandler,filterChainBuilder,ioAcceptor]; root of factory hierarchy
(这里的Spring applicationContext 与前面的applicationContext没有任何关系,是独立的。两个上下文中的bean不可见,修改的方法见 http://blog.csdn.net/teamlet/article/details/26476671 )
#实例化beans
{INFO } [2014-05-04 14:56:05,928] <org.hibernate.cfg.annotations.Version> : Hibernate Annotations 3.4.0.GA
{INFO } [2014-05-04 14:56:05,936] <org.hibernate.cfg.Environment> : Hibernate 3.3.1.GA
{INFO } [2014-05-04 14:56:05,939] <org.hibernate.cfg.Environment> : hibernate.properties not found
{INFO } [2014-05-04 14:56:05,942] <org.hibernate.cfg.Environment> : Bytecode provider name : javassist
{INFO } [2014-05-04 14:56:05,945] <org.hibernate.cfg.Environment> : using JDK 1.4 java.sql.Timestamp handling
{INFO } [2014-05-04 14:56:06,020] <org.hibernate.annotations.common.Version> : Hibernate Commons Annotations 3.1.0.GA
{INFO } [2014-05-04 14:56:06,031] <org.hibernate.cfg.Configuration> : configuring from url: file:/data/apache-tomcat-7.0.39/webapps/ROOT/WEB-INF/classes/hibernate.cfg.xml
{INFO } [2014-05-04 14:56:06,122] <org.hibernate.cfg.Configuration> : Configured SessionFactory: null
{INFO } [2014-05-04 14:56:06,156] <org.hibernate.cfg.AnnotationBinder> : Binding entity from annotated class: org.androidpn.server.model.User
{INFO } [2014-05-04 14:56:06,184] <org.hibernate.cfg.annotations.EntityBinder> : Bind entity org.androidpn.server.model.User on table apn_user
{INFO } [2014-05-04 14:56:06,221] <org.hibernate.cfg.AnnotationConfiguration> : Hibernate Validator not found: ignoring
{INFO } [2014-05-04 14:56:06,222] <org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean> : Building new Hibernate SessionFactory
{INFO } [2014-05-04 14:56:06,224] <org.hibernate.cfg.search.HibernateSearchEventListenerRegister> : Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
{INFO } [2014-05-04 14:56:06,263] <org.hibernate.connection.ConnectionProviderFactory> : Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
{INFO } [2014-05-04 14:56:06,439] <org.hibernate.cfg.SettingsFactory> : RDBMS: MySQL, version: 5.5.33-log
{INFO } [2014-05-04 14:56:06,439] <org.hibernate.cfg.SettingsFactory> : JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )
{INFO } [2014-05-04 14:56:06,449] <org.hibernate.dialect.Dialect> : Using dialect: org.hibernate.dialect.MySQLDialect
{INFO } [2014-05-04 14:56:06,452] <org.hibernate.transaction.TransactionFactoryFactory> : Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
{INFO } [2014-05-04 14:56:06,453] <org.hibernate.transaction.TransactionManagerLookupFactory> : No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
{INFO } [2014-05-04 14:56:06,453] <org.hibernate.cfg.SettingsFactory> : Automatic flush during beforeCompletion(): disabled
{INFO } [2014-05-04 14:56:06,453] <org.hibernate.cfg.SettingsFactory> : Automatic session close at end of transaction: disabled
{INFO } [2014-05-04 14:56:06,453] <org.hibernate.cfg.SettingsFactory> : JDBC batch size: 15
{INFO } [2014-05-04 14:56:06,453] <org.hibernate.cfg.SettingsFactory> : JDBC batch updates for versioned data: disabled
{INFO } [2014-05-04 14:56:06,453] <org.hibernate.cfg.SettingsFactory> : Scrollable result sets: enabled
{INFO } [2014-05-04 14:56:06,454] <org.hibernate.cfg.SettingsFactory> : JDBC3 getGeneratedKeys(): enabled
{INFO } [2014-05-04 14:56:06,454] <org.hibernate.cfg.SettingsFactory> : Connection release mode: auto
{INFO } [2014-05-04 14:56:06,454] <org.hibernate.cfg.SettingsFactory> : Maximum outer join fetch depth: 2
{INFO } [2014-05-04 14:56:06,454] <org.hibernate.cfg.SettingsFactory> : Default batch fetch size: 1
{INFO } [2014-05-04 14:56:06,454] <org.hibernate.cfg.SettingsFactory> : Generate SQL with comments: enabled
{INFO } [2014-05-04 14:56:06,455] <org.hibernate.cfg.SettingsFactory> : Order SQL updates by primary key: disabled
{INFO } [2014-05-04 14:56:06,455] <org.hibernate.cfg.SettingsFactory> : Order SQL inserts for batching: disabled
{INFO } [2014-05-04 14:56:06,455] <org.hibernate.cfg.SettingsFactory> : Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
{INFO } [2014-05-04 14:56:06,456] <org.hibernate.hql.ast.ASTQueryTranslatorFactory> : Using ASTQueryTranslatorFactory
{INFO } [2014-05-04 14:56:06,456] <org.hibernate.cfg.SettingsFactory> : Query language substitutions: {}
{INFO } [2014-05-04 14:56:06,456] <org.hibernate.cfg.SettingsFactory> : JPA-QL strict compliance: disabled
{INFO } [2014-05-04 14:56:06,456] <org.hibernate.cfg.SettingsFactory> : Second-level cache: enabled
{INFO } [2014-05-04 14:56:06,457] <org.hibernate.cfg.SettingsFactory> : Query cache: disabled
{INFO } [2014-05-04 14:56:06,460] <org.hibernate.cfg.SettingsFactory> : Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
{INFO } [2014-05-04 14:56:06,460] <org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge> : Cache provider: net.sf.ehcache.hibernate.EhCacheProvider
{INFO } [2014-05-04 14:56:06,462] <org.hibernate.cfg.SettingsFactory> : Optimize cache for minimal puts: disabled
{INFO } [2014-05-04 14:56:06,462] <org.hibernate.cfg.SettingsFactory> : Structured second-level cache entries: disabled
{INFO } [2014-05-04 14:56:06,465] <org.hibernate.cfg.SettingsFactory> : Echoing all SQL to stdout
{INFO } [2014-05-04 14:56:06,466] <org.hibernate.cfg.SettingsFactory> : Statistics: disabled
{INFO } [2014-05-04 14:56:06,466] <org.hibernate.cfg.SettingsFactory> : Deleted entity synthetic identifier rollback: disabled
{INFO } [2014-05-04 14:56:06,466] <org.hibernate.cfg.SettingsFactory> : Default entity-mode: pojo
{INFO } [2014-05-04 14:56:06,466] <org.hibernate.cfg.SettingsFactory> : Named query checking : enabled
{INFO } [2014-05-04 14:56:06,488] <org.hibernate.impl.SessionFactoryImpl> : building session factory
{INFO } [2014-05-04 14:56:06,659] <org.hibernate.impl.SessionFactoryObjectFactory> : Not binding factory to JNDI, no JNDI name configured
{INFO } [2014-05-04 14:56:06,664] <org.hibernate.tool.hbm2ddl.SchemaUpdate> : Running hbm2ddl schema update
{INFO } [2014-05-04 14:56:06,664] <org.hibernate.tool.hbm2ddl.SchemaUpdate> : fetching database metadata
{INFO } [2014-05-04 14:56:06,665] <org.hibernate.tool.hbm2ddl.SchemaUpdate> : updating schema
{INFO } [2014-05-04 14:56:06,678] <org.hibernate.tool.hbm2ddl.TableMetadata> : table found: apn.apn_user
{INFO } [2014-05-04 14:56:06,678] <org.hibernate.tool.hbm2ddl.TableMetadata> : columns: [created_date, id, username, updated_date, email, name, password]
{INFO } [2014-05-04 14:56:06,678] <org.hibernate.tool.hbm2ddl.TableMetadata> : foreign keys: []
{INFO } [2014-05-04 14:56:06,678] <org.hibernate.tool.hbm2ddl.TableMetadata> : indexes: [username, primary]
{INFO } [2014-05-04 14:56:06,679] <org.hibernate.tool.hbm2ddl.SchemaUpdate> : schema update complete
{INFO } [2014-05-04 14:56:06,703] <org.springframework.orm.hibernate3.HibernateTransactionManager> : Using DataSource [org.apache.commons.dbcp.BasicDataSource@588d16eb] of Hibernate SessionFactory for HibernateTransactionManager
{DEBUG} [2014-05-04 14:56:06,802] <org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder> : LinkedHashMap is an ordered map.
{INFO } [2014-05-04 14:56:06,836] <org.androidpn.server.xmpp.XmppServer> : Spring Configuration loaded.
{INFO } [2014-05-04 14:56:06,836] <org.androidpn.server.xmpp.XmppServer> : XmppServer started: 127.0.0.1
{INFO } [2014-05-04 14:56:06,836] <org.androidpn.server.xmpp.XmppServer> : Androidpn Server v0.5.0
{DEBUG} [2014-05-04 14:56:06,892] <org.androidpn.server.console.controller.UserController> : Found action method [public org.springframework.web.servlet.ModelAndView org.androidpn.server.console.controller.UserController.list(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception]
{DEBUG} [2014-05-04 14:56:06,906] <org.androidpn.server.console.controller.SessionController> : Found action method [public org.springframework.web.servlet.ModelAndView org.androidpn.server.console.controller.SessionController.list(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception]
# dispatcher 初始化完毕。
{INFO } [2014-05-04 14:56:06,937] <org.springframework.web.servlet.DispatcherServlet> : FrameworkServlet 'dispatcher': initialization completed in 1490 ms
# 对应 tomcat/conf/server.xml中的 Connector 8080端口
May 04, 2014 2:56:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
# 对应 tomcat/conf/server.xml中的 Connector 8009端口
May 04, 2014 2:56:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
# 对应 tomcat/conf/server.xml中的 Server
May 04, 2014 2:56:09 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 9459 ms
<启动完成>
web.xml中的部分内容:
<context-param><param-name>contextConfigLocation</param-name>
<param-value>
classpath:conf/application-context.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
dispatcher-servlet.xml内容:
<bean id="urlMapping"class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"><property name="mappings"><value>/index.do=filenameController/user.do=userController/session.do=sessionController/notification.do=notificationController</value></property><property name="order" value="1" /></bean><bean id="filenameController"class="org.springframework.web.servlet.mvc.UrlFilenameViewController" /><bean id="userController" class="org.androidpn.server.console.controller.UserController"><property name="methodNameResolver" ref="paramResolver" /></bean><bean id="sessionController"class="org.androidpn.server.console.controller.SessionController"><property name="methodNameResolver" ref="paramResolver" /></bean><bean id="notificationController"class="org.androidpn.server.console.controller.NotificationController"><property name="methodNameResolver" ref="paramResolver" /></bean><bean id="paramResolver"class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver"><property name="paramName" value="action" /><property name="defaultMethodName" value="list" /></bean><bean id="viewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="requestContextAttribute" value="rc" /><property name="viewClass"value="org.springframework.web.servlet.view.JstlView" /><property name="prefix" value="/page/" /><property name="suffix" value=".jsp" /></bean><!--<bean id="exceptionResolver"class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"><property name="exceptionMappings"> <props> <propkey="java.lang.Exception">error</prop> </props> </property> </bean>--><bean id="messageSource"class="org.springframework.context.support.ResourceBundleMessageSource"><property name="basename" value="messages" /><property name="useCodeAsDefaultMessage" value="true" /></bean>
config.xml内容
<configuration><system /><properties fileName="config.properties" /></configuration>
spring-config.xml内容:
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"xmlns:util="http://www.springframework.org/schema/util"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsdhttp://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd"><!-- =============================================================== --><!-- Resources --><!-- =============================================================== --><bean id="propertyConfigurer"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath:jdbc.properties</value></list></property></bean><!-- =============================================================== --><!-- Data Source --><!-- =============================================================== --><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"destroy-method="close"><property name="driverClassName" value="${jdbcDriverClassName}" /><property name="url" value="${jdbcUrl}" /><property name="username" value="${jdbcUsername}" /><property name="password" value="${jdbcPassword}" /><property name="maxActive" value="${jdbcMaxActive}" /><property name="maxIdle" value="${jdbcMaxIdle}" /><property name="maxWait" value="${jdbcMaxWait}" /><property name="defaultAutoCommit" value="true" /></bean><!-- =============================================================== --><!-- Hibernate --><!-- =============================================================== --><bean id="sessionFactory"class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"><property name="dataSource" ref="dataSource" /><property name="configLocation" value="classpath:hibernate.cfg.xml" /></bean><bean id="transactionManager"class="org.springframework.orm.hibernate3.HibernateTransactionManager"><property name="sessionFactory" ref="sessionFactory" /></bean><!-- =============================================================== --><!-- Data Access Objects --><!-- =============================================================== --><bean id="userDao" class="org.androidpn.server.dao.hibernate.UserDaoHibernate"><property name="sessionFactory" ref="sessionFactory" /></bean><!-- =============================================================== --><!-- Services --><!-- =============================================================== --><bean id="userService" class="org.androidpn.server.service.impl.UserServiceImpl"><property name="userDao" ref="userDao" /></bean><!-- =============================================================== --><!-- SSL --><!-- =============================================================== --><!--<bean id="tlsContextFactory"class="org.androidpn.server.ssl2.ResourceBasedTLSContextFactory"><constructor-arg value="classpath:bogus_mina_tls.cert" /><property name="password" value="boguspw" /><property name="trustManagerFactory"><bean class="org.androidpn.server.ssl2.BogusTrustManagerFactory" /></property></bean>--><!-- =============================================================== --><!-- MINA --><!-- =============================================================== --><bean class="org.springframework.beans.factory.config.CustomEditorConfigurer"><property name="customEditors"><map><entry key="java.net.SocketAddress"><bean class="org.apache.mina.integration.beans.InetSocketAddressEditor" /></entry></map></property></bean><bean id="xmppHandler" class="org.androidpn.server.xmpp.net.XmppIoHandler" /><bean id="filterChainBuilder"class="org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder"><property name="filters"><map><entry key="executor"><bean class="org.apache.mina.filter.executor.ExecutorFilter" /></entry><entry key="codec"><bean class="org.apache.mina.filter.codec.ProtocolCodecFilter"><constructor-arg><bean class="org.androidpn.server.xmpp.codec.XmppCodecFactory" /></constructor-arg></bean></entry><!--<entry key="logging"><bean class="org.apache.mina.filter.logging.LoggingFilter" /></entry>--></map></property></bean><bean id="ioAcceptor" class="org.apache.mina.transport.socket.nio.NioSocketAcceptor"init-method="bind" destroy-method="unbind"><property name="defaultLocalAddress" value=":5222" /><property name="handler" ref="xmppHandler" /><property name="filterChainBuilder" ref="filterChainBuilder" /><property name="reuseAddress" value="true" /></bean></beans>