Spring 是常见的Java bean 容器
Hession 是一个RPC通信框架,效率虽然不如thrift和Google Protocol Buffer,但是比较容易上手
配置情况如下(基于tomcat容器)
Server:
tomcat-web.xml
<servlet>
<servlet-name>userStarReadServiceExporter</servlet-name>
<servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class>
</servlet>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:conf/applicationContext*.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
applicationcontext.xml
<bean id="userStarReadService" class="com.******.impl.StarReadServiceImpl">
<property name="manager" ref="userStarManager" />
</bean>
<!-- hessain service api exporter -->
<bean name="userStarReadServiceExporter" class="org.springframework.remoting.caucho.HessianServiceExporter">
<property name="service" ref="userStarReadService"/>
<property name="serviceInterface" value="com.******.IStarReadService"/>
</bean>
client:
userService = (IUserService) new ZhishiHessianProxyFactory(timeoutInMillis, timeoutInMillis).create(IUserService.class, url);
分享到:
相关推荐
本篇文章将详细探讨“Hession整合Spring”的相关知识点。 首先,我们来看一下Hession的两种发布方式: 1. **Hession单独使用**: 在不依赖Spring的情况下,Hession可以独立作为一个服务发布和调用。开发者需要...
Hession与SpringMVC整合的例子程序,HseServer.zip为服务器端,HseClient.zip为客户端 pom.xml为引用的jar,可以删除一些无用的引用。版本为JDK8,Spring4.3.4,hessian4.0.38
【Hession入门及注入Spring】 ...通过上述步骤,我们已经了解了如何创建一个基础的Hession服务器,并将其整合到Spring框架中。这只是一个起点,实际项目中可能还需要考虑安全性、性能优化和错误处理等方面。
在提供的"springHessianService"文件中,可能包含了一个使用Spring整合Hession的例子。Spring框架允许我们更优雅地管理服务,如通过注解配置服务bean,自动注册到Hession服务器,以及利用Spring的AOP特性添加事务、...
当我们将Hessian与Spring进行整合时,主要目标是利用Spring的依赖注入(Dependency Injection, DI)和组件管理能力来简化Hessian服务的创建和管理。以下是一些关键知识点: 1. **Spring核心模块**(spring-core-...
Spring Boot 整合 Hessian 的示例 在本文中,我们将通过实例代码来介绍如何将 Hessian 集成到 Spring Boot 应用程序中。Hessian 是一个基于 RPC(Remote Procedure Call,远程过程调用)的轻量级框架,它提供了一个...
【标题】:“Spring + Hessian + Maven 整合”是一个基于Java的分布式服务开发实践,它结合了Spring框架的强大功能,Hessian的轻量级RPC(远程过程调用)协议,以及Maven作为项目构建和依赖管理工具。这个压缩包包含...
Hessian是一个由Caucho Technology开发的轻量级二进制RPC协议,因为采用的是二进制协议,所以它很适合于发送二进制数据。 本例子使用spring 整合hessian使开发更加的容易。
Hessian是一个轻量级的remoting on http工具,使用简单的方法提供了RMI(Remote Method Invocation,远程方法调用)的功能。采用的是二进制RPC(Remote Procedure Call Protocol,远程过程调用协议)协议,因为采用...