org.geotoolkit.factory
Class RecursiveSearchException

Object
  extended by Throwable
      extended by Exception
          extended by RuntimeException
              extended by FactoryRegistryException
                  extended by RecursiveSearchException
All Implemented Interfaces:
Serializable

public class RecursiveSearchException
extends FactoryRegistryException

Thrown when FactoryRegistry is invoked recursively for the same category. This exception is often the result of a programming error. It happen typically when an implementation of some FooFactory interface queries in their constructor, directly or indirectly, getServiceProvider for the same category (namely FooFactory.class). Factories implemented as wrappers around other factories of the same kind are the most likely to fall in this canvas. If this RecursiveSearchException was not throw, the application would typically dies with a StackOverflowError.

A workaround for this exception is to invoke getServiceProvider outside the constuctor, when a method first need it.

Since:
2.3
Version:
3.00
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form
Module:
utility/geotk-utility (download)    View source code for this class

Constructor Summary
RecursiveSearchException(Class<?> category)
          Creates a new exception with a default message determined from the specified category.
RecursiveSearchException(String message)
          Creates a new exception with the specified detail message.
 
Method Summary
 
Methods inherited from class Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RecursiveSearchException

public RecursiveSearchException(String message)
Creates a new exception with the specified detail message.

Parameters:
message - The details message, or null.

RecursiveSearchException

public RecursiveSearchException(Class<?> category)
Creates a new exception with a default message determined from the specified category.

Parameters:
category - The category for which a recursive call is detected.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.