Giriş
İstemci tarafında RMI çağrısı yapmak için kullanılır.
setServiceInterface metodu
Elimizde şöyle bir kod olsun.
İstemci tarafında RMI çağrısı yapmak için kullanılır.
setServiceInterface metodu
Elimizde şöyle bir kod olsun.
public interface Calculation {
  int cube(int number);
  Info greeting(String name);
}
public class Info implements Serializable {
  ...
}
public class CalculationImpl implements Calculation {
  @Override
  public int cube(int number){
    return number*number*number;
  }
  @Override
  public Info greeting(String name) {
    Info res = new Info();
    ...
    return res;
  }
}<beans xmlns="http://www.springframework.org/schema/beans" ...>
  <bean id="calculationBean" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
    <property name="serviceUrl" value="rmi://192.168.100.94:1999/CalculationService"/>
    <property name="serviceInterface" value="com.misc.poc.rmi.Calculation"/>
    <property name="lookupStubOnStartup" value="false"/>
    <property name="refreshStubOnConnectFailure" value="true"/>
  </bean>
</beans> 
Hiç yorum yok:
Yorum Gönder