No perder la conexion RMI


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
		http://www.springframework.org/schema/util 
		http://www.springframework.org/schema/util/spring-util-3.0.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/aop  
		http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

	<context:annotation-config />
	<context:component-scan base-package="es.depontevedra.cividas.rmi.connect" />

	<bean id="cividasE" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
		<property name="serviceUrl" value="rmi://${cividas.server.host}:${cividas.server.port}/${cividas.server.name}" />
		<property name="serviceInterface" value="com.ontimize.locator.EntityReferenceLocator" />
		<property name="refreshStubOnConnectFailure" value="true" />
	</bean>
	
	<bean id="cividasU" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
		<property name="serviceUrl" value="rmi://${cividas.server.host}:${cividas.server.port}/${cividas.server.name}" />
		<property name="serviceInterface" value="com.ontimize.locator.UtilReferenceLocator" />
		<property name="refreshStubOnConnectFailure" value="true" />
	</bean>
	
	<bean id="cividasRemoteEntity" class="es.depontevedra.cividas.rmi.connect.CividasRemoteEntity">
		<property name="user" value="${cividas.server.user}" />
		<property name="pass" value="${cividas.server.pass}" />
		<property name="host" value="${cividas.server.host}" />
		<property name="port" value="${cividas.server.port}" />
		<property name="name" value="${cividas.server.name}" />
	</bean>

	<bean id="cividasEntity" class="es.depontevedra.cividas.rmi.connect.CividasEntity">
		<property name="user" value="${cividas.server.user}" />
		<property name="pass" value="${cividas.server.pass}" />
		<property name="host" value="${cividas.server.host}" />
		<property name="port" value="${cividas.server.port}" />
		<property name="name" value="${cividas.server.name}" />
	</bean>

</beans>

depues en la clase que implemntes capturas:

public class CividasConnection {
	
	private static final Logger LOGGER = LoggerFactory.getLogger(CividasConnection.class);
	
	@Autowired
	private EntityReferenceLocator cividas;
	
	@Autowired
	private UtilReferenceLocator cividasUtil;

Anuncios
No perder la conexion RMI