多个单例对象存在于两个或多个虚拟机中。
多个单例对象被不同的类加载器同时加载。
Multiple singletons simultaneously loaded by different class loaders.
我们正在做的一件事是支持集群的单例服务。
One of the things we are working on is support for clustered singleton services.
那么,要怎么样来使用单例提供者呢?
单例创建模式是一个通用的编程习语。
The Singleton creation pattern is a common programming idiom.
您可以像调用静态方法一样访问单例对象的方法。
You can access methods on singleton objects similar to how you would call static methods.
清单4显示了使用方法而非属性来指定适当类的单例。
Listing 4 shows a version of the singleton that USES a method instead of an attribute to specify the appropriate class.
UI组件和应用对象(这是一个单例)都能收到系统事件。
Both UI components and the Application object (which is a singleton) can receive system events.
静态getInstance方法包含单例的模板代码。
The static getInstance method contains the template code for a singleton.
还记得吗,object表示 Scala中的一个单例。
我坚信,在大多数的框架中,使用单例模式时,考虑得都太少了。
It is my true belief that Singleton patterns have been used with far too little thought in most frameworks.
单例对象被垃圾回收机制回收,然后单例类又被重新加载。
Singleton classes destroyed by garbage collection, then reloaded.
相反您可以定义一个对象(而不是类)并且它将成为类的一个单例实例。
Instead you can define some as an object (instead of a class) and it becomes a singleton instance of the class.
Singletonbean是一个在所属容器上下文中的单例对象。
A singleton bean is a singleton in the context of the owning container.
当该构造方法运行的同时,恰好被另一线程访问,两个单例对象将被创建。
Two singletons will be created if the constructor runs and simultaneously another thread calls the method.
由于子类的实例也是单例类的实例,所以可能出现多个单例实例并存的情况。
Since an instance of a subclass is an instance of your superclass, you could find multiple instances of the singleton.
因此,除非仔细计划,否则应该避免使用JAX - RS资源的单例实例。
Therefore, use of a singleton instance for JAX-RS resources should be avoided unless carefully planned.
他们会发现每次他们要创建一个不同的单例类的时候,都不得不写同样得代码。
Those who use it will find that they often have to write the same code each time they want to create a different Singleton class.
当单例类的副本运行于多个虚拟机中时,每个虚拟机都会为其创建一个实例对象。
When copies of the singleton class run in multiple VMs, an instance is created for each machine.
Spring之前为bean提供了两种作用域:单例和原型(或者叫非单例)。
Spring has traditionally offered two scopes for beans: singleton and Prototype (or non-singleton).
单例模式是一种有用的控制类访问的途径,他能保证只有一个类实例存在。
Singletons are a useful way to control access to a class, making sure that only one instance can exist.
更有甚者,单例对象能够被状态化;这样,它们可以作为一个状态仓库向外提供服务。
Moreover, singletons can be stateful; in this case, their role is to serve as a unique repository of state.
单例、生成器和工厂方法设计模式被视为是创建型的模式,因它们可协助对象的构建。
The singleton, builder, and factory method design patterns are considered creational patterns, as they assist in the construction of objects.
单例模式同样用于控制像数据库连接或者sockets这样的资源访问。
Singletons often control access to resources such as database connections or sockets.
这通常对描述符起到不好的影响,使它类似于一个单例模式(singleton)。
This has the usually undesirable effect of making the descriptor something like a singleton. For example.
然后展示了PHPV5.3的LSB特性,并给出了单例和活动记录设计模式。
Then it shows how PHP V5.3's LSB feature resolves those issues, while showing implementations of the singleton and active record design patterns.
这是一个可用来创建单例类实例确不需要为每个特定的类重写单例模式代码的可重用的类。
This is a class that can be used repeatedly to instantiate a class as a singleton without having to re-write the singleton pattern code for that specific class.
当一个单例对象被当着垃圾回收,然后该单例类又被重新加载,一个新的单例对象被创建。
When a singleton class is garbage-collected and then reloaded, a new singleton instance is created.
不同于书本和培训课程中所提的单例模式,真正的企业具有非常复杂的数据架构。
Unlike the simplistic models in books and training courses, a real enterprise has a very complicated data architecture.
这是一个Scala单例(singleton),因为它使用对象声明,而不是类声明。
This is a Scala singleton because it USES the object declaration instead of a class declaration.
应用推荐