net.sf.mmm.util.context.api
Interface GenericContextFactory

All Known Implementing Classes:
AbstractGenericContextFactory, GenericContextFactoryImpl

@ComponentSpecification
public interface GenericContextFactory

This is the interface for a factory of generic contexts.

Since:
1.1.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Method Summary
 MutableGenericContext createContext()
          This method creates a new instance of a MutableGenericContext.
 MutableGenericContext createContext(MapFactory<? extends Map> mapFactory)
          This method creates a new instance of a MutableGenericContext using the given MapFactory.
 MutableGenericContext createContext(MapFactory<? extends Map> mapFactory, GenericValueConverter<Object> valueConverter)
          This method creates a new instance of a MutableGenericContext using the given MapFactory.
 

Method Detail

createContext

MutableGenericContext createContext()
This method creates a new instance of a MutableGenericContext. It will use a HashMapFactory and delegate to createContext(MapFactory).
ATTENTION:
Such context is usually suitable even if child-contexts are created and passed to other threads while the original thread is modifying the original context as proved in the according test-case. However HashMap.get(Object) is not academically thread-safe so if you need mission-critical safety, you might want to pass ConcurrentHashMapFactory to createContext(MapFactory).

Returns:
the new context.

createContext

MutableGenericContext createContext(MapFactory<? extends Map> mapFactory)
This method creates a new instance of a MutableGenericContext using the given MapFactory.

Parameters:
mapFactory - is the factory used to create maps for the underlying context.
Returns:
the new context.

createContext

MutableGenericContext createContext(MapFactory<? extends Map> mapFactory,
                                    GenericValueConverter<Object> valueConverter)
This method creates a new instance of a MutableGenericContext using the given MapFactory.

Parameters:
mapFactory - is the factory used to create maps for the underlying context.
valueConverter - is the GenericValueConverter used for converting variables if requested for a different type.
Returns:
the new context.
Since:
2.0.0


Copyright © 2001-2010 mmm-Team. All Rights Reserved.