├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── README.md ├── build.sh ├── checkstyle-rules.xml ├── checkstyle-suppressions.xml ├── docker-compose.yml ├── findbugs-rules.xml ├── nano-commons ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── commons │ │ │ ├── .gitkeep │ │ │ ├── annatations │ │ │ └── Property.java │ │ │ ├── crypt │ │ │ ├── CipherExecutor.java │ │ │ ├── CryptUtil.java │ │ │ ├── DecryptException.java │ │ │ ├── DefaultCipherExecutor.java │ │ │ ├── EncryptException.java │ │ │ └── NoOpCipherExecutor.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── EntityException.java │ │ │ ├── exception │ │ │ ├── ClassCastException.java │ │ │ ├── DateFormatException.java │ │ │ ├── Md5Exception.java │ │ │ ├── SerializationException.java │ │ │ ├── StringFormatException.java │ │ │ ├── UnsupportedAccessException.java │ │ │ └── ZipException.java │ │ │ ├── format │ │ │ ├── ClassCast.java │ │ │ ├── DateFormat.java │ │ │ └── Pattern.java │ │ │ ├── i18n │ │ │ ├── DefaultMessageSource.java │ │ │ ├── MessageSource.java │ │ │ └── NoSuchMessageException.java │ │ │ ├── io │ │ │ ├── AbstractResource.java │ │ │ ├── ClassPathResource.java │ │ │ ├── InputStreamSource.java │ │ │ ├── NestedExceptionUtils.java │ │ │ ├── NestedIOException.java │ │ │ └── Resource.java │ │ │ ├── loader │ │ │ ├── LoaderException.java │ │ │ └── PropertiesLoader.java │ │ │ ├── support │ │ │ ├── logging │ │ │ │ ├── AbstractAnalysisLogger.java │ │ │ │ ├── AnalysisLoggerMXBean.java │ │ │ │ ├── JakartaCommonsLoggingImpl.java │ │ │ │ ├── Jdk14LoggingImpl.java │ │ │ │ ├── Log4j2Impl.java │ │ │ │ ├── Logger.java │ │ │ │ ├── LoggerException.java │ │ │ │ ├── LoggerFactory.java │ │ │ │ ├── NoLoggingImpl.java │ │ │ │ ├── Resources.java │ │ │ │ └── SLF4JImpl.java │ │ │ └── message │ │ │ │ ├── AbstractMessageFactory.java │ │ │ │ ├── Message.java │ │ │ │ ├── MessageFactory.java │ │ │ │ ├── ObjectMessage.java │ │ │ │ ├── ParameterizedMessage.java │ │ │ │ ├── ParameterizedMessageFactory.java │ │ │ │ └── SimpleMessage.java │ │ │ └── util │ │ │ ├── AntPathMatcher.java │ │ │ ├── Assert.java │ │ │ ├── BASE64.java │ │ │ ├── Charsets.java │ │ │ ├── ClassUtils.java │ │ │ ├── CollectionBuilder.java │ │ │ ├── CollectionUtils.java │ │ │ ├── ContentType.java │ │ │ ├── MD5Utils.java │ │ │ ├── MapBuilder.java │ │ │ ├── MathUtils.java │ │ │ ├── MultiValueMap.java │ │ │ ├── ObjectCompare.java │ │ │ ├── ObjectUtils.java │ │ │ ├── PathMatcher.java │ │ │ ├── ReflectUtils.java │ │ │ ├── ResourceUtils.java │ │ │ ├── RuntimeUtil.java │ │ │ ├── SerializableUtils.java │ │ │ ├── StringUtils.java │ │ │ ├── UUIDUtils.java │ │ │ └── ZipUtils.java │ └── resources │ │ └── template │ │ ├── log4j.dtd │ │ ├── log4j.xml │ │ └── log4j2.xml │ └── test │ ├── java │ └── org │ │ └── nanoframework │ │ └── commons │ │ ├── .gitkeep │ │ ├── CommonsTestSuite.java │ │ ├── crypt │ │ └── CryptTest.java │ │ ├── entity │ │ ├── BaseEntityTest.java │ │ ├── ParentEntity.java │ │ └── UseEntity.java │ │ ├── format │ │ └── ClassCastTest.java │ │ ├── i18n │ │ ├── MessageSourceLocaleTest.java │ │ └── MessageSourceTest.java │ │ ├── io │ │ └── ClassPathResourceTest.java │ │ ├── loader │ │ └── PropertiesLoaderTest.java │ │ ├── support │ │ └── logging │ │ │ ├── JakataCommonsLoggingTest.java │ │ │ ├── Jdk14LoggingTest.java │ │ │ ├── Log4j2Test.java │ │ │ ├── Log4jTest.java │ │ │ └── NoLoggingTest.java │ │ └── util │ │ ├── AntPathMatcherTests.java │ │ ├── Base64Test.java │ │ ├── CollectionBuilderTest.java │ │ ├── MapBuilderTest.java │ │ ├── MathTest.java │ │ ├── Md5Test.java │ │ ├── ObjectCompareTest.java │ │ └── ZipTest.java │ └── resources │ ├── .gitkeep │ ├── context.properties │ └── messages │ ├── messages.properties │ ├── messages_en_US.properties │ ├── messages_zh_CN.properties │ └── messages_zh_TW.properties ├── nano-concurrent-parent ├── nano-concurrent-cluster │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── concurrent │ │ │ │ └── scheduler │ │ │ │ └── cluster │ │ │ │ ├── .gitkeep │ │ │ │ ├── BaseClusterScheduler.java │ │ │ │ ├── ClusterScheduler.java │ │ │ │ ├── ClusterSchedulerPlugin.java │ │ │ │ ├── config │ │ │ │ ├── Configure.java │ │ │ │ ├── Election.java │ │ │ │ ├── Node.java │ │ │ │ ├── NodeStatus.java │ │ │ │ ├── Worker.java │ │ │ │ └── WorkerStatus.java │ │ │ │ ├── consts │ │ │ │ ├── ConsulSources.java │ │ │ │ └── Keys.java │ │ │ │ ├── exception │ │ │ │ └── SchedulerRegistryException.java │ │ │ │ ├── loader │ │ │ │ └── ClusterSchedulerLoader.java │ │ │ │ ├── lock │ │ │ │ ├── AbstractConsulLocker.java │ │ │ │ └── ElectionLocker.java │ │ │ │ └── storage │ │ │ │ ├── .gitkeep │ │ │ │ ├── ElectionScheduler.java │ │ │ │ ├── NodeStatusSyncScheduler.java │ │ │ │ └── listener │ │ │ │ └── SchedulerListener.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ └── META-INF │ │ │ └── nano │ │ │ └── spi │ │ │ ├── org.nanoframework.concurrent.scheduler.loader.SchedulerLoader │ │ │ └── org.nanoframework.core.plugins.Plugin │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── concurrent │ │ │ └── scheduler │ │ │ └── cluster │ │ │ ├── .gitkeep │ │ │ ├── AbstractConsulTests.java │ │ │ ├── ClusterSchedulerSuite.java │ │ │ ├── Test2Scheduler.java │ │ │ ├── TestScheduler.java │ │ │ ├── config │ │ │ └── ConfigureListenerTest.java │ │ │ └── loader │ │ │ └── LoaderTest.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── cluster-scheduler-context.properties │ │ └── consul.properties ├── nano-concurrent-rocketmq │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── concurrent │ │ │ │ └── rocketmq │ │ │ │ └── .gitkeep │ │ └── resources │ │ │ └── .gitkeep │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── concurrent │ │ │ └── rocketmq │ │ │ └── .gitkeep │ │ └── resources │ │ └── .gitkeep ├── nano-concurrent │ ├── .gitignore │ ├── Cluster.graffle │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── concurrent │ │ │ │ ├── queue │ │ │ │ └── BlockingQueueFactory.java │ │ │ │ └── scheduler │ │ │ │ ├── BaseScheduler.java │ │ │ │ ├── CronExpression.java │ │ │ │ ├── Scheduler.java │ │ │ │ ├── SchedulerConfig.java │ │ │ │ ├── SchedulerFactory.java │ │ │ │ ├── SchedulerPlugin.java │ │ │ │ ├── SchedulerThreadFactory.java │ │ │ │ ├── exception │ │ │ │ └── SchedulerException.java │ │ │ │ ├── loader │ │ │ │ └── SchedulerLoader.java │ │ │ │ └── single │ │ │ │ ├── SchedulerAnalysis.java │ │ │ │ ├── SchedulerShutdownHook.java │ │ │ │ ├── SchedulerStatus.java │ │ │ │ └── StatusMonitorScheduler.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ └── META-INF │ │ │ └── nano │ │ │ └── spi │ │ │ └── org.nanoframework.core.plugins.Plugin │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── concurrent │ │ │ └── scheduler │ │ │ ├── .gitkeep │ │ │ ├── SchedulerSuite.java │ │ │ ├── longwait │ │ │ ├── LongWaitScheduler.java │ │ │ ├── PluginLoaderInit.java │ │ │ └── SchedulerTests.java │ │ │ └── tests │ │ │ ├── PluginLoaderInit.java │ │ │ ├── SchedulerTests.java │ │ │ ├── Test2Scheduler.java │ │ │ └── TestScheduler.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── longwait-context.properties │ │ └── test-context.properties └── pom.xml ├── nano-core ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── core │ │ │ ├── component │ │ │ ├── Components.java │ │ │ ├── aop │ │ │ │ ├── After.java │ │ │ │ ├── AfterInterceptor.java │ │ │ │ ├── AfterMore.java │ │ │ │ ├── AfterMoreInterceptor.java │ │ │ │ ├── Before.java │ │ │ │ ├── BeforeAndAfter.java │ │ │ │ ├── BeforeAndAfterInterceptor.java │ │ │ │ ├── BeforeAndAfterMore.java │ │ │ │ ├── BeforeAndAfterMoreInterceptor.java │ │ │ │ ├── BeforeInterceptor.java │ │ │ │ ├── BeforeMore.java │ │ │ │ ├── BeforeMoreInterceptor.java │ │ │ │ ├── IAfter.java │ │ │ │ ├── IBefore.java │ │ │ │ ├── IBeforeAndAfter.java │ │ │ │ └── MethodNames.java │ │ │ ├── exception │ │ │ │ ├── BindRequestParamException.java │ │ │ │ ├── ComponentInvokeException.java │ │ │ │ ├── ComponentScanException.java │ │ │ │ ├── ComponentServiceRepeatException.java │ │ │ │ └── ServiceInvokeException.java │ │ │ ├── scan │ │ │ │ ├── ClassScanner.java │ │ │ │ ├── DefaultVFS.java │ │ │ │ ├── JBoss6VFS.java │ │ │ │ ├── ResolverUtil.java │ │ │ │ └── VFS.java │ │ │ └── stereotype │ │ │ │ ├── Component.java │ │ │ │ └── bind │ │ │ │ ├── PathVariable.java │ │ │ │ ├── RequestMapper.java │ │ │ │ ├── RequestMapping.java │ │ │ │ ├── RequestMethod.java │ │ │ │ ├── RequestParam.java │ │ │ │ ├── Routes.java │ │ │ │ ├── UrlPathHelper.java │ │ │ │ └── ValueConstants.java │ │ │ ├── context │ │ │ ├── ApplicationContext.java │ │ │ └── URLContext.java │ │ │ ├── globals │ │ │ └── Globals.java │ │ │ ├── inject │ │ │ ├── API.java │ │ │ ├── AbstractMethodInjectInterceptor.java │ │ │ ├── BindException.java │ │ │ └── FieldInject.java │ │ │ ├── plugins │ │ │ ├── Module.java │ │ │ ├── Plugin.java │ │ │ ├── PluginLoader.java │ │ │ ├── PluginLoaderException.java │ │ │ └── defaults │ │ │ │ ├── exception │ │ │ │ └── BindModuleException.java │ │ │ │ ├── module │ │ │ │ ├── AOPModule.java │ │ │ │ ├── APIModule.java │ │ │ │ ├── FieldInjectModule.java │ │ │ │ ├── SPIModule.java │ │ │ │ └── SysAttrModule.java │ │ │ │ └── plugin │ │ │ │ └── Log4j2Plugin.java │ │ │ └── spi │ │ │ ├── Lazy.java │ │ │ ├── Level.java │ │ │ ├── Order.java │ │ │ ├── SPI.java │ │ │ ├── SPIException.java │ │ │ ├── SPILoader.java │ │ │ ├── SPIMapper.java │ │ │ ├── SPIProvider.java │ │ │ └── SPIResource.java │ └── resources │ │ ├── .gitkeep │ │ └── META-INF │ │ └── nano │ │ └── spi │ │ ├── org.nanoframework.core.plugins.Module │ │ └── org.nanoframework.core.plugins.Plugin │ └── test │ ├── java │ └── org │ │ └── nanoframework │ │ └── core │ │ ├── .gitkeep │ │ ├── ApiScanTest.java │ │ ├── AttrInjectTest.java │ │ ├── CoreTestSuite.java │ │ ├── Entity.java │ │ ├── EntitySingleton.java │ │ ├── InjectorTest.java │ │ ├── component │ │ ├── ApiComponent.java │ │ ├── ApiComponent2.java │ │ ├── ComponentsTest.java │ │ ├── PluginLoaderInit.java │ │ ├── TestComponent.java │ │ ├── aop │ │ │ ├── AfterAOP.java │ │ │ └── BeforeAOP.java │ │ ├── impl │ │ │ ├── ApiComponentImpl.java │ │ │ └── TestComponentImpl.java │ │ └── stereotype │ │ │ └── bind │ │ │ └── RequestMapperTest.java │ │ ├── context │ │ └── URLContextTest.java │ │ ├── service │ │ ├── ApiService.java │ │ └── impl │ │ │ ├── ApiService2Impl.java │ │ │ └── ApiServiceImpl.java │ │ ├── spi │ │ ├── SPITests.java │ │ └── test │ │ │ ├── NotSpiService.java │ │ │ ├── SpiLazyService.java │ │ │ ├── SpiNotImplService.java │ │ │ ├── SpiService.java │ │ │ └── impl │ │ │ ├── TestLazyServiceImpl.java │ │ │ ├── TestService2Impl.java │ │ │ └── TestServiceImpl.java │ │ └── stereotype │ │ └── bind │ │ └── RouteTests.java │ └── resources │ ├── .gitkeep │ ├── META-INF │ └── nano │ │ └── spi │ │ ├── org.nanoframework.core.spi.test.NotSpiService │ │ ├── org.nanoframework.core.spi.test.SpiLazyService │ │ ├── org.nanoframework.core.spi.test.SpiNotImplService │ │ └── org.nanoframework.core.spi.test.SpiService │ └── context.properties ├── nano-ext ├── README.md ├── nano-ext-dubbo │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── extension │ │ │ │ └── dubbo │ │ │ │ ├── DubboReferenceInterceptor.java │ │ │ │ ├── DubboReferenceModule.java │ │ │ │ ├── DubboServiceModule.java │ │ │ │ └── inject │ │ │ │ └── DubboReferenceInjector.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ └── META-INF │ │ │ └── nano │ │ │ └── spi │ │ │ └── org.nanoframework.core.plugins.Module │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── extension │ │ │ └── dubbo │ │ │ ├── DubboServiceExportTest.java │ │ │ ├── GenericServiceProxy.java │ │ │ ├── GenericServiceTest.java │ │ │ ├── HelloWorldProxy.java │ │ │ └── service │ │ │ ├── GenericService.java │ │ │ ├── HelloWorld2Service.java │ │ │ ├── HelloWorldService.java │ │ │ └── impl │ │ │ ├── GenericIntegerService.java │ │ │ ├── GenericMapService.java │ │ │ ├── GenericStringService.java │ │ │ └── HelloWorldServiceImpl.java │ │ └── resources │ │ ├── context.properties │ │ ├── dubbo.properties │ │ └── log4j2.xml ├── nano-ext-httpclient │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── extension │ │ │ │ └── httpclient │ │ │ │ ├── AbstractHttpClient.java │ │ │ │ ├── HttpClient.java │ │ │ │ ├── HttpClientImpl.java │ │ │ │ ├── HttpClientInvokeException.java │ │ │ │ ├── HttpResponse.java │ │ │ │ ├── exception │ │ │ │ └── HttpClientException.java │ │ │ │ └── inject │ │ │ │ ├── HttpClientInjector.java │ │ │ │ ├── HttpConfig.java │ │ │ │ └── HttpConfigure.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── nano │ │ │ └── spi │ │ │ └── org.nanoframework.extension.httpclient.HttpClient │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── extension │ │ │ └── httpclient │ │ │ ├── HttpClientProxy.java │ │ │ ├── HttpClientTest.java │ │ │ └── test │ │ │ └── TestHttpClientImpl.java │ │ └── resources │ │ └── META-INF │ │ └── nano │ │ └── spi │ │ └── org.nanoframework.extension.httpclient.HttpClient ├── nano-ext-mail │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── extension │ │ │ │ └── mail │ │ │ │ ├── .gitkeep │ │ │ │ ├── AbstractMailSender.java │ │ │ │ ├── AbstractMailSenderFactory.java │ │ │ │ ├── MailAuthenticator.java │ │ │ │ └── defaults │ │ │ │ ├── DefaultMailSender.java │ │ │ │ └── DefaultMailSenderFactory.java │ │ └── resources │ │ │ └── .gitkeep │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── extension │ │ │ └── mail │ │ │ ├── .gitkeep │ │ │ └── MailSendTest.java │ │ └── resources │ │ └── .gitkeep ├── nano-ext-shiro-client │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── extension │ │ │ │ └── shiro │ │ │ │ └── client │ │ │ │ ├── .gitkeep │ │ │ │ ├── AbstractConfigurationFilter.java │ │ │ │ ├── AbstractShiroClientFilter.java │ │ │ │ ├── AuthenticationException.java │ │ │ │ ├── Protocol.java │ │ │ │ ├── authentication │ │ │ │ ├── AuthenticationFilter.java │ │ │ │ ├── AuthenticationServletRequest.java │ │ │ │ └── UnknownSessionException.java │ │ │ │ ├── configuration │ │ │ │ ├── BaseConfigurationStrategy.java │ │ │ │ ├── ConfigurationKey.java │ │ │ │ ├── ConfigurationKeys.java │ │ │ │ ├── ConfigurationStrategy.java │ │ │ │ ├── ConfigurationStrategyName.java │ │ │ │ ├── JndiConfigurationStrategyImpl.java │ │ │ │ ├── LegacyConfigurationStrategyImpl.java │ │ │ │ ├── PropertiesConfigurationStrategyImpl.java │ │ │ │ ├── SystemPropertiesConfigurationStrategyImpl.java │ │ │ │ └── WebXmlConfigurationStrategyImpl.java │ │ │ │ ├── matchers │ │ │ │ ├── ContainsPatternUrlPatternMatcherStrategy.java │ │ │ │ ├── ExactUrlPatternMatcherStrategy.java │ │ │ │ ├── RegexUrlPatternMatcherStrategy.java │ │ │ │ └── UrlPatternMatcherStrategy.java │ │ │ │ ├── session │ │ │ │ └── ShiroClientHttpSession.java │ │ │ │ ├── util │ │ │ │ ├── ServiceUtils.java │ │ │ │ └── URIBuilder.java │ │ │ │ ├── validation │ │ │ │ ├── RegistrySessionException.java │ │ │ │ └── TicketServiceValidateFilter.java │ │ │ │ └── web │ │ │ │ └── component │ │ │ │ ├── AuthenticationComponent.java │ │ │ │ └── impl │ │ │ │ └── AuthenticationComponentImpl.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ └── nanoframework │ │ │ └── shiro.sso.client.properties │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── extension │ │ │ └── shiro │ │ │ └── client │ │ │ ├── .gitkeep │ │ │ ├── Bootstrap.java │ │ │ └── component │ │ │ ├── SessionComponent.java │ │ │ └── impl │ │ │ └── SessionComponentImpl.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── context.properties │ │ └── webapp │ │ ├── WEB-INF │ │ ├── jetty.xml │ │ ├── web.xml │ │ └── webdefault.xml │ │ └── index.jsp ├── nano-ext-shiro │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── extension │ │ │ │ └── shiro │ │ │ │ ├── .gitkeep │ │ │ │ ├── Protocol.java │ │ │ │ ├── ShiroAopModule.java │ │ │ │ ├── ShiroPlugin.java │ │ │ │ ├── ShiroWebModule.java │ │ │ │ ├── authc │ │ │ │ ├── DisabledAuthenticationException.java │ │ │ │ ├── SaltedAuthenticationInfo.java │ │ │ │ ├── SimpleAuthenticationInfo.java │ │ │ │ └── credential │ │ │ │ │ ├── HashedCredentialsMatcher.java │ │ │ │ │ └── SimpleCredentialsMatcher.java │ │ │ │ ├── cache │ │ │ │ ├── RedisCache.java │ │ │ │ └── RedisCacheManager.java │ │ │ │ ├── codec │ │ │ │ └── CodecSupport.java │ │ │ │ ├── crypto │ │ │ │ └── hash │ │ │ │ │ ├── AbstractHash.java │ │ │ │ │ ├── Hash.java │ │ │ │ │ ├── Md2Hash.java │ │ │ │ │ └── SimpleHash.java │ │ │ │ ├── listener │ │ │ │ └── SSOSessionListener.java │ │ │ │ ├── realm │ │ │ │ ├── JdbcRealm.java │ │ │ │ ├── MyBatisRealm.java │ │ │ │ └── RealmQuery.java │ │ │ │ ├── servlet │ │ │ │ └── CryptCookie.java │ │ │ │ ├── session │ │ │ │ └── mgt │ │ │ │ │ └── eis │ │ │ │ │ └── RedisSessionDAO.java │ │ │ │ ├── util │ │ │ │ ├── ByteSource.java │ │ │ │ ├── EnumConverter.java │ │ │ │ ├── ShiroSecurityHelper.java │ │ │ │ └── SimpleByteSource.java │ │ │ │ └── web │ │ │ │ ├── component │ │ │ │ ├── SSOComponent.java │ │ │ │ ├── Status.java │ │ │ │ └── impl │ │ │ │ │ ├── AbstractSSOComponent.java │ │ │ │ │ └── SSOComponentImpl.java │ │ │ │ ├── exception │ │ │ │ └── MultiRealmException.java │ │ │ │ ├── filter │ │ │ │ └── authc │ │ │ │ │ └── SSOAuthenticationFilter.java │ │ │ │ ├── service │ │ │ │ ├── RealmService.java │ │ │ │ ├── SSOService.java │ │ │ │ └── impl │ │ │ │ │ ├── RealmServiceImpl.java │ │ │ │ │ └── SSOServiceImpl.java │ │ │ │ └── session │ │ │ │ └── mgt │ │ │ │ ├── CookieRememberMeManager.java │ │ │ │ └── DefaultWebSessionManager.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ ├── META-INF │ │ │ ├── default-sso-shiro-template.ini │ │ │ └── nano │ │ │ │ └── spi │ │ │ │ ├── org.nanoframework.core.plugins.Module │ │ │ │ └── org.nanoframework.core.plugins.Plugin │ │ │ └── nanoframework │ │ │ └── shiro.sso.properties │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── ext │ │ │ └── shiro │ │ │ ├── .gitkeep │ │ │ ├── ShiroStartup.java │ │ │ ├── component │ │ │ ├── ShiroComponent.java │ │ │ └── impl │ │ │ │ └── ShiroComponentImpl.java │ │ │ └── test │ │ │ ├── ShiroHelloWorldTest.java │ │ │ ├── ShiroJdbcAuthTest.java │ │ │ └── SimpleHashTest.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── context.properties │ │ ├── shiro-jdbc.ini │ │ ├── shiro-jdbc.properties │ │ ├── shiro-redis.properties │ │ ├── shiro.ini │ │ └── webapp │ │ ├── WEB-INF │ │ ├── jetty.xml │ │ ├── pages │ │ │ └── login.jsp │ │ ├── web.xml │ │ └── webdefault.xml │ │ └── index.jsp ├── nano-ext-websocket │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── extension │ │ │ │ └── websocket │ │ │ │ ├── AbstractWebSocketHandler.java │ │ │ │ ├── ChannelGroupItem.java │ │ │ │ ├── ChannelGroupSupport.java │ │ │ │ ├── WebSocket.java │ │ │ │ ├── WebSocketException.java │ │ │ │ ├── WebSocketFactory.java │ │ │ │ ├── WebSocketPlugin.java │ │ │ │ ├── WebSocketServer.java │ │ │ │ └── WebSocketServerInitializer.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ └── META-INF │ │ │ └── nano │ │ │ └── spi │ │ │ └── org.nanoframework.core.plugins.Plugin │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── extension │ │ │ └── websocket │ │ │ └── .gitkeep │ │ └── resources │ │ └── .gitkeep └── pom.xml ├── nano-jetty-server ├── .gitignore ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── server │ │ │ │ ├── .gitkeep │ │ │ │ ├── JettyCustomServer.java │ │ │ │ ├── cmd │ │ │ │ ├── Commands.java │ │ │ │ └── Mode.java │ │ │ │ ├── exception │ │ │ │ ├── JettyServerException.java │ │ │ │ └── ReadXMLException.java │ │ │ │ └── session │ │ │ │ ├── AbstractSessionIdManager.java │ │ │ │ ├── AbstractSessionManager.java │ │ │ │ └── redis │ │ │ │ ├── RedisSessionIdManager.java │ │ │ │ └── RedisSessionManager.java │ │ └── resources │ │ │ └── .gitkeep │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── server │ │ │ ├── .gitkeep │ │ │ └── Bootstrap.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── assembly.xml │ │ ├── context.properties │ │ └── webRoot │ │ ├── WEB-INF │ │ ├── jetty.xml │ │ ├── web.xml │ │ └── webdefault.xml │ │ └── index.jsp └── webRoot │ ├── WEB-INF │ ├── jetty.xml │ ├── web.xml │ └── webdefault.xml │ └── index.jsp ├── nano-orm ├── nano-orm-consul │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── orm │ │ │ │ └── consul │ │ │ │ ├── .gitkeep │ │ │ │ ├── ConsulModule.java │ │ │ │ ├── config │ │ │ │ └── ConsulConfig.java │ │ │ │ └── exception │ │ │ │ └── ConsulException.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ ├── META-INF │ │ │ └── nano │ │ │ │ └── spi │ │ │ │ └── org.nanoframework.core.plugins.Module │ │ │ └── consul-template.properties │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── orm │ │ │ └── consul │ │ │ ├── .gitkeep │ │ │ ├── AbstractConsulTests.java │ │ │ └── ConsulTests.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── consul.properties │ │ └── context.properties ├── nano-orm-jdbc │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── orm │ │ │ │ ├── DataSourceLoader.java │ │ │ │ ├── DataSourceLoaderException.java │ │ │ │ ├── DataSourceModule.java │ │ │ │ ├── ORMType.java │ │ │ │ ├── PoolType.java │ │ │ │ └── jdbc │ │ │ │ ├── DataSourceException.java │ │ │ │ ├── DefaultSqlExecutor.java │ │ │ │ ├── JdbcAdapter.java │ │ │ │ ├── JdbcDataSourceLoader.java │ │ │ │ ├── JdbcModule.java │ │ │ │ ├── binding │ │ │ │ ├── BindJdbcManagerModule.java │ │ │ │ ├── GlobalJdbcManager.java │ │ │ │ ├── JdbcManager.java │ │ │ │ ├── JdbcTransactional.java │ │ │ │ ├── JdbcTransactionalMethodInterceptor.java │ │ │ │ └── SqlExecutor.java │ │ │ │ ├── config │ │ │ │ ├── C3P0JdbcConfig.java │ │ │ │ ├── DruidJdbcConfig.java │ │ │ │ ├── JdbcConfig.java │ │ │ │ ├── Property.java │ │ │ │ └── TomcatJdbcConfig.java │ │ │ │ ├── jstl │ │ │ │ ├── Result.java │ │ │ │ ├── ResultImpl.java │ │ │ │ └── ResultSupport.java │ │ │ │ ├── pool │ │ │ │ ├── C3P0Pool.java │ │ │ │ ├── DruidPool.java │ │ │ │ ├── Pool.java │ │ │ │ └── TomcatJdbcPool.java │ │ │ │ └── record │ │ │ │ ├── AbstractJdbcRecord.java │ │ │ │ ├── JdbcRecord.java │ │ │ │ ├── Record.java │ │ │ │ ├── annotation │ │ │ │ ├── Column.java │ │ │ │ ├── Id.java │ │ │ │ └── Table.java │ │ │ │ ├── exception │ │ │ │ └── MultiRecordException.java │ │ │ │ └── script │ │ │ │ ├── SQLScript.java │ │ │ │ └── SQLScriptBatch.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ ├── META-INF │ │ │ └── nano │ │ │ │ └── spi │ │ │ │ ├── org.nanoframework.core.plugins.Module │ │ │ │ └── org.nanoframework.orm.DataSourceLoader │ │ │ └── jdbc-template.properties │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── orm │ │ │ └── jdbc │ │ │ ├── .gitkeep │ │ │ ├── JdbcRecordTest.java │ │ │ └── domain │ │ │ └── User.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── jdbc-test.properties │ │ └── test-schema.sql ├── nano-orm-jedis │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── orm │ │ │ │ └── jedis │ │ │ │ ├── AbstractRedisClient.java │ │ │ │ ├── GlobalRedisClient.java │ │ │ │ ├── JedisModule.java │ │ │ │ ├── RedisClient.java │ │ │ │ ├── RedisClientPool.java │ │ │ │ ├── RedisConfig.java │ │ │ │ ├── binding │ │ │ │ └── BindRedisClientModule.java │ │ │ │ ├── cluster │ │ │ │ └── RedisClusterClientImpl.java │ │ │ │ ├── commands │ │ │ │ ├── HashRedisClient.java │ │ │ │ ├── KeyValueRedisClient.java │ │ │ │ ├── ListRedisClient.java │ │ │ │ ├── PubSubRedisClient.java │ │ │ │ ├── SetRedisClient.java │ │ │ │ └── SortedSetRedisClient.java │ │ │ │ ├── exception │ │ │ │ ├── NotFoundExtendException.java │ │ │ │ ├── RedisClientException.java │ │ │ │ └── TimeoutException.java │ │ │ │ ├── lock │ │ │ │ ├── RedisLocker.java │ │ │ │ └── impl │ │ │ │ │ └── RedisLockerImpl.java │ │ │ │ └── sharded │ │ │ │ └── RedisClientImpl.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ ├── META-INF │ │ │ └── nano │ │ │ │ └── spi │ │ │ │ └── org.nanoframework.core.plugins.Module │ │ │ └── redis-template.properties │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── orm │ │ │ └── jedis │ │ │ ├── ExtendRedisClientTest.java │ │ │ ├── RedisClientExt.java │ │ │ ├── RedisClientExtImpl.java │ │ │ ├── RedisClientInitialize.java │ │ │ ├── RedisLockerTests.java │ │ │ ├── cluster │ │ │ ├── HashTests.java │ │ │ ├── KeyTests.java │ │ │ ├── ListTests.java │ │ │ ├── RedisClusterTestSuite.java │ │ │ ├── SetTests.java │ │ │ └── SortedSetTests.java │ │ │ └── sharded │ │ │ ├── RedisTestSuite.java │ │ │ ├── ShardedHashTests.java │ │ │ ├── ShardedInfoTests.java │ │ │ ├── ShardedKeyTests.java │ │ │ ├── ShardedListTests.java │ │ │ ├── ShardedSetTests.java │ │ │ └── ShardedSortedSetTests.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── log4j2.xml │ │ ├── redis-ext.properties │ │ └── redis-test.properties ├── nano-orm-kafka │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── orm │ │ │ │ └── kafka │ │ │ │ ├── KafkaProducerModule.java │ │ │ │ └── exception │ │ │ │ └── KafkaProducerException.java │ │ └── resources │ │ │ ├── META-INF │ │ │ └── nano │ │ │ │ └── spi │ │ │ │ └── org.nanoframework.core.plugins.Module │ │ │ └── kafka-producer-template.properties │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── orm │ │ │ └── kafka │ │ │ ├── AbstractTests.java │ │ │ └── KafkaTests.java │ │ └── resources │ │ └── kafka-producer.properties ├── nano-orm-mybatis │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── orm │ │ │ │ └── mybatis │ │ │ │ ├── DataSourceConfig.java │ │ │ │ ├── GlobalSqlSession.java │ │ │ │ ├── MapperProvider.java │ │ │ │ ├── MultiDataSourceModule.java │ │ │ │ ├── MultiTransactional.java │ │ │ │ ├── MultiTransactionalMethodInterceptor.java │ │ │ │ ├── MultiTransactionalModule.java │ │ │ │ ├── MybatisDataSourceLoader.java │ │ │ │ ├── binding │ │ │ │ └── BindSqlSessionModule.java │ │ │ │ └── plugin │ │ │ │ ├── AbstractDataSourceFactory.java │ │ │ │ ├── C3P0DataSourceFactory.java │ │ │ │ ├── DruidDataSourceFactory.java │ │ │ │ └── TomcatJdbcPoolDataSourceFactory.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ ├── META-INF │ │ │ └── nano │ │ │ │ └── spi │ │ │ │ ├── org.nanoframework.core.plugins.Module │ │ │ │ └── org.nanoframework.orm.DataSourceLoader │ │ │ ├── mybatis-3-config.dtd │ │ │ ├── mybatis-config-c3p0.xml │ │ │ ├── mybatis-config-druid.xml │ │ │ └── mybatis-config-tomcat_jdbc_pool.xml │ │ └── test │ │ └── resources │ │ └── .gitkeep ├── nano-orm-rocketmq │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── orm │ │ │ │ └── rocketmq │ │ │ │ ├── .gitkeep │ │ │ │ ├── RocketMQProducerModule.java │ │ │ │ ├── config │ │ │ │ └── RocketMQConfig.java │ │ │ │ └── exception │ │ │ │ ├── MQClientException.java │ │ │ │ └── RocketMQProducerException.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ ├── META-INF │ │ │ └── nano │ │ │ │ └── spi │ │ │ │ └── org.nanoframework.core.plugins.Module │ │ │ └── rocketmq-template.properties │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── orm │ │ │ └── rocketmq │ │ │ ├── .gitkeep │ │ │ ├── AbstractRocketMQTests.java │ │ │ └── RocketMQTests.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── context.properties │ │ └── rocketmq.properties └── pom.xml ├── nano-server ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── server │ │ │ ├── App.java │ │ │ ├── GitPull.java │ │ │ └── exception │ │ │ ├── GitAPIException.java │ │ │ └── UnknownHostException.java │ └── resources │ │ └── application-template.properties │ └── test │ ├── java │ └── org │ │ └── nanoframework │ │ └── server │ │ └── GitPullTests.java │ └── resources │ └── application.properties ├── nano-super ├── pom.xml └── src │ └── licensing │ ├── header-definitions.xml │ └── header.txt ├── nano-tomcat-server ├── .gitignore ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── nanoframework │ │ │ │ └── server │ │ │ │ ├── .gitkeep │ │ │ │ ├── TomcatCustomServer.java │ │ │ │ ├── cfg │ │ │ │ ├── AbstractConf.java │ │ │ │ ├── ConnectorConf.java │ │ │ │ └── ExecutorConf.java │ │ │ │ ├── cmd │ │ │ │ ├── Commands.java │ │ │ │ └── Mode.java │ │ │ │ └── exception │ │ │ │ └── TomcatServerException.java │ │ └── resources │ │ │ ├── .gitkeep │ │ │ └── META-INF │ │ │ └── tomcat │ │ │ └── web.xml │ └── test │ │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── server │ │ │ ├── .gitkeep │ │ │ ├── TomcatReadonlyTests.java │ │ │ ├── TomcatServerBootstrap.java │ │ │ └── component │ │ │ ├── TomcatComponent.java │ │ │ ├── TomcatReadonlyComponent.java │ │ │ └── impl │ │ │ ├── TomcatComponentImpl.java │ │ │ └── TomcatReadonlyComponentImpl.java │ │ └── resources │ │ ├── .gitkeep │ │ ├── assembly.xml │ │ ├── context.properties │ │ └── webRoot │ │ ├── WEB-INF │ │ └── web.xml │ │ └── index.jsp └── webRoot │ ├── WEB-INF │ ├── default.xml │ └── web.xml │ └── index.jsp ├── nano-webmvc ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── nanoframework │ │ │ └── web │ │ │ └── server │ │ │ ├── cookie │ │ │ ├── CookieValueManager.java │ │ │ ├── Cookies.java │ │ │ └── DefaultCookieValueManager.java │ │ │ ├── filter │ │ │ ├── AbstractFilter.java │ │ │ ├── ConnectFilter.java │ │ │ ├── CrossOriginFilter.java │ │ │ ├── EnvironmentFilter.java │ │ │ └── HttpRequestFilter.java │ │ │ ├── http │ │ │ └── status │ │ │ │ ├── ComponentStatus.java │ │ │ │ ├── HttpStatus.java │ │ │ │ ├── HttpStatusCode.java │ │ │ │ ├── Response.java │ │ │ │ └── ResultMap.java │ │ │ ├── mvc │ │ │ ├── Model.java │ │ │ ├── View.java │ │ │ └── support │ │ │ │ ├── AngularRedirectView.java │ │ │ │ ├── ForwardView.java │ │ │ │ ├── RedirectModel.java │ │ │ │ └── RedirectView.java │ │ │ ├── servlet │ │ │ └── DispatcherServlet.java │ │ │ └── stream │ │ │ └── ReadStream.java │ └── resources │ │ └── .gitkeep │ └── test │ ├── java │ └── org │ │ └── nanoframework │ │ └── web │ │ ├── PropertiesLoaderTest.java │ │ ├── entity │ │ ├── EntitySerialTest.java │ │ └── EntityTest.java │ │ ├── guice │ │ └── PrivateGuiceTest.java │ │ └── server │ │ └── http │ │ └── status │ │ └── tests │ │ └── ResultMapTest.java │ └── resources │ ├── .gitkeep │ └── test-loader.properties ├── pom.xml └── src └── licensing ├── header-definitions.xml └── header.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .project 3 | .classpath 4 | .settings/ 5 | target/ 6 | build/ 7 | bin/ 8 | tags 9 | logs/ 10 | assembly/ 11 | conf/ 12 | *.log 13 | webRoot/ 14 | *.pid 15 | .checkstyle 16 | .fbIncludeFilterFile 17 | .fbExcludeFilterFile 18 | coverage-local.sh 19 | .idea 20 | *.iml 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | 5 | services: 6 | - docker 7 | - docker-compose 8 | 9 | before_script: 10 | - export MAVEN_OPTS="-Xmx2048m" 11 | 12 | before_install: 13 | - git clone https://github.com/riveryang/dubbox.git 14 | - cd dubbox 15 | - cp build-notest.sh build-dubbo.sh 16 | - git checkout dubbo-parent-3.0.0 17 | - ./build-dubbo.sh 18 | - cd .. 19 | - rm -rf dubbox 20 | 21 | install: 22 | - docker pull redis:alpine 23 | - docker run -d -p 6380:6379 redis:alpine 24 | - docker run -d -p 6381:6379 redis:alpine 25 | - docker-compose up -d 26 | - docker run -d -p 8500:8500 consul 27 | 28 | script: 29 | - ./build.sh 30 | 31 | notifications: 32 | email: false 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Release](https://img.shields.io/badge/release-1.4.9-blue.svg)](https://github.com/nano-projects/nano-framework/releases) 2 | [![Build Status](https://travis-ci.org/nano-projects/nano-framework.svg?branch=master)](https://travis-ci.org/nano-projects/nano-framework) 3 | [![Coverage Status](https://coveralls.io/repos/github/nano-projects/nano-framework/badge.svg)](https://coveralls.io/github/nano-projects/nano-framework) 4 | [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 5 | -------------------------------------------------------------------------------- /findbugs-rules.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-commons/src/main/java/org/nanoframework/commons/.gitkeep -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/crypt/CipherExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.crypt; 17 | 18 | import javax.validation.constraints.NotNull; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.3.7 24 | */ 25 | public interface CipherExecutor { 26 | 27 | /** 28 | * Encrypt the value. Implementations may 29 | * choose to also sign the final value. 30 | * @param value the value 31 | * @return the encrypted value or null 32 | */ 33 | String encode(@NotNull String value); 34 | 35 | /** 36 | * Decode the value. Signatures may also be verified. 37 | * @param value encrypted value 38 | * @return the decoded value. 39 | */ 40 | String decode(@NotNull String value); 41 | } 42 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/crypt/DecryptException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.crypt; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class DecryptException extends RuntimeException { 24 | private static final long serialVersionUID = 2618331308933845339L; 25 | 26 | public DecryptException(final String message, final Throwable cause) { 27 | super(message, cause); 28 | } 29 | 30 | @Override 31 | public String getMessage() { 32 | return "解密异常: " + super.getMessage(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/crypt/EncryptException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.crypt; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class EncryptException extends RuntimeException { 24 | private static final long serialVersionUID = 5713797904458714409L; 25 | 26 | public EncryptException(final String message, final Throwable cause) { 27 | super(message, cause); 28 | } 29 | 30 | @Override 31 | public String getMessage() { 32 | return "加密异常: " + super.getMessage(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/exception/ClassCastException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class ClassCastException extends RuntimeException { 24 | private static final long serialVersionUID = 3778728285493433413L; 25 | 26 | /** 27 | * 28 | * @param message the message 29 | * @param cause the cause 30 | */ 31 | public ClassCastException(final String message, final Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | @Override 36 | public String getMessage() { 37 | return "加载异常: " + super.getMessage(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/exception/DateFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class DateFormatException extends RuntimeException { 24 | private static final long serialVersionUID = 4883777612565681931L; 25 | 26 | /** 27 | * 28 | * @param message the message 29 | * @param cause the cause 30 | */ 31 | public DateFormatException(final String message, final Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | @Override 36 | public String getMessage() { 37 | return "时间转换异常: " + super.getMessage(); 38 | } 39 | } -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/exception/SerializationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class SerializationException extends RuntimeException { 24 | private static final long serialVersionUID = 7933180233859813371L; 25 | 26 | /** 27 | * 28 | * @param message the message 29 | * @param cause the cause 30 | */ 31 | public SerializationException(final String message, final Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/exception/StringFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class StringFormatException extends RuntimeException { 24 | private static final long serialVersionUID = 2104634926671632268L; 25 | 26 | /** 27 | * 28 | * @param message the message 29 | * @param cause the cause 30 | */ 31 | public StringFormatException(final String message, final Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | @Override 36 | public String getMessage() { 37 | return "字符处理异常: " + super.getMessage(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/exception/ZipException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.10 22 | */ 23 | public class ZipException extends RuntimeException { 24 | private static final long serialVersionUID = -1192361995704899310L; 25 | 26 | /** 27 | * @param message 异常消息 28 | * @param cause 异常实体 29 | */ 30 | public ZipException(final String message, final Throwable cause) { 31 | super(message, cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/format/Pattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.format; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public enum Pattern { 24 | /** The 'Date' Pattern. */ 25 | DATE("yyyy-MM-dd"), 26 | /** The ‘Time’ Pattern. */ 27 | TIME("HH:mm:ss"), 28 | /** The 'DateTime' Pattern. */ 29 | DATETIME("yyyy-MM-dd HH:mm:ss"), 30 | /** The 'Timestamp' Pattern. */ 31 | TIMESTAMP("yyyy-MM-dd HH:mm:ss.SSS"); 32 | 33 | private String pattern; 34 | 35 | Pattern(final String pattern) { 36 | this.pattern = pattern; 37 | } 38 | 39 | public String get() { 40 | return pattern; 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/support/logging/LoggerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.support.logging; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.14 22 | */ 23 | public class LoggerException extends RuntimeException { 24 | private static final long serialVersionUID = -8628934047050622843L; 25 | 26 | public LoggerException(final String message) { 27 | super(message); 28 | } 29 | 30 | public LoggerException(final String message, final Throwable cause) { 31 | super(message, cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/util/MathUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.util; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.1 22 | */ 23 | public final class MathUtils { 24 | 25 | public static double max(double... doubles) { 26 | double max = 0; 27 | for (double doub : doubles) { 28 | max = Math.max(max, doub); 29 | } 30 | 31 | return max; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-commons/src/main/java/org/nanoframework/commons/util/PathMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.nanoframework.commons.util; 18 | 19 | import java.util.Comparator; 20 | import java.util.Map; 21 | 22 | /** 23 | * 24 | * @author Juergen Hoeller 25 | * @since 1.2 26 | * @see AntPathMatcher 27 | */ 28 | public interface PathMatcher { 29 | 30 | boolean isPattern(String path); 31 | 32 | boolean match(String pattern, String path); 33 | 34 | boolean matchStart(String pattern, String path); 35 | 36 | String extractPathWithinPattern(String pattern, String path); 37 | 38 | Map extractUriTemplateVariables(String pattern, String path); 39 | 40 | Comparator getPatternComparator(String path); 41 | 42 | String combine(String pattern1, String pattern2); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-commons/src/test/java/org/nanoframework/commons/.gitkeep -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/entity/ParentEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.entity; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class ParentEntity extends BaseEntity { 24 | private static final long serialVersionUID = 8811634032292314799L; 25 | private String id; 26 | 27 | public String getId() { 28 | return id; 29 | } 30 | 31 | public void setId(String id) { 32 | this.id = id; 33 | } 34 | } -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/entity/UseEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.entity; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class UseEntity extends ParentEntity { 24 | private static final long serialVersionUID = -3526556092477724339L; 25 | private String name; 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | } -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/support/logging/JakataCommonsLoggingTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.support.logging; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.14 22 | */ 23 | public class JakataCommonsLoggingTest extends NoLoggingTest { 24 | 25 | @Override 26 | public void selectLogger() { 27 | LoggerFactory.selectJakartaCommonsLogging(); 28 | logger = LoggerFactory.getLogger(JakataCommonsLoggingTest.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/support/logging/Jdk14LoggingTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.support.logging; 17 | 18 | import org.junit.Before; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.3.14 24 | */ 25 | public class Jdk14LoggingTest extends NoLoggingTest { 26 | 27 | @Before 28 | @Override 29 | public void selectLogger() { 30 | LoggerFactory.selectJdk14Logging(); 31 | logger = LoggerFactory.getLogger(Jdk14LoggingTest.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/support/logging/Log4j2Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.support.logging; 17 | 18 | import org.junit.Before; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.3.14 24 | */ 25 | public class Log4j2Test extends NoLoggingTest { 26 | 27 | @Before 28 | @Override 29 | public void selectLogger() { 30 | LoggerFactory.selectLog4j2Logging(); 31 | logger = LoggerFactory.getLogger(Log4j2Test.class); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/support/logging/Log4jTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.support.logging; 17 | 18 | import org.junit.Before; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.3.14 24 | */ 25 | public class Log4jTest extends NoLoggingTest { 26 | 27 | @Before 28 | @Override 29 | public void selectLogger() { 30 | LoggerFactory.selectLog4jLogging(); 31 | logger = LoggerFactory.getLogger(Log4jTest.class); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/util/Base64Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.util; 17 | 18 | import java.util.Base64; 19 | 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | 23 | /** 24 | * 25 | * @author yanghe 26 | * @since 1.3.15 27 | */ 28 | public class Base64Test { 29 | 30 | @Test 31 | public void base64Test() { 32 | final String content = "base 64 content"; 33 | final BASE64 base64 = BASE64.getInstance(); 34 | final String encode = base64.encode(content.getBytes()); 35 | final String decode = new String(Base64.getDecoder().decode(encode)); 36 | Assert.assertEquals(content, decode); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/util/MathTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.util; 17 | 18 | import org.junit.Assert; 19 | import org.junit.Test; 20 | 21 | /** 22 | * 23 | * @author yanghe 24 | * @since 1.3.15 25 | */ 26 | public class MathTest { 27 | 28 | @Test 29 | public void maxTest() { 30 | double max = MathUtils.max(1, 2, 3); 31 | Assert.assertEquals(max == 3, true); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/util/ObjectCompareTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.util; 17 | 18 | import org.junit.Test; 19 | import org.nanoframework.commons.support.logging.Logger; 20 | import org.nanoframework.commons.support.logging.LoggerFactory; 21 | 22 | /** 23 | * @author yanghe 24 | * @date 2016年1月19日 上午9:05:43 25 | */ 26 | public class ObjectCompareTest { 27 | private Logger LOG = LoggerFactory.getLogger(ObjectCompareTest.class); 28 | 29 | @Test 30 | public void test0() { 31 | LOG.debug("Test reg empty: " + ObjectCompare.isInListByRegEx("Test", "")); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-commons/src/test/java/org/nanoframework/commons/util/ZipTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.commons.util; 17 | 18 | import org.junit.Test; 19 | 20 | /** 21 | * @author yanghe 22 | * @since 1.4.11 23 | */ 24 | public class ZipTest { 25 | 26 | @Test 27 | public void decodeTest() { 28 | final String value = "1234567890"; 29 | final String gzip = ZipUtils.gzip(value); 30 | final String val1 = ZipUtils.gunzip(gzip); 31 | 32 | org.junit.Assert.assertEquals(val1, value); 33 | 34 | final String zip = ZipUtils.zip(value); 35 | final String val2 = ZipUtils.unzip(zip); 36 | 37 | org.junit.Assert.assertEquals(val2, value); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /nano-commons/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-commons/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-commons/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context=/messages/messages.properties 18 | 19 | context.root=/common-test 20 | -------------------------------------------------------------------------------- /nano-commons/src/test/resources/messages/messages.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | message.hello=message by root {} 18 | -------------------------------------------------------------------------------- /nano-commons/src/test/resources/messages/messages_en_US.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | message.hello=简体中文{} 18 | -------------------------------------------------------------------------------- /nano-commons/src/test/resources/messages/messages_zh_CN.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | message.hello=简体中文{} 18 | -------------------------------------------------------------------------------- /nano-commons/src/test/resources/messages/messages_zh_TW.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | message.hello=繁体中文{} 18 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/BaseClusterScheduler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.cluster; 17 | 18 | import org.nanoframework.concurrent.scheduler.BaseScheduler; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.4.9 24 | */ 25 | public abstract class BaseClusterScheduler extends BaseScheduler { 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/ClusterScheduler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.cluster; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.8 28 | */ 29 | @Target(ElementType.TYPE) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | public @interface ClusterScheduler { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/consts/ConsulSources.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.cluster.consts; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.9 22 | */ 23 | public final class ConsulSources { 24 | 25 | public static final String KV_SCHEDULER_CLUSTER = "consul.kv:scheduler-cluster"; 26 | 27 | public static final String SESSION_SCHEDULER_CLUSTER = "consul.session:scheduler-cluster"; 28 | 29 | private ConsulSources() { 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/consts/Keys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.cluster.consts; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.9 22 | */ 23 | public final class Keys { 24 | public static final String CLUSTER_SCHEDULER_ENABLED = "context.cluster.scheduler.enabled"; 25 | 26 | public static final String BASE_PACKAGE = "context.cluster.scheduler-scan.base-package"; 27 | 28 | public static final String CLUSTER_ID = "context.cluster.scheduler.id"; 29 | 30 | public static final String NODE_ID = "context.cluster.scheduler.node.id"; 31 | 32 | private Keys() { 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/lock/ElectionLocker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.cluster.lock; 17 | 18 | import org.nanoframework.concurrent.scheduler.cluster.consts.Keys; 19 | 20 | import com.google.inject.Inject; 21 | import com.google.inject.Singleton; 22 | import com.google.inject.name.Named; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.9 28 | */ 29 | @Singleton 30 | public class ElectionLocker extends AbstractConsulLocker { 31 | 32 | @Inject 33 | public ElectionLocker(@Named(Keys.CLUSTER_ID) String clusterId) { 34 | super("Election-" + clusterId, clusterId); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/storage/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-cluster/src/main/java/org/nanoframework/concurrent/scheduler/cluster/storage/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-cluster/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/resources/META-INF/nano/spi/org.nanoframework.concurrent.scheduler.loader.SchedulerLoader: -------------------------------------------------------------------------------- 1 | cluster=org.nanoframework.concurrent.scheduler.cluster.loader.ClusterSchedulerLoader 2 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Plugin: -------------------------------------------------------------------------------- 1 | org.nanoframework.concurrent.scheduler.cluster.ClusterSchedulerPlugin 2 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/test/java/org/nanoframework/concurrent/scheduler/cluster/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-cluster/src/test/java/org/nanoframework/concurrent/scheduler/cluster/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/test/java/org/nanoframework/concurrent/scheduler/cluster/ClusterSchedulerSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.cluster; 17 | 18 | import org.junit.runner.RunWith; 19 | import org.junit.runners.Suite; 20 | import org.nanoframework.concurrent.scheduler.cluster.config.ConfigureListenerTest; 21 | import org.nanoframework.concurrent.scheduler.cluster.loader.LoaderTest; 22 | 23 | /** 24 | * 25 | * @author yanghe 26 | * @since 1.4.9 27 | */ 28 | @RunWith(Suite.class) 29 | @Suite.SuiteClasses({ 30 | ConfigureListenerTest.class, 31 | LoaderTest.class 32 | }) 33 | public class ClusterSchedulerSuite { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/test/java/org/nanoframework/concurrent/scheduler/cluster/Test2Scheduler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.cluster; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.9 22 | */ 23 | @ClusterScheduler 24 | public class Test2Scheduler extends BaseClusterScheduler { 25 | 26 | @Override 27 | public void before() { 28 | 29 | } 30 | 31 | @Override 32 | public void execute() { 33 | 34 | } 35 | 36 | @Override 37 | public void after() { 38 | 39 | } 40 | 41 | @Override 42 | public void destroy() { 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/test/java/org/nanoframework/concurrent/scheduler/cluster/TestScheduler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.cluster; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.9 22 | */ 23 | @ClusterScheduler 24 | public class TestScheduler extends BaseClusterScheduler { 25 | 26 | @Override 27 | public void before() { 28 | 29 | } 30 | 31 | @Override 32 | public void execute() { 33 | 34 | } 35 | 36 | @Override 37 | public void after() { 38 | 39 | } 40 | 41 | @Override 42 | public void destroy() { 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-cluster/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/test/resources/cluster-scheduler-context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context= 18 | 19 | context.version=0.0.1 20 | 21 | context.mode=DEV 22 | 23 | context.root=/concurrent 24 | 25 | context.cluster.scheduler.enabled=true 26 | context.cluster.scheduler-scan.base-package=org.nanoframework.concurrent.scheduler.cluster 27 | context.cluster.scheduler.id=test-cluster 28 | context.cluster.scheduler.node.id=test-{0} 29 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-cluster/src/test/resources/consul.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2017 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Consul加载根 18 | consul.root=1 19 | 20 | # Consul ID 21 | consul.1.id=scheduler-cluster 22 | # Consul的地址, 格式: : 23 | consul.1.host.port= 24 | # Consul 资源URL 25 | consul.1.url= 26 | # Consul权限验证用户名 27 | consul.1.username= 28 | # Consul权限验证密码 29 | consul.1.password= 30 | # Consul ACLs token 31 | consul.1.token= 32 | # Consul 请求头参数列表, JSON数据格式 33 | consul.1.headers= 34 | # 连接超时时长, 单位: 毫秒 35 | consul.1.timeout.connect=3000 36 | # 读取超时时长,单位: 毫秒 37 | consul.1.timeout.read=60000 38 | # 写入超时时长, 单位: 毫秒 39 | conusl.1.timeout.write=5000 40 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-rocketmq/src/main/java/org/nanoframework/concurrent/rocketmq/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-rocketmq/src/main/java/org/nanoframework/concurrent/rocketmq/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-rocketmq/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-rocketmq/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-rocketmq/src/test/java/org/nanoframework/concurrent/rocketmq/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-rocketmq/src/test/java/org/nanoframework/concurrent/rocketmq/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent-rocketmq/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent-rocketmq/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/Cluster.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent/Cluster.graffle -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/main/java/org/nanoframework/concurrent/scheduler/loader/SchedulerLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.loader; 17 | 18 | import org.nanoframework.core.spi.Lazy; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.4.8 24 | */ 25 | @Lazy 26 | public interface SchedulerLoader { 27 | 28 | /** 29 | * 30 | * 加载任务. 31 | */ 32 | void load(); 33 | } 34 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/main/java/org/nanoframework/concurrent/scheduler/single/SchedulerShutdownHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler.single; 17 | 18 | import org.nanoframework.concurrent.scheduler.SchedulerFactory; 19 | 20 | /** 21 | * 22 | * 23 | * @author yanghe 24 | * @since 1.4.8 25 | */ 26 | public class SchedulerShutdownHook implements Runnable { 27 | private final SchedulerFactory factory; 28 | 29 | public SchedulerShutdownHook(final SchedulerFactory factory) { 30 | this.factory = factory; 31 | } 32 | 33 | @Override 34 | public void run() { 35 | factory.destory(); 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Plugin: -------------------------------------------------------------------------------- 1 | org.nanoframework.concurrent.scheduler.SchedulerPlugin 2 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/test/java/org/nanoframework/concurrent/scheduler/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent/src/test/java/org/nanoframework/concurrent/scheduler/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/test/java/org/nanoframework/concurrent/scheduler/SchedulerSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.concurrent.scheduler; 17 | 18 | import org.junit.runner.RunWith; 19 | import org.junit.runners.Suite; 20 | 21 | /** 22 | * @author yanghe 23 | * @since 1.4.9 24 | */ 25 | @RunWith(Suite.class) 26 | @Suite.SuiteClasses({ 27 | org.nanoframework.concurrent.scheduler.tests.SchedulerTests.class, 28 | org.nanoframework.concurrent.scheduler.longwait.SchedulerTests.class 29 | }) 30 | public class SchedulerSuite { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-concurrent-parent/nano-concurrent/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/test/resources/longwait-context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context= 18 | 19 | context.version=0.0.1 20 | 21 | context.mode=DEV 22 | 23 | context.root=/concurrent 24 | 25 | context.scheduler-scan.base-package=org.nanoframework.concurrent.scheduler.longwait 26 | -------------------------------------------------------------------------------- /nano-concurrent-parent/nano-concurrent/src/test/resources/test-context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context= 18 | 19 | context.version=0.0.1 20 | 21 | context.mode=DEV 22 | 23 | context.root=/concurrent 24 | 25 | context.scheduler-scan.base-package=org.nanoframework.concurrent.scheduler.tests 26 | -------------------------------------------------------------------------------- /nano-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/After.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author yanghe 26 | * @since 1.0 27 | */ 28 | @Target({ ElementType.METHOD }) 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Documented 31 | public @interface After { 32 | Class value(); 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/AfterMore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author yanghe 26 | * @since 1.0 27 | */ 28 | @Target({ ElementType.METHOD }) 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Documented 31 | public @interface AfterMore { 32 | After[] value(); 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/Before.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author yanghe 26 | * @since 1.0 27 | */ 28 | @Target({ ElementType.METHOD }) 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Documented 31 | public @interface Before { 32 | Class value(); 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/BeforeAndAfter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author yanghe 26 | * @since 1.0 27 | */ 28 | @Target({ ElementType.METHOD }) 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Documented 31 | public @interface BeforeAndAfter { 32 | Class value(); 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/BeforeAndAfterMore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author yanghe 26 | * @since 1.0 27 | */ 28 | @Target({ ElementType.METHOD }) 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Documented 31 | public @interface BeforeAndAfterMore { 32 | BeforeAndAfter[] value(); 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/BeforeMore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author yanghe 26 | * @since 1.0 27 | */ 28 | @Target({ ElementType.METHOD }) 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Documented 31 | public @interface BeforeMore { 32 | Before[] value(); 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/IAfter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import org.aopalliance.intercept.MethodInvocation; 19 | 20 | /** 21 | * @author yanghe 22 | * @since 1.0 23 | */ 24 | public interface IAfter { 25 | void after(MethodInvocation invocation, Object result); 26 | } 27 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/IBefore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import org.aopalliance.intercept.MethodInvocation; 19 | 20 | /** 21 | * @author yanghe 22 | * @since 1.0 23 | */ 24 | public interface IBefore { 25 | void before(MethodInvocation invocation); 26 | } 27 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/IBeforeAndAfter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | /** 19 | * @author yanghe 20 | * @since 1.0 21 | */ 22 | public interface IBeforeAndAfter extends IBefore, IAfter { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/aop/MethodNames.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | /** 19 | * @author yanghe 20 | * @since 1.0 21 | */ 22 | public final class MethodNames { 23 | protected static final String BEFORE = "before"; 24 | protected static final String AFTER = "after"; 25 | 26 | private MethodNames() { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/exception/ComponentServiceRepeatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.exception; 17 | 18 | /** 19 | * 重复组件服务异常 20 | * 21 | * @author yanghe 22 | * @since 1.0 23 | */ 24 | public class ComponentServiceRepeatException extends RuntimeException { 25 | private static final long serialVersionUID = -4050783744076776903L; 26 | 27 | public ComponentServiceRepeatException() { 28 | 29 | } 30 | 31 | public ComponentServiceRepeatException(String message) { 32 | super(message); 33 | } 34 | 35 | public ComponentServiceRepeatException(String message, Throwable cause) { 36 | super(message, cause); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/stereotype/bind/PathVariable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.stereotype.bind; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.0 28 | */ 29 | @Target(ElementType.PARAMETER) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | public @interface PathVariable { 33 | 34 | /** 35 | * 36 | * @return The URI template variable to bind to. 37 | */ 38 | String value() default ""; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/stereotype/bind/RequestMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.stereotype.bind; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public enum RequestMethod { 24 | GET, HEAD, POST, PUT, DELETE, OPTIONS, TRACE, PATCH 25 | 26 | } -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/component/stereotype/bind/ValueConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.stereotype.bind; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public interface ValueConstants { 24 | 25 | /** 26 | * Constant defining a value for no default - as a replacement for 27 | * null which we cannot use in annotation attributes. 28 | *

This is an artificial arrangement of 16 unicode characters, 29 | * with its sole purpose being to never match user-declared values. 30 | * @see RequestParam#defaultValue() 31 | */ 32 | String DEFAULT_NONE = "\n\t\t\n\t\t\n\uE000\uE001\uE002\n\t\t\t\t\n"; 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/globals/Globals.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.globals; 17 | 18 | import java.util.concurrent.ConcurrentMap; 19 | 20 | import com.google.common.collect.Maps; 21 | 22 | /** 23 | * 全局变量,针对一些全局的属性做统一管理. 24 | * @author yanghe 25 | * @since 1.0 26 | */ 27 | public final class Globals { 28 | private static final ConcurrentMap, Object> GLOBALS = Maps.newConcurrentMap(); 29 | 30 | private Globals() { 31 | 32 | } 33 | 34 | public static void set(final Class clz, final Object global) { 35 | GLOBALS.put(clz, global); 36 | } 37 | 38 | @SuppressWarnings("unchecked") 39 | public static final T get(final Class clz) { 40 | return (T) GLOBALS.get(clz); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/inject/API.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.inject; 17 | 18 | import static java.lang.annotation.ElementType.TYPE; 19 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 20 | 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.2 28 | */ 29 | @Retention(RUNTIME) 30 | @Target(TYPE) 31 | public @interface API { 32 | String value() default ""; 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/inject/BindException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.inject; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.2 22 | */ 23 | public class BindException extends RuntimeException { 24 | private static final long serialVersionUID = 5383088197972897359L; 25 | 26 | public BindException(final String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/inject/FieldInject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.inject; 17 | 18 | import com.google.inject.MembersInjector; 19 | 20 | import java.lang.annotation.Documented; 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * @author yanghe 28 | * @since 1.4.10 29 | */ 30 | @Documented 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target({ElementType.FIELD, ElementType.METHOD}) 33 | public @interface FieldInject { 34 | /** 35 | * @return 自定义Field依赖注入实现 36 | */ 37 | Class value(); 38 | } 39 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/plugins/Module.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.plugins; 17 | 18 | import java.util.List; 19 | 20 | import javax.servlet.ServletConfig; 21 | 22 | import org.nanoframework.core.spi.Lazy; 23 | 24 | /** 25 | * @author yanghe 26 | * @since 1.1 27 | */ 28 | @Lazy 29 | public interface Module extends com.google.inject.Module { 30 | List load() throws Throwable; 31 | 32 | void config(ServletConfig config) throws Throwable; 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/plugins/Plugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.plugins; 17 | 18 | import javax.servlet.ServletConfig; 19 | 20 | import org.nanoframework.core.spi.Lazy; 21 | 22 | /** 23 | * @author yanghe 24 | * @since 1.1 25 | */ 26 | @Lazy 27 | public interface Plugin { 28 | boolean load() throws Throwable; 29 | 30 | void config(ServletConfig config) throws Throwable; 31 | } 32 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/plugins/PluginLoaderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.plugins; 17 | 18 | /** 19 | * @author yanghe 20 | * @since 1.1 21 | */ 22 | public class PluginLoaderException extends RuntimeException { 23 | private static final long serialVersionUID = -3388677411268525198L; 24 | 25 | public PluginLoaderException() { 26 | super(); 27 | } 28 | 29 | public PluginLoaderException(String message) { 30 | super(message); 31 | } 32 | 33 | public PluginLoaderException(String message, Throwable cause) { 34 | super(message, cause); 35 | } 36 | 37 | public PluginLoaderException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/spi/Lazy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.8 28 | */ 29 | @Documented 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ ElementType.TYPE }) 32 | public @interface Lazy { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/spi/Level.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.9 28 | */ 29 | @Documented 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ ElementType.TYPE }) 32 | public @interface Level { 33 | 34 | /** 35 | * 36 | * @return 级别,值越小,越早加载 37 | */ 38 | int value() default 0; 39 | } 40 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/spi/Order.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.8 28 | */ 29 | @Documented 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ ElementType.TYPE }) 32 | public @interface Order { 33 | 34 | /** 35 | * 36 | * @return 排序值,值越小越靠前,值越大越靠后 37 | */ 38 | int value() default 0; 39 | } 40 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/spi/SPI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.8 28 | * @deprecated 29 | */ 30 | @Deprecated 31 | @Documented 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target({ ElementType.TYPE }) 34 | public @interface SPI { 35 | 36 | String[] value() default {}; 37 | } 38 | -------------------------------------------------------------------------------- /nano-core/src/main/java/org/nanoframework/core/spi/SPIException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.8 22 | */ 23 | public class SPIException extends RuntimeException { 24 | private static final long serialVersionUID = 2314941568526812529L; 25 | 26 | public SPIException(final String message) { 27 | super(message); 28 | } 29 | 30 | public SPIException(final String message, final Throwable cause) { 31 | super(message, cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-core/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-core/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.core.plugins.defaults.module.FieldInjectModule 2 | org.nanoframework.core.plugins.defaults.module.AOPModule 3 | org.nanoframework.core.plugins.defaults.module.APIModule 4 | org.nanoframework.core.plugins.defaults.module.SysAttrModule 5 | -------------------------------------------------------------------------------- /nano-core/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Plugin: -------------------------------------------------------------------------------- 1 | org.nanoframework.core.plugins.defaults.plugin.Log4j2Plugin 2 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-core/src/test/java/org/nanoframework/core/.gitkeep -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/CoreTestSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core; 17 | 18 | import org.nanoframework.core.stereotype.bind.RouteTests; 19 | 20 | import junit.framework.JUnit4TestAdapter; 21 | import junit.framework.Test; 22 | import junit.framework.TestSuite; 23 | 24 | /** 25 | * @author yanghe 26 | * @date 2015年10月8日 下午4:22:35 27 | */ 28 | public class CoreTestSuite { 29 | public static Test suite() { 30 | TestSuite suite = new TestSuite("Nano Framework Core Test Suite"); 31 | suite.addTest(new JUnit4TestAdapter(RouteTests.class)); 32 | return suite; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/Entity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core; 17 | 18 | import org.nanoframework.commons.entity.BaseEntity; 19 | import org.nanoframework.commons.util.UUIDUtils; 20 | 21 | /** 22 | * 23 | * @author yanghe 24 | * @since 1.0 25 | */ 26 | public class Entity extends BaseEntity { 27 | private static final long serialVersionUID = 2887355674297694472L; 28 | public final String uuid = UUIDUtils.create(); 29 | } -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/EntitySingleton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core; 17 | 18 | import org.nanoframework.commons.entity.BaseEntity; 19 | import org.nanoframework.commons.util.UUIDUtils; 20 | 21 | import com.google.inject.Singleton; 22 | 23 | /** 24 | * 25 | * @author yanghe 26 | * @since 1.0 27 | */ 28 | @Singleton 29 | public class EntitySingleton extends BaseEntity { 30 | private static final long serialVersionUID = 2887355674297694472L; 31 | public final String uuid = UUIDUtils.create(); 32 | } -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/component/ApiComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component; 17 | 18 | import org.nanoframework.core.component.impl.ApiComponentImpl; 19 | import org.nanoframework.core.component.stereotype.Component; 20 | import org.nanoframework.core.component.stereotype.bind.RequestMapping; 21 | 22 | import com.google.inject.ImplementedBy; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.2 28 | */ 29 | @Component 30 | @ImplementedBy(ApiComponentImpl.class) 31 | public interface ApiComponent { 32 | @RequestMapping("/invoke") 33 | String invoke(); 34 | } 35 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/component/ApiComponent2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component; 17 | 18 | import org.nanoframework.core.component.impl.ApiComponentImpl; 19 | import org.nanoframework.core.component.stereotype.Component; 20 | import org.nanoframework.core.component.stereotype.bind.RequestMapping; 21 | 22 | import com.google.inject.ImplementedBy; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.4.2 28 | */ 29 | @Component 30 | @ImplementedBy(ApiComponentImpl.class) 31 | public interface ApiComponent2 { 32 | @RequestMapping("/invoke2") 33 | String invoke2(); 34 | } 35 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/component/aop/AfterAOP.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import org.aopalliance.intercept.MethodInvocation; 19 | 20 | import com.google.inject.Singleton; 21 | 22 | /** 23 | * 24 | * @author yanghe 25 | * @since 1.3.15 26 | */ 27 | @Singleton 28 | public class AfterAOP implements IAfter { 29 | public static Object RESULT; 30 | 31 | @Override 32 | public void after(final MethodInvocation invocation, final Object result) { 33 | RESULT = result; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/component/aop/BeforeAOP.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.component.aop; 17 | 18 | import org.aopalliance.intercept.MethodInvocation; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.3.15 24 | */ 25 | public class BeforeAOP implements IBefore { 26 | public static Object RESULT; 27 | 28 | @Override 29 | public void before(MethodInvocation invocation) { 30 | RESULT = invocation.getArguments()[0]; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/service/ApiService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.service; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.2 22 | */ 23 | public interface ApiService { 24 | String invoke(); 25 | } 26 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/service/impl/ApiService2Impl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.service.impl; 17 | 18 | import org.nanoframework.core.inject.API; 19 | import org.nanoframework.core.service.ApiService; 20 | 21 | /** 22 | * 23 | * @author yanghe 24 | * @since 1.4.2 25 | */ 26 | @API("apiService2") 27 | public class ApiService2Impl implements ApiService { 28 | 29 | @Override 30 | public String invoke() { 31 | return "Api Invoke 2"; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/service/impl/ApiServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.service.impl; 17 | 18 | import org.nanoframework.core.inject.API; 19 | import org.nanoframework.core.service.ApiService; 20 | 21 | /** 22 | * 23 | * @author yanghe 24 | * @since 1.4.2 25 | */ 26 | @API 27 | public class ApiServiceImpl implements ApiService { 28 | 29 | @Override 30 | public String invoke() { 31 | return "Api Invoke"; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/spi/test/NotSpiService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi.test; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.8 22 | */ 23 | public interface NotSpiService { 24 | 25 | String echo(); 26 | } 27 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/spi/test/SpiLazyService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi.test; 17 | 18 | import org.nanoframework.core.spi.Lazy; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.4.8 24 | */ 25 | @Lazy 26 | public interface SpiLazyService { 27 | 28 | String echo(); 29 | } 30 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/spi/test/SpiNotImplService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi.test; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.8 22 | */ 23 | public interface SpiNotImplService { 24 | 25 | String echo(); 26 | } 27 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/spi/test/SpiService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi.test; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.8 22 | */ 23 | public interface SpiService { 24 | 25 | String echo(); 26 | } 27 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/spi/test/impl/TestLazyServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi.test.impl; 17 | 18 | import org.nanoframework.core.spi.test.SpiLazyService; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.4.8 24 | */ 25 | public class TestLazyServiceImpl implements SpiLazyService { 26 | 27 | @Override 28 | public String echo() { 29 | return "Echo Lazy TestService"; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/spi/test/impl/TestService2Impl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi.test.impl; 17 | 18 | import org.nanoframework.core.spi.test.SpiService; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.4.8 24 | */ 25 | public class TestService2Impl implements SpiService { 26 | 27 | @Override 28 | public String echo() { 29 | return "Echo TestService 2"; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /nano-core/src/test/java/org/nanoframework/core/spi/test/impl/TestServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.core.spi.test.impl; 17 | 18 | import org.nanoframework.core.spi.test.SpiService; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.4.8 24 | */ 25 | public class TestServiceImpl implements SpiService { 26 | 27 | @Override 28 | public String echo() { 29 | return "Echo TestService"; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /nano-core/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-core/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-core/src/test/resources/META-INF/nano/spi/org.nanoframework.core.spi.test.NotSpiService: -------------------------------------------------------------------------------- 1 | testService=org.nanoframework.core.spi.test.impl.TestServiceImpl 2 | -------------------------------------------------------------------------------- /nano-core/src/test/resources/META-INF/nano/spi/org.nanoframework.core.spi.test.SpiLazyService: -------------------------------------------------------------------------------- 1 | testLazyService=org.nanoframework.core.spi.test.impl.TestLazyServiceImpl 2 | testLazyService2=org.nanoframework.core.spi.test.impl.TestLazyService2Impl -------------------------------------------------------------------------------- /nano-core/src/test/resources/META-INF/nano/spi/org.nanoframework.core.spi.test.SpiNotImplService: -------------------------------------------------------------------------------- 1 | testService=org.nanoframework.core.spi.test.impl.TestServiceImpl 2 | -------------------------------------------------------------------------------- /nano-core/src/test/resources/META-INF/nano/spi/org.nanoframework.core.spi.test.SpiService: -------------------------------------------------------------------------------- 1 | testService=org.nanoframework.core.spi.test.impl.TestServiceImpl 2 | org.nanoframework.core.spi.test.impl.TestService2Impl 3 | testService2 -------------------------------------------------------------------------------- /nano-core/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context= 18 | 19 | context.version=0.0.1 20 | 21 | context.mode=DEV 22 | 23 | context.root=/core 24 | 25 | context.component-scan.base-package=org.nanoframework.core.component 26 | context.api-scan.base-package=org.nanoframework.core.component,org.nanoframework.core.service 27 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-dubbo/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.extension.dubbo.DubboReferenceModule 2 | org.nanoframework.extension.dubbo.DubboServiceModule -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/GenericService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.dubbo.service; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.10 22 | */ 23 | public interface GenericService { 24 | 25 | T get(); 26 | } 27 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/HelloWorld2Service.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.dubbo.service; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.1 22 | */ 23 | public interface HelloWorld2Service { 24 | String say2(String who); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/HelloWorldService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.dubbo.service; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.1 22 | */ 23 | public interface HelloWorldService { 24 | String say(String who); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/impl/GenericIntegerService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.dubbo.service.impl; 17 | 18 | import org.nanoframework.extension.dubbo.service.GenericService; 19 | 20 | import com.alibaba.dubbo.config.annotation.Service; 21 | 22 | /** 23 | * 24 | * @author yanghe 25 | * @since 1.4.10 26 | */ 27 | @Service(group = "generic.integer") 28 | public class GenericIntegerService implements GenericService { 29 | 30 | @Override 31 | public Integer get() { 32 | return 1; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/impl/GenericMapService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.dubbo.service.impl; 17 | 18 | import java.util.Map; 19 | 20 | import org.nanoframework.commons.util.MapBuilder; 21 | import org.nanoframework.extension.dubbo.service.GenericService; 22 | 23 | import com.alibaba.dubbo.config.annotation.Service; 24 | 25 | /** 26 | * 27 | * @author yanghe 28 | * @since 1.4.10 29 | */ 30 | @Service(group = "generic.map") 31 | public class GenericMapService implements GenericService> { 32 | 33 | @Override 34 | public Map get() { 35 | return MapBuilder.builder().put("key1", "Hello").put("key2", "Generic").build(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/test/java/org/nanoframework/extension/dubbo/service/impl/GenericStringService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.dubbo.service.impl; 17 | 18 | import org.nanoframework.extension.dubbo.service.GenericService; 19 | 20 | import com.alibaba.dubbo.config.annotation.Service; 21 | 22 | /** 23 | * 24 | * @author yanghe 25 | * @since 1.4.10 26 | */ 27 | @Service(group = "generic.string") 28 | public class GenericStringService implements GenericService { 29 | 30 | @Override 31 | public String get() { 32 | return "Hello, generic!"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | context.dubbo-service.base-package=org.nanoframework.extension.dubbo.service.impl 2 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-dubbo/src/test/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | dubbo.application.name=dubbo-with-nano 2 | dubbo.registry.address=N/A 3 | # dubbo.monitor.protocol=registry 4 | 5 | dubbo.protocol.dubbo.port=20880 6 | dubbo.provider.timeout=1000 7 | dubbo.provider.retries=3 8 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-httpclient/src/main/resources/META-INF/nano/spi/org.nanoframework.extension.httpclient.HttpClient: -------------------------------------------------------------------------------- 1 | default=org.nanoframework.extension.httpclient.HttpClientImpl 2 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-httpclient/src/test/java/org/nanoframework/extension/httpclient/HttpClientProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.httpclient; 17 | 18 | import com.google.inject.Inject; 19 | import org.nanoframework.core.inject.FieldInject; 20 | import org.nanoframework.extension.httpclient.inject.HttpClientInjector; 21 | import org.nanoframework.extension.httpclient.inject.HttpConfig; 22 | 23 | /** 24 | * @author yanghe 25 | * @since 1.4.10 26 | */ 27 | public class HttpClientProxy { 28 | private HttpClient client; 29 | private HttpClient testClient; 30 | 31 | @FieldInject(HttpClientInjector.class) 32 | @HttpConfig 33 | private HttpClient fieldInject; 34 | 35 | public HttpClient getFieldInject() { 36 | return fieldInject; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-httpclient/src/test/java/org/nanoframework/extension/httpclient/test/TestHttpClientImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.httpclient.test; 17 | 18 | import org.nanoframework.extension.httpclient.HttpClientImpl; 19 | import org.nanoframework.extension.httpclient.inject.HttpConfigure; 20 | 21 | import java.nio.charset.Charset; 22 | import java.util.concurrent.TimeUnit; 23 | 24 | /** 25 | * @author yanghe 26 | * @since 1.4.10 27 | */ 28 | public class TestHttpClientImpl extends HttpClientImpl { 29 | /** 30 | * @param conf HttpClient配置 31 | */ 32 | public TestHttpClientImpl(final HttpConfigure conf) { 33 | super(conf); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-httpclient/src/test/resources/META-INF/nano/spi/org.nanoframework.extension.httpclient.HttpClient: -------------------------------------------------------------------------------- 1 | test=org.nanoframework.extension.httpclient.test.TestHttpClientImpl 2 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-mail/src/main/java/org/nanoframework/extension/mail/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-mail/src/main/java/org/nanoframework/extension/mail/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-mail/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-mail/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-mail/src/test/java/org/nanoframework/extension/mail/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-mail/src/test/java/org/nanoframework/extension/mail/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-mail/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-mail/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/main/java/org/nanoframework/extension/shiro/client/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-shiro-client/src/main/java/org/nanoframework/extension/shiro/client/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/main/java/org/nanoframework/extension/shiro/client/configuration/SystemPropertiesConfigurationStrategyImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.shiro.client.configuration; 17 | 18 | import javax.servlet.Filter; 19 | import javax.servlet.FilterConfig; 20 | 21 | /** 22 | * 23 | * @author yanghe 24 | * @since 1.3.7 25 | */ 26 | public class SystemPropertiesConfigurationStrategyImpl extends BaseConfigurationStrategy { 27 | 28 | public void init(FilterConfig filterConfig, Class filterClazz) { 29 | } 30 | 31 | @Override 32 | protected String get(ConfigurationKey configurationKey) { 33 | return System.getProperty(configurationKey.getName()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/main/java/org/nanoframework/extension/shiro/client/matchers/ContainsPatternUrlPatternMatcherStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.shiro.client.matchers; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.7 22 | */ 23 | public final class ContainsPatternUrlPatternMatcherStrategy implements UrlPatternMatcherStrategy { 24 | 25 | private String pattern; 26 | 27 | public boolean matches(final String url) { 28 | return url.contains(this.pattern); 29 | } 30 | 31 | public void setPattern(final String pattern) { 32 | this.pattern = pattern; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/main/java/org/nanoframework/extension/shiro/client/matchers/UrlPatternMatcherStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.shiro.client.matchers; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.7 22 | */ 23 | public interface UrlPatternMatcherStrategy { 24 | /** 25 | * Execute the match between the given pattern and the url 26 | * @param url the request url typically with query strings included 27 | * @return true if match is successful 28 | */ 29 | boolean matches(String url); 30 | 31 | /** 32 | * The pattern against which the url is compared 33 | * @param pattern the pattern 34 | */ 35 | void setPattern(String pattern); 36 | } 37 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-shiro-client/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/main/resources/nanoframework/shiro.sso.client.properties: -------------------------------------------------------------------------------- 1 | context.component-scan.base-package=org.nanoframework.extension.shiro.client.web.component -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/test/java/org/nanoframework/extension/shiro/client/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-shiro-client/src/test/java/org/nanoframework/extension/shiro/client/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/test/java/org/nanoframework/extension/shiro/client/Bootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.shiro.client; 17 | 18 | import org.nanoframework.server.JettyCustomServer; 19 | import org.nanoframework.server.cmd.Commands; 20 | 21 | /** 22 | * 23 | * @author yanghe 24 | * @since 1.3.7 25 | */ 26 | public final class Bootstrap { 27 | 28 | private Bootstrap() { 29 | 30 | } 31 | 32 | public static void main(final String[] args) { 33 | JettyCustomServer.server().bootstrap(Commands.START.toString()); 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-shiro-client/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context= 18 | 19 | context.mode=DEV 20 | 21 | context.root=/shiro 22 | 23 | context.component-scan.base-package=org.nanoframework.extension.shiro.client.component 24 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro-client/src/test/resources/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 2 | <%-- 3 | 4 | Copyright 2015-2016 the original author or authors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | 18 | --%> 19 | 20 | 21 | Hello World, Shiro Client! 22 | 23 | 24 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/java/org/nanoframework/extension/shiro/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-shiro/src/main/java/org/nanoframework/extension/shiro/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/java/org/nanoframework/extension/shiro/ShiroAopModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.shiro; 17 | 18 | import java.util.List; 19 | 20 | import javax.servlet.ServletConfig; 21 | 22 | import org.nanoframework.core.plugins.Module; 23 | 24 | import com.google.common.collect.Lists; 25 | 26 | /** 27 | * 28 | * @author yanghe 29 | * @since 1.4.8 30 | */ 31 | public class ShiroAopModule extends org.apache.shiro.guice.aop.ShiroAopModule implements Module { 32 | 33 | @Override 34 | public List load() throws Throwable { 35 | return Lists.newArrayList(this); 36 | } 37 | 38 | @Override 39 | public void config(ServletConfig config) throws Throwable { 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/java/org/nanoframework/extension/shiro/ShiroWebModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.shiro; 17 | 18 | import javax.servlet.ServletContext; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 0.0.1 24 | */ 25 | public class ShiroWebModule extends org.apache.shiro.guice.web.ShiroWebModule { 26 | 27 | /** 28 | * @param servletContext 29 | */ 30 | public ShiroWebModule(final ServletContext servletContext) { 31 | super(servletContext); 32 | } 33 | 34 | @Override 35 | protected void configureShiroWeb() { 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/java/org/nanoframework/extension/shiro/authc/SaltedAuthenticationInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.shiro.authc; 17 | 18 | import org.nanoframework.extension.shiro.util.ByteSource; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 1.2 24 | */ 25 | public interface SaltedAuthenticationInfo { 26 | ByteSource getCredentialsSalt(); 27 | } 28 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/java/org/nanoframework/extension/shiro/web/service/RealmService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.shiro.web.service; 17 | 18 | import org.apache.shiro.authz.AuthorizationInfo; 19 | import org.apache.shiro.subject.PrincipalCollection; 20 | import org.nanoframework.extension.shiro.web.service.impl.RealmServiceImpl; 21 | 22 | import com.google.inject.ImplementedBy; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.3.7 28 | */ 29 | @ImplementedBy(RealmServiceImpl.class) 30 | public interface RealmService { 31 | 32 | AuthorizationInfo getAuthorizationInfo(); 33 | 34 | AuthorizationInfo getAuthorizationInfo(PrincipalCollection principals); 35 | } 36 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-shiro/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.extension.shiro.ShiroAopModule -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Plugin: -------------------------------------------------------------------------------- 1 | org.nanoframework.extension.shiro.ShiroPlugin 2 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/main/resources/nanoframework/shiro.sso.properties: -------------------------------------------------------------------------------- 1 | context.component-scan.base-package=org.nanoframework.extension.shiro.web.component -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/test/java/org/nanoframework/ext/shiro/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-shiro/src/test/java/org/nanoframework/ext/shiro/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/test/java/org/nanoframework/ext/shiro/ShiroStartup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.ext.shiro; 17 | 18 | import org.nanoframework.server.JettyCustomServer; 19 | import org.nanoframework.server.cmd.Commands; 20 | 21 | /** 22 | * @author yanghe 23 | * @date 2015年12月9日 下午5:11:32 24 | */ 25 | public class ShiroStartup { 26 | public static void main(String[] args) { 27 | JettyCustomServer.server().bootstrap(Commands.START.toString()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-shiro/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context= 18 | 19 | context.mode=DEV 20 | 21 | context.root=/shiro 22 | 23 | mapper.package.jdbc=/shiro-jdbc.properties 24 | 25 | context.component-scan.base-package=org.nanoframework.ext.shiro.component 26 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/test/resources/shiro-redis.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | redis.root=1 18 | 19 | redis.1.redisType=shiro 20 | redis.1.hostNames=192.168.99.100:6379 21 | redis.1.maxTotal=100 22 | redis.1.maxIdle=10 23 | redis.1.timeOut=5000 24 | redis.1.testOnBorrow=false 25 | redis.1.expireTime=0 26 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/test/resources/shiro.ini: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | [users] 18 | admin=admin 19 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-shiro/src/test/resources/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 2 | <%-- 3 | 4 | Copyright 2015-2016 the original author or authors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | 18 | --%> 19 | 20 | 21 | Hello World, Shiro! 22 | 23 | 24 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-websocket/src/main/java/org/nanoframework/extension/websocket/WebSocketException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.extension.websocket; 17 | 18 | /** 19 | * @author yanghe 20 | * @since 1.1 21 | */ 22 | public class WebSocketException extends RuntimeException { 23 | private static final long serialVersionUID = -6956723226962912844L; 24 | 25 | public WebSocketException() { 26 | 27 | } 28 | 29 | public WebSocketException(String message) { 30 | super(message); 31 | } 32 | 33 | public WebSocketException(Throwable cause) { 34 | super(cause); 35 | } 36 | 37 | public WebSocketException(String message, Throwable cause) { 38 | super(message, cause); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-websocket/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-websocket/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-websocket/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Plugin: -------------------------------------------------------------------------------- 1 | org.nanoframework.extension.websocket.WebSocketPlugin 2 | -------------------------------------------------------------------------------- /nano-ext/nano-ext-websocket/src/test/java/org/nanoframework/extension/websocket/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-websocket/src/test/java/org/nanoframework/extension/websocket/.gitkeep -------------------------------------------------------------------------------- /nano-ext/nano-ext-websocket/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-ext/nano-ext-websocket/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-jetty-server/.gitignore: -------------------------------------------------------------------------------- 1 | !webRoot -------------------------------------------------------------------------------- /nano-jetty-server/src/main/java/org/nanoframework/server/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-jetty-server/src/main/java/org/nanoframework/server/.gitkeep -------------------------------------------------------------------------------- /nano-jetty-server/src/main/java/org/nanoframework/server/cmd/Commands.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server.cmd; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.14 22 | */ 23 | public enum Commands { 24 | START, STOP, VERSION, HELP 25 | } -------------------------------------------------------------------------------- /nano-jetty-server/src/main/java/org/nanoframework/server/cmd/Mode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server.cmd; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.14 22 | */ 23 | public enum Mode { 24 | DEV, PROD 25 | } 26 | -------------------------------------------------------------------------------- /nano-jetty-server/src/main/java/org/nanoframework/server/exception/JettyServerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class JettyServerException extends RuntimeException { 24 | private static final long serialVersionUID = 7394251380464789083L; 25 | 26 | public JettyServerException() { 27 | 28 | } 29 | 30 | public JettyServerException(String message) { 31 | super(message); 32 | 33 | } 34 | 35 | public JettyServerException(String message, Throwable cause) { 36 | super(message, cause); 37 | 38 | } 39 | 40 | @Override 41 | public String getMessage() { 42 | return "Jetty服务异常: " + super.getMessage(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /nano-jetty-server/src/main/java/org/nanoframework/server/exception/ReadXMLException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class ReadXMLException extends RuntimeException { 24 | private static final long serialVersionUID = 5581544308399688381L; 25 | 26 | public ReadXMLException() { 27 | 28 | } 29 | 30 | public ReadXMLException(String message) { 31 | super(message); 32 | 33 | } 34 | 35 | public ReadXMLException(String message, Throwable cause) { 36 | super(message, cause); 37 | 38 | } 39 | 40 | @Override 41 | public String getMessage() { 42 | return "读取XML异常: " + super.getMessage(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /nano-jetty-server/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-jetty-server/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-jetty-server/src/test/java/org/nanoframework/server/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-jetty-server/src/test/java/org/nanoframework/server/.gitkeep -------------------------------------------------------------------------------- /nano-jetty-server/src/test/java/org/nanoframework/server/Bootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.17 22 | */ 23 | public final class Bootstrap { 24 | 25 | private Bootstrap() { 26 | 27 | } 28 | 29 | public static void main(final String[] args) { 30 | JettyCustomServer.server().bootstrap(args); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /nano-jetty-server/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-jetty-server/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-jetty-server/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context= 18 | 19 | context.version=0.0.1 20 | 21 | context.mode=DEV 22 | 23 | context.root=/jetty 24 | 25 | context.component-scan.base-package=org.nanoframework.server.component 26 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/main/java/org/nanoframework/orm/consul/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-consul/src/main/java/org/nanoframework/orm/consul/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/main/java/org/nanoframework/orm/consul/exception/ConsulException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.consul.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.9 22 | */ 23 | public class ConsulException extends RuntimeException { 24 | private static final long serialVersionUID = -5836008704632479642L; 25 | 26 | public ConsulException() { 27 | 28 | } 29 | 30 | public ConsulException(final String message) { 31 | super(message); 32 | } 33 | 34 | public ConsulException(final String message, final Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public ConsulException(final Throwable cause) { 39 | super(cause); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-consul/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.orm.consul.ConsulModule 2 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/main/resources/consul-template.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2017 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Consul加载根 18 | consul.root= 19 | 20 | # Consul ID 21 | consul.1.id= 22 | # Consul的地址, 格式: : 23 | consul.1.host.port= 24 | # Consul 资源URL 25 | consul.1.url= 26 | # Consul权限验证用户名 27 | consul.1.username= 28 | # Consul权限验证密码 29 | consul.1.password= 30 | # Consul ACLs token 31 | consul.1.token= 32 | # Consul 请求头参数列表, JSON数据格式 33 | consul.1.headers= 34 | # 连接超时时长, 单位: 毫秒 35 | consul.1.timeout.connect= 36 | # 读取超时时长,单位: 毫秒 37 | consul.1.timeout.read= 38 | # 写入超时时长, 单位: 毫秒 39 | conusl.1.timeout.write= 40 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/test/java/org/nanoframework/orm/consul/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-consul/src/test/java/org/nanoframework/orm/consul/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-consul/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/test/resources/consul.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2017 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Consul加载根 18 | consul.root=1 19 | 20 | # Consul ID 21 | consul.1.id=test 22 | # Consul的地址, 格式: : 23 | consul.1.host.port= 24 | # Consul 资源URL 25 | consul.1.url= 26 | # Consul权限验证用户名 27 | consul.1.username= 28 | # Consul权限验证密码 29 | consul.1.password= 30 | # Consul ACLs token 31 | consul.1.token= 32 | # Consul 请求头参数列表, JSON数据格式 33 | consul.1.headers= 34 | # 连接超时时长, 单位: 毫秒 35 | consul.1.timeout.connect=3000 36 | # 读取超时时长,单位: 毫秒 37 | consul.1.timeout.read=60000 38 | # 写入超时时长, 单位: 毫秒 39 | conusl.1.timeout.write=5000 40 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-consul/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/DataSourceLoaderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm; 17 | 18 | /** 19 | * @author yanghe 20 | * @since 1.2 21 | */ 22 | public class DataSourceLoaderException extends RuntimeException { 23 | private static final long serialVersionUID = -2507126142998789661L; 24 | 25 | public DataSourceLoaderException() { } 26 | 27 | public DataSourceLoaderException(String message) { 28 | super(message); 29 | } 30 | 31 | public DataSourceLoaderException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | @Override 36 | public String getMessage() { 37 | return "加载数据源异常: " + super.getMessage(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/ORMType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm; 17 | 18 | /** 19 | * @author yanghe 20 | * @since 1.2 21 | */ 22 | public enum ORMType { 23 | JDBC, MYBATIS; 24 | } 25 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/PoolType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm; 17 | 18 | /** 19 | * @author yanghe 20 | * @since 1.0 21 | */ 22 | public enum PoolType { 23 | C3P0, DRUID, TOMCAT_JDBC_POOL; 24 | } 25 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/jdbc/DataSourceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jdbc; 17 | 18 | /** 19 | * 数据源处理异常 20 | * 21 | * @author yanghe 22 | * @since 1.2 23 | */ 24 | public class DataSourceException extends RuntimeException { 25 | private static final long serialVersionUID = -4463455332449664304L; 26 | 27 | public DataSourceException() { 28 | 29 | } 30 | 31 | public DataSourceException(String message) { 32 | super(message); 33 | 34 | } 35 | 36 | public DataSourceException(String message, Throwable cause) { 37 | super(message, cause); 38 | 39 | } 40 | 41 | @Override 42 | public String getMessage() { 43 | return "数据源配置异常: " + super.getMessage(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/jdbc/pool/Pool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jdbc.pool; 17 | 18 | import javax.sql.DataSource; 19 | 20 | /** 21 | * @author yanghe 22 | * @since 1.2 23 | */ 24 | public interface Pool { 25 | public void closeAndClear(); 26 | public DataSource getPool(String envId); 27 | } 28 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/jdbc/record/annotation/Column.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jdbc.record.annotation; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.3.15 28 | */ 29 | @Target({ ElementType.FIELD }) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | public @interface Column { 33 | /** 34 | * 35 | * @return Database column name 36 | */ 37 | String value(); 38 | } 39 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/jdbc/record/annotation/Id.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jdbc.record.annotation; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.3.15 28 | */ 29 | @Target({ ElementType.FIELD }) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | public @interface Id { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/jdbc/record/annotation/Table.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jdbc.record.annotation; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * 26 | * @author yanghe 27 | * @since 1.3.15 28 | */ 29 | @Target({ ElementType.TYPE }) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | public @interface Table { 33 | /** 34 | * 35 | * @return Database table name 36 | */ 37 | String value(); 38 | } 39 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/java/org/nanoframework/orm/jdbc/record/exception/MultiRecordException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jdbc.record.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.15 22 | */ 23 | public class MultiRecordException extends RuntimeException { 24 | private static final long serialVersionUID = 7241865179261938921L; 25 | 26 | public MultiRecordException() { 27 | super(); 28 | } 29 | 30 | public MultiRecordException(final String message) { 31 | super(message); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-jdbc/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.orm.jdbc.binding.BindJdbcManagerModule 2 | org.nanoframework.orm.DataSourceModule 3 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/main/resources/META-INF/nano/spi/org.nanoframework.orm.DataSourceLoader: -------------------------------------------------------------------------------- 1 | org.nanoframework.orm.jdbc.JdbcDataSourceLoader 2 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/test/java/org/nanoframework/orm/jdbc/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-jdbc/src/test/java/org/nanoframework/orm/jdbc/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-jdbc/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-jdbc/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/main/java/org/nanoframework/orm/jedis/exception/TimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jedis.exception; 17 | 18 | /** 19 | * Jedis操作异常处理类. 20 | * 21 | * @author yanghe 22 | * @since 1.0 23 | */ 24 | public class TimeoutException extends RuntimeException { 25 | private static final long serialVersionUID = -6151365904901655741L; 26 | 27 | public TimeoutException() { 28 | 29 | } 30 | 31 | public TimeoutException(final String message) { 32 | super(message); 33 | } 34 | 35 | public TimeoutException(final String message, final Throwable cause) { 36 | super(message, cause); 37 | } 38 | 39 | public TimeoutException(final Throwable cause) { 40 | super(cause); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-jedis/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.orm.jedis.binding.BindRedisClientModule 2 | org.nanoframework.orm.jedis.JedisModule -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/main/resources/redis-template.properties: -------------------------------------------------------------------------------- 1 | # 2 | # redis.root=1 3 | # 4 | # 5 | # redis.1.redisType= 6 | # redis.1.hostNames= 7 | # redis.1.maxTotal= 8 | # redis.1.maxIdle= 9 | # redis.1.timeOut= 10 | # redis.1.testOnBorrow= 11 | # redis.1.expireTime= 12 | # redis.1.cluster= 13 | # redis.1.maxRedirections= 14 | # redis.1.extend= 15 | # redis.1.extendResource= 16 | # redis.1.lockGroup= 17 | # redis.1.lockTimeout= 18 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/test/java/org/nanoframework/orm/jedis/RedisClientExt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jedis; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * 22 | * @author yanghe 23 | * @since 0.0.1 24 | */ 25 | public interface RedisClientExt extends RedisClient { 26 | boolean sets(Map values); 27 | } 28 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/test/java/org/nanoframework/orm/jedis/RedisClientInitialize.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.jedis; 17 | 18 | import java.io.IOException; 19 | 20 | import org.junit.Before; 21 | import org.nanoframework.commons.loader.LoaderException; 22 | 23 | /** 24 | * 25 | * @author yanghe 26 | * @since 1.3.16 27 | */ 28 | public class RedisClientInitialize { 29 | protected RedisClient redisClient; 30 | 31 | @Before 32 | public void before() throws LoaderException, IOException { 33 | if (redisClient == null) { 34 | try { 35 | redisClient = GlobalRedisClient.get("cluster"); 36 | } catch (final Throwable e) { 37 | // ignore 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-jedis/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/test/resources/redis-ext.properties: -------------------------------------------------------------------------------- 1 | sharded2=sharded -------------------------------------------------------------------------------- /nano-orm/nano-orm-jedis/src/test/resources/redis-test.properties: -------------------------------------------------------------------------------- 1 | redis.root=1,2,3 2 | 3 | redis.1.redisType=sharded 4 | redis.1.hostNames=localhost:6380 5 | redis.1.maxTotal=100 6 | redis.1.maxIdle=30 7 | redis.1.minIdle=10 8 | redis.1.timeOut=1000 9 | redis.1.testOnBorrow=false 10 | redis.1.expireTime=2 11 | 12 | redis.2.redisType=cluster 13 | # redis.2.hostNames=192.168.180.221:7000;192.168.180.221:7001;192.168.180.221:7002;192.168.180.221:7003;192.168.180.221:7004;192.168.180.221:7005 14 | # 减少编译在此消耗的时间,这里缩减为1个节点,timeout设置为1秒 15 | redis.2.hostNames=192.168.180.221:7000 16 | redis.2.maxTotal=100 17 | redis.2.maxIdle=30 18 | redis.2.minIdle=10 19 | redis.2.timeOut=1000 20 | redis.2.testOnBorrow=false 21 | redis.2.expireTime=2 22 | redis.2.cluster=true 23 | 24 | redis.3.redisType=sharded2 25 | redis.3.hostNames=localhost:6381 26 | redis.3.maxTotal=100 27 | redis.3.maxIdle=30 28 | redis.3.minIdle=10 29 | redis.3.timeOut=1000 30 | redis.3.testOnBorrow=false 31 | redis.3.expireTime=2 32 | redis.3.extend=org.nanoframework.orm.jedis.RedisClientExtImpl 33 | redis.3.extendResource=/redis-ext.properties 34 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-kafka/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.orm.kafka.KafkaProducerModule 2 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-kafka/src/test/resources/kafka-producer.properties: -------------------------------------------------------------------------------- 1 | bootstrap.servers=10.129.221.243:9092,10.129.221.244:9092,10.129.221.245:9092 2 | 3 | # Key的序列化类。 4 | # Type: class 5 | # Default: 6 | # Importance: high 7 | key.serializer=org.apache.kafka.common.serialization.StringSerializer 8 | 9 | # Value的序列化类。 10 | # Type: class 11 | # Default: 12 | # Importance: high 13 | value.serializer=org.apache.kafka.common.serialization.StringSerializer 14 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-mybatis/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-mybatis/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-mybatis/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-mybatis/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.orm.mybatis.binding.BindSqlSessionModule -------------------------------------------------------------------------------- /nano-orm/nano-orm-mybatis/src/main/resources/META-INF/nano/spi/org.nanoframework.orm.DataSourceLoader: -------------------------------------------------------------------------------- 1 | org.nanoframework.orm.mybatis.MybatisDataSourceLoader 2 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-mybatis/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-mybatis/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/main/java/org/nanoframework/orm/rocketmq/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-rocketmq/src/main/java/org/nanoframework/orm/rocketmq/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-rocketmq/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/main/resources/META-INF/nano/spi/org.nanoframework.core.plugins.Module: -------------------------------------------------------------------------------- 1 | org.nanoframework.orm.rocketmq.RocketMQProducerModule 2 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/main/resources/rocketmq-template.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2017 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # RocketMQ加载根 18 | rocketmq.root= 19 | 20 | # RocketMQ ID 21 | rocketmq.1.id= 22 | # RocketMQ Producer对象JSON配置 23 | rocketmq.1.base={} 24 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/test/java/org/nanoframework/orm/rocketmq/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-rocketmq/src/test/java/org/nanoframework/orm/rocketmq/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/test/java/org/nanoframework/orm/rocketmq/RocketMQTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.orm.rocketmq; 17 | 18 | import org.apache.rocketmq.client.producer.MQProducer; 19 | import org.junit.Ignore; 20 | import org.junit.Test; 21 | import org.nanoframework.commons.util.Assert; 22 | 23 | import com.google.inject.Inject; 24 | import com.google.inject.name.Named; 25 | 26 | /** 27 | * 28 | * @author yanghe 29 | * @since 1.4.9 30 | */ 31 | @Ignore 32 | public class RocketMQTests extends AbstractRocketMQTests { 33 | 34 | @Inject 35 | @Named("rkt:test") 36 | private MQProducer producer; 37 | 38 | @Test 39 | public void createProducerTest() { 40 | injects(); 41 | Assert.notNull(producer); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-orm/nano-orm-rocketmq/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /nano-orm/nano-orm-rocketmq/src/test/resources/rocketmq.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2017 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # RocketMQ加载根 18 | rocketmq.root=1 19 | 20 | # RocketMQ ID 21 | rocketmq.1.id=test 22 | # RocketMQ Producer对象JSON配置 23 | rocketmq.1.base={\ 24 | "namesrvAddr": "10.1.232.108:9876;10.1.232.109:9876;10.1.232.110:9876;10.1.232.111:9876", \ 25 | "instanceName": "test-p1", \ 26 | "producerGroup": "test" \ 27 | } 28 | -------------------------------------------------------------------------------- /nano-server/src/main/resources/application-template.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2017 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 是否开启配置中心功能 18 | application.enabled=true 19 | 20 | # 配置中心资源库 21 | application.git.repo=https://github.com/nano-projects/nano-conf.git 22 | 23 | # default: HEAD 24 | application.git.repo.branch= 25 | 26 | # 一级目录 27 | application.conf.path=test 28 | 29 | # 二级目录 30 | application.conf.env=sit 31 | 32 | # 三级目录 33 | application.conf.host=localhost 34 | 35 | # 覆盖规则,CLEAN | REPLACE 36 | application.conf.repeat.policy=CLEAN 37 | -------------------------------------------------------------------------------- /nano-server/src/test/java/org/nanoframework/server/GitPullTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server; 17 | 18 | import java.io.IOException; 19 | 20 | import org.eclipse.jgit.api.errors.GitAPIException; 21 | import org.eclipse.jgit.api.errors.InvalidRemoteException; 22 | import org.eclipse.jgit.api.errors.TransportException; 23 | import org.junit.Test; 24 | 25 | /** 26 | * 27 | * @author yanghe 28 | * @since 1.4.6 29 | */ 30 | public class GitPullTests { 31 | 32 | @Test 33 | public void pullTest() throws InvalidRemoteException, TransportException, GitAPIException, IOException { 34 | GitPull.create().quickPull(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /nano-server/src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2017 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | application.enabled=true 18 | 19 | application.git.repo=https://github.com/nano-projects/nano-conf.git 20 | 21 | application.git.repo.branch= 22 | 23 | application.conf.path=test 24 | 25 | application.conf.env=sit 26 | 27 | application.conf.host= 28 | 29 | # CLEAN | REPLACE 30 | application.conf.repeat.policy=CLEAN 31 | -------------------------------------------------------------------------------- /nano-super/src/licensing/header-definitions.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | /* 22 | * 23 | */ 24 | ( |\t)*/\*( |\t)*$ 25 | ( |\t)*\*/( |\t)*$ 26 | true 27 | true 28 | 29 | 30 | -------------------------------------------------------------------------------- /nano-super/src/licensing/header.txt: -------------------------------------------------------------------------------- 1 | Copyright 2015-2016 the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /nano-tomcat-server/.gitignore: -------------------------------------------------------------------------------- 1 | !webRoot -------------------------------------------------------------------------------- /nano-tomcat-server/src/main/java/org/nanoframework/server/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-tomcat-server/src/main/java/org/nanoframework/server/.gitkeep -------------------------------------------------------------------------------- /nano-tomcat-server/src/main/java/org/nanoframework/server/cmd/Commands.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server.cmd; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.14 22 | */ 23 | public enum Commands { 24 | START, STOP, VERSION, HELP 25 | } -------------------------------------------------------------------------------- /nano-tomcat-server/src/main/java/org/nanoframework/server/cmd/Mode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server.cmd; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.3.14 22 | */ 23 | public enum Mode { 24 | DEV, PROD 25 | } 26 | -------------------------------------------------------------------------------- /nano-tomcat-server/src/main/java/org/nanoframework/server/exception/TomcatServerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server.exception; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.0 22 | */ 23 | public class TomcatServerException extends RuntimeException { 24 | private static final long serialVersionUID = 7394251380464789083L; 25 | 26 | public TomcatServerException() { 27 | 28 | } 29 | 30 | public TomcatServerException(String message) { 31 | super(message); 32 | 33 | } 34 | 35 | public TomcatServerException(String message, Throwable cause) { 36 | super(message, cause); 37 | 38 | } 39 | 40 | @Override 41 | public String getMessage() { 42 | return "Jetty服务异常: " + super.getMessage(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /nano-tomcat-server/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-tomcat-server/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-tomcat-server/src/test/java/org/nanoframework/server/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-tomcat-server/src/test/java/org/nanoframework/server/.gitkeep -------------------------------------------------------------------------------- /nano-tomcat-server/src/test/java/org/nanoframework/server/TomcatServerBootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.server; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.4.2 22 | */ 23 | public class TomcatServerBootstrap { 24 | 25 | public static void main(String[] args) throws Throwable { 26 | TomcatCustomServer.server().bootstrap(args); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /nano-tomcat-server/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-tomcat-server/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-tomcat-server/src/test/resources/context.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | context= 18 | 19 | context.version=0.0.1 20 | 21 | context.mode=DEV 22 | 23 | context.root=/tomcat 24 | 25 | context.component-scan.base-package=org.nanoframework.server.component 26 | 27 | context.tomcat.executor={ \ 28 | "namePrefix": "nano-exec-", \ 29 | "maxThreads": 1000, \ 30 | "minSpareThreads": 50, \ 31 | } 32 | 33 | context.tomcat.connector={ \ 34 | "port": 7000 \ 35 | } 36 | -------------------------------------------------------------------------------- /nano-webmvc/src/main/java/org/nanoframework/web/server/http/status/Response.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.web.server.http.status; 17 | 18 | /** 19 | * 20 | * @author yanghe 21 | * @since 1.2 22 | */ 23 | public enum Response { 24 | EMPTY; 25 | } -------------------------------------------------------------------------------- /nano-webmvc/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-webmvc/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /nano-webmvc/src/test/java/org/nanoframework/web/server/http/status/tests/ResultMapTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.nanoframework.web.server.http.status.tests; 17 | 18 | import org.junit.Assert; 19 | import org.junit.Test; 20 | import org.nanoframework.web.server.http.status.HttpStatus; 21 | import org.nanoframework.web.server.http.status.ResultMap; 22 | 23 | /** 24 | * 25 | * @author yanghe 26 | * @since 1.4.5 27 | */ 28 | public class ResultMapTest { 29 | 30 | @Test 31 | public void valuesTest() { 32 | final ResultMap res = HttpStatus.OK.to().builder().put("hello", "world").build(); 33 | Assert.assertEquals(res.getValues().get("hello"), "world"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /nano-webmvc/src/test/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nano-projects/nano-framework/4af4e90cfdefea4f4a202ee6a227ae89c01ab950/nano-webmvc/src/test/resources/.gitkeep -------------------------------------------------------------------------------- /nano-webmvc/src/test/resources/test-loader.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2016 the original author or authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | key=value 18 | -------------------------------------------------------------------------------- /src/licensing/header-definitions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /* 5 | * 6 | */ 7 | ( |\t)*/\*( |\t)*$ 8 | ( |\t)*\*/( |\t)*$ 9 | true 10 | true 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/licensing/header.txt: -------------------------------------------------------------------------------- 1 | Copyright 2015-2016 the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. --------------------------------------------------------------------------------