public void assemble( ModuleAssembly module )
throws AssemblyException
{
try
{
ModuleAssembly configModule = module;
new EntityTestAssembler().assemble( configModule );
// START SNIPPET: assembly
new JettyServiceAssembler().withConfig( configModule, Visibility.layer ).assemble( module );
// END SNIPPET: assembly
port = FreePortFinder.findFreePortOnLoopback();
JettyConfiguration config = module.forMixin( JettyConfiguration.class ).declareDefaults();
config.hostName().set( "127.0.0.1" );
config.port().set( port );
// START SNIPPET: assembly
new HttpShiroAssembler().
withConfig( configModule, Visibility.layer ).
assemble( module );
module.services( MyRealmService.class );
// END SNIPPET: assembly
configModule.forMixin( ShiroIniConfiguration.class ).
declareDefaults().
iniResourcePath().set( "classpath:web-shiro.ini" );
addServlets( serve( "/*" ).with( MyServletService.class ) ).to( module );
}