@Override public void assemble( ModuleAssembly module ) throws AssemblyException { ModuleAssembly configModule = module; new EntityTestAssembler().assemble( configModule ); // START SNIPPET: assemblyssl new SecureJettyServiceAssembler().withConfig( configModule, Visibility.layer ).assemble( module ); // END SNIPPET: assemblyssl // START SNIPPET: configssl SecureJettyConfiguration config = configModule.forMixin( SecureJettyConfiguration.class ).declareDefaults(); config.hostName().set( "127.0.0.1" ); config.port().set( httpsPort ); config.keystorePath().set( getKeyStoreFile( SERVER_KEYSTORE_FILENAME ).getAbsolutePath() ); config.keystoreType().set( "JCEKS" ); config.keystorePassword().set( KS_PASSWORD ); // END SNIPPET: configssl // START SNIPPET: assemblyssl addServlets( serve( "/hello" ).with( HelloWorldServletService.class ) ).to( module ); addFilters( filter( "/*" ).through( UnitOfWorkFilterService.class ).on( REQUEST ) ).to( module ); // END SNIPPET: assemblyssl }
@Override public void assemble( ModuleAssembly module ) { super.assemble( module ); addContextListeners( listen().with( EnvironmentLoaderService.class ) ) .to( module ); addFilters( filter( "/*" ) .through( ShiroFilterService.class ) .on( REQUEST, FORWARD, INCLUDE, ERROR, ASYNC ) ) .to( module ); if( hasConfig() ) { configModule() .entities( ShiroIniConfiguration.class ) .visibleIn( configVisibility() ); } } }
@Override public void assemble( ModuleAssembly module ) { super.assemble( module ); addContextListeners( listen().with( EnvironmentLoaderService.class ) ) .to( module ); addFilters( filter( "/*" ) .through( ShiroFilterService.class ) .on( REQUEST, FORWARD, INCLUDE, ERROR, ASYNC ) ) .to( module ); if( hasConfig() ) { configModule() .entities( ShiroIniConfiguration.class ) .visibleIn( configVisibility() ); } } }
@Override public final void assemble( ModuleAssembly module ) throws AssemblyException { ModuleAssembly configModule = module; new EntityTestAssembler().assemble( configModule ); // START SNIPPET: assembly // Assemble the JettyService new JettyServiceAssembler().withConfig( configModule, Visibility.layer ).assemble( module ); // Set HTTP port as JettyConfiguration default JettyConfiguration config = configModule.forMixin( JettyConfiguration.class ).declareDefaults(); config.hostName().set( "127.0.0.1" ); config.port().set( httpPort ); // Serve /helloWorld with HelloWorldServletService addServlets( serve( "/helloWorld" ).with( HelloWorldServletService.class ) ).to( module ); // Filter requests on /* through provided UnitOfWorkFilterService addFilters( filter( "/*" ).through( UnitOfWorkFilterService.class ).on( REQUEST ) ).to( module ); // END SNIPPET: assembly }
public static FilterAssembler filter( String path ) { return new FilterAssembler( path ); }
public static FilterAssembler filter( String path ) { return new FilterAssembler( path ); }
@SuppressWarnings( "unchecked" ) public void to( ModuleAssembly module ) throws AssemblyException { for ( FilterAssembler filterAssembler : filterAssemblers ) { module.services( filterAssembler.filter() ). setMetaInfo( filterAssembler.filterInfo() ). instantiateOnStartup().visibleIn( layer ); } }
@SuppressWarnings( "unchecked" ) public void to( ModuleAssembly module ) throws AssemblyException { for ( FilterAssembler filterAssembler : filterAssemblers ) { module.services( filterAssembler.filter() ). setMetaInfo( filterAssembler.filterInfo() ). instantiateOnStartup().visibleIn( layer ); } }