java - Singleton use in different thread -
i have remote service , an, object (singleton). when call singleton class ui thread , remote service 2 objects. can me?
if have remote service have 2 separate processes. each process has own virtual machine. therefore, singleton class instantiated once in each process.
if need single think whether need remote service. if can implement remote service local service solve problem.
if, on other hand, need single instance shared across 2 separate processes, need instantiate singleton only in remote services process , access via remote calls ui process.
Comments
Post a Comment