thomescai http://blog.csdn.net/thomescai(转载请保留)
概要:HttpServiceContext和HttpService之间的匹配。是通过分解器类。
先看AsyncWeb.xml配置:
<beans>
<bean id="httpServiceHandler"
class="org.apache.asyncweb.server.HttpServiceHandler">
<property name="serviceResolver">
<bean
class="org.apache.asyncweb.server.resolver.CompositeResolver">
<property name="resolvers">
<list>
<bean
class="org.apache.asyncweb.server.resolver.SimplePrefixResolver">
<property name="uriPrefix">
<value>/service/</value>
</property>
</bean>
<bean
class="org.apache.asyncweb.server.resolver.PassThruResolver" />
</list>
</property>
</bean>
</property>
</bean>
<bean id="httpServiceAutoload"
class="org.apache.asyncweb.spring.HttpServiceLoader">
<property name="handler">
<ref bean="httpServiceHandler" />
</property>
</bean>
</beans>
CompositeResolver中有一个List<ServiceResolver> resolvers列表。
在配置中加载了ServiceResolver的实现类。用于对uri进行循环匹配。
类图:
总结:这部分比较简单,大家猛看看吧。