How to create a cross-process Singleton class in Java

前端 未结 2 1579
囚心锁ツ
囚心锁ツ 2020-12-10 16:21

Is is possible to create a universal Singleton class, which is, at any given time, only one instance is shared across multiple Java processes?

2条回答
  •  时光说笑
    2020-12-10 16:46

    Yes, but not without external facilities. The simplest way is to use RMI. Other options include CORBA or Web Services - Just google it up.

提交回复
热议问题