Package be.gaudry.model.exception
Class SingletonException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
be.gaudry.model.exception.IllegalInstanceException
be.gaudry.model.exception.SingletonException
- All Implemented Interfaces:
Serializable
Thrown when trying to build a second instance of a singleton class.
\nThe instance field must be final and initialized on a static bloc; this exception
is thrown by the constructor if the instance is not null.
\nIf the instance is built on a lazy way, a boolean field may be used to know if the
instance is initialized, and initialize the instance at the first lazy call.
- Since:
- 1.0 (Nov 26, 2010), broldev.core.model 0.0.1-SNAPSHOT dependency
- Version:
- 1.0 (Nov 26, 2010)
- Author:
- Steph GAUDRY
- See Also:
Provided by the broldev.core.model project.
, Serialized Form
-
Constructor Summary
ConstructorDescriptionBuilds an instance of this exception without specifying the class that is at faultSingletonException(Class<?> nonInstanciableClass)
Builds an instance of the exception with the class that an instance is trying to be created -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SingletonException
public SingletonException()Builds an instance of this exception without specifying the class that is at fault -
SingletonException
Builds an instance of the exception with the class that an instance is trying to be created- Parameters:
nonInstanciableClass
- class than an instance may not be built
-