java - how many instances of the class UserHandler will be created in this case? -
in our application using spring rmi concept .
i have question follows
there 1 interface named userhandleri , implementation class userhandler shown below
interface
public interface userhandleri extends remote { public boolean add_user(string message) throws exception; }
and implementation class (userhandler)
public class userhandler implements userhandleri { public abstract boolean add_user(string message) throws exception { // business logic goes here return true ; } }
related above class , interface above , these mentioned in xml file
<bean id="streamer-core" class="com.user.userhandler" scope="singleton" /> <bean id="streamer" class="org.springframework.remoting.rmi.rmiproxyfactorybean"> <property name="serviceurl" value="rmi://${${appl-host}}:${${appl-port}}/app" /> <property name="serviceinterface" value="com.at.userhandler"/> <property name="refreshstubonconnectfailure" value="true"/> <property name="lookupstubonstartup" value="false" /> </bean>
i not sure if missing configuration files ??
my question , how can know how many (instances ) times class userhandler created . singleton ?? can prove ??
thanks in advance .
you have set com.user.userhandler
bean name streamer-core
singleton scope. created 1 bean streamer-core
per 1 application context. more details read: spring documentation:
scopes single bean definition single object instance per spring ioc container.
but related bean. after set com.user.userhandler
seviceinterface rmiproxtfactorybean create 1 more instance com.user.userhandler
.
instance com.user.userhandler creates in rmiproxyfactorybean#afterpropertyset via proxyfactory
Comments
Post a Comment