Pet*_*son 3 java apache axis web-services
我们正在使用apache轴与Web服务进行通信.它工作正常,但在一天的过程中我们生成1GB的临时文件.如果我们重新启动服务但是需要每天重新启动服务这些文件都会被删除,所以我们没有用完磁盘空间似乎有点傻.
这有一个简单的解决方案吗?
我们找到了一种避免生成这些文件的程序化方法 - 这听起来像是一种更好的管理方式.我在AXIS2-3919问题的评论中发布了这个问题,但是为了以下情况,我会将其复制到此处:
实际上,每次创建AXIS配置上下文时,文件都会部署到temp文件夹.此外,似乎生成的Stub可以通过构造函数接受现有的配置对象.因此,以下Spring配置帮助我们解决了这个问题(不相关的bean和类名被删除):
<bean id="....Stub" factory-bean="...." factory-method="...." scope="request">
<!-- this next element effects the proxying of the surrounding bean,
needed because .... will try to set the stub out of request scope -->
<aop:scoped-proxy/>
<constructor-arg index="0" >
<!-- The WS stub is created here, and passed to the factory-method of ... as a parameter -->
<bean class="com......ws.....Stub" scope="prototype">
<constructor-arg ref="axisConfigContext" />
</bean>
</constructor-arg>
</bean>
<!-- Exists to avoid deployment of axis jar into temp dir for each request. See AXIS2-3919 for more details. -->
<bean id="axisConfigContext"
class="org.apache.axis2.context.ConfigurationContextFactory"
factory-method="createConfigurationContextFromFileSystem">
<constructor-arg index="0"><null /></constructor-arg>
<constructor-arg index="1"><null /></constructor-arg>
</bean>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9484 次 |
| 最近记录: |