├── chapter05-aspectj-aspects ├── settings.gradle └── src │ └── main │ └── java │ └── com │ └── apress │ └── prospring5 │ └── ch5 │ ├── MessageWriter.java │ └── AspectJDemo.java ├── chapter04 ├── property-editors │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── test.txt │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch4 │ │ │ └── custom │ │ │ └── NamePropertyEditor.java │ └── build.gradle ├── resource │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── test.txt │ └── build.gradle ├── boot-web │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── banner.txt │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch4 │ │ └── ctrl │ │ └── HelloWorld.java ├── java-config-message-provider │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── message.properties │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch4 │ │ │ └── multiple │ │ │ └── AppConfigFour.java │ └── build.gradle ├── message-source │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── labels_en.properties │ │ │ └── labels_ko_KR.properties │ └── build.gradle ├── property-placeholder │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ └── build.gradle ├── jsr330 │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch4 │ │ │ ├── MessageProvider.java │ │ │ └── MessageRenderer.java │ └── build.gradle ├── groovy-config-java │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── beans.groovy │ └── 에러시 조치방법.txt ├── profiles │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── prospring5 │ │ │ │ └── ch4 │ │ │ │ ├── FoodProviderService.java │ │ │ │ └── Food.java │ │ │ └── resources │ │ │ └── spring │ │ │ ├── highschool-config.xml │ │ │ └── kindergarten-config.xml │ └── build.gradle ├── events │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch4 │ │ │ ├── MessageEventListener.java │ │ │ └── MessageEvent.java │ │ └── resources │ │ └── spring │ │ └── app-context-xml.xml ├── bean-init-method │ └── build.gradle ├── environment │ └── build.gradle ├── factory-bean │ └── build.gradle ├── post-construct │ └── build.gradle ├── initializing-bean-destroy │ └── build.gradle ├── initializing-bean │ └── build.gradle ├── shutdown-hook │ └── build.gradle ├── disposable-bean │ └── build.gradle ├── boot-simple │ └── src │ │ └── main │ │ ├── resources │ │ └── banner.txt │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch4 │ │ └── HelloWorld.java ├── post-construct-pre-destroy │ └── build.gradle ├── application-context-aware │ └── build.gradle ├── factory-bean-and-factory-method-attributes │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch4 │ │ └── MessageDigestFactory.java ├── bean-name-aware │ ├── build.gradle │ └── src │ │ └── main │ │ ├── resources │ │ └── spring │ │ │ └── app-context-xml.xml │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch4 │ │ ├── NamedSinger.java │ │ └── NamedSingerDemo.java ├── java-config │ └── build.gradle ├── groovy-config │ ├── build.gradle │ └── src │ │ └── main │ │ └── groovy │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch4 │ │ └── GroovyConfig.groovy └── chapter04.gradle ├── chapter13 ├── junit5-test │ └── src │ │ └── test │ │ └── resources │ │ └── db │ │ ├── clean-up.sql │ │ └── test-data.sql ├── integration-test │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── prospring5 │ │ │ │ └── ch13 │ │ │ │ └── SingerServiceImplTest.xls │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch13 │ │ │ └── DataSets.java │ └── build.gradle ├── base-test │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch13 │ │ ├── repos │ │ └── SingerRepository.java │ │ └── services │ │ └── SingerService.java └── mvc-unit-test │ └── build.gradle ├── chapter18 ├── integration │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── support │ │ │ ├── singers3.csv │ │ │ ├── singers1.csv │ │ │ ├── singers4.csv │ │ │ ├── singers2.csv │ │ │ └── singer.sql │ └── build.gradle ├── integration-cfg │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── support │ │ │ ├── singers3.csv │ │ │ ├── singers1.csv │ │ │ ├── singers4.csv │ │ │ ├── singers2.csv │ │ │ └── singer.sql │ └── build.gradle ├── batch-boot │ └── src │ │ └── main │ │ └── resources │ │ ├── application.properties │ │ ├── support │ │ ├── test-data.csv │ │ └── singer.sql │ │ └── banner.txt ├── xd │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── support │ │ │ ├── singers.csv │ │ │ ├── jdbc.properties │ │ │ └── ddl.sql │ └── build.gradle ├── batch │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── support │ │ │ ├── test-data.csv │ │ │ └── singer.sql │ └── build.gradle ├── batch-cfg │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── support │ │ │ ├── test-data.csv │ │ │ └── singer.sql │ └── build.gradle ├── batch-jsr352 │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── support │ │ │ ├── test-data.csv │ │ │ └── singer.sql │ └── build.gradle ├── webflux │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch18 │ │ └── repos │ │ ├── SingerRepository.java │ │ └── ReactiveSingerRepo.java ├── webflux-boot │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch18 │ │ │ └── repos │ │ │ ├── SingerRepository.java │ │ │ └── ReactiveSingerRepo.java │ │ └── resources │ │ └── banner.txt └── boot-tests │ └── src │ ├── main │ ├── resources │ │ └── banner.txt │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch18 │ │ └── FluxGenerator.java │ └── test │ └── java │ └── com │ └── apress │ └── prospring5 │ └── ch18 │ └── test │ └── config │ └── TestConfig.java ├── chapter12 ├── rest │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── castor.properties │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch12 │ │ │ └── CustomCredentialsProvider.java │ └── build.gradle ├── secure-rest │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── castor.properties │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch12 │ │ │ ├── init │ │ │ └── SecurityWebApplicationInitializer.java │ │ │ └── CustomCredentialsProvider.java │ └── build.gradle ├── boot-jms │ └── src │ │ └── main │ │ └── resources │ │ ├── application.properties │ │ └── banner.txt ├── jms-artemis │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch12 │ │ │ └── MessageSender.java │ └── build.gradle ├── jms-hornetq │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch12 │ │ │ └── MessageSender.java │ └── build.gradle ├── boot-amqp │ └── src │ │ └── main │ │ └── resources │ │ └── banner.txt ├── boot-rest │ └── src │ │ └── main │ │ ├── resources │ │ └── banner.txt │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch12 │ │ ├── repos │ │ └── SingerRepository.java │ │ └── services │ │ └── SingerService.java ├── base-remote │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch12 │ │ ├── repos │ │ └── SingerRepository.java │ │ └── services │ │ └── SingerService.java ├── amqp-rpc │ └── build.gradle └── spring-invoker │ ├── build.gradle │ └── src │ └── main │ └── java │ └── com │ └── apress │ └── prospring5 │ └── ch12 │ └── config │ └── WebConfig.java ├── chapter15 ├── jmx │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── castor.properties │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch15 │ │ │ ├── AppStatistics.java │ │ │ └── AppStatisticsImpl.java │ └── build.gradle └── boot-jmx │ └── src │ └── main │ ├── java │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch15 │ │ ├── AppStatistics.java │ │ ├── repos │ │ └── SingerRepository.java │ │ └── services │ │ └── SingerService.java │ └── resources │ └── banner.txt ├── chapter16 ├── singer-webapp-jcfg │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── standard.properties │ │ │ ├── webapp │ │ │ ├── ckeditor │ │ │ │ ├── samples │ │ │ │ │ ├── assets │ │ │ │ │ │ ├── sample.css │ │ │ │ │ │ ├── sample.jpg │ │ │ │ │ │ └── inlineall │ │ │ │ │ │ │ └── logo.png │ │ │ │ │ └── plugins │ │ │ │ │ │ └── htmlwriter │ │ │ │ │ │ └── assets │ │ │ │ │ │ └── outputforflash │ │ │ │ │ │ ├── outputforflash.fla │ │ │ │ │ │ └── outputforflash.swf │ │ │ │ ├── plugins │ │ │ │ │ ├── icons.png │ │ │ │ │ ├── icons_hidpi.png │ │ │ │ │ ├── link │ │ │ │ │ │ └── images │ │ │ │ │ │ │ ├── anchor.png │ │ │ │ │ │ │ └── hidpi │ │ │ │ │ │ │ └── anchor.png │ │ │ │ │ ├── image │ │ │ │ │ │ └── images │ │ │ │ │ │ │ └── noimage.png │ │ │ │ │ ├── magicline │ │ │ │ │ │ └── images │ │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ │ └── hidpi │ │ │ │ │ │ │ └── icon.png │ │ │ │ │ ├── about │ │ │ │ │ │ └── dialogs │ │ │ │ │ │ │ ├── logo_ckeditor.png │ │ │ │ │ │ │ └── hidpi │ │ │ │ │ │ │ └── logo_ckeditor.png │ │ │ │ │ └── dialog │ │ │ │ │ │ └── dialogDefinition.js │ │ │ │ └── skins │ │ │ │ │ └── moono │ │ │ │ │ ├── icons.png │ │ │ │ │ ├── icons_hidpi.png │ │ │ │ │ └── images │ │ │ │ │ ├── lock.png │ │ │ │ │ ├── arrow.png │ │ │ │ │ ├── close.png │ │ │ │ │ ├── refresh.png │ │ │ │ │ ├── lock-open.png │ │ │ │ │ └── hidpi │ │ │ │ │ ├── close.png │ │ │ │ │ ├── lock.png │ │ │ │ │ ├── refresh.png │ │ │ │ │ └── lock-open.png │ │ │ ├── images │ │ │ │ └── banner.png │ │ │ ├── styles │ │ │ │ └── custom-theme │ │ │ │ │ └── images │ │ │ │ │ ├── ui-icons_444444_256x240.png │ │ │ │ │ ├── ui-icons_555555_256x240.png │ │ │ │ │ ├── ui-icons_777620_256x240.png │ │ │ │ │ ├── ui-icons_777777_256x240.png │ │ │ │ │ ├── ui-icons_cc0000_256x240.png │ │ │ │ │ └── ui-icons_ffffff_256x240.png │ │ │ ├── jqgrid │ │ │ │ └── plugins │ │ │ │ │ └── searchFilter.css │ │ │ └── WEB-INF │ │ │ │ └── i18n │ │ │ │ └── messages.properties │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch16 │ │ │ ├── config │ │ │ └── WebConfig.java │ │ │ ├── web │ │ │ └── SingerController.java │ │ │ ├── repos │ │ │ └── SingerRepository.java │ │ │ ├── init │ │ │ └── SecurityWebApplicationInitializer.java │ │ │ ├── util │ │ │ └── Message.java │ │ │ └── services │ │ │ └── SingerService.java │ └── build.gradle ├── singer-webapp-xml │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── standard.properties │ │ │ └── sql │ │ │ │ └── schema.sql │ │ │ ├── webapp │ │ │ ├── ckeditor │ │ │ │ ├── samples │ │ │ │ │ ├── assets │ │ │ │ │ │ ├── sample.css │ │ │ │ │ │ ├── sample.jpg │ │ │ │ │ │ └── inlineall │ │ │ │ │ │ │ └── logo.png │ │ │ │ │ └── plugins │ │ │ │ │ │ └── htmlwriter │ │ │ │ │ │ └── assets │ │ │ │ │ │ └── outputforflash │ │ │ │ │ │ ├── outputforflash.fla │ │ │ │ │ │ └── outputforflash.swf │ │ │ │ ├── plugins │ │ │ │ │ ├── icons.png │ │ │ │ │ ├── icons_hidpi.png │ │ │ │ │ ├── link │ │ │ │ │ │ └── images │ │ │ │ │ │ │ ├── anchor.png │ │ │ │ │ │ │ └── hidpi │ │ │ │ │ │ │ └── anchor.png │ │ │ │ │ ├── image │ │ │ │ │ │ └── images │ │ │ │ │ │ │ └── noimage.png │ │ │ │ │ ├── magicline │ │ │ │ │ │ └── images │ │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ │ └── hidpi │ │ │ │ │ │ │ └── icon.png │ │ │ │ │ ├── about │ │ │ │ │ │ └── dialogs │ │ │ │ │ │ │ ├── logo_ckeditor.png │ │ │ │ │ │ │ └── hidpi │ │ │ │ │ │ │ └── logo_ckeditor.png │ │ │ │ │ └── dialog │ │ │ │ │ │ └── dialogDefinition.js │ │ │ │ └── skins │ │ │ │ │ └── moono │ │ │ │ │ ├── icons.png │ │ │ │ │ ├── icons_hidpi.png │ │ │ │ │ └── images │ │ │ │ │ ├── arrow.png │ │ │ │ │ ├── close.png │ │ │ │ │ ├── lock.png │ │ │ │ │ ├── refresh.png │ │ │ │ │ ├── hidpi │ │ │ │ │ ├── lock.png │ │ │ │ │ ├── close.png │ │ │ │ │ ├── refresh.png │ │ │ │ │ └── lock-open.png │ │ │ │ │ └── lock-open.png │ │ │ ├── images │ │ │ │ └── banner.png │ │ │ ├── styles │ │ │ │ └── custom-theme │ │ │ │ │ └── images │ │ │ │ │ ├── ui-icons_444444_256x240.png │ │ │ │ │ ├── ui-icons_555555_256x240.png │ │ │ │ │ ├── ui-icons_777620_256x240.png │ │ │ │ │ ├── ui-icons_777777_256x240.png │ │ │ │ │ ├── ui-icons_cc0000_256x240.png │ │ │ │ │ └── ui-icons_ffffff_256x240.png │ │ │ ├── jqgrid │ │ │ │ └── plugins │ │ │ │ │ └── searchFilter.css │ │ │ └── WEB-INF │ │ │ │ └── i18n │ │ │ │ └── messages.properties │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch16 │ │ │ ├── repos │ │ │ └── SingerRepository.java │ │ │ ├── util │ │ │ └── Message.java │ │ │ └── services │ │ │ └── SingerService.java │ └── build.gradle └── singer-webapp-boot │ └── src │ └── main │ ├── resources │ ├── application.properties │ ├── static │ │ └── images │ │ │ └── banner.png │ ├── banner.txt │ └── templates │ │ └── fragments │ │ └── footer.html │ └── java │ └── com │ └── apress │ └── prospring5 │ └── ch16 │ ├── repos │ └── SingerRepository.java │ └── services │ └── SingerService.java ├── document └── images │ ├── cover_front.jpg │ └── cover_front.png ├── chapter07 ├── hibernate-crud │ ├── build.gradle │ └── src │ │ └── main │ │ ├── resources │ │ └── db │ │ │ └── jdbc.properties │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch7 │ │ └── dao │ │ ├── InstrumentDao.java │ │ └── SingerDao.java ├── hibernate-base │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch7 │ │ └── dao │ │ └── SingerDao.java └── chapter07.gradle ├── chapter09 ├── boot-jta │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── banner.txt │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch9 │ │ ├── services │ │ └── SingerService.java │ │ ├── repos │ │ └── SingerRepository.java │ │ └── ex │ │ └── AsyncXAResourcesException.java ├── transactions-jta │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch9 │ │ │ └── ex │ │ │ └── AsyncXAResourcesException.java │ └── build.gradle ├── base-dao │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch9 │ │ ├── services │ │ └── SingerService.java │ │ └── repos │ │ ├── AlbumRepository.java │ │ └── SingerRepository.java ├── transactions-programmatic │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch9 │ │ │ └── services │ │ │ └── SingerService.java │ └── build.gradle ├── transactions-xml │ └── build.gradle └── transactions-annotation │ └── build.gradle ├── chapter08 ├── jpa-criteria │ ├── 프로젝트 빌드방법.docx │ ├── .factorypath │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch8 │ │ └── SingerService.java ├── jpa-crud │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch8 │ │ │ └── service │ │ │ ├── SingerSummaryService.java │ │ │ └── SingerService.java │ └── build.gradle ├── boot-jpa │ └── src │ │ └── main │ │ ├── resources │ │ └── banner.txt │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch8 │ │ ├── InstrumentRepository.java │ │ └── SingerRepository.java ├── hibernate-envers │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── prospring5 │ │ │ │ └── ch8 │ │ │ │ ├── CustomDefaultRevisionEntity.java │ │ │ │ ├── repos │ │ │ │ └── SingerAuditRepository.java │ │ │ │ ├── AuditorAwareBean.java │ │ │ │ └── services │ │ │ │ └── SingerAuditService.java │ │ │ └── resources │ │ │ └── db │ │ │ └── test-data.sql │ └── build.gradle ├── spring-data-jpa-audit │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── prospring5 │ │ │ │ └── ch8 │ │ │ │ ├── repos │ │ │ │ └── SingerAuditRepository.java │ │ │ │ ├── services │ │ │ │ └── SingerAuditService.java │ │ │ │ └── AuditorAwareBean.java │ │ │ └── resources │ │ │ └── db │ │ │ ├── test-data.sql │ │ │ └── schema.sql │ └── build.gradle ├── spring-data-jpa-alt │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch8 │ │ │ ├── repos │ │ │ ├── InstrumentRepository.java │ │ │ └── SingerRepository.java │ │ │ └── services │ │ │ ├── SingerService.java │ │ │ └── AlbumService.java │ └── build.gradle └── spring-data-jpa │ ├── src │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch8 │ │ ├── SingerService.java │ │ └── SingerRepository.java │ └── build.gradle ├── chapter03 ├── injection │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch3 │ │ │ ├── Encyclopedia.java │ │ │ ├── Oracle.java │ │ │ └── BookwormOracle.java │ └── build.gradle ├── bean-autowiring │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch3 │ │ │ ├── xml │ │ │ ├── Bar.java │ │ │ ├── Foo.java │ │ │ └── complicated │ │ │ │ ├── Foo.java │ │ │ │ ├── FooImpl1.java │ │ │ │ └── FooImpl2.java │ │ │ ├── sandbox │ │ │ ├── Foo.java │ │ │ ├── Bar.java │ │ │ ├── FooImplTwo.java │ │ │ └── FooImplOne.java │ │ │ └── annotated │ │ │ └── Guitar.java │ └── build.gradle ├── collections │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch3 │ │ │ ├── Recipient.java │ │ │ ├── ContentHolder.java │ │ │ ├── ArtworkSender.java │ │ │ ├── xml │ │ │ └── LyricHolder.java │ │ │ ├── FtpArtworkSender.java │ │ │ └── annotated │ │ │ └── LyricHolder.java │ └── build.gradle ├── setter-injection │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── prospring5 │ │ │ │ └── ch3 │ │ │ │ ├── Dependency.java │ │ │ │ ├── Encyclopedia.java │ │ │ │ ├── Oracle.java │ │ │ │ ├── NewsletterSender.java │ │ │ │ ├── SetterInjection.java │ │ │ │ ├── annotated │ │ │ │ ├── HelloWorldMessageProvider.java │ │ │ │ └── HelloWorldConfiguration.java │ │ │ │ ├── mixed │ │ │ │ └── HelloWorldConfiguration.java │ │ │ │ └── BookwormOracle.java │ │ │ └── resources │ │ │ └── spring │ │ │ └── xml-bean-factory-config.xml │ └── build.gradle ├── constructor-injection │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch3 │ │ │ ├── Dependency.java │ │ │ └── ConstructorInjection.java │ └── build.gradle ├── cdl │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch3 │ │ │ ├── Container.java │ │ │ ├── ManagedComponent.java │ │ │ ├── Dependency.java │ │ │ ├── DefaultContainer.java │ │ │ ├── CDLDemo.java │ │ │ └── ContextualizedDependencyLookup.java │ └── build.gradle ├── method-injection │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch3 │ │ │ ├── DemoBean.java │ │ │ ├── annotated │ │ │ ├── DemoBean.java │ │ │ └── AbstractLookupDemoBean.java │ │ │ ├── AbstractLookupDemoBean.java │ │ │ ├── Singer.java │ │ │ └── StandardLookupDemoBean.java │ └── build.gradle ├── nesting │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch3 │ │ │ └── Song.java │ │ └── resources │ │ └── spring │ │ └── parent-context.xml ├── bean-aliases │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── prospring5 │ │ │ │ └── ch3 │ │ │ │ └── annotated │ │ │ │ └── Trophy.java │ │ └── resources │ │ │ └── spring │ │ │ ├── app-context-02.xml │ │ │ └── app-context-03.xml │ │ └── test │ │ └── resources │ │ └── spring │ │ └── app-context-01.xml ├── method-replacement │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch3 │ │ └── ReplacementTarget.java ├── bean-inheritance │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch3 │ │ └── xml │ │ └── Singer.java ├── bean-instantiation-mode │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch3 │ │ │ └── Singleton.java │ │ └── resources │ │ └── spring │ │ └── app-context-xml.xml ├── simple-types │ └── build.gradle ├── field-injection │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch3 │ │ └── annotated │ │ └── Singer.java ├── chapter03.gradle └── dependency-pull │ └── build.gradle ├── chapter06 ├── spring-boot-jdbc │ └── src │ │ └── main │ │ └── resources │ │ ├── application.properties │ │ └── banner.txt ├── spring-jdbc-annotations │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── db │ │ │ ├── jdbc2.properties │ │ │ └── jdbc.properties │ │ │ └── sql │ │ │ └── stored-function.sql │ └── build.gradle ├── spring-jdbc-embedded │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── db │ │ │ └── jdbc.properties │ └── build.gradle ├── spring-jdbc-rowmapper │ └── build.gradle ├── spring-jdbc-namedparam │ └── build.gradle ├── spring-jdbc-resultsetextractor │ └── build.gradle ├── plain-jdbc │ ├── build.gradle │ └── src │ │ └── main │ │ └── resources │ │ └── db │ │ └── ddl.sql └── chapter06.gradle ├── chapter14 ├── groovy-spring │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── prospring5 │ │ │ │ └── ch14 │ │ │ │ ├── RuleFactory.java │ │ │ │ ├── RuleEngine.java │ │ │ │ └── SingerService.java │ │ │ └── groovy │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch14 │ │ │ └── Rule.groovy │ └── 에러시 조치방법.txt ├── script-engines │ └── build.gradle ├── base-groovy │ ├── src │ │ └── main │ │ │ └── groovy │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch14 │ │ │ └── Singer.groovy │ └── build.gradle └── chapter14.gradle ├── chapter02 ├── hello-world │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── msf.properties │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch2 │ │ │ ├── decoupled │ │ │ ├── MessageProvider.java │ │ │ ├── MessageRenderer.java │ │ │ ├── HelloWorldDecoupled.java │ │ │ ├── HelloWorldMessageProvider.java │ │ │ └── HelloWorldDecoupledWithFactory.java │ │ │ ├── common │ │ │ ├── Singer.java │ │ │ ├── GiftedSinger.java │ │ │ └── Guitar.java │ │ │ ├── HelloWorld.java │ │ │ └── HelloWorldWithCommandLine.java │ └── build.gradle └── chapter02.gradle ├── chapter05 ├── cglib-performance │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch5 │ │ │ ├── SimpleBean.java │ │ │ ├── NoOpBeforeAdvice.java │ │ │ ├── DefaultSimpleBean.java │ │ │ └── TestPointcut.java │ └── build.gradle ├── aop-hello-world │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch5 │ │ │ ├── introduction │ │ │ ├── IsModified.java │ │ │ └── IsModifiedAdvisor.java │ │ │ ├── Agent.java │ │ │ ├── SimpleBeforeAdvice.java │ │ │ └── AgentDecorator.java │ └── build.gradle ├── cflow-pointcuts │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch5 │ │ │ └── TestBean.java │ └── build.gradle ├── security │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch5 │ │ ├── SecureBean.java │ │ ├── UserInfo.java │ │ └── SecurityManager.java ├── simple-around-advice │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch5 │ │ └── WorkerBean.java ├── simple-throws-advice │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch5 │ │ └── ErrorBean.java ├── after-returning-advice-keygen │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch5 │ │ └── KeyGenerator.java ├── aspectj-boot │ └── src │ │ └── main │ │ ├── resources │ │ └── banner.txt │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch5 │ │ └── Guitar.java ├── dynamic-pointcut │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch5 │ │ │ └── SampleBean.java │ └── build.gradle ├── proxyfactorybean │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch5 │ │ │ ├── Documentarist.java │ │ │ └── AuditAdvice.java │ └── build.gradle ├── aspectj-annotations │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch5 │ │ └── AppConfig.java ├── static-pointcut │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch5 │ │ │ ├── GreatGuitarist.java │ │ │ └── GoodGuitarist.java │ └── build.gradle ├── annotation-pointcut │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch5 │ │ │ └── AdviceRequired.java │ └── build.gradle ├── simple-after-returning-advice │ └── build.gradle ├── simple-before-advice │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch5 │ │ │ └── Guitarist.java │ └── build.gradle ├── aop-namespace │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch5 │ │ ├── SimpleAdvice.java │ │ └── NewDocumentarist.java ├── regex-pointcuts │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch5 │ │ └── Guitarist.java ├── simple-name-matching │ └── build.gradle ├── modification-introduction │ └── build.gradle ├── proxyfactorybean-introduction │ └── build.gradle ├── composable-pointcut │ └── build.gradle ├── aspectj-regex-pointcuts │ └── build.gradle └── chapter05.gradle ├── chapter10 ├── converter │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ └── build.gradle ├── property-editor │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ └── build.gradle ├── custom-formatter │ └── build.gradle ├── spring-validator │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch10 │ │ └── config │ │ └── AppConfig.java ├── converter-multiple-types │ └── build.gradle ├── jsr349 │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch10 │ │ │ └── obj │ │ │ ├── Gender.java │ │ │ └── Genre.java │ └── build.gradle ├── jsr349-custom │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch10 │ │ │ └── obj │ │ │ ├── Gender.java │ │ │ └── Genre.java │ └── build.gradle └── jsr349-assertTrue │ ├── src │ └── main │ │ └── java │ │ └── com │ │ └── apress │ │ └── prospring5 │ │ └── ch10 │ │ └── obj │ │ ├── Gender.java │ │ └── Genre.java │ └── build.gradle ├── chapter11 ├── async-task │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch11 │ │ │ └── AsyncService.java │ └── build.gradle ├── base-task │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── prospring5 │ │ │ └── ch11 │ │ │ ├── repos │ │ │ └── CarRepository.java │ │ │ └── services │ │ │ └── CarService.java │ └── build.gradle ├── task-executor │ └── build.gradle ├── scheduled-task │ └── build.gradle └── scheduled-task-annotation │ └── build.gradle ├── chapter17 ├── stomp │ └── build.gradle ├── sockjs │ └── build.gradle ├── websocket-api │ └── build.gradle ├── sockjs-cfg │ └── build.gradle ├── stomp-cfg │ └── build.gradle └── websocket-api-cfg │ └── build.gradle └── .gitignore /chapter05-aspectj-aspects/settings.gradle: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter04/property-editors/src/main/resources/test.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter04/resource/src/main/resources/test.txt: -------------------------------------------------------------------------------- 1 | Dreaming with a Broken Heart -------------------------------------------------------------------------------- /chapter13/junit5-test/src/test/resources/db/clean-up.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM SINGER; -------------------------------------------------------------------------------- /chapter18/integration/src/main/resources/support/singers3.csv: -------------------------------------------------------------------------------- 1 | John,Butler,Ocean 2 | -------------------------------------------------------------------------------- /chapter12/rest/src/main/resources/castor.properties: -------------------------------------------------------------------------------- 1 | org.exolab.castor.indent=true 2 | -------------------------------------------------------------------------------- /chapter15/jmx/src/main/resources/castor.properties: -------------------------------------------------------------------------------- 1 | org.exolab.castor.indent=true 2 | -------------------------------------------------------------------------------- /chapter18/integration-cfg/src/main/resources/support/singers3.csv: -------------------------------------------------------------------------------- 1 | John,Butler,Ocean 2 | -------------------------------------------------------------------------------- /chapter18/integration/src/main/resources/support/singers1.csv: -------------------------------------------------------------------------------- 1 | John,Mayer,Helpless 2 | -------------------------------------------------------------------------------- /chapter12/secure-rest/src/main/resources/castor.properties: -------------------------------------------------------------------------------- 1 | org.exolab.castor.indent=true 2 | -------------------------------------------------------------------------------- /chapter18/integration-cfg/src/main/resources/support/singers1.csv: -------------------------------------------------------------------------------- 1 | John,Mayer,Helpless 2 | -------------------------------------------------------------------------------- /chapter18/integration/src/main/resources/support/singers4.csv: -------------------------------------------------------------------------------- 1 | BB,King,Chains And Things 2 | -------------------------------------------------------------------------------- /chapter18/integration-cfg/src/main/resources/support/singers4.csv: -------------------------------------------------------------------------------- 1 | BB,King,Chains And Things 2 | -------------------------------------------------------------------------------- /chapter18/integration/src/main/resources/support/singers2.csv: -------------------------------------------------------------------------------- 1 | Eric,Clapton,Change The World 2 | -------------------------------------------------------------------------------- /chapter04/boot-web/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | management.endpoints.web.exposure.include=* -------------------------------------------------------------------------------- /chapter18/integration-cfg/src/main/resources/support/singers2.csv: -------------------------------------------------------------------------------- 1 | Eric,Clapton,Change The World 2 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/resources/standard.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/standard.css 2 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/resources/standard.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/standard.css 2 | -------------------------------------------------------------------------------- /document/images/cover_front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/document/images/cover_front.jpg -------------------------------------------------------------------------------- /document/images/cover_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/document/images/cover_front.png -------------------------------------------------------------------------------- /chapter04/java-config-message-provider/src/main/resources/message.properties: -------------------------------------------------------------------------------- 1 | message=Only hope can keep me together 2 | -------------------------------------------------------------------------------- /chapter07/hibernate-crud/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter06:plain-jdbc') 3 | compile db.dbcp2 4 | } -------------------------------------------------------------------------------- /chapter09/boot-jta/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.artemis.embedded.queues=singers 2 | spring.jta.log-dir=out -------------------------------------------------------------------------------- /chapter18/batch-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.schema=classpath:support/*.sql 2 | 3 | 4 | -------------------------------------------------------------------------------- /chapter08/jpa-criteria/프로젝트 빌드방법.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter08/jpa-criteria/프로젝트 빌드방법.docx -------------------------------------------------------------------------------- /chapter16/singer-webapp-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | spring.jpa.hibernate.ddl-auto=create-drop -------------------------------------------------------------------------------- /chapter12/boot-jms/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.artemis.mode=embedded 2 | spring.artemis.embedded.queues=prospring5 -------------------------------------------------------------------------------- /chapter04/message-source/src/main/resources/labels_en.properties: -------------------------------------------------------------------------------- 1 | msg=My stupid mouth has got me in trouble 2 | nameMsg=My name is {0} {1} 3 | -------------------------------------------------------------------------------- /chapter04/property-placeholder/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | application.home=application_home 2 | user.home=/home/jules-new 3 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/assets/sample.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Required by tests (dom/document.html). 3 | */ 4 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/assets/sample.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Required by tests (dom/document.html). 3 | */ 4 | -------------------------------------------------------------------------------- /chapter18/xd/src/main/resources/support/singers.csv: -------------------------------------------------------------------------------- 1 | John,Mayer,Helpless 2 | Eric,Clapton,Change The World 3 | John,Butler,Ocean 4 | BB,King,Chains And Things -------------------------------------------------------------------------------- /chapter03/injection/src/main/java/com/apress/prospring5/ch3/Encyclopedia.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class Encyclopedia { 4 | 5 | } -------------------------------------------------------------------------------- /chapter18/batch/src/main/resources/support/test-data.csv: -------------------------------------------------------------------------------- 1 | John,Mayer,Helpless 2 | Eric,Clapton,Change The World 3 | John,Butler,Ocean 4 | BB,King,Chains And Things -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/xml/Bar.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.xml; 2 | 3 | public class Bar { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/xml/Foo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.xml; 2 | 3 | public class Foo { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /chapter03/collections/src/main/java/com/apress/prospring5/ch3/Recipient.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class Recipient { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/Dependency.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class Dependency { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /chapter13/junit5-test/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | insert into singer (first_name, last_name, birth_date,version) values ('John', 'Mayer', '1977-10-16', 0); 2 | -------------------------------------------------------------------------------- /chapter18/batch-boot/src/main/resources/support/test-data.csv: -------------------------------------------------------------------------------- 1 | John,Mayer,Helpless 2 | Eric,Clapton,Change The World 3 | John,Butler,Ocean 4 | BB,King,Chains And Things -------------------------------------------------------------------------------- /chapter18/batch-cfg/src/main/resources/support/test-data.csv: -------------------------------------------------------------------------------- 1 | John,Mayer,Helpless 2 | Eric,Clapton,Change The World 3 | John,Butler,Ocean 4 | BB,King,Chains And Things -------------------------------------------------------------------------------- /chapter18/batch-jsr352/src/main/resources/support/test-data.csv: -------------------------------------------------------------------------------- 1 | John,Mayer,Helpless 2 | Eric,Clapton,Change The World 3 | John,Butler,Ocean 4 | BB,King,Chains And Things -------------------------------------------------------------------------------- /chapter03/collections/src/main/java/com/apress/prospring5/ch3/ContentHolder.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public interface ContentHolder { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /chapter03/constructor-injection/src/main/java/com/apress/prospring5/ch3/Dependency.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class Dependency { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/Encyclopedia.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class Encyclopedia { 4 | 5 | } -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/images/banner.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/images/banner.png -------------------------------------------------------------------------------- /chapter18/xd/src/main/resources/support/jdbc.properties: -------------------------------------------------------------------------------- 1 | driverClassName=com.mysql.cj.jdbc.Driver 2 | url=jdbc:mysql://localhost:3306/xd?useSSL=true 3 | username=xd 4 | password=xd 5 | -------------------------------------------------------------------------------- /chapter06/spring-boot-jdbc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.schema=db/schema.sql 2 | spring.datasource.data=db/test-data.sql 3 | spring.datasource.initialize=true -------------------------------------------------------------------------------- /chapter03/cdl/src/main/java/com/apress/prospring5/ch3/Container.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public interface Container { 4 | Object getDependency(String key); 5 | } 6 | -------------------------------------------------------------------------------- /chapter03/injection/src/main/java/com/apress/prospring5/ch3/Oracle.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public interface Oracle { 4 | String defineMeaningOfLife(); 5 | } 6 | -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/Oracle.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public interface Oracle { 4 | String defineMeaningOfLife(); 5 | } 6 | -------------------------------------------------------------------------------- /chapter04/jsr330/src/main/java/com/apress/prospring5/ch4/MessageProvider.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | public interface MessageProvider { 4 | String getMessage(); 5 | } 6 | -------------------------------------------------------------------------------- /chapter15/jmx/src/main/java/com/apress/prospring5/ch15/AppStatistics.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch15; 2 | 3 | public interface AppStatistics { 4 | int getTotalSingerCount(); 5 | } 6 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/icons.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/icons.png -------------------------------------------------------------------------------- /chapter14/groovy-spring/src/main/java/com/apress/prospring5/ch14/RuleFactory.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch14; 2 | 3 | public interface RuleFactory { 4 | Rule getAgeCategoryRule(); 5 | } 6 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-boot/src/main/resources/static/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-boot/src/main/resources/static/images/banner.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/icons.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/icons.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/icons_hidpi.png -------------------------------------------------------------------------------- /chapter04/message-source/src/main/resources/labels_ko_KR.properties: -------------------------------------------------------------------------------- 1 | msg=\uB0B4 \uBA4D\uCCAD\uD55C \uC785\uC774 \uB098\uB97C \uACE4\uACBD\uC5D0 \uBE60\uB728\uB838\uC9C0. 2 | nameMsg=\uB0B4 \uC774\uB984\uC740 {0} {1} -------------------------------------------------------------------------------- /chapter12/jms-artemis/src/main/java/com/apress/prospring5/ch12/MessageSender.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12; 2 | 3 | public interface MessageSender { 4 | void sendMessage(String message); 5 | } 6 | -------------------------------------------------------------------------------- /chapter12/jms-hornetq/src/main/java/com/apress/prospring5/ch12/MessageSender.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12; 2 | 3 | public interface MessageSender { 4 | void sendMessage(String message); 5 | } 6 | -------------------------------------------------------------------------------- /chapter14/groovy-spring/src/main/java/com/apress/prospring5/ch14/RuleEngine.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch14; 2 | 3 | public interface RuleEngine { 4 | void run(Rule rule, Object object); 5 | } 6 | -------------------------------------------------------------------------------- /chapter14/groovy-spring/src/main/java/com/apress/prospring5/ch14/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch14; 2 | 3 | public interface SingerService { 4 | void applyRule(Singer singer); 5 | } 6 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/icons_hidpi.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/assets/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/assets/sample.jpg -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/assets/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/assets/sample.jpg -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/resources/msf.properties: -------------------------------------------------------------------------------- 1 | renderer.class=com.apress.prospring5.ch2.decoupled.StandardOutMessageRenderer 2 | provider.class=com.apress.prospring5.ch2.decoupled.HelloWorldMessageProvider 3 | -------------------------------------------------------------------------------- /chapter03/cdl/src/main/java/com/apress/prospring5/ch3/ManagedComponent.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public interface ManagedComponent { 4 | void performLookup(Container container); 5 | } 6 | -------------------------------------------------------------------------------- /chapter05/cglib-performance/src/main/java/com/apress/prospring5/ch5/SimpleBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public interface SimpleBean { 4 | void advised(); 5 | void unadvised(); 6 | } 7 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/icons_hidpi.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/lock.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/icons_hidpi.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/arrow.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/close.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/lock.png -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/decoupled/MessageProvider.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2.decoupled; 2 | 3 | public interface MessageProvider { 4 | String getMessage(); 5 | } 6 | -------------------------------------------------------------------------------- /chapter03/method-injection/src/main/java/com/apress/prospring5/ch3/DemoBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public interface DemoBean { 4 | Singer getMySinger(); 5 | void doSomething(); 6 | } 7 | -------------------------------------------------------------------------------- /chapter05/aop-hello-world/src/main/java/com/apress/prospring5/ch5/introduction/IsModified.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5.introduction; 2 | 3 | public interface IsModified { 4 | boolean isModified(); 5 | } 6 | -------------------------------------------------------------------------------- /chapter07/hibernate-crud/src/main/resources/db/jdbc.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | driverClassName=org.h2.Driver 3 | url=jdbc:h2:~/musicdb 4 | username=prospring5 5 | password=prospring5 -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/link/images/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/link/images/anchor.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/arrow.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/close.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/refresh.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/link/images/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/link/images/anchor.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/refresh.png -------------------------------------------------------------------------------- /chapter04/groovy-config-java/src/main/resources/beans.groovy: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4 2 | 3 | import com.apress.prospring5.ch3.xml.Singer 4 | 5 | beans { 6 | singer(Singer, name: 'John Mayer', age: 39) 7 | } 8 | -------------------------------------------------------------------------------- /chapter06/spring-jdbc-annotations/src/main/resources/db/jdbc2.properties: -------------------------------------------------------------------------------- 1 | driverClassName=com.mysql.cj.jdbc.Driver 2 | url=jdbc:mysql://localhost:3306/musicdb?useSSL=true 3 | dbusername=prospring5 4 | dbpassword=prospring5 5 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/image/images/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/image/images/noimage.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/lock-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/lock-open.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/image/images/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/image/images/noimage.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/magicline/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/magicline/images/icon.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/assets/inlineall/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/assets/inlineall/logo.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/hidpi/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/hidpi/lock.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/lock-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/lock-open.png -------------------------------------------------------------------------------- /chapter05/aop-hello-world/src/main/java/com/apress/prospring5/ch5/Agent.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class Agent { 4 | public void speak() { 5 | System.out.print("Bond"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/magicline/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/magicline/images/icon.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/assets/inlineall/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/assets/inlineall/logo.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/hidpi/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/hidpi/close.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/hidpi/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/hidpi/lock.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/link/images/hidpi/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/link/images/hidpi/anchor.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/hidpi/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/hidpi/close.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/hidpi/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/hidpi/refresh.png -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/sandbox/Foo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.sandbox; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 2/23/17. 5 | */ 6 | public interface Foo { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /chapter05/cflow-pointcuts/src/main/java/com/apress/prospring5/ch5/TestBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class TestBean { 4 | public void foo() { 5 | System.out.println("foo()"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter06/spring-jdbc-annotations/src/main/resources/db/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName=com.mysql.cj.jdbc.Driver 2 | jdbc.url=jdbc:mysql://localhost:3306/musicdb?useSSL=true 3 | jdbc.username=prospring5 4 | jdbc.password=prospring5 -------------------------------------------------------------------------------- /chapter06/spring-jdbc-embedded/src/main/resources/db/jdbc.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | driverClassName=org.h2.Driver 3 | url=jdbc:h2:~/musicdb 4 | username=prospring5 5 | password=prospring5 6 | 7 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/java/com/apress/prospring5/ch16/config/WebConfig.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/java/com/apress/prospring5/ch16/config/WebConfig.java -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/link/images/hidpi/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/link/images/hidpi/anchor.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/hidpi/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/hidpi/refresh.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/hidpi/lock-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/skins/moono/images/hidpi/lock-open.png -------------------------------------------------------------------------------- /chapter03/method-injection/src/main/java/com/apress/prospring5/ch3/annotated/DemoBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.annotated; 2 | 3 | public interface DemoBean { 4 | Singer getMySinger(); 5 | void doSomething(); 6 | } 7 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/about/dialogs/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/about/dialogs/logo_ckeditor.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/magicline/images/hidpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/magicline/images/hidpi/icon.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/hidpi/lock-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/skins/moono/images/hidpi/lock-open.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/about/dialogs/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/about/dialogs/logo_ckeditor.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/magicline/images/hidpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/magicline/images/hidpi/icon.png -------------------------------------------------------------------------------- /chapter03/cdl/src/main/java/com/apress/prospring5/ch3/Dependency.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class Dependency { 4 | @Override 5 | public String toString() { 6 | return "Hello from " + getClass(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter04/profiles/src/main/java/com/apress/prospring5/ch4/FoodProviderService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | import java.util.List; 4 | 5 | public interface FoodProviderService { 6 | List provideLunchSet(); 7 | } 8 | -------------------------------------------------------------------------------- /chapter15/boot-jmx/src/main/java/com/apress/prospring5/ch15/AppStatistics.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch15; 2 | 3 | public interface AppStatistics { 4 | 5 | int getTotalSingerCount(); 6 | 7 | String findJohn(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/java/com/apress/prospring5/ch16/web/SingerController.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/java/com/apress/prospring5/ch16/web/SingerController.java -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/dialog/dialogDefinition.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/common/Singer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2.common; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 4/2/17. 5 | */ 6 | public interface Singer { 7 | void sing(); 8 | } 9 | -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/xml/complicated/Foo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.xml.complicated; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 2/24/17. 5 | */ 6 | public interface Foo { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /chapter13/integration-test/src/test/resources/com/apress/prospring5/ch13/SingerServiceImplTest.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter13/integration-test/src/test/resources/com/apress/prospring5/ch13/SingerServiceImplTest.xls -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/plugins/dialog/dialogDefinition.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/styles/custom-theme/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/styles/custom-theme/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /chapter18/batch/src/main/resources/support/singer.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE singer IF EXISTS; 2 | 3 | CREATE TABLE singer ( 4 | singer_id BIGINT IDENTITY NOT NULL PRIMARY KEY, 5 | first_name VARCHAR(20), 6 | last_name VARCHAR(20), 7 | song VARCHAR(100) 8 | ); 9 | -------------------------------------------------------------------------------- /chapter06/spring-jdbc-annotations/src/main/resources/sql/stored-function.sql: -------------------------------------------------------------------------------- 1 | DELIMITER // 2 | CREATE FUNCTION getFirstNameById(in_id INT) 3 | RETURNS VARCHAR(60) 4 | BEGIN 5 | RETURN (SELECT first_name FROM singer WHERE id = in_id); 6 | END // 7 | DELIMITER ; -------------------------------------------------------------------------------- /chapter10/converter/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | date.format.pattern=yyyy-MM-dd 2 | 3 | countrySinger.firstName=John 4 | countrySinger.lastName=Mayer 5 | countrySinger.birthDate=1977-10-16 6 | countrySinger.personalSite=http://johnmayer.com/ 7 | -------------------------------------------------------------------------------- /chapter18/batch-boot/src/main/resources/support/singer.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE SINGER IF EXISTS; 2 | 3 | CREATE TABLE SINGER ( 4 | singer_id BIGINT IDENTITY NOT NULL PRIMARY KEY, 5 | first_name VARCHAR(20), 6 | last_name VARCHAR(20), 7 | song VARCHAR(100) 8 | ); 9 | -------------------------------------------------------------------------------- /chapter18/batch-cfg/src/main/resources/support/singer.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE singer IF EXISTS; 2 | 3 | CREATE TABLE singer ( 4 | singer_id BIGINT IDENTITY NOT NULL PRIMARY KEY, 5 | first_name VARCHAR(20), 6 | last_name VARCHAR(20), 7 | song VARCHAR(100) 8 | ); 9 | -------------------------------------------------------------------------------- /chapter10/property-editor/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | date.format.pattern=yyyy-MM-dd 2 | 3 | countrySinger.firstName=John 4 | countrySinger.lastName=Mayer 5 | countrySinger.birthDate=1977-10-16 6 | countrySinger.personalSite=http://johnmayer.com/ 7 | -------------------------------------------------------------------------------- /chapter18/batch-jsr352/src/main/resources/support/singer.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE singer IF EXISTS; 2 | 3 | CREATE TABLE singer ( 4 | singer_id BIGINT IDENTITY NOT NULL PRIMARY KEY, 5 | first_name VARCHAR(20), 6 | last_name VARCHAR(20), 7 | song VARCHAR(100) 8 | ); 9 | -------------------------------------------------------------------------------- /chapter18/integration-cfg/src/main/resources/support/singer.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE singer IF EXISTS; 2 | 3 | CREATE TABLE singer ( 4 | singer_id BIGINT IDENTITY NOT NULL PRIMARY KEY, 5 | first_name VARCHAR(20), 6 | last_name VARCHAR(20), 7 | song VARCHAR(100) 8 | ); 9 | -------------------------------------------------------------------------------- /chapter18/integration/src/main/resources/support/singer.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE singer IF EXISTS; 2 | 3 | CREATE TABLE singer ( 4 | singer_id BIGINT IDENTITY NOT NULL PRIMARY KEY, 5 | first_name VARCHAR(20), 6 | last_name VARCHAR(20), 7 | song VARCHAR(100) 8 | ); 9 | -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2; 2 | 3 | public class HelloWorld { 4 | 5 | public static void main(String... args) { 6 | System.out.println("Hello World!"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/common/GiftedSinger.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2.common; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 4/2/17. 5 | */ 6 | public interface GiftedSinger extends Singer { 7 | void play(Guitar guitar); 8 | } 9 | -------------------------------------------------------------------------------- /chapter11/async-task/src/main/java/com/apress/prospring5/ch11/AsyncService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch11; 2 | 3 | import java.util.concurrent.Future; 4 | 5 | public interface AsyncService { 6 | void asyncTask(); 7 | Future asyncWithReturn(String name); 8 | } 9 | -------------------------------------------------------------------------------- /chapter04/jsr330/src/main/java/com/apress/prospring5/ch4/MessageRenderer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | public interface MessageRenderer { 4 | void render(); 5 | void setMessageProvider(MessageProvider provider); 6 | MessageProvider getMessageProvider(); 7 | } 8 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-jcfg/src/main/webapp/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilbutITbook/006987/HEAD/chapter16/singer-webapp-xml/src/main/webapp/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf -------------------------------------------------------------------------------- /chapter03/collections/src/main/java/com/apress/prospring5/ch3/ArtworkSender.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public interface ArtworkSender { 4 | void sendArtwork(String artworkPath, Recipient recipient); 5 | String getFriendlyName(); 6 | String getShortName(); 7 | } 8 | -------------------------------------------------------------------------------- /chapter14/groovy-spring/src/main/groovy/com/apress/prospring5/ch14/Rule.groovy: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch14 2 | 3 | class Rule { 4 | private boolean singlehit = true 5 | private conditions = new ArrayList() 6 | private actions = new ArrayList() 7 | private parameters = new ArrayList() 8 | } 9 | -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/decoupled/MessageRenderer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2.decoupled; 2 | 3 | public interface MessageRenderer { 4 | void render(); 5 | void setMessageProvider(MessageProvider provider); 6 | MessageProvider getMessageProvider(); 7 | } 8 | -------------------------------------------------------------------------------- /chapter03/cdl/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch3.CDLDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter09/boot-jta/src/main/java/com/apress/prospring5/ch9/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch9.services; 2 | 3 | import com.apress.prospring5.ch9.entities.Singer; 4 | 5 | public interface SingerService { 6 | Singer save(Singer singer); 7 | 8 | long count(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/sandbox/Bar.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.sandbox; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 2/23/17. 5 | */ 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component("kitchen") 9 | public class Bar { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /chapter04/events/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.Publisher", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter03/injection/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch3.xml.InjectRef", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter04/resource/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.ResourceDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter05/security/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch5.SecurityDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter10/converter/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch10.ConvServDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter11/base-task/src/main/java/com/apress/prospring5/ch11/repos/CarRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch11.repos; 2 | 3 | import com.apress.prospring5.ch11.entities.Car; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface CarRepository extends CrudRepository { 7 | } 8 | -------------------------------------------------------------------------------- /chapter17/stomp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | war { 4 | archiveName = 'stomp.war' 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/method-injection/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch3.LookupDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter05/security/src/main/java/com/apress/prospring5/ch5/SecureBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class SecureBean { 4 | public void writeSecureMessage() { 5 | System.out.println("Every time I learn something new, " 6 | + "it pushes some old stuff out of my brain"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter08/jpa-criteria/.factorypath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /chapter08/jpa-crud/src/main/java/com/apress/prospring5/ch8/service/SingerSummaryService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.service; 2 | 3 | import com.apress.prospring5.ch8.view.SingerSummary; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerSummaryService { 8 | List findAll(); 9 | } 10 | -------------------------------------------------------------------------------- /chapter17/sockjs/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | war { 4 | archiveName = 'sockjs.war' 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/sandbox/FooImplTwo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.sandbox; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 2/23/17. 7 | */ 8 | @Component 9 | public class FooImplTwo implements Foo{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/xml/complicated/FooImpl1.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.xml.complicated; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 2/24/17. 7 | */ 8 | public class FooImpl1 implements Foo { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/xml/complicated/FooImpl2.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.xml.complicated; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 2/24/17. 7 | */ 8 | public class FooImpl2 implements Foo { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /chapter04/bean-init-method/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | "Main-Class": "com.apress.prospring5.ch4.Singer", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 8 | ) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter04/environment/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.EnvironmentSampleLast", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter04/factory-bean/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.MessageDigestDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter04/message-source/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.MessageSourceDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter10/property-editor/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch10.PropEditorDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter11/base-task/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.data, misc.joda, db.h2 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 10 | } 11 | } -------------------------------------------------------------------------------- /chapter14/script-engines/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch14.ListScriptEngines", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter03/bean-autowiring/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | "Main-Class": "com.apress.prospring5.ch3.xml.Target", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 8 | ) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/nesting/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch3.HierarchicalAppContextUsage", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter04/post-construct/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.SingerWithJSR250", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter04/property-editors/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.PropertyEditorBean", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter05/simple-around-advice/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch5.ProfilingDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter09/boot-jta/src/main/java/com/apress/prospring5/ch9/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch9.repos; 2 | 3 | import com.apress.prospring5.ch9.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface SingerRepository extends CrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /chapter10/custom-formatter/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch10.ConvFormatServDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter10/spring-validator/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch10.SpringValidatorDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter18/webflux/src/main/java/com/apress/prospring5/ch18/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch18.repos; 2 | 3 | import com.apress.prospring5.ch18.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface SingerRepository extends CrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /chapter03/bean-aliases/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | "Main-Class": "com.apress.prospring5.ch3.xml.BeanNameAliasing", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 8 | ) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/method-replacement/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch3.MethodReplacementDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter04/boot-web/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) -------------------------------------------------------------------------------- /chapter04/initializing-bean-destroy/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.DestructiveBean", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter04/initializing-bean/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.SingerWithInterface", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter04/property-placeholder/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.PlaceHolderDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter04/shutdown-hook/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.DestructiveBeanWithHook", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter05-aspectj-aspects/src/main/java/com/apress/prospring5/ch5/MessageWriter.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class MessageWriter { 4 | public void writeMessage() { 5 | System.out.println("foobar!"); 6 | } 7 | 8 | public void foo() { 9 | System.out.println("foo"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/aop-hello-world/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | "Main-Class": "com.apress.prospring5.ch5.AgentAOPDemo", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 8 | ) 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /chapter05/simple-throws-advice/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch5.SimpleThrowsAdvice", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter17/websocket-api/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | war { 4 | archiveName = 'websocket-echo.war' 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter18/webflux-boot/src/main/java/com/apress/prospring5/ch18/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch18.repos; 2 | 3 | import com.apress.prospring5.ch18.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface SingerRepository extends CrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /chapter03/bean-inheritance/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | "Main-Class": "com.apress.prospring5.ch3.xml.InheritanceDemo", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 8 | ) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/bean-instantiation-mode/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | "Main-Class": "com.apress.prospring5.ch3.NonSingletonDemo", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 8 | ) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/simple-types/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch3.annotated.InjectSimpleSpel", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter04/disposable-bean/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.DestructiveBeanWithInterface", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter08/boot-jpa/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter09/boot-jta/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter10/converter-multiple-types/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch10.MultipleConvServDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter12/boot-amqp/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter12/boot-jms/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter12/boot-rest/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter15/boot-jmx/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | war { 4 | archiveName = 'singer-webapp-xml.war' 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter18/batch-boot/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter18/boot-tests/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter03/collections/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch3.annotated.CollectionInjection", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter03/nesting/src/main/java/com/apress/prospring5/ch3/Song.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class Song { 4 | private String title; 5 | 6 | public void setTitle(String title) { 7 | this.title = title; 8 | } 9 | 10 | public String getTitle() { 11 | return title; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter04/boot-simple/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter04/post-construct-pre-destroy/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.DestructiveBeanWithJSR250", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter05/after-returning-advice-keygen/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | 'Main-Class': "com.apress.prospring5.ch5.AfterAdviceDemo", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ')) 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /chapter05/aspectj-boot/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter08/hibernate-envers/src/main/java/com/apress/prospring5/ch8/CustomDefaultRevisionEntity.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8; 2 | 3 | import org.hibernate.envers.DefaultRevisionEntity; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 5/8/17. 7 | */ 8 | public class CustomDefaultRevisionEntity extends DefaultRevisionEntity { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /chapter14/groovy-spring/에러시 조치방법.txt: -------------------------------------------------------------------------------- 1 | 이 프로젝트는 이클립스에서 RuleEngineDemo class를 실행하면 RuleEngineImpl.groovy 파일을 찾이 못해 에러가 발생할 수 있습니다. 2 | 에러 발생 시에는 Gradle Tasks View에서 chapter14>groovy-spring 의 build task를 수행한 후 실행하기 바랍니다. 3 | 4 | 참고로 RuleEngineImpl.groovy 파일에 에러가 표시되는데 이는 이클립스가 resources 디렉터리 아래에 있는 groovy 파일에도 문법 체크를 하기 때문입니다. 5 | 예제 실행에는 아무런 문제가 없습니다. 6 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-boot/src/main/java/com/apress/prospring5/ch16/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.repos; 2 | 3 | import com.apress.prospring5.ch16.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface SingerRepository extends CrudRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /chapter18/webflux-boot/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter04/groovy-config-java/에러시 조치방법.txt: -------------------------------------------------------------------------------- 1 | 이 프로젝트는 이클립스에서 GroovyBeans class를 실행하면 beans.groovy 파일을 찾이 못해 에러가 발생할 수 있습니다. 2 | 에러 발생 시에는 Gradle Tasks View에서 chapter04>groovy-config-build 의 build task를 수행한 후 실행하기 바랍니다. 3 | 4 | 참고로 beans.groovy 파일에 에러가 표시되는데 이는 이클립스가 resources 디렉터리 아래에 있는 groovy 파일에도 문법 체크를 하기 때문입니다. (패키지 에러가 발생합니다.) 5 | 예제 실행에는 아무런 문제가 없습니다. 6 | -------------------------------------------------------------------------------- /chapter06/spring-boot-jdbc/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.6) 8 | -------------------------------------------------------------------------------- /chapter18/xd/src/main/resources/support/ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE USER 'xd'@'localhost' IDENTIFIED BY 'xd'; 2 | CREATE SCHEMA XD; 3 | GRANT ALL PRIVILEGES ON XD . * TO 'xd'@'localhost'; 4 | FLUSH PRIVILEGES; 5 | 6 | /*in case of java.sql.SQLException: The server timezone value 'UTC' is unrecognized or represents more than one timezone. */ 7 | SET GLOBAL time_zone = '+3:00'; -------------------------------------------------------------------------------- /chapter05/dynamic-pointcut/src/main/java/com/apress/prospring5/ch5/SampleBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class SampleBean { 4 | public void foo(int x) { 5 | System.out.println("Invoked foo() with: " + x); 6 | } 7 | 8 | public void bar() { 9 | System.out.println("Invoked bar()"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter08/hibernate-envers/src/main/java/com/apress/prospring5/ch8/repos/SingerAuditRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.repos; 2 | 3 | import com.apress.prospring5.ch8.entities.SingerAudit; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface SingerAuditRepository extends CrudRepository { 7 | } 8 | -------------------------------------------------------------------------------- /chapter12/base-remote/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.data, db.h2 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 10 | } 11 | } -------------------------------------------------------------------------------- /chapter14/base-groovy/src/main/groovy/com/apress/prospring5/ch14/Singer.groovy: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch14 2 | 3 | /** 4 | * Created by iuliana.cosmina on 6/25/17. 5 | */ 6 | class Singer { 7 | def firstName 8 | def lastName 9 | def birthDate 10 | 11 | String toString() { 12 | "($firstName,$lastName,$birthDate)" 13 | } 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /chapter03/method-injection/src/main/java/com/apress/prospring5/ch3/AbstractLookupDemoBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public abstract class AbstractLookupDemoBean implements DemoBean { 4 | public abstract Singer getMySinger(); 5 | 6 | @Override 7 | public void doSomething() { 8 | getMySinger().sing(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter04/application-context-aware/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | "Main-Class": "com.apress.prospring5.ch4.DestructiveBeanWithInterface", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 8 | ) 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /chapter04/factory-bean-and-factory-method-attributes/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.MessageDigestFactoryDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter06/spring-jdbc-rowmapper/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter06:plain-jdbc') 3 | compile db.h2 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter08/hibernate-envers/src/main/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | insert into singer_audit (first_name, last_name, birth_date) values ('John', 'Mayer', '1977-10-16'); 2 | insert into singer_audit (first_name, last_name, birth_date) values ('Eric', 'Clapton', '1945-03-30'); 3 | insert into singer_audit (first_name, last_name, birth_date) values ('John', 'Butler', '1975-04-01'); -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-audit/src/main/java/com/apress/prospring5/ch8/repos/SingerAuditRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.repos; 2 | 3 | import com.apress.prospring5.ch8.entities.SingerAudit; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface SingerAuditRepository extends CrudRepository { 7 | } 8 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-boot/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v.2.1.3.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter17/sockjs-cfg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | war { 4 | archiveName = 'sockjs2.war' 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter17/stomp-cfg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | war { 4 | archiveName = 'stomp2.war' 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter18/batch/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile db.h2, db.dbcp2 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By": "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class": "com.apress.prospring5.ch18.SingerJobDemo", 10 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter06/spring-jdbc-namedparam/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter06:plain-jdbc') 3 | compile db.h2 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-audit/src/main/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | insert into singer_audit (first_name, last_name, birth_date) values ('John', 'Mayer', '1977-10-16'); 2 | insert into singer_audit (first_name, last_name, birth_date) values ('Eric', 'Clapton', '1945-03-30'); 3 | insert into singer_audit (first_name, last_name, birth_date) values ('John', 'Butler', '1975-04-01'); -------------------------------------------------------------------------------- /chapter09/boot-jta/src/main/java/com/apress/prospring5/ch9/ex/AsyncXAResourcesException.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch9.ex; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 5/28/17. 5 | */ 6 | public class AsyncXAResourcesException extends RuntimeException { 7 | 8 | public AsyncXAResourcesException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/java/com/apress/prospring5/ch16/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.repos; 2 | 3 | import com.apress.prospring5.ch16.entities.Singer; 4 | import org.springframework.data.repository.PagingAndSortingRepository; 5 | 6 | public interface SingerRepository extends PagingAndSortingRepository { 7 | } 8 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/java/com/apress/prospring5/ch16/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.repos; 2 | 3 | import com.apress.prospring5.ch16.entities.Singer; 4 | import org.springframework.data.repository.PagingAndSortingRepository; 5 | 6 | public interface SingerRepository extends PagingAndSortingRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/NewsletterSender.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public interface NewsletterSender { 4 | void setSmtpServer(String smtpServer); 5 | String getSmtpServer(); 6 | 7 | void setFromAddress(String fromAddress); 8 | String getFromAddress(); 9 | 10 | void send(); 11 | } 12 | -------------------------------------------------------------------------------- /chapter06/spring-jdbc-resultsetextractor/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter06:plain-jdbc') 3 | compile db.h2 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter08/jpa-crud/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch8.SpringJPADemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter09/transactions-jta/src/main/java/com/apress/prospring5/ch9/ex/AsyncXAResourcesException.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch9.ex; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 5/28/17. 5 | */ 6 | public class AsyncXAResourcesException extends RuntimeException { 7 | 8 | public AsyncXAResourcesException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter13/base-test/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.data, db.h2, hibernate.em 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 10 | } 11 | } -------------------------------------------------------------------------------- /chapter13/mvc-unit-test/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter13:integration-test') 3 | testCompile testing.jmock 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter06/spring-jdbc-annotations/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter06:plain-jdbc') 3 | compile db.mysql, db.dbcp2 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter07/hibernate-base/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch7.SpringHibernateDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } -------------------------------------------------------------------------------- /chapter17/websocket-api-cfg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | war { 4 | archiveName = 'websocket-echo2.war' 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter04/bean-name-aware/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( "Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch4.NamedSingerDemo", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /chapter04/jsr330/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile misc.inject 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch4.Jsr330Demo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter06/plain-jdbc/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile db.mysql 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch6.PlainJdbcDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter11/base-task/src/main/java/com/apress/prospring5/ch11/services/CarService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch11.services; 2 | 3 | import com.apress.prospring5.ch11.entities.Car; 4 | 5 | import java.util.List; 6 | 7 | public interface CarService { 8 | List findAll(); 9 | Car save(Car car); 10 | void updateCarAgeJob(); 11 | boolean isDone(); 12 | } 13 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | war { 4 | archiveName = 'singer-webapp-jcfg.war' 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter18/xd/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile db.mysql, db.dbcp2 3 | } 4 | jar { 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Main-Class" : "com.apress.prospring5.ch18.SingerJobResults", 9 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 10 | } 11 | } -------------------------------------------------------------------------------- /chapter03/field-injection/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes("Created-By" : "Iuliana Cosmina", 4 | "Specification-Title": "Pro Spring 5", 5 | "Main-Class" : "com.apress.prospring5.ch3.annotated.FieldInjection", 6 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /chapter03/method-replacement/src/main/java/com/apress/prospring5/ch3/ReplacementTarget.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class ReplacementTarget { 4 | public String formatMessage(String msg) { 5 | return "

" + msg + "

"; 6 | } 7 | 8 | public String formatMessage(Object msg) { 9 | return "

" + msg + "

"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter10/jsr349/src/main/java/com/apress/prospring5/ch10/obj/Gender.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch10.obj; 2 | 3 | public enum Gender { 4 | MALE("M"), FEMALE("F"); 5 | private String code; 6 | 7 | Gender(String code) { 8 | this.code = code; 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return this.code; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter14/base-groovy/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | 3 | dependencies{ 4 | compile misc.groovy 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes("Created-By" : "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter14/chapter14.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | group 'com.apress.prospring5.ch14' 3 | apply plugin: 'java' 4 | 5 | /*Task that copies all the dependencies under build/libs */ 6 | task copyDependencies(type: Copy) { 7 | from configurations.compile 8 | into 'build/libs' 9 | } 10 | 11 | dependencies { 12 | compile spring.webmvc, misc.slf4jJcl, misc.logback, misc.lang3 13 | } 14 | } -------------------------------------------------------------------------------- /chapter18/batch-cfg/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile db.h2, db.dbcp2 3 | } 4 | jar { 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Main-Class" : "com.apress.prospring5.ch18.SingerJobDemo", 9 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 10 | } 11 | } -------------------------------------------------------------------------------- /chapter18/batch-jsr352/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile db.hsqldb,db.dbcp, db.dbcp2 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By": "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class": "com.apress.prospring5.ch18.SingerJobDemo", 10 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter05/simple-around-advice/src/main/java/com/apress/prospring5/ch5/WorkerBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class WorkerBean { 4 | public void doSomeWork(int noOfTimes) { 5 | for(int x = 0; x < noOfTimes; x++) { 6 | work(); 7 | } 8 | } 9 | 10 | private void work() { 11 | System.out.print(""); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter10/jsr349/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies{ 2 | compile misc.javaEl, misc.glassfishEl 3 | } 4 | jar { 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Main-Class" : "com.apress.prospring5.ch10.Jsr349Demo", 9 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 10 | } 11 | } -------------------------------------------------------------------------------- /chapter11/async-task/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.context 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch11.AsyncTaskDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter12/amqp-rpc/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.rabbit 3 | } 4 | 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch12.AmqpRpcDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter05/aop-hello-world/src/main/java/com/apress/prospring5/ch5/introduction/IsModifiedAdvisor.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5.introduction; 2 | 3 | import org.springframework.aop.support.DefaultIntroductionAdvisor; 4 | 5 | public class IsModifiedAdvisor extends DefaultIntroductionAdvisor { 6 | public IsModifiedAdvisor() { 7 | super(new IsModifiedMixin()); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /chapter10/jsr349-custom/src/main/java/com/apress/prospring5/ch10/obj/Gender.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch10.obj; 2 | 3 | public enum Gender { 4 | MALE("M"), FEMALE("F"); 5 | private String code; 6 | 7 | Gender(String code) { 8 | this.code = code; 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return this.code; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter10/jsr349/src/main/java/com/apress/prospring5/ch10/obj/Genre.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch10.obj; 2 | 3 | public enum Genre { 4 | POP("P"), JAZZ("J"), BLUES("B"), COUNTRY("C"); 5 | private String code; 6 | 7 | private Genre(String code) { 8 | this.code = code; 9 | } 10 | 11 | public String toString() { 12 | return this.code; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter11/task-executor/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.context 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch11.TaskExecutorDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter02/hello-world/build.gradle: -------------------------------------------------------------------------------- 1 | jar { 2 | manifest { 3 | attributes( 4 | "Created-By": "Iuliana Cosmina", 5 | "Specification-Title": "Pro Spring 5", 6 | "Main-Class" : "com.apress.prospring5.ch2.HelloWorldSpringDI", 7 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 8 | ) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/annotated/Guitar.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.annotated; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 2/22/17. 7 | */ 8 | @Component("gopher") 9 | public class Guitar { 10 | 11 | public void sing(){ 12 | System.out.println("Cm Eb Fm Ab Bb"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter10/jsr349-assertTrue/src/main/java/com/apress/prospring5/ch10/obj/Gender.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch10.obj; 2 | 3 | public enum Gender { 4 | MALE("M"), FEMALE("F"); 5 | private String code; 6 | 7 | Gender(String code) { 8 | this.code = code; 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return this.code; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter09/base-dao/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile db.mysql 3 | compile (hibernate.tx) { 4 | exclude group: 'org.hibernate', module: 'hibernate' 5 | } 6 | } 7 | 8 | jar { 9 | manifest { 10 | attributes("Created-By" : "Iuliana Cosmina", 11 | "Specification-Title": "Pro Spring 5", 12 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 13 | } 14 | } -------------------------------------------------------------------------------- /chapter09/transactions-jta/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter09:base-dao') 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch9.TxJtaDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter10/jsr349-assertTrue/src/main/java/com/apress/prospring5/ch10/obj/Genre.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch10.obj; 2 | 3 | public enum Genre { 4 | POP("P"), JAZZ("J"), BLUES("B"), COUNTRY("C"); 5 | private String code; 6 | 7 | private Genre(String code) { 8 | this.code = code; 9 | } 10 | 11 | public String toString() { 12 | return this.code; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter10/jsr349-custom/src/main/java/com/apress/prospring5/ch10/obj/Genre.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch10.obj; 2 | 3 | public enum Genre { 4 | POP("P"), JAZZ("J"), BLUES("B"), COUNTRY("C"); 5 | private String code; 6 | 7 | private Genre(String code) { 8 | this.code = code; 9 | } 10 | 11 | public String toString() { 12 | return this.code; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter15/jmx/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | dependencies { 4 | compile project(':chapter12:base-remote') 5 | } 6 | 7 | 8 | war { 9 | archiveName = 'jmx.war' 10 | manifest { 11 | attributes("Created-By" : "Iuliana Cosmina", 12 | "Specification-Title": "Pro Spring 5", 13 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /chapter03/chapter03.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | group 'com.apress.prospring5.ch03' 3 | apply plugin: 'java' 4 | 5 | /*Task that copies all the dependencies under build/libs */ 6 | task copyDependencies(type: Copy) { 7 | from configurations.compile 8 | into 'build/libs' 9 | } 10 | 11 | dependencies { 12 | compile spring.context, misc.slf4jJcl, misc.logback 13 | testCompile testing.junit 14 | } 15 | } -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/SetterInjection.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class SetterInjection { 4 | 5 | private Dependency dependency; 6 | 7 | public void setDependency(Dependency dependency) { 8 | this.dependency = dependency; 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return dependency.toString(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/proxyfactorybean/src/main/java/com/apress/prospring5/ch5/Documentarist.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class Documentarist { 4 | 5 | protected GrammyGuitarist guitarist; 6 | 7 | public void execute() { 8 | guitarist.sing(); 9 | guitarist.talk(); 10 | } 11 | 12 | public void setGuitarist(GrammyGuitarist guitarist) { 13 | this.guitarist = guitarist; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter08/boot-jpa/src/main/java/com/apress/prospring5/ch8/InstrumentRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8; 2 | 3 | import com.apress.prospring5.ch8.entities.Instrument; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 5/12/17. 8 | */ 9 | public interface InstrumentRepository extends CrudRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /chapter09/base-dao/src/main/java/com/apress/prospring5/ch9/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch9.services; 2 | 3 | import com.apress.prospring5.ch9.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | 9 | List findAll(); 10 | 11 | Singer findById(Long id); 12 | 13 | Singer save(Singer singer); 14 | 15 | long countAll(); 16 | } 17 | -------------------------------------------------------------------------------- /chapter10/jsr349-custom/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile misc.javaEl, misc.glassfishEl 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch10.Jsr349CustomDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/HelloWorldWithCommandLine.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2; 2 | 3 | public class HelloWorldWithCommandLine { 4 | 5 | public static void main(String... args) { 6 | if (args.length > 0) { 7 | System.out.println(args[0]); 8 | } else { 9 | System.out.println("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter03/bean-aliases/src/main/java/com/apress/prospring5/ch3/annotated/Trophy.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.annotated; 2 | 3 | import org.springframework.core.annotation.AliasFor; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 2/19/17. 7 | */ 8 | 9 | @Award 10 | public @interface Trophy { 11 | 12 | @AliasFor(annotation = Award.class, attribute = "value") 13 | String[] name() default {}; 14 | } 15 | -------------------------------------------------------------------------------- /chapter04/profiles/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | testCompile spring.test, testing.junit 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch4.ProfileXmlConfigDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter05/aspectj-annotations/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | 7 | jar { 8 | manifest { 9 | attributes( 10 | "Created-By": "Iuliana Cosmina", 11 | "Specification-Title": "Pro Spring 5", 12 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 13 | ) 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /chapter07/hibernate-crud/src/main/java/com/apress/prospring5/ch7/dao/InstrumentDao.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch7.dao; 2 | 3 | import com.apress.prospring5.ch7.entities.Instrument; 4 | import com.apress.prospring5.ch7.entities.Singer; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 4/23/17. 8 | */ 9 | public interface InstrumentDao { 10 | 11 | Instrument save(Instrument instrument); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /chapter09/transactions-programmatic/src/main/java/com/apress/prospring5/ch9/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch9.services; 2 | 3 | import com.apress.prospring5.ch9.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | List findAll(); 9 | Singer findById(Long id); 10 | Singer save(Singer singer); 11 | long countAll(); 12 | } 13 | -------------------------------------------------------------------------------- /chapter09/transactions-xml/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter09:base-dao') 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch9.TxDeclarativeDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter11/scheduled-task/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter11:base-task') 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch11.ScheduleTaskDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter03/cdl/src/main/java/com/apress/prospring5/ch3/DefaultContainer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class DefaultContainer implements Container { 4 | @Override 5 | public Object getDependency(String key) { 6 | if("myDependency".equals(key)) { 7 | return new Dependency(); 8 | } 9 | 10 | throw new RuntimeException("Unknown dependency: " + key); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter05/proxyfactorybean/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch5.ProxyFactoryBeanDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-audit/src/main/java/com/apress/prospring5/ch8/services/SingerAuditService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.services; 2 | 3 | import com.apress.prospring5.ch8.entities.SingerAudit; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerAuditService { 8 | List findAll(); 9 | SingerAudit findById(Long id); 10 | SingerAudit save(SingerAudit singer); 11 | } 12 | -------------------------------------------------------------------------------- /chapter10/jsr349-assertTrue/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile misc.javaEl, misc.glassfishEl 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch10.Jsr349AssertTrueDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter12/secure-rest/src/main/java/com/apress/prospring5/ch12/init/SecurityWebApplicationInitializer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12.init; 2 | 3 | import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 9/14/15. 7 | */ 8 | public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer { 9 | } 10 | -------------------------------------------------------------------------------- /chapter05/dynamic-pointcut/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter05:aop-hello-world') 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch5.DynamicPointcutDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter09/transactions-programmatic/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter09:base-dao') 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch9.TxProgrammaticDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter03/constructor-injection/src/main/java/com/apress/prospring5/ch3/ConstructorInjection.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class ConstructorInjection { 4 | 5 | private Dependency dependency; 6 | 7 | public ConstructorInjection(Dependency dependency) { 8 | this.dependency = dependency; 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return dependency.toString(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-alt/src/main/java/com/apress/prospring5/ch8/repos/InstrumentRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.repos; 2 | 3 | import com.apress.prospring5.ch8.entities.Instrument; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 5/7/17. 8 | */ 9 | public interface InstrumentRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /chapter08/spring-data-jpa/src/main/java/com/apress/prospring5/ch8/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8; 2 | 3 | import com.apress.prospring5.ch8.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | List findAll(); 9 | List findByFirstName(String firstName); 10 | List findByFirstNameAndLastName(String firstName, String lastName); 11 | } 12 | -------------------------------------------------------------------------------- /chapter12/boot-rest/src/main/java/com/apress/prospring5/ch12/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12.repos; 2 | 3 | import com.apress.prospring5.ch12.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | import java.util.List; 7 | 8 | public interface SingerRepository extends CrudRepository { 9 | 10 | List findByFirstName(String firstName); 11 | } 12 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/java/com/apress/prospring5/ch16/init/SecurityWebApplicationInitializer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.init; 2 | 3 | import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 9/14/15. 7 | */ 8 | public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer { 9 | } 10 | -------------------------------------------------------------------------------- /chapter11/scheduled-task-annotation/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter11:base-task') 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch11.ScheduleTaskAnnotationDemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter12/base-remote/src/main/java/com/apress/prospring5/ch12/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12.repos; 2 | 3 | import com.apress.prospring5.ch12.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | import java.util.List; 7 | 8 | public interface SingerRepository extends CrudRepository { 9 | 10 | List findByFirstName(String firstName); 11 | } 12 | -------------------------------------------------------------------------------- /chapter13/integration-test/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter13:base-test') 3 | compile misc.poi, 4 | hibernate.validator, misc.validation, misc.javaEl, misc.glassfishEl 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes("Created-By" : "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter18/integration/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile db.h2, db.dbcp2, spring.batchIntegration, spring.integrationFile 3 | } 4 | jar { 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Main-Class" : "com.apress.prospring5.ch18.FileWatcherDemo", 9 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 10 | } 11 | } -------------------------------------------------------------------------------- /chapter18/boot-tests/src/main/java/com/apress/prospring5/ch18/FluxGenerator.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch18; 2 | 3 | import org.springframework.stereotype.Component; 4 | import reactor.core.publisher.Flux; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 8/6/17. 8 | */ 9 | @Component 10 | public class FluxGenerator { 11 | 12 | public Flux generate(String... args){ 13 | return Flux.just(args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /chapter18/integration-cfg/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile db.h2, db.dbcp2, spring.batchIntegration, spring.integrationFile 3 | } 4 | jar { 5 | manifest { 6 | attributes("Created-By" : "Iuliana Cosmina", 7 | "Specification-Title": "Pro Spring 5", 8 | "Main-Class" : "com.apress.prospring5.ch18.FileWatcherDemo", 9 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 10 | } 11 | } -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/decoupled/HelloWorldDecoupled.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2.decoupled; 2 | 3 | public class HelloWorldDecoupled { 4 | public static void main(String... args) { 5 | MessageRenderer mr = new StandardOutMessageRenderer(); 6 | MessageProvider mp = new HelloWorldMessageProvider(); 7 | mr.setMessageProvider(mp); 8 | mr.render(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /chapter03/cdl/src/main/java/com/apress/prospring5/ch3/CDLDemo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class CDLDemo { 4 | public static void main(String... args) { 5 | Container container = new DefaultContainer(); 6 | 7 | ManagedComponent managedComponent = new ContextualizedDependencyLookup(); 8 | managedComponent.performLookup(container); 9 | 10 | System.out.println(managedComponent); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter03/method-injection/src/main/java/com/apress/prospring5/ch3/Singer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 2/20/17. 5 | */ 6 | public class Singer { 7 | private String lyric = "I played a quick game of chess with the salt and pepper shaker"; 8 | 9 | public void sing() { 10 | // 콘솔을 오염시키지 않으려고 주석 처리함 11 | //System.out.println(lyric); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter05/static-pointcut/src/main/java/com/apress/prospring5/ch5/GreatGuitarist.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import com.apress.prospring5.ch2.common.Singer; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 4/2/17. 7 | */ 8 | public class GreatGuitarist implements Singer { 9 | 10 | @Override public void sing() { 11 | System.out.println("I shot the sheriff, \n" + 12 | "But I did not shoot the deputy"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter05/annotation-pointcut/src/main/java/com/apress/prospring5/ch5/AdviceRequired.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target({ElementType.TYPE, ElementType.METHOD}) 10 | public @interface AdviceRequired { 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/simple-throws-advice/src/main/java/com/apress/prospring5/ch5/ErrorBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class ErrorBean { 4 | public void errorProneMethod() throws Exception { 5 | throw new Exception("Generic Exception"); 6 | } 7 | 8 | public void otherErrorProneMethod() throws IllegalArgumentException { 9 | throw new IllegalArgumentException("IllegalArgument Exception"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter06/spring-jdbc-embedded/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter06:plain-jdbc') 3 | compile db.h2, db.derby 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch6.JdbcSingerDaoDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-alt/src/main/java/com/apress/prospring5/ch8/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.services; 2 | 3 | import com.apress.prospring5.ch8.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | List findAll(); 9 | List findByFirstName(String firstName); 10 | List findByFirstNameAndLastName(String firstName, String lastName); 11 | } 12 | -------------------------------------------------------------------------------- /chapter18/webflux/src/main/java/com/apress/prospring5/ch18/repos/ReactiveSingerRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch18.repos; 2 | 3 | import com.apress.prospring5.ch18.entities.Singer; 4 | import reactor.core.publisher.Flux; 5 | import reactor.core.publisher.Mono; 6 | 7 | public interface ReactiveSingerRepo { 8 | 9 | Mono findById(Long id); 10 | 11 | Flux findAll(); 12 | 13 | Mono save(Mono singer); 14 | } 15 | -------------------------------------------------------------------------------- /chapter04/java-config/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter03:constructor-injection') 3 | testCompile testing.junit 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch4.JavaConfigSimpleDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter04/profiles/src/main/java/com/apress/prospring5/ch4/Food.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | public class Food { 4 | private String name; 5 | 6 | public Food() { 7 | } 8 | 9 | public Food(String name) { 10 | this.name = name; 11 | } 12 | 13 | public String getName() { 14 | return name; 15 | } 16 | 17 | public void setName(String name) { 18 | this.name = name; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter05/cglib-performance/src/main/java/com/apress/prospring5/ch5/NoOpBeforeAdvice.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import org.springframework.aop.MethodBeforeAdvice; 6 | 7 | public class NoOpBeforeAdvice implements MethodBeforeAdvice { 8 | @Override 9 | public void before(Method method, Object[] args, Object target) 10 | throws Throwable { 11 | // no-op 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter08/spring-data-jpa/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.data, misc.guava 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch8.SpringJPADemo", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } -------------------------------------------------------------------------------- /chapter18/webflux-boot/src/main/java/com/apress/prospring5/ch18/repos/ReactiveSingerRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch18.repos; 2 | 3 | import com.apress.prospring5.ch18.entities.Singer; 4 | import reactor.core.publisher.Flux; 5 | import reactor.core.publisher.Mono; 6 | 7 | public interface ReactiveSingerRepo { 8 | 9 | Mono findById(Long id); 10 | 11 | Flux findAll(); 12 | 13 | Mono save(Mono singer); 14 | } 15 | -------------------------------------------------------------------------------- /chapter05/cglib-performance/src/main/java/com/apress/prospring5/ch5/DefaultSimpleBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class DefaultSimpleBean implements SimpleBean { 4 | private long dummy = 0; 5 | 6 | @Override 7 | public void advised() { 8 | dummy = System.currentTimeMillis(); 9 | } 10 | 11 | @Override 12 | public void unadvised() { 13 | dummy = System.currentTimeMillis(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/simple-after-returning-advice/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter05:simple-before-advice') 3 | } 4 | 5 | jar { 6 | manifest { 7 | attributes("Created-By" : "Iuliana Cosmina", 8 | "Specification-Title": "Pro Spring 5", 9 | "Main-Class" : "com.apress.prospring5.ch5.SimpleAfterReturningAdvice", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /chapter05/simple-before-advice/src/main/java/com/apress/prospring5/ch5/Guitarist.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import com.apress.prospring5.ch2.common.Singer; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 3/26/17. 7 | */ 8 | public class Guitarist implements Singer { 9 | 10 | private String lyric="You're gonna live forever in me"; 11 | 12 | @Override 13 | public void sing(){ 14 | System.out.println(lyric); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /chapter05/static-pointcut/src/main/java/com/apress/prospring5/ch5/GoodGuitarist.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import com.apress.prospring5.ch2.common.Singer; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 4/2/17. 7 | */ 8 | public class GoodGuitarist implements Singer { 9 | 10 | @Override public void sing() { 11 | System.out.println("Who says I can't be free \n" + 12 | "From all of the things that I used to be"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter10/spring-validator/src/main/java/com/apress/prospring5/ch10/config/AppConfig.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch10.config; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 6/5/17. 8 | */ 9 | @Configuration 10 | @ComponentScan(basePackages = "com.apress.prospring5.ch10") 11 | public class AppConfig { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /chapter12/jms-hornetq/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.jms, misc.jms, misc.hornetq 3 | 4 | testCompile spring.test 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes("Created-By" : "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Main-Class" : "com.apress.prospring5.ch12.JmsHornetQDemo", 12 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /chapter13/integration-test/src/main/java/com/apress/prospring5/ch13/DataSets.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch13; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.METHOD) 10 | public @interface DataSets { 11 | String setUpDataSet() default ""; 12 | } 13 | -------------------------------------------------------------------------------- /chapter02/chapter02.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | group 'com.apress.prospring5.ch02' 3 | apply plugin: 'java' 4 | 5 | /*Task that copies all the dependencies under build/libs */ 6 | task copyDependencies(type: Copy) { 7 | from configurations.compile 8 | into 'build/libs' 9 | } 10 | 11 | dependencies { 12 | compile spring.context, misc.slf4jJcl, misc.logback 13 | testCompile testing.junit 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /chapter05/aspectj-boot/src/main/java/com/apress/prospring5/ch5/Guitar.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 4/9/17. 5 | */ 6 | public class Guitar { 7 | private String brand =" Martin"; 8 | 9 | public String play(){ 10 | return "G C G C Am D7"; 11 | } 12 | 13 | public String getBrand() { 14 | return brand; 15 | } 16 | 17 | public void setBrand(String brand) { 18 | this.brand = brand; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter05/cflow-pointcuts/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch5.ControlFlowDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter05/cglib-performance/src/main/java/com/apress/prospring5/ch5/TestPointcut.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import org.springframework.aop.support.StaticMethodMatcherPointcut; 6 | 7 | public class TestPointcut extends StaticMethodMatcherPointcut { 8 | @Override 9 | public boolean matches(Method method, Class cls) { 10 | return ("advise".equals(method.getName())); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-alt/build.gradle: -------------------------------------------------------------------------------- 1 | // this is an alternative example for the Spring Data JPA example using JpaRepository 2 | dependencies { 3 | compile spring.data, misc.guava 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter12/jms-artemis/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile spring.jms, misc.jms, misc.artemisClient 3 | 4 | testCompile spring.test 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes("Created-By" : "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Main-Class" : "com.apress.prospring5.ch12.JmsArtemisDemo", 12 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS SINGER; 2 | 3 | CREATE TABLE SINGER ( 4 | ID INT NOT NULL AUTO_INCREMENT 5 | , FIRST_NAME VARCHAR(60) NOT NULL 6 | , LAST_NAME VARCHAR(40) NOT NULL 7 | , BIRTH_DATE DATE 8 | , DESCRIPTION VARCHAR(2000) 9 | , PHOTO BLOB 10 | , VERSION INT NOT NULL DEFAULT 0 11 | , UNIQUE UQ_SINGER_1 (FIRST_NAME, LAST_NAME) 12 | , PRIMARY KEY (ID) 13 | ); 14 | -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/decoupled/HelloWorldMessageProvider.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2.decoupled; 2 | 3 | public class HelloWorldMessageProvider implements MessageProvider { 4 | 5 | public HelloWorldMessageProvider(){ 6 | System.out.println(" --> HelloWorldMessageProvider: 생성자가 호출됨"); 7 | } 8 | 9 | @Override 10 | public String getMessage() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter04/events/src/main/java/com/apress/prospring5/ch4/MessageEventListener.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | import org.springframework.context.ApplicationListener; 4 | 5 | public class MessageEventListener implements ApplicationListener { 6 | @Override 7 | public void onApplicationEvent(MessageEvent event) { 8 | MessageEvent msgEvt = event; 9 | System.out.println("수신: " + msgEvt.getMessage()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/aop-namespace/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:proxyfactorybean') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes( 9 | "Created-By": "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Main-Class": "com.apress.prospring5.ch5.AopNamespaceDemo", 12 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 13 | ) 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /chapter05/cglib-performance/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch5.ProxyPerfTest", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter05/regex-pointcuts/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch5.RegexpPointcutDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter05/simple-name-matching/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch5.NamePointcutDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter05/static-pointcut/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch5.StaticPointcutDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter06/plain-jdbc/src/main/resources/db/ddl.sql: -------------------------------------------------------------------------------- 1 | CREATE USER 'prospring5'@'localhost' IDENTIFIED BY 'prospring5'; 2 | 3 | CREATE SCHEMA MUSICDB; 4 | GRANT ALL PRIVILEGES ON MUSICDB . * TO 'prospring5'@'localhost'; 5 | FLUSH PRIVILEGES; 6 | 7 | /* 에러(java.sql.SQLException: The server timezone value 'UTC' 8 | * is unrecognized or represents more than one timezone.)가 발생할 때. 9 | * DB 환경변수를 KST로 설정한다. (원서는 러시아 표준시인 +3:00이 설정돼 있었음) */ 10 | SET GLOBAL time_zone = '+9:00'; -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/jqgrid/plugins/searchFilter.css: -------------------------------------------------------------------------------- 1 | .ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;} 2 | .ui-searchFilter table {position:relative; margin:0em; width:auto} 3 | .ui-searchFilter table td {margin: 0em; padding: 1px;} 4 | .ui-searchFilter table td input, .ui-searchFilter table td select {margin: 0.1em;} 5 | .ui-searchFilter .ui-state-default { cursor: pointer; } 6 | .ui-searchFilter .divider hr {margin: 1px; } -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/annotated/HelloWorldMessageProvider.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.annotated; 2 | 3 | import com.apress.prospring5.ch2.decoupled.MessageProvider; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component("provider") 7 | public class HelloWorldMessageProvider implements MessageProvider { 8 | 9 | @Override 10 | public String getMessage() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter04/events/src/main/java/com/apress/prospring5/ch4/MessageEvent.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | import org.springframework.context.ApplicationEvent; 4 | 5 | public class MessageEvent extends ApplicationEvent { 6 | private String msg; 7 | 8 | public MessageEvent(Object source, String msg) { 9 | super(source); 10 | this.msg = msg; 11 | } 12 | 13 | public String getMessage() { 14 | return msg; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /chapter04/groovy-config/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'groovy' 2 | 3 | dependencies { 4 | compile misc.groovy 5 | compile project(':chapter03:bean-inheritance') 6 | } 7 | 8 | jar { 9 | manifest { 10 | attributes("Created-By" : "Iuliana Cosmina", 11 | "Specification-Title": "Pro Spring 5", 12 | "Main-Class" : "com.apress.prospring5.ch4.GroovyConfig", 13 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 14 | } 15 | } -------------------------------------------------------------------------------- /chapter05/modification-introduction/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch5.IntroductionDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter05/simple-before-advice/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch5.SimpleBeforeAdvice", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/jqgrid/plugins/searchFilter.css: -------------------------------------------------------------------------------- 1 | .ui-searchFilter { display: none; position: absolute; z-index: 770; overflow: visible;} 2 | .ui-searchFilter table {position:relative; margin:0em; width:auto} 3 | .ui-searchFilter table td {margin: 0em; padding: 1px;} 4 | .ui-searchFilter table td input, .ui-searchFilter table td select {margin: 0.1em;} 5 | .ui-searchFilter .ui-state-default { cursor: pointer; } 6 | .ui-searchFilter .divider hr {margin: 1px; } -------------------------------------------------------------------------------- /chapter03/collections/src/main/java/com/apress/prospring5/ch3/xml/LyricHolder.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.xml; 2 | 3 | import com.apress.prospring5.ch3.ContentHolder; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 2/19/17. 7 | */ 8 | public class LyricHolder implements ContentHolder{ 9 | private String value = "'You be the DJ, I'll be the driver'"; 10 | 11 | 12 | @Override public String toString() { 13 | return "LyricHolder: { " + value + "}"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter04/bean-name-aware/src/main/resources/spring/app-context-xml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /chapter04/java-config-message-provider/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter03:constructor-injection') 3 | testCompile testing.junit 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch4.JavaConfigExampleOne", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter04/property-editors/src/main/java/com/apress/prospring5/ch4/custom/NamePropertyEditor.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4.custom; 2 | 3 | import java.beans.PropertyEditorSupport; 4 | 5 | public class NamePropertyEditor extends PropertyEditorSupport { 6 | @Override 7 | public void setAsText(String text) throws IllegalArgumentException { 8 | String[] name = text.split("\\s"); 9 | 10 | setValue(new FullName(name[0], name[1])); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter08/hibernate-envers/src/main/java/com/apress/prospring5/ch8/AuditorAwareBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8; 2 | 3 | import org.springframework.data.domain.AuditorAware; 4 | import org.springframework.stereotype.Component; 5 | 6 | import java.util.Optional; 7 | 8 | @Component 9 | public class AuditorAwareBean implements AuditorAware { 10 | public Optional getCurrentAuditor() { 11 | return Optional.of("prospring5"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter05/annotation-pointcut/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes( 9 | "Created-By": "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Main-Class": "com.apress.prospring5.ch5.AnnotationPointcutDemo", 12 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 13 | ) 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /chapter05/proxyfactorybean-introduction/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch5.IntroductionConfigDemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter08/hibernate-envers/src/main/java/com/apress/prospring5/ch8/services/SingerAuditService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.services; 2 | 3 | import com.apress.prospring5.ch8.entities.SingerAudit; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerAuditService { 8 | List findAll(); 9 | SingerAudit findById(Long id); 10 | SingerAudit save(SingerAudit singerAudit); 11 | SingerAudit findAuditByRevision(Long id, int revision); 12 | } 13 | -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-audit/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | dependencies { 3 | compile spring.aspects, spring.data, misc.guava 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch8.SpringAuditJPADemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-audit/src/main/java/com/apress/prospring5/ch8/AuditorAwareBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8; 2 | 3 | import org.springframework.data.domain.AuditorAware; 4 | import org.springframework.stereotype.Component; 5 | 6 | import java.util.Optional; 7 | 8 | @Component 9 | public class AuditorAwareBean implements AuditorAware { 10 | public Optional getCurrentAuditor() { 11 | return Optional.of("prospring5"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter12/base-remote/src/main/java/com/apress/prospring5/ch12/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12.services; 2 | 3 | import com.apress.prospring5.ch12.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | 9 | List findAll(); 10 | 11 | List findByFirstName(String firstName); 12 | 13 | Singer findById(Long id); 14 | 15 | Singer save(Singer singer); 16 | 17 | void delete(Singer singer); 18 | } 19 | -------------------------------------------------------------------------------- /chapter12/boot-rest/src/main/java/com/apress/prospring5/ch12/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12.services; 2 | 3 | import com.apress.prospring5.ch12.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | 9 | List findAll(); 10 | 11 | List findByFirstName(String firstName); 12 | 13 | Singer findById(Long id); 14 | 15 | Singer save(Singer singer); 16 | 17 | void delete(Singer singer); 18 | } 19 | -------------------------------------------------------------------------------- /chapter04/java-config-message-provider/src/main/java/com/apress/prospring5/ch4/multiple/AppConfigFour.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4.multiple; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 3/15/17. 8 | */ 9 | @Configuration 10 | @ComponentScan(basePackages={"com.apress.prospring5.ch4.annotated"}) 11 | public class AppConfigFour { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-boot/src/main/java/com/apress/prospring5/ch16/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.services; 2 | 3 | import com.apress.prospring5.ch16.entities.Singer; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | 7 | import java.util.List; 8 | 9 | public interface SingerService { 10 | List findAll(); 11 | Singer findById(Long id); 12 | Singer save(Singer singer); 13 | } 14 | -------------------------------------------------------------------------------- /chapter03/bean-instantiation-mode/src/main/java/com/apress/prospring5/ch3/Singleton.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class Singleton { 4 | private static Singleton instance; 5 | 6 | static { 7 | instance = new Singleton(); 8 | } 9 | 10 | public static Singleton getInstance() { 11 | return instance; 12 | } 13 | 14 | private Singleton(){ 15 | // needed so developers cannot instantiate this class directly 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/mixed/HelloWorldConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.mixed; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.context.annotation.ImportResource; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 1/29/17. 8 | */ 9 | @ImportResource(locations = {"classpath:spring/app-context-xml.xml"}) 10 | @Configuration 11 | public class HelloWorldConfiguration { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /chapter04/boot-web/src/main/java/com/apress/prospring5/ch4/ctrl/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4.ctrl; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 3/19/17. 8 | */ 9 | @RestController 10 | public class HelloWorld { 11 | 12 | @RequestMapping("/") 13 | public String sayHi() { 14 | return "Hello World!"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /chapter05/aop-namespace/src/main/java/com/apress/prospring5/ch5/SimpleAdvice.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import org.aspectj.lang.JoinPoint; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 4/9/17. 7 | */ 8 | public class SimpleAdvice { 9 | 10 | public void simpleBeforeAdvice(JoinPoint joinPoint) { 11 | System.out.println("Executing: " + 12 | joinPoint.getSignature().getDeclaringTypeName() + " " 13 | + joinPoint.getSignature().getName()); 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /chapter08/boot-jpa/src/main/java/com/apress/prospring5/ch8/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8; 2 | 3 | import com.apress.prospring5.ch8.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | import java.util.List; 7 | 8 | public interface SingerRepository extends CrudRepository { 9 | List findByFirstName(String firstName); 10 | List findByFirstNameAndLastName(String firstName, String lastName); 11 | } 12 | -------------------------------------------------------------------------------- /chapter08/jpa-crud/src/main/java/com/apress/prospring5/ch8/service/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.service; 2 | 3 | import com.apress.prospring5.ch8.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | List findAll(); 9 | List findAllWithAlbum(); 10 | Singer findById(Long id); 11 | Singer save(Singer singer); 12 | void delete(Singer singer); 13 | List findAllByNativeQuery(); 14 | } 15 | -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-alt/src/main/java/com/apress/prospring5/ch8/services/AlbumService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.services; 2 | 3 | import com.apress.prospring5.ch8.entities.Album; 4 | import com.apress.prospring5.ch8.entities.Singer; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by iuliana.cosmina on 5/7/17. 10 | */ 11 | public interface AlbumService { 12 | List findBySinger(Singer singer); 13 | 14 | List findByTitle(String title); 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | *.iml 4 | out 5 | build 6 | gradle 7 | gradlew* 8 | *.class 9 | transaction-logs 10 | .project 11 | .settings 12 | target 13 | .classpath 14 | WebContent 15 | bin 16 | 17 | # Mobile Tools for Java (J2ME) 18 | .mtj.tmp/ 19 | 20 | # Package Files # 21 | *.jar 22 | *.war 23 | *.ear 24 | *.log 25 | 26 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 27 | hs_err_pid* 28 | 29 | gradlew 30 | gradlew.bat 31 | .DS_Store 32 | generated -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/annotated/HelloWorldConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.annotated; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 1/29/17. 8 | */ 9 | @ComponentScan(basePackages = {"com.apress.prospring5.ch3.annotated"}) 10 | @Configuration 11 | public class HelloWorldConfiguration { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /chapter05/aop-hello-world/src/main/java/com/apress/prospring5/ch5/SimpleBeforeAdvice.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import org.springframework.aop.MethodBeforeAdvice; 6 | 7 | public class SimpleBeforeAdvice implements MethodBeforeAdvice { 8 | @Override 9 | public void before(Method method, Object[] args, Object target) 10 | throws Throwable { 11 | System.out.println("Before method: " + method); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /chapter08/hibernate-envers/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | dependencies { 3 | compile spring.aspects, spring.data, misc.guava, hibernate.envers 4 | } 5 | 6 | jar { 7 | manifest { 8 | attributes("Created-By" : "Iuliana Cosmina", 9 | "Specification-Title": "Pro Spring 5", 10 | "Main-Class" : "com.apress.prospring5.ch8.SpringEnversJPADemo", 11 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 12 | } 13 | } -------------------------------------------------------------------------------- /chapter08/jpa-criteria/src/main/java/com/apress/prospring5/ch8/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8; 2 | 3 | import java.util.List; 4 | 5 | public interface SingerService { 6 | List findAll(); 7 | List findAllWithAlbum(); 8 | Singer findById(Long id); 9 | Singer save(Singer singer); 10 | void delete(Singer singer); 11 | List findAllByNativeQuery(); 12 | List findByCriteriaQuery(String firstName, String lastName); 13 | } 14 | -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-audit/src/main/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE SINGER_AUDIT ( 2 | ID INT NOT NULL AUTO_INCREMENT 3 | , FIRST_NAME VARCHAR(60) NOT NULL 4 | , LAST_NAME VARCHAR(40) NOT NULL 5 | , BIRTH_DATE DATE 6 | , VERSION INT NOT NULL DEFAULT 0 7 | , CREATED_BY VARCHAR(20) 8 | , CREATED_DATE TIMESTAMP 9 | , LAST_MODIFIED_BY VARCHAR(20) 10 | , LAST_MODIFIED_DATE TIMESTAMP 11 | , UNIQUE UQ_SINGER_AUDIT_1 (FIRST_NAME, LAST_NAME) 12 | , PRIMARY KEY (ID) 13 | ); 14 | -------------------------------------------------------------------------------- /chapter12/rest/src/main/java/com/apress/prospring5/ch12/CustomCredentialsProvider.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12; 2 | 3 | import org.apache.http.auth.AuthScope; 4 | import org.apache.http.auth.Credentials; 5 | import org.apache.http.impl.client.BasicCredentialsProvider; 6 | 7 | public class CustomCredentialsProvider extends BasicCredentialsProvider { 8 | public void setCredentials(Credentials credentials) { 9 | this.setCredentials(AuthScope.ANY, credentials); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter03/dependency-pull/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile spring.context, misc.slf4jJcl, misc.logback 4 | testCompile testing.junit 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes("Created-By" : "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Main-Class" : "com.apress.prospring5.ch3.DependencyPull", 12 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 13 | } 14 | } -------------------------------------------------------------------------------- /chapter08/spring-data-jpa/src/main/java/com/apress/prospring5/ch8/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8; 2 | 3 | import java.util.List; 4 | 5 | import com.apress.prospring5.ch8.entities.Singer; 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | public interface SingerRepository extends CrudRepository { 9 | List findByFirstName(String firstName); 10 | List findByFirstNameAndLastName(String firstName, String lastName); 11 | } 12 | -------------------------------------------------------------------------------- /chapter12/spring-invoker/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | dependencies { 4 | compile project(':chapter12:base-remote') 5 | compile spring.webmvc, web.servlet, misc.yasson 6 | testCompile spring.test 7 | } 8 | 9 | 10 | war { 11 | archiveName = 'remoting.war' 12 | manifest { 13 | attributes("Created-By" : "Iuliana Cosmina", 14 | "Specification-Title": "Pro Spring 5", 15 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /chapter03/method-injection/src/main/java/com/apress/prospring5/ch3/StandardLookupDemoBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class StandardLookupDemoBean implements DemoBean { 4 | 5 | private Singer mySinger; 6 | 7 | public void setMySinger(Singer mySinger) { 8 | this.mySinger = mySinger; 9 | } 10 | 11 | @Override 12 | public Singer getMySinger() { 13 | return this.mySinger; 14 | } 15 | 16 | @Override 17 | public void doSomething() { 18 | mySinger.sing(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/resources/spring/xml-bean-factory-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /chapter12/secure-rest/src/main/java/com/apress/prospring5/ch12/CustomCredentialsProvider.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12; 2 | 3 | import org.apache.http.auth.AuthScope; 4 | import org.apache.http.auth.Credentials; 5 | import org.apache.http.impl.client.BasicCredentialsProvider; 6 | 7 | public class CustomCredentialsProvider extends BasicCredentialsProvider { 8 | public void setCredentials(Credentials credentials) { 9 | this.setCredentials(AuthScope.ANY, credentials); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter03/setter-injection/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile spring.context, misc.slf4jJcl, misc.logback 4 | testCompile testing.junit 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes("Created-By" : "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Main-Class" : "com.apress.prospring5.ch3.DeclareSpringComponents", 12 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 13 | } 14 | } -------------------------------------------------------------------------------- /chapter13/base-test/src/main/java/com/apress/prospring5/ch13/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch13.repos; 2 | 3 | import com.apress.prospring5.ch13.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | import java.util.List; 7 | 8 | public interface SingerRepository extends CrudRepository { 9 | 10 | List findByFirstName(String firstName); 11 | 12 | Singer findByFirstNameAndLastName(String firstName, String lastName); 13 | } 14 | -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/common/Guitar.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2.common; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 4/2/17. 5 | */ 6 | public class Guitar { 7 | private String brand =" Martin"; 8 | 9 | public String play(){ 10 | return "G C G C Am D7"; 11 | } 12 | 13 | public String getBrand() { 14 | return brand; 15 | } 16 | 17 | public void setBrand(String brand) { 18 | this.brand = brand; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter03/injection/src/main/java/com/apress/prospring5/ch3/BookwormOracle.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class BookwormOracle implements Oracle { 4 | private Encyclopedia encyclopedia; 5 | 6 | public void setEncyclopedia(Encyclopedia encyclopedia) { 7 | this.encyclopedia = encyclopedia; 8 | } 9 | 10 | @Override 11 | public String defineMeaningOfLife() { 12 | return "Encyclopedias are a waste of money - go see the world instead"; 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /chapter12/spring-invoker/src/main/java/com/apress/prospring5/ch12/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch12.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | /** 8 | * Created by iuliana.cosmina on 6/5/17. 9 | */ 10 | @Configuration 11 | @EnableWebMvc 12 | public class WebConfig implements WebMvcConfigurer { 13 | 14 | } -------------------------------------------------------------------------------- /chapter15/boot-jmx/src/main/java/com/apress/prospring5/ch15/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch15.repos; 2 | 3 | import com.apress.prospring5.ch15.entities.Singer; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | import java.util.List; 7 | 8 | public interface SingerRepository extends CrudRepository { 9 | 10 | List findByFirstName(String firstName); 11 | 12 | List findByFirstNameAndLastName(String firstName, String lastName); 13 | } 14 | -------------------------------------------------------------------------------- /chapter02/hello-world/src/main/java/com/apress/prospring5/ch2/decoupled/HelloWorldDecoupledWithFactory.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch2.decoupled; 2 | 3 | public class HelloWorldDecoupledWithFactory { 4 | 5 | public static void main(String... args) { 6 | MessageRenderer mr = MessageSupportFactory.getInstance().getMessageRenderer(); 7 | MessageProvider mp = MessageSupportFactory.getInstance().getMessageProvider(); 8 | mr.setMessageProvider(mp); 9 | mr.render(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /chapter03/bean-autowiring/src/main/java/com/apress/prospring5/ch3/sandbox/FooImplOne.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.sandbox; 2 | 3 | import org.springframework.context.annotation.Primary; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 2/23/17. 8 | */ 9 | @Component 10 | //Decomment the following annotation and comment the @Qualifier in the TrickyTarget class to test this annotation 11 | //@Primary 12 | public class FooImplOne implements Foo { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /chapter03/setter-injection/src/main/java/com/apress/prospring5/ch3/BookwormOracle.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class BookwormOracle implements Oracle { 4 | private Encyclopedia encyclopedia; 5 | 6 | public void setEncyclopedia(Encyclopedia encyclopedia) { 7 | this.encyclopedia = encyclopedia; 8 | } 9 | 10 | @Override 11 | public String defineMeaningOfLife() { 12 | return "Encyclopedias are a waste of money - go see the world instead"; 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /chapter09/transactions-annotation/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter09:base-dao') 3 | compile (hibernate.tx) { 4 | exclude group: 'org.hibernate', module: 'hibernate' 5 | } 6 | 7 | } 8 | 9 | jar { 10 | manifest { 11 | attributes("Created-By" : "Iuliana Cosmina", 12 | "Specification-Title": "Pro Spring 5", 13 | "Main-Class" : "com.apress.prospring5.ch9.TxAnnotationDemo", 14 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 15 | } 16 | } -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/java/com/apress/prospring5/ch16/util/Message.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.util; 2 | 3 | public class Message { 4 | private String type; 5 | private String message; 6 | 7 | public Message(String type, String message) { 8 | this.type = type; 9 | this.message = message; 10 | } 11 | 12 | public String getType() { 13 | return type; 14 | } 15 | 16 | public String getMessage() { 17 | return message; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/java/com/apress/prospring5/ch16/util/Message.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.util; 2 | 3 | public class Message { 4 | private String type; 5 | private String message; 6 | 7 | public Message(String type, String message) { 8 | this.type = type; 9 | this.message = message; 10 | } 11 | 12 | public String getType() { 13 | return type; 14 | } 15 | 16 | public String getMessage() { 17 | return message; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /chapter03/bean-aliases/src/main/resources/spring/app-context-02.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /chapter05/proxyfactorybean/src/main/java/com/apress/prospring5/ch5/AuditAdvice.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import org.aspectj.lang.JoinPoint; 4 | import org.springframework.aop.MethodBeforeAdvice; 5 | 6 | import java.lang.reflect.Method; 7 | 8 | public class AuditAdvice implements MethodBeforeAdvice { 9 | 10 | @Override 11 | public void before(Method method, Object[] args, Object target) 12 | throws Throwable { 13 | System.out.println("Executing: " + method); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter09/base-dao/src/main/java/com/apress/prospring5/ch9/repos/AlbumRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch9.repos; 2 | 3 | import com.apress.prospring5.ch9.entities.Album; 4 | import com.apress.prospring5.ch9.entities.Singer; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by iuliana.cosmina on 5/7/17. 11 | */ 12 | public interface AlbumRepository extends JpaRepository { 13 | List findBySinger(Singer singer); 14 | } 15 | -------------------------------------------------------------------------------- /chapter18/boot-tests/src/test/java/com/apress/prospring5/ch18/test/config/TestConfig.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch18.test.config; 2 | 3 | import com.apress.prospring5.ch18.FluxGenerator; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | /** 8 | * Created by iuliana.cosmina on 8/6/17. 9 | */ 10 | @Configuration 11 | public class TestConfig { 12 | 13 | @Bean FluxGenerator generator(){ 14 | return new FluxGenerator(); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /chapter03/constructor-injection/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile spring.context, misc.slf4jJcl, misc.logback 4 | testCompile testing.junit 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes("Created-By" : "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Main-Class" : "com.apress.prospring5.ch3.annotated.ConstructorConfusion", 12 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter04/boot-simple/src/main/java/com/apress/prospring5/ch4/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * Created by iuliana.cosmina on 3/19/17. 9 | */ 10 | @Component 11 | public class HelloWorld { 12 | 13 | private static Logger logger = LoggerFactory.getLogger(HelloWorld.class); 14 | 15 | public void sayHi() { 16 | logger.info("Hello World!"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /chapter05/composable-pointcut/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | compile project(':chapter05:simple-name-matching') 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes("Created-By" : "Iuliana Cosmina", 10 | "Specification-Title": "Pro Spring 5", 11 | "Main-Class" : "com.apress.prospring5.ch5.ComposablePointcutDemo", 12 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 13 | } 14 | } -------------------------------------------------------------------------------- /chapter07/hibernate-base/src/main/java/com/apress/prospring5/ch7/dao/SingerDao.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch7.dao; 2 | 3 | import com.apress.prospring5.ch7.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by iuliana.cosmina on 4/21/17. 9 | */ 10 | public interface SingerDao { 11 | 12 | List findAll(); 13 | 14 | List findAllWithAlbum(); 15 | 16 | Singer findById(Long id); 17 | 18 | Singer save(Singer singer); 19 | 20 | void delete(Singer singer); 21 | } 22 | -------------------------------------------------------------------------------- /chapter07/hibernate-crud/src/main/java/com/apress/prospring5/ch7/dao/SingerDao.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch7.dao; 2 | 3 | import com.apress.prospring5.ch7.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by iuliana.cosmina on 4/21/17. 9 | */ 10 | public interface SingerDao { 11 | 12 | List findAll(); 13 | 14 | List findAllWithAlbum(); 15 | 16 | Singer findById(Long id); 17 | 18 | Singer save(Singer singer); 19 | 20 | void delete(Singer singer); 21 | } 22 | -------------------------------------------------------------------------------- /chapter03/cdl/src/main/java/com/apress/prospring5/ch3/ContextualizedDependencyLookup.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class ContextualizedDependencyLookup implements ManagedComponent { 4 | private Dependency dependency; 5 | 6 | @Override 7 | public void performLookup(Container container) { 8 | this.dependency = (Dependency) container.getDependency("myDependency"); 9 | } 10 | 11 | @Override 12 | public String toString() { 13 | return dependency.toString(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/security/src/main/java/com/apress/prospring5/ch5/UserInfo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class UserInfo { 4 | private String userName; 5 | private String password; 6 | 7 | public UserInfo(String userName, String password) { 8 | this.userName = userName; 9 | this.password = password; 10 | } 11 | 12 | public String getPassword() { 13 | return password; 14 | } 15 | 16 | public String getUserName() { 17 | return userName; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /chapter07/chapter07.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | group 'com.apress.prospring5.ch07' 3 | apply plugin: 'java' 4 | 5 | /* build/libs 아래에 모든 의존성을 복사하는 작업 */ 6 | task copyDependencies(type: Copy) { 7 | from configurations.compile 8 | into 'build/libs' 9 | } 10 | 11 | dependencies { 12 | // boot 모듈을 제외한 모든 서브 모듈에 다음과 같은 종속성을 지정함 13 | if (!project.name.contains("boot")) { 14 | compile spring.contextSupport, spring.orm, misc.slf4jJcl, misc.logback, db.h2, misc.lang3, hibernate.em 15 | } 16 | testCompile testing.junit 17 | } 18 | } -------------------------------------------------------------------------------- /chapter12/rest/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | dependencies { 4 | compile project(':chapter12:base-remote') 5 | compile spring.oxm, spring.webmvc, web.servlet, misc.castor, misc.jacksonDatabind, web.httpclient 6 | testCompile spring.test 7 | } 8 | 9 | 10 | war { 11 | archiveName = 'rest.war' 12 | manifest { 13 | attributes("Created-By" : "Iuliana Cosmina", 14 | "Specification-Title": "Pro Spring 5", 15 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-boot/src/main/resources/templates/fragments/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 |
10 |

Copyright (c) 2017 by Iuliana Cosmina and Apress. All rights reserved.

11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /chapter05/aspectj-regex-pointcuts/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':chapter02:hello-world') 3 | compile project(':chapter05:aop-hello-world') 4 | compile project(':chapter05:regex-pointcuts') 5 | } 6 | 7 | jar { 8 | manifest { 9 | attributes( 10 | "Created-By": "Iuliana Cosmina", 11 | "Specification-Title": "Pro Spring 5", 12 | "Main-Class": "com.apress.prospring5.ch5.AspectjexpPointcutDemo", 13 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 14 | ) 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/java/com/apress/prospring5/ch16/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.services; 2 | 3 | import java.util.List; 4 | 5 | import com.apress.prospring5.ch16.entities.Singer; 6 | import org.springframework.data.domain.Page; 7 | import org.springframework.data.domain.Pageable; 8 | 9 | public interface SingerService { 10 | List findAll(); 11 | Singer findById(Long id); 12 | Singer save(Singer singer); 13 | Page findAllByPage(Pageable pageable); 14 | } 15 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/java/com/apress/prospring5/ch16/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch16.services; 2 | 3 | import java.util.List; 4 | 5 | import com.apress.prospring5.ch16.entities.Singer; 6 | import org.springframework.data.domain.Page; 7 | import org.springframework.data.domain.Pageable; 8 | 9 | public interface SingerService { 10 | List findAll(); 11 | Singer findById(Long id); 12 | Singer save(Singer singer); 13 | Page findAllByPage(Pageable pageable); 14 | } 15 | -------------------------------------------------------------------------------- /chapter03/field-injection/src/main/java/com/apress/prospring5/ch3/annotated/Singer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.annotated; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 2/15/17. 8 | */ 9 | @Service("singer") 10 | public class Singer { 11 | 12 | @Autowired 13 | private Inspiration inspirationBean; 14 | 15 | public void sing() { 16 | System.out.println("... " + inspirationBean.getLyric()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /chapter03/bean-aliases/src/main/resources/spring/app-context-03.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /chapter03/collections/src/main/java/com/apress/prospring5/ch3/FtpArtworkSender.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3; 2 | 3 | public class FtpArtworkSender implements ArtworkSender { 4 | @Override 5 | public void sendArtwork(String artworkPath, Recipient recipient) { 6 | // ftp 로직을 여기에 구현 7 | } 8 | 9 | @Override 10 | public String getFriendlyName() { 11 | return "파일 전송 프로토콜"; 12 | } 13 | 14 | @Override 15 | public String getShortName() { 16 | return "ftp"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /chapter04/profiles/src/main/resources/spring/highschool-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /chapter09/base-dao/src/main/java/com/apress/prospring5/ch9/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch9.repos; 2 | 3 | import com.apress.prospring5.ch9.entities.Singer; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.jpa.repository.Query; 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | public interface SingerRepository extends CrudRepository { 9 | 10 | @Query("select count(s) from Singer s") 11 | Long countAllSingers(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /chapter04/bean-name-aware/src/main/java/com/apress/prospring5/ch4/NamedSinger.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | import org.springframework.beans.factory.BeanNameAware; 4 | 5 | public class NamedSinger implements BeanNameAware { 6 | private String name; 7 | 8 | /** @Implements {@link BeanNameAware#setBeanName(String)} */ 9 | public void setBeanName(String beanName) { 10 | this.name = beanName; 11 | } 12 | 13 | public void sing() { 14 | System.out.println("Singer [" + name + "] - sing()"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /chapter04/profiles/src/main/resources/spring/kindergarten-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /chapter05/aop-namespace/src/main/java/com/apress/prospring5/ch5/NewDocumentarist.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import com.apress.prospring5.ch2.common.Guitar; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 4/9/17. 7 | */ 8 | public class NewDocumentarist extends Documentarist { 9 | 10 | @Override 11 | public void execute() { 12 | guitarist.sing(); 13 | Guitar guitar = new Guitar(); 14 | guitar.setBrand("Gibson"); 15 | guitarist.sing(guitar); 16 | //guitarist.sing(new Guitar()); 17 | guitarist.talk(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /chapter04/chapter04.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | group 'com.apress.prospring5.ch04' 3 | apply plugin: 'java' 4 | 5 | /*Task that copies all the dependencies under build/libs */ 6 | task copyDependencies(type: Copy) { 7 | from configurations.compile 8 | into 'build/libs' 9 | } 10 | 11 | dependencies { 12 | //we specify these dependencies for all submodules, except the boot module, that defines its own 13 | if (!project.name.contains("boot")) { 14 | compile spring.context,misc.slf4jJcl, misc.logback 15 | } 16 | testCompile testing.junit 17 | } 18 | } -------------------------------------------------------------------------------- /chapter04/factory-bean-and-factory-method-attributes/src/main/java/com/apress/prospring5/ch4/MessageDigestFactory.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | import java.security.MessageDigest; 4 | 5 | public class MessageDigestFactory { 6 | private String algorithmName = "MD5"; 7 | 8 | public MessageDigest createInstance() throws Exception { 9 | return MessageDigest.getInstance(algorithmName); 10 | } 11 | 12 | public void setAlgorithmName(String algorithmName) { 13 | this.algorithmName = algorithmName; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/aop-hello-world/src/main/java/com/apress/prospring5/ch5/AgentDecorator.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import org.aopalliance.intercept.MethodInterceptor; 4 | import org.aopalliance.intercept.MethodInvocation; 5 | 6 | public class AgentDecorator implements MethodInterceptor { 7 | public Object invoke(MethodInvocation invocation) throws Throwable { 8 | System.out.print("James "); 9 | 10 | Object retVal = invocation.proceed(); 11 | 12 | System.out.println("!"); 13 | return retVal; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/security/src/main/java/com/apress/prospring5/ch5/SecurityManager.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | public class SecurityManager { 4 | private static ThreadLocal threadLocal = new ThreadLocal<>(); 5 | 6 | public void login(String userName, String password) { 7 | threadLocal.set(new UserInfo(userName, password)); 8 | } 9 | 10 | public void logout() { 11 | threadLocal.set(null); 12 | } 13 | 14 | public UserInfo getLoggedOnUser() { 15 | return threadLocal.get(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /chapter13/base-test/src/main/java/com/apress/prospring5/ch13/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch13.services; 2 | 3 | import com.apress.prospring5.ch13.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | 9 | List findAll(); 10 | 11 | List findByFirstName(String firstName); 12 | 13 | Singer findById(Long id); 14 | 15 | Singer save(Singer singer); 16 | 17 | void delete(Singer singer); 18 | 19 | Singer findByFirstNameAndLastName(String firstName, String lastName); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /chapter15/boot-jmx/src/main/java/com/apress/prospring5/ch15/services/SingerService.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch15.services; 2 | 3 | import com.apress.prospring5.ch15.entities.Singer; 4 | 5 | import java.util.List; 6 | 7 | public interface SingerService { 8 | 9 | List findAll(); 10 | 11 | List findByFirstName(String firstName); 12 | 13 | List findByFirstNameAndLastName(String firstName, String lastName); 14 | 15 | Singer findById(Long id); 16 | 17 | Singer save(Singer singer); 18 | 19 | void delete(Singer singer); 20 | } 21 | -------------------------------------------------------------------------------- /chapter15/jmx/src/main/java/com/apress/prospring5/ch15/AppStatisticsImpl.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch15; 2 | 3 | import com.apress.prospring5.ch12.services.SingerService; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Component; 6 | 7 | public class AppStatisticsImpl implements AppStatistics { 8 | @Autowired 9 | private SingerService singerService; 10 | 11 | @Override 12 | public int getTotalSingerCount() { 13 | return singerService.findAll().size(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter03/collections/src/main/java/com/apress/prospring5/ch3/annotated/LyricHolder.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.annotated; 2 | 3 | import com.apress.prospring5.ch3.ContentHolder; 4 | import org.springframework.stereotype.Service; 5 | 6 | /** 7 | * Created by iuliana.cosmina on 2/19/17. 8 | */ 9 | @Service("lyricHolder") 10 | public class LyricHolder implements ContentHolder{ 11 | 12 | private String value = "'You be the DJ, I'll be the driver'"; 13 | 14 | @Override public String toString() { 15 | return "LyricHolder: { " + value + "}"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /chapter04/groovy-config/src/main/groovy/com/apress/prospring5/ch4/GroovyConfig.groovy: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4 2 | 3 | import com.apress.prospring5.ch3.xml.Singer 4 | import org.springframework.context.support.GenericApplicationContext 5 | import org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader 6 | 7 | def ctx = new GenericApplicationContext() 8 | def reader = new GroovyBeanDefinitionReader(ctx) 9 | 10 | reader.beans { 11 | singer(Singer, name: 'John Mayer', age: 39) 12 | } 13 | 14 | ctx.refresh() 15 | 16 | println ctx.getBean("singer") 17 | -------------------------------------------------------------------------------- /chapter05/aspectj-annotations/src/main/java/com/apress/prospring5/ch5/AppConfig.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 6 | 7 | /** 8 | * Created by iuliana.cosmina on 4/9/17. 9 | */ 10 | @Configuration 11 | @ComponentScan(basePackages = {"com.apress.prospring5.ch5"}) 12 | @EnableAspectJAutoProxy(proxyTargetClass = true) 13 | public class AppConfig { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /chapter04/events/src/main/resources/spring/app-context-xml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /chapter16/singer-webapp-jcfg/src/main/webapp/WEB-INF/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | welcome_titlepane=Welcome to {0} 2 | welcome_h3=Welcome to {0} 3 | 4 | singer_save_success=singer saved successfully 5 | singer_save_fail=Failed saving singer 6 | 7 | validation.firstname.NotBlank.message=First name is required 8 | validation.lastname.NotBlank.message=Last name is required 9 | validation.firstname.Size.message=First name must be between {min} and {max} 10 | validation.lastname.Size.message=Last name must be between {min} and {max} 11 | 12 | message_login_fail=Login failed, please try again -------------------------------------------------------------------------------- /chapter16/singer-webapp-xml/src/main/webapp/WEB-INF/i18n/messages.properties: -------------------------------------------------------------------------------- 1 | welcome_titlepane=Welcome to {0} 2 | welcome_h3=Welcome to {0} 3 | 4 | singer_save_success=singer saved successfully 5 | singer_save_fail=Failed saving singer 6 | 7 | validation.firstname.NotBlank.message=First name is required 8 | validation.lastname.NotBlank.message=Last name is required 9 | validation.firstname.Size.message=First name must be between {min} and {max} 10 | validation.lastname.Size.message=Last name must be between {min} and {max} 11 | 12 | message_login_fail=Login failed, please try again -------------------------------------------------------------------------------- /chapter03/bean-inheritance/src/main/java/com/apress/prospring5/ch3/xml/Singer.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.xml; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 2/25/17. 5 | */ 6 | public class Singer { 7 | private String name; 8 | private int age; 9 | 10 | public void setName(String name) { 11 | this.name = name; 12 | } 13 | 14 | public void setAge(int age) { 15 | this.age = age; 16 | } 17 | 18 | public String toString() { 19 | return "\t이름: " + name + "\n\t" + "나이: " + age; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /chapter08/spring-data-jpa-alt/src/main/java/com/apress/prospring5/ch8/repos/SingerRepository.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch8.repos; 2 | 3 | import java.util.List; 4 | 5 | import com.apress.prospring5.ch8.entities.Singer; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.repository.CrudRepository; 8 | 9 | public interface SingerRepository extends JpaRepository { 10 | List findByFirstName(String firstName); 11 | List findByFirstNameAndLastName(String firstName, String lastName); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /chapter05/regex-pointcuts/src/main/java/com/apress/prospring5/ch5/Guitarist.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import com.apress.prospring5.ch2.common.Singer; 4 | 5 | /** 6 | * Created by iuliana.cosmina on 4/2/17. 7 | */ 8 | public class Guitarist implements Singer { 9 | 10 | @Override public void sing() { 11 | System.out.println("Just keep me where the light is"); 12 | } 13 | 14 | public void sing2() { 15 | System.out.println("Oh gravity, stay the hell away from me"); 16 | } 17 | 18 | public void rest() { 19 | System.out.println("zzz"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /chapter05-aspectj-aspects/src/main/java/com/apress/prospring5/ch5/AspectJDemo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import org.springframework.context.support.GenericXmlApplicationContext; 4 | 5 | public class AspectJDemo { 6 | public static void main(String... args) { 7 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 8 | ctx.load("classpath:spring/app-context-xml.xml"); 9 | ctx.refresh(); 10 | 11 | MessageWriter writer = new MessageWriter(); 12 | writer.writeMessage(); 13 | writer.foo(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/after-returning-advice-keygen/src/main/java/com/apress/prospring5/ch5/KeyGenerator.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch5; 2 | 3 | import java.util.Random; 4 | 5 | public class KeyGenerator { 6 | protected static final long WEAK_KEY = 0xFFFFFFF0000000L; 7 | protected static final long STRONG_KEY = 0xACDF03F590AE56L; 8 | 9 | private Random rand = new Random(); 10 | 11 | public long getKey() { 12 | int x = rand.nextInt(3); 13 | 14 | if (x == 1) { 15 | return WEAK_KEY; 16 | } 17 | 18 | return STRONG_KEY; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter06/chapter06.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | group 'com.apress.prospring5.ch06' 3 | apply plugin: 'java' 4 | 5 | /*Task that copies all the dependencies under build/libs */ 6 | task copyDependencies(type: Copy) { 7 | from configurations.compile 8 | into 'build/libs' 9 | } 10 | 11 | dependencies { 12 | //we specify these dependencies for all submodules, except the boot module, that defines its own 13 | if (!project.name.contains("boot")) { 14 | compile spring.context, spring.jdbc, misc.slf4jJcl, misc.logback, db.dbcp2, misc.lang3 15 | } 16 | testCompile testing.junit 17 | } 18 | } -------------------------------------------------------------------------------- /chapter03/bean-aliases/src/test/resources/spring/app-context-01.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /chapter03/nesting/src/main/resources/spring/parent-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /chapter05/chapter05.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | group 'com.apress.prospring5.ch05' 3 | apply plugin: 'java' 4 | 5 | /*Task that copies all the dependencies under build/libs */ 6 | task copyDependencies(type: Copy) { 7 | from configurations.compile 8 | into 'build/libs' 9 | } 10 | 11 | dependencies { 12 | //we specify these dependencies for all submodules, except the boot module, that defines its own 13 | if (!project.name.contains("boot")) { 14 | compile spring.context, misc.slf4jJcl, misc.logback, misc.aspectjweaver, misc.aspectjrt 15 | } 16 | testCompile testing.junit 17 | } 18 | } -------------------------------------------------------------------------------- /chapter12/secure-rest/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'war' 2 | 3 | dependencies { 4 | compile project(':chapter12:base-remote') 5 | compile spring.oxm, spring.webmvc, web.servlet, misc.castor, misc.jacksonDatabind, web.httpclient, 6 | spring.securityWeb, spring.securityConfig 7 | testCompile spring.test 8 | } 9 | 10 | 11 | war { 12 | archiveName = 'secure-rest.war' 13 | manifest { 14 | attributes("Created-By" : "Iuliana Cosmina", 15 | "Specification-Title": "Pro Spring 5", 16 | "Class-Path" : configurations.compile.collect { it.getName() }.join(' ')) 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter03/bean-instantiation-mode/src/main/resources/spring/app-context-xml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /chapter03/method-injection/src/main/java/com/apress/prospring5/ch3/annotated/AbstractLookupDemoBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch3.annotated; 2 | 3 | import org.springframework.beans.factory.annotation.Lookup; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component("abstractLookupBean") 7 | public class AbstractLookupDemoBean implements DemoBean { 8 | @Lookup("singer") 9 | public Singer getMySinger() { 10 | return null; // 동적으로 오버라이드 됨 11 | } 12 | 13 | @Override 14 | public void doSomething() { 15 | getMySinger().sing(); 16 | } 17 | } -------------------------------------------------------------------------------- /chapter04/bean-name-aware/src/main/java/com/apress/prospring5/ch4/NamedSingerDemo.java: -------------------------------------------------------------------------------- 1 | package com.apress.prospring5.ch4; 2 | 3 | import org.springframework.context.support.GenericXmlApplicationContext; 4 | 5 | public class NamedSingerDemo { 6 | public static void main(String... args) { 7 | GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(); 8 | ctx.load("classpath:spring/app-context-xml.xml"); 9 | ctx.refresh(); 10 | 11 | NamedSinger bean = (NamedSinger) ctx.getBean("johnMayer"); 12 | bean.sing(); 13 | 14 | ctx.close(); 15 | } 16 | } 17 | --------------------------------------------------------------------------------