//Interface
public interface rmservice
{
}
//Interface Implmentation
public class rmserviceimpl implements rmservice
{
public rmserviceimpl()
{
System.
out.
println("constructor ok");
}
{
return "Hai " this.greeting a;
}
public void setGreeting
(String a
)
{
greeting=a;
}
}
//rmservice.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/ spring-beans.dtd">
<beans>
<bean id="rmservice" class="rmserviceimpl">
<property name="greeting">
<value>Good Morning!...</value>
</property>
</bean>
</beans>
//Client
import java.io.*;
import org.springframework.beans.factory.*;
import org.springframework.beans.factory.xml.*;
import org.springframework.core.io.*;
public class rmserviceclient
{
public static void main
(String args
[])
{
try
{
Resource res = new ClassPathResource("rmservice.xml");
BeanFactory factory = new XmlBeanFactory(res);
System.
out.
println("factory created");
rmservice bean1 = (rmservice)factory.getBean("rmservice");
String s = bean1.
getresult(args
[0]);
}
}
}