...
The class RegistryBuilder is used to create a Registry.
Code Block |
|
RegistryBuilder builder = new RegistryBuilder();
builder.add(AppModule.class, UtilModule.class);
Registry registry = builder.build();
registry.performRegistryStartup(); |
...
The call to performRegistryStartup() is necessary to ensure that any services marked with the EagerLoad annotation are, in fact, loaded.
As of version 5.2 the class RegistryBuilder has convenience methods to build and start a Registry. The static method RegistryBuilder.buildAndStartupRegistry(Class...) constructs a registry, adds a number of modules to the registry and performs registry startup. The returned registry is ready to use.
Code Block |
|
Registry registry = RegistryBuilder.buildAndStartupRegistry(AppModule.class, UtilModule.class);
|
...
In addition, the JVM system property tapestry.modules
(if specified) is a list of additional module classes to load. This is often used in development, where tests may be executed against the local classes, not JARs, and so there is no manifest to read.
Shutting down the Registry
...