javax.jmi.reflect
Class AlreadyExistsException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--javax.jmi.reflect.JmiException
                          |
                          +--javax.jmi.reflect.AlreadyExistsException
All Implemented Interfaces:
java.io.Serializable

public class AlreadyExistsException
extends JmiException

Exception thrown by refCreateInstance and create methods when a client attempts to create the second instance of a singleton.
I think we should rather return the existing instance of singleton from the create method without throwing this exception. This behaviour is more common for singletons.

See Also:
Serialized Form

Constructor Summary
AlreadyExistsException(RefObject existing)
          Constructs new AlreadyExistsException without detail message.
AlreadyExistsException(RefObject existing, java.lang.String msg)
          Constructs an AlreadyExistsException with the specified detail message.
 
Method Summary
 RefObject getExistingInstance()
          Returns existing instance of singleton.
 
Methods inherited from class javax.jmi.reflect.JmiException
getElementInError, getObjectInError
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlreadyExistsException

public AlreadyExistsException(RefObject existing)
Constructs new AlreadyExistsException without detail message.

Parameters:
existing - existing singleton instance

AlreadyExistsException

public AlreadyExistsException(RefObject existing,
                              java.lang.String msg)
Constructs an AlreadyExistsException with the specified detail message.

Parameters:
existing - existing singleton instance
msg - the detail message.
Method Detail

getExistingInstance

public RefObject getExistingInstance()
Returns existing instance of singleton.

Returns:
existing singleton instance