Hosted environments, such as Google App Engine, impose additional restrictions on threading. For GPars to integrate with
these environments better, the default thread factory and timer factory can be customized.
The _GPars_Config_ class provides static initialization methods allowing third parties to register their own implementations of
the _PoolFactory_ and _TimerFactory_ interfaces, which will then be used to create default pools and timers for Actors, Dataflow
and PGroups.

{code}
public final class GParsConfig {
    private static volatile PoolFactory poolFactory;
    private static volatile TimerFactory timerFactory;

    public static void setPoolFactory(final PoolFactory pool)

    public static PoolFactory getPoolFactory()

    public static Pool retrieveDefaultPool()

    public static void setTimerFactory(final TimerFactory timerFactory)

    public static TimerFactory getTimerFactory()

    public static GeneralTimer retrieveDefaultTimer(final String name, final boolean daemon)

    public static void shutdown()
}
{code}

The custom factories should be registered immediately after the application startup in order for Actors and Dataflow
to be able to use them for their default groups.

h3. Shutdown

The _GParsConfig.shutdown()_ method can be used in managed environments to properly shutdown all asynchronously run timers
and free the memory from all thread-local variables. After the call to this method the GPars library will no longer provide
the declared services.

h3. Compatibility

Some further compatibility problems may occur when running GPars in a hosted environment. The most noticeable one is probably
 the lack of ForkJoinThreadPool (aka jsr-166y) support in GAE. Functionality such as Fork/Join and GParsPool may thus not be available on some
 services as a result. However, GParsExecutorsPool, Dataflow, Actors, Agents and Stm should work normally
 even when using managed non-Java SE thread pools.
