@Override public void assemble( ModuleAssembly module ) throws AssemblyException { ModuleAssembly configModule = module; new EntityTestAssembler().assemble( configModule ); new SecureJettyServiceAssembler().withConfig( configModule, Visibility.layer ).assemble( module ); // START SNIPPET: config 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 ); config.truststorePath().set( getKeyStoreFile( TRUSTSTORE_FILENAME ).getAbsolutePath() ); config.truststoreType().set( "JCEKS" ); config.truststorePassword().set( KS_PASSWORD ); config.wantClientAuth().set( Boolean.TRUE ); // END SNIPPET: config addServlets( serve( "/hello" ).with( HelloWorldServletService.class ) ).to( module ); }
@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 }