Package org.apache.tapestry5.ioc
Class RegistryBuilder
- java.lang.Object
-
- org.apache.tapestry5.ioc.RegistryBuilder
-
public final class RegistryBuilder extends Object
Used to construct the IoCRegistry
. This class is not thread-safe. The Registry, once created, is thread-safe.
-
-
Constructor Summary
Constructors Constructor Description RegistryBuilder()
RegistryBuilder(ClassLoader classLoader)
RegistryBuilder(ClassLoader classLoader, LoggerSource loggerSource)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RegistryBuilder
add(Class... moduleClasses)
Adds a number of modules (as module classes) to the registry, returning the builder for further configuration.RegistryBuilder
add(String classname)
Adds a modle class (specified by fully qualified class name) to the registry, returning the builder for further configuration.RegistryBuilder
add(ModuleDef moduleDef)
Adds aModuleDef
to the registry, returning the builder for further configuration.Registry
build()
Constructs and returns the registry; this may only be done once.static Registry
buildAndStartupRegistry(Class... moduleClasses)
Constructs the registry, adds a number of modules (as module classes) to the registry and performs registry startup.static Registry
buildAndStartupRegistry(ModuleDef moduleDef, Class... moduleClasses)
Constructs the registry, adds aModuleDef
and a number of modules (as module classes) to the registry and performs registry startup.ClassLoader
getClassLoader()
org.slf4j.Logger
getLogger()
-
-
-
Constructor Detail
-
RegistryBuilder
public RegistryBuilder()
-
RegistryBuilder
public RegistryBuilder(ClassLoader classLoader)
-
RegistryBuilder
public RegistryBuilder(ClassLoader classLoader, LoggerSource loggerSource)
-
-
Method Detail
-
add
public RegistryBuilder add(ModuleDef moduleDef)
Adds aModuleDef
to the registry, returning the builder for further configuration.
-
add
public RegistryBuilder add(Class... moduleClasses)
Adds a number of modules (as module classes) to the registry, returning the builder for further configuration.- See Also:
ImportModule
-
add
public RegistryBuilder add(String classname)
Adds a modle class (specified by fully qualified class name) to the registry, returning the builder for further configuration.- See Also:
ImportModule
-
build
public Registry build()
Constructs and returns the registry; this may only be done once. The caller is responsible for invokingRegistry.performRegistryStartup()
.
-
getClassLoader
public ClassLoader getClassLoader()
-
getLogger
public org.slf4j.Logger getLogger()
-
buildAndStartupRegistry
public static Registry buildAndStartupRegistry(ModuleDef moduleDef, Class... moduleClasses)
Constructs the registry, adds aModuleDef
and a number of modules (as module classes) to the registry and performs registry startup. The returned registry is ready to use. The caller is must not invokeRegistry.performRegistryStartup()
.
-
buildAndStartupRegistry
public static Registry buildAndStartupRegistry(Class... moduleClasses)
Constructs the registry, adds a number of modules (as module classes) to the registry and performs registry startup. The returned registry is ready to use. The caller is must not invokeRegistry.performRegistryStartup()
.- Parameters:
moduleClasses
- modules (as module classes) to add- Returns:
Registry
- Since:
- 5.2.0
-
-