├── .asf.yaml ├── .github └── workflows │ └── maven.yml ├── .gitignore ├── LICENSE ├── NOTICE ├── README.adoc ├── integration-tests ├── app-groovy │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── apache │ │ │ └── groovy │ │ │ └── SimpleService.groovy │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── groovy │ │ │ └── SimpleServiceTest.groovy │ │ └── parsed │ │ └── SimpleService2.groovy ├── beanvalidation │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ └── beanvalidation │ │ │ └── itest │ │ │ └── Service.java │ │ └── test │ │ └── java │ │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── beanvalidation │ │ └── itest │ │ └── ServiceTest.java ├── dispatch-jsp │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── meecrowave │ │ │ │ └── it │ │ │ │ └── jsp │ │ │ │ └── dispatch │ │ │ │ ├── DispatchEndpoint.java │ │ │ │ ├── Model.java │ │ │ │ └── ModelRenderer.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── resources │ │ │ └── WEB-INF │ │ │ └── dispatch.jsp │ │ └── test │ │ └── java │ │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── it │ │ └── jsp │ │ └── dispatch │ │ └── DispatchEndpointTest.java ├── no-cxf │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── nocxf │ │ └── itest │ │ └── RunWithoutCxfTest.java ├── pom.xml ├── sse │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── meecrowave │ │ │ │ └── tests │ │ │ │ ├── sse │ │ │ │ ├── NewsService.java │ │ │ │ └── RSApplication.java │ │ │ │ └── ws │ │ │ │ └── ChatWS.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── beans.xml │ │ │ └── services │ │ │ └── jakarta.ws.rs.sse.SseEventSource.Builder │ │ └── test │ │ └── java │ │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── tests │ │ ├── sse │ │ └── SSETest.java │ │ └── ws │ │ └── WSTest.java ├── ssl │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── meecrowave │ │ │ │ └── tests │ │ │ │ └── ssl │ │ │ │ └── HelloWorld.java │ │ └── resources │ │ │ ├── ca-chain.cert.pem │ │ │ ├── meecrowave.cert.pem │ │ │ ├── meecrowave.key.pem │ │ │ ├── meecrowave_first_host.jks │ │ │ ├── meecrowave_second_host.jks │ │ │ └── meecrowave_trust.jks │ │ └── test │ │ └── java │ │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── tests │ │ └── ssl │ │ ├── SslDefaultConfigurationTest.java │ │ ├── SslHostConfigPropertiesTest.java │ │ ├── TestSetup.java │ │ └── TlsVirtualHostPropertiesTest.java └── webservices │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ └── tests │ │ │ └── webservices │ │ │ ├── Contract1.java │ │ │ ├── Contract2.java │ │ │ ├── Endpoint1.java │ │ │ └── Endpoint2.java │ └── resources │ │ └── META-INF │ │ └── beans.xml │ └── test │ └── java │ └── org │ └── apache │ └── meecrowave │ └── tests │ └── webservice │ └── JAXWSTest.java ├── meecrowave-arquillian ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ └── arquillian │ │ │ ├── MeecrowaveConfiguration.java │ │ │ ├── MeecrowaveContainer.java │ │ │ └── MeecrowaveExtension.java │ └── resources │ │ └── META-INF │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── services │ │ └── org.jboss.arquillian.core.spi.LoadableExtension │ └── test │ └── java │ └── org │ ├── apache │ └── meecrowave │ │ └── arquillian │ │ └── MeecrowaveContainerTest.java │ └── app │ ├── Endpoint.java │ ├── Injectable.java │ └── RsApp.java ├── meecrowave-core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ ├── Meecrowave.java │ │ │ ├── api │ │ │ ├── ListeningBase.java │ │ │ ├── StartListening.java │ │ │ └── StopListening.java │ │ │ ├── cdi │ │ │ ├── MeecrowaveSeContainerInitializer.java │ │ │ └── MeecrowaveSeContainerSelector.java │ │ │ ├── configuration │ │ │ └── Configuration.java │ │ │ ├── cxf │ │ │ ├── ConfigurableBus.java │ │ │ ├── CxfCdiAutoSetup.java │ │ │ ├── Cxfs.java │ │ │ ├── JAXRSFieldInjectionInterceptor.java │ │ │ ├── JAXWSAddressMapper.java │ │ │ ├── JAXWSCdiExtension.java │ │ │ ├── MeecrowaveBus.java │ │ │ ├── MeecrowaveClientLifecycleListener.java │ │ │ └── WsMapping.java │ │ │ ├── io │ │ │ └── IO.java │ │ │ ├── lang │ │ │ └── Substitutor.java │ │ │ ├── logging │ │ │ ├── jul │ │ │ │ ├── AbstractDelegatingLogger.java │ │ │ │ └── Log4j2Logger.java │ │ │ ├── log4j2 │ │ │ │ ├── Log4j2Shutdown.java │ │ │ │ ├── Log4j2s.java │ │ │ │ ├── MeecrowaveLog4j2ConfigurationFactory.java │ │ │ │ └── MeecrowaveLogEventFactory.java │ │ │ ├── openwebbeans │ │ │ │ └── Log4j2LoggerFactory.java │ │ │ └── tomcat │ │ │ │ ├── JULLog.java │ │ │ │ ├── Log4j2Log.java │ │ │ │ └── LogFacade.java │ │ │ ├── openwebbeans │ │ │ ├── KnownClassesFilter.java │ │ │ ├── KnownJarsFilter.java │ │ │ ├── MeecrowaveExtension.java │ │ │ ├── MeecrowaveSecurityService.java │ │ │ ├── OWBAutoSetup.java │ │ │ └── OWBTomcatWebScannerService.java │ │ │ ├── runner │ │ │ ├── Cli.java │ │ │ └── cli │ │ │ │ └── CliOption.java │ │ │ ├── service │ │ │ ├── Priotities.java │ │ │ └── ValueTransformer.java │ │ │ ├── tomcat │ │ │ ├── CDIInstanceManager.java │ │ │ ├── LoggingAccessLogPattern.java │ │ │ ├── MeecrowaveContextConfig.java │ │ │ ├── OWBJarScanner.java │ │ │ ├── ProvidedLoader.java │ │ │ ├── TomcatAutoInitializer.java │ │ │ └── light │ │ │ │ └── LightDigester.java │ │ │ └── watching │ │ │ └── ReloadOnChangeController.java │ └── resources │ │ ├── META-INF │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── beans.xml │ │ ├── openwebbeans │ │ │ └── openwebbeans.properties │ │ └── services │ │ │ ├── jakarta.enterprise.inject.spi.Extension │ │ │ ├── org.apache.juli.logging.Log │ │ │ └── org.apache.openwebbeans.se.SeContainerSelector │ │ ├── log4j2.component.properties │ │ └── log4j2.meecrowave-logging │ └── test │ ├── java │ └── org │ │ ├── apache │ │ └── meecrowave │ │ │ ├── AsyncTest.java │ │ │ ├── ConfigInjection.java │ │ │ ├── ContextInProxiedInstancesTest.java │ │ │ ├── CustomSessionConfigTest.java │ │ │ ├── InstanceCustomizerTest.java │ │ │ ├── InterfaceBasedTest.java │ │ │ ├── JsonStructureEndpointTest.java │ │ │ ├── MeecrowaveTest.java │ │ │ ├── MultipartTest.java │ │ │ ├── NoConnectorTest.java │ │ │ ├── OctetStreamMediaTypeTest.java │ │ │ ├── PrincipalTest.java │ │ │ ├── ServletContainerInitialierInjectionTest.java │ │ │ ├── ServletContainerProgrammaticRegistrationTest.java │ │ │ ├── SharedLibTest.java │ │ │ ├── Streams.java │ │ │ ├── TestPrincipal.java │ │ │ ├── ValveTest.java │ │ │ ├── WatcherTest.java │ │ │ ├── cdi │ │ │ └── MeecrowaveSeContainerInitializerTest.java │ │ │ ├── cxf │ │ │ └── MeecrowaveClientLifecycleListenerTest.java │ │ │ ├── johnzon │ │ │ ├── DebugJohnzonBufferStrategy.java │ │ │ └── JohnzonBufferTest.java │ │ │ ├── lang │ │ │ └── SubstitutorTest.java │ │ │ ├── runner │ │ │ └── CliTest.java │ │ │ └── test │ │ │ └── api │ │ │ └── ListeningTest.java │ │ └── superbiz │ │ └── app │ │ ├── Bounced.java │ │ ├── Endpoint.java │ │ ├── Init.java │ │ ├── Injectable.java │ │ ├── InterfaceApi.java │ │ ├── InterfaceBased.java │ │ ├── RsApp.java │ │ ├── SomeFilter.java │ │ └── TestJsonEndpoint.java │ └── resources │ ├── META-INF │ ├── openwebbeans │ │ └── openwebbeans.properties │ └── services │ │ ├── jakarta.servlet.ServletContainerInitializer │ │ └── org.apache.meecrowave.runner.Cli$Options │ └── sirona.properties ├── meecrowave-doc ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── doc │ │ ├── JBake.java │ │ ├── PDFify.java │ │ └── generator │ │ ├── ArquillianConfiguration.java │ │ ├── BaseGenerator.java │ │ ├── CliConfiguration.java │ │ ├── Configuration.java │ │ ├── Downloads.java │ │ ├── GradleConfiguration.java │ │ ├── LetsEncryptConfiguration.java │ │ ├── MavenConfiguration.java │ │ ├── OAuth2Configuration.java │ │ └── ProxyConfiguration.java │ ├── jbake │ ├── assets │ │ ├── assets │ │ │ ├── css │ │ │ │ └── styles.css │ │ │ ├── images │ │ │ │ └── empty.gif │ │ │ ├── js │ │ │ │ └── main.js │ │ │ └── plugins │ │ │ │ ├── bootstrap │ │ │ │ ├── css │ │ │ │ │ ├── bootstrap.min.css │ │ │ │ │ └── bootstrap.min.css.map │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ │ └── bootstrap.min.js │ │ │ │ ├── elegant_font │ │ │ │ └── css │ │ │ │ │ ├── fonts │ │ │ │ │ ├── ElegantIcons.eot │ │ │ │ │ ├── ElegantIcons.svg │ │ │ │ │ ├── ElegantIcons.ttf │ │ │ │ │ └── ElegantIcons.woff │ │ │ │ │ └── style.css │ │ │ │ ├── font-awesome │ │ │ │ ├── css │ │ │ │ │ └── font-awesome.min.css │ │ │ │ └── fonts │ │ │ │ │ ├── FontAwesome.otf │ │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ │ ├── jquery-1.12.3.min.js │ │ │ │ └── jquery-match-height │ │ │ │ └── jquery.matchHeight-min.js │ │ ├── favicon.ico │ │ └── favicon.png │ ├── content │ │ ├── community.adoc │ │ ├── companion-projects.adoc │ │ ├── components.adoc │ │ ├── download.adoc │ │ ├── howto.adoc │ │ ├── meecrowave-core │ │ │ ├── cli.adoc │ │ │ ├── configuration.adoc │ │ │ └── deploy-webapp.adoc │ │ ├── meecrowave-gradle │ │ │ └── index.adoc │ │ ├── meecrowave-jpa │ │ │ └── index.adoc │ │ ├── meecrowave-jta │ │ │ └── index.adoc │ │ ├── meecrowave-letsencrypt │ │ │ └── index.adoc │ │ ├── meecrowave-maven │ │ │ └── index.adoc │ │ ├── meecrowave-oauth2 │ │ │ └── index.adoc │ │ ├── meecrowave-proxy │ │ │ └── index.adoc │ │ ├── meecrowave-websocket │ │ │ └── index.adoc │ │ ├── start.adoc │ │ └── testing │ │ │ └── index.adoc │ ├── jbake.properties │ └── templates │ │ ├── footer.gsp │ │ ├── header.gsp │ │ ├── index.gsp │ │ └── page.gsp │ └── resources │ └── META-INF │ ├── LICENSE │ └── NOTICE ├── meecrowave-gradle-plugin ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── gradle │ │ ├── MeecrowaveExtension.java │ │ ├── MeecrowavePlugin.java │ │ ├── MeecrowaveTask.java │ │ └── classloader │ │ └── FilterGradleClassLoader.java │ └── resources │ └── META-INF │ ├── LICENSE │ ├── NOTICE │ └── gradle-plugins │ ├── org.apache.meecrowave.properties │ └── org.apache.microwave.microwave.properties ├── meecrowave-jpa ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ └── jpa │ │ │ ├── api │ │ │ ├── EntityManagerScoped.java │ │ │ ├── Jpa.java │ │ │ ├── PersistenceUnitInfoBuilder.java │ │ │ └── Unit.java │ │ │ └── internal │ │ │ ├── AnyLiteral.java │ │ │ ├── AutoJpaAnnotationType.java │ │ │ ├── EntityManagerBean.java │ │ │ ├── EntityManagerContext.java │ │ │ ├── JpaExtension.java │ │ │ ├── JpaInterceptorBase.java │ │ │ ├── JpaLiteral.java │ │ │ ├── JpaNoTransactionInterceptor.java │ │ │ ├── JpaTransactionInterceptor.java │ │ │ └── UnitLiteral.java │ └── resources │ │ └── META-INF │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── services │ │ └── jakarta.enterprise.inject.spi.Extension │ └── test │ ├── java │ └── org │ │ ├── apache │ │ └── meecrowave │ │ │ └── jpa │ │ │ └── internal │ │ │ ├── JpaExtensionTest.java │ │ │ └── exceptionlost │ │ │ └── JPAExceptionLostTest.java │ │ └── app │ │ └── JPADao.java │ └── resources │ └── META-INF │ └── beans.xml ├── meecrowave-jta ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ └── jta │ │ │ ├── AnyLiteral.java │ │ │ ├── DefaultLiteral.java │ │ │ ├── InterceptorBase.java │ │ │ ├── JtaConfig.java │ │ │ ├── JtaExtension.java │ │ │ ├── MandatoryInterceptor.java │ │ │ ├── NeverInterceptor.java │ │ │ ├── NotSupportedInterceptor.java │ │ │ ├── RequiredInterceptor.java │ │ │ ├── RequiredNewInterceptor.java │ │ │ ├── SupportsInterceptor.java │ │ │ ├── TransactionContext.java │ │ │ └── TransactionExceptionMapper.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── jakarta.enterprise.inject.spi.Extension │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── jta │ │ ├── RequiredInterceptorTest.java │ │ └── ScopeTest.java │ └── resources │ └── META-INF │ └── beans.xml ├── meecrowave-junit ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ ├── internal │ │ │ └── ClassLoaderLock.java │ │ │ ├── junit │ │ │ ├── InjectRule.java │ │ │ ├── MeecrowaveRule.java │ │ │ ├── MeecrowaveRuleBase.java │ │ │ ├── MonoMeecrowave.java │ │ │ └── ScopeRule.java │ │ │ ├── junit5 │ │ │ ├── AfterFirstInjection.java │ │ │ ├── AfterLastTest.java │ │ │ ├── BaseLifecycle.java │ │ │ ├── MeecrowaveConfig.java │ │ │ ├── MeecrowaveExtension.java │ │ │ ├── MonoMeecrowaveConfig.java │ │ │ ├── MonoMeecrowaveExtension.java │ │ │ ├── Scopes.java │ │ │ └── ScopesExtension.java │ │ │ └── testing │ │ │ ├── ConfigurationInject.java │ │ │ ├── Injector.java │ │ │ └── MonoBase.java │ └── resources │ │ └── META-INF │ │ ├── LICENSE │ │ └── NOTICE │ └── test │ ├── java │ └── org │ │ ├── apache │ │ └── meecrowave │ │ │ ├── junit │ │ │ ├── MeecrowaveRuleTest.java │ │ │ └── MonoMeecrowaveRuleTest.java │ │ │ └── junit5 │ │ │ ├── MeecrowaveConfigMetaAnnotationTest.java │ │ │ ├── MeecrowaveConfigScopesTest.java │ │ │ ├── MeecrowaveConfigTest.java │ │ │ ├── MeecrowaveRequestScopedConfig.java │ │ │ ├── MeecrowaveTestLifecycleTest.java │ │ │ ├── PerClass2MeecrowaveConfigTest.java │ │ │ ├── PerClassMeecrowaveConfigTest.java │ │ │ ├── PerClassMeecrowaveTestLifecycleTest.java │ │ │ ├── ScopesTest.java │ │ │ └── bean │ │ │ ├── Appender.java │ │ │ └── SomeCommonInterface.java │ │ └── app │ │ ├── Endpoint.java │ │ ├── Injectable.java │ │ ├── MyAppClass.java │ │ ├── MyReqClass.java │ │ └── RsApp.java │ └── resources │ └── META-INF │ └── beans.xml ├── meecrowave-letsencrypt ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── letencrypt │ │ ├── LetsEncryptReloadLifecycle.java │ │ ├── LetsEncryptSetup.java │ │ └── LetsEncryptValve.java │ └── resources │ └── META-INF │ └── services │ └── org.apache.meecrowave.runner.Cli$Options ├── meecrowave-maven-plugin ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ └── maven │ │ │ ├── MeecrowaveBakeMojo.java │ │ │ ├── MeecrowaveBundleMojo.java │ │ │ └── MeecrowaveRunMojo.java │ └── resources │ │ ├── META-INF │ │ ├── LICENSE │ │ └── NOTICE │ │ └── bin │ │ ├── catalina.sh │ │ ├── meecrowave.bat │ │ ├── meecrowave.sh │ │ ├── shutdown.sh │ │ └── startup.sh │ └── test │ ├── java │ └── org │ │ ├── apache │ │ └── meecrowave │ │ │ └── maven │ │ │ ├── MeecrowaveBundleMojoTest.java │ │ │ └── MeecrowaveRunMojoTest.java │ │ └── app │ │ ├── AdditionalEndpoint.java │ │ ├── Endpoint.java │ │ ├── Injectable.java │ │ ├── Model.java │ │ └── RsApp.java │ └── resources │ ├── MeecrowaveBundleMojoTest │ ├── pom.xml │ └── src │ │ └── main │ │ └── webapp │ │ └── sub │ │ └── index.html │ ├── MeecrowaveRunMojoTest │ ├── pom.xml │ └── src │ │ └── main │ │ └── webapp │ │ └── sub │ │ └── index.html │ └── meecrowave.properties ├── meecrowave-oauth2-minimal ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ └── oauth2 │ │ │ ├── configuration │ │ │ ├── JCacheConfigurer.java │ │ │ ├── JPAAdapter.java │ │ │ ├── OAuth2Configurer.java │ │ │ └── OAuth2Options.java │ │ │ ├── data │ │ │ └── RefreshTokenEnabledProvider.java │ │ │ ├── provider │ │ │ └── JCacheCodeDataProvider.java │ │ │ └── resource │ │ │ ├── OAuth2Application.java │ │ │ ├── OAuth2AuthorizationCodeGrantService.java │ │ │ ├── OAuth2RevokeTokenService.java │ │ │ └── OAuth2TokenService.java │ └── resources │ │ ├── META-INF │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── beans.xml │ │ └── services │ │ │ └── org.apache.meecrowave.runner.Cli$Options │ │ └── default-oauth2.jcs │ └── test │ └── java │ └── org │ └── apache │ └── meecrowave │ └── oauth2 │ ├── Keystores.java │ └── OAuth2Test.java ├── meecrowave-oauth2 └── pom.xml ├── meecrowave-proxy ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── meecrowave │ │ │ └── proxy │ │ │ └── servlet │ │ │ ├── configuration │ │ │ └── Routes.java │ │ │ ├── front │ │ │ ├── ProxyServlet.java │ │ │ └── cdi │ │ │ │ ├── CDIProxyServlet.java │ │ │ │ ├── event │ │ │ │ ├── AfterResponse.java │ │ │ │ ├── BaseEvent.java │ │ │ │ ├── BeforeRequest.java │ │ │ │ ├── OnRequest.java │ │ │ │ └── OnResponse.java │ │ │ │ ├── extension │ │ │ │ └── SpyExtension.java │ │ │ │ └── func │ │ │ │ ├── IOConsumer.java │ │ │ │ └── IOFunction.java │ │ │ ├── meecrowave │ │ │ └── ProxyServletSetup.java │ │ │ └── service │ │ │ ├── ConfigurationLoader.java │ │ │ └── SimpleSubstitutor.java │ └── resources │ │ └── META-INF │ │ ├── beans.xml │ │ └── services │ │ ├── jakarta.enterprise.inject.spi.Extension │ │ └── org.apache.meecrowave.Meecrowave$ContextCustomizer │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── proxy │ │ └── servlet │ │ ├── ProxyServletTest.java │ │ ├── mock │ │ └── FakeRemoteServer.java │ │ └── service │ │ └── ConfigurationLoaderTest.java │ └── resources │ ├── ConfigurationLoaderTest │ ├── ensureDefaults.json │ └── mergeWithDefaultRoute.json │ ├── ProxyServletTest │ └── upload │ │ └── file.txt │ └── routes.json ├── meecrowave-specs-api └── pom.xml ├── meecrowave-websocket ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── meecrowave │ │ └── websocket │ │ └── CDIServerConfigurator.java │ └── resources │ └── META-INF │ └── services │ └── jakarta.websocket.server.ServerEndpointConfig$Configurator ├── pom.xml └── test-app ├── pom.xml └── src └── main └── java └── org └── superbiz └── app ├── Injectable.java ├── OtherEndpoint.java └── OtherFilter.java /.asf.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | github: 18 | dependabot_alerts: false 19 | dependabot_updates: false 20 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. 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 | name: Java CI 17 | 18 | on: [push, pull_request] 19 | 20 | jobs: 21 | build: 22 | runs-on: ${{ matrix.os }} 23 | continue-on-error: ${{ matrix.experimental }} 24 | strategy: 25 | matrix: 26 | os: [ubuntu-latest] 27 | java: [ 17 ] 28 | experimental: [false] 29 | 30 | steps: 31 | - uses: actions/checkout@v3 32 | - uses: actions/cache@v3 33 | with: 34 | path: ~/.m2/repository 35 | key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} 36 | restore-keys: | 37 | ${{ runner.os }}-maven- 38 | - name: Set up JDK ${{ matrix.java }} 39 | uses: actions/setup-java@v3 40 | with: 41 | distribution: adopt 42 | java-version: ${{ matrix.java }} 43 | - name: Build with Maven 44 | run: mvn -V clean verify --no-transfer-progress 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .classpath 3 | .project 4 | .settings 5 | .idea 6 | *.ipr 7 | *.iml 8 | *.log 9 | *~ 10 | .site-content 11 | dependency-reduced-pom.xml 12 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /integration-tests/app-groovy/src/main/java/org/apache/groovy/SimpleService.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.groovy 20 | 21 | import javax.enterprise.context.ApplicationScoped 22 | import javax.ws.rs.GET 23 | import javax.ws.rs.Path 24 | 25 | @Path("simple") 26 | @ApplicationScoped 27 | class SimpleService { 28 | @GET 29 | get() { 30 | "simple" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /integration-tests/app-groovy/src/test/parsed/SimpleService2.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | import javax.enterprise.context.ApplicationScoped 20 | import javax.ws.rs.GET 21 | import javax.ws.rs.Path 22 | 23 | @Path("simple2") 24 | @ApplicationScoped 25 | class SimpleService2 { 26 | @GET 27 | get() { 28 | "simple2" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /integration-tests/beanvalidation/src/main/java/org/apache/meecrowave/beanvalidation/itest/Service.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.beanvalidation.itest; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import jakarta.validation.Valid; 23 | import jakarta.validation.constraints.NotNull; 24 | import jakarta.ws.rs.GET; 25 | import jakarta.ws.rs.Path; 26 | import jakarta.ws.rs.Produces; 27 | import jakarta.ws.rs.QueryParam; 28 | import jakarta.ws.rs.core.MediaType; 29 | 30 | @Path("test") 31 | @ApplicationScoped 32 | public class Service { 33 | @GET 34 | @Valid 35 | @Produces(MediaType.APPLICATION_JSON) 36 | public Res get(@QueryParam("val") final String val) { 37 | final Res res = new Res(); 38 | res.setValue(val); 39 | return res; 40 | } 41 | 42 | public static class Res { 43 | @NotNull 44 | private String value; 45 | 46 | public String getValue() { 47 | return value; 48 | } 49 | 50 | void setValue(final String value) { 51 | this.value = value; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /integration-tests/dispatch-jsp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | integration-tests 23 | org.apache.meecrowave 24 | 2.0.0-SNAPSHOT 25 | 26 | 4.0.0 27 | 28 | dispatch-jsp 29 | Meecrowave :: Integration Tests :: JSP Dispatch 30 | 31 | 32 | 33 | org.apache.meecrowave 34 | meecrowave-core 35 | ${project.version} 36 | 37 | 38 | org.apache.tomcat 39 | tomcat-jasper 40 | ${tomcat.version} 41 | 42 | 43 | 44 | junit 45 | junit 46 | ${junit.version} 47 | test 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /integration-tests/dispatch-jsp/src/main/java/org/apache/meecrowave/it/jsp/dispatch/DispatchEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.it.jsp.dispatch; 20 | 21 | import static org.apache.meecrowave.it.jsp.dispatch.Model.view; 22 | 23 | import jakarta.enterprise.context.ApplicationScoped; 24 | import jakarta.ws.rs.GET; 25 | import jakarta.ws.rs.Path; 26 | import jakarta.ws.rs.Produces; 27 | import jakarta.ws.rs.core.MediaType; 28 | 29 | @Path("dispatch") 30 | @ApplicationScoped 31 | public class DispatchEndpoint { 32 | @GET 33 | @Produces(MediaType.TEXT_HTML) 34 | public Model get() { 35 | return view("/WEB-INF/dispatch.jsp") 36 | .set("title", "Endpoint"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /integration-tests/dispatch-jsp/src/main/java/org/apache/meecrowave/it/jsp/dispatch/Model.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.it.jsp.dispatch; 20 | 21 | import static java.util.Collections.unmodifiableMap; 22 | 23 | import java.util.HashMap; 24 | import java.util.Map; 25 | 26 | public class Model { 27 | final String path; 28 | final Map data = new HashMap<>(); 29 | 30 | private Model(final String path) { 31 | this.path = path; 32 | } 33 | 34 | public Model set(final String name, final Object data) { 35 | this.data.put(name, data); 36 | return this; 37 | } 38 | 39 | public Map getData() { 40 | return unmodifiableMap(data); 41 | } 42 | 43 | public static Model view(final String path) { 44 | return new Model(path); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /integration-tests/dispatch-jsp/src/main/resources/META-INF/resources/WEB-INF/dispatch.jsp: -------------------------------------------------------------------------------- 1 | <% 2 | /* 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | */ 20 | %> 21 | <%@ page language="java" pageEncoding="UTF-8" session="false"%> 22 | 23 | 24 | 25 | 26 | Meecrowave :: IT :: Dispatch 27 | 28 | 29 |

<%= request.getAttribute("title") %>

30 | 31 | 32 | -------------------------------------------------------------------------------- /integration-tests/sse/src/main/java/org/apache/meecrowave/tests/sse/RSApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.tests.sse; 20 | 21 | import jakarta.ws.rs.ApplicationPath; 22 | import jakarta.ws.rs.core.Application; 23 | 24 | @ApplicationPath("/rs") 25 | public class RSApplication extends Application { 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/sse/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /integration-tests/sse/src/main/resources/META-INF/services/jakarta.ws.rs.sse.SseEventSource.Builder: -------------------------------------------------------------------------------- 1 | org.apache.cxf.jaxrs.sse.client.SseEventSourceBuilderImpl 2 | -------------------------------------------------------------------------------- /integration-tests/ssl/src/main/java/org/apache/meecrowave/tests/ssl/HelloWorld.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.tests.ssl; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import jakarta.ws.rs.GET; 23 | import jakarta.ws.rs.Path; 24 | import jakarta.ws.rs.Produces; 25 | import jakarta.ws.rs.core.MediaType; 26 | 27 | @Path("/") 28 | @ApplicationScoped 29 | public class HelloWorld { 30 | 31 | @GET 32 | @Path("hello") 33 | @Produces(MediaType.TEXT_PLAIN) 34 | public String sayHello() { 35 | return "Hello"; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /integration-tests/ssl/src/main/resources/meecrowave.cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEwjCCAqqgAwIBAgICQAAwDQYJKoZIhvcNAQELBQAwVzELMAkGA1UEBhMCVVMx 3 | ETAPBgNVBAgMCE1hcnlsYW5kMQ8wDQYDVQQKDAZBcGFjaGUxCzAJBgNVBAsMAklU 4 | MRcwFQYDVQQDDA53d3cuYXBhY2hlLm9yZzAeFw0xNzEyMjMxNDM4NDNaFw00NTA0 5 | MzAxNDM4NDNaMHQxCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhNYXJ5bGFuZDEUMBIG 6 | A1UEBwwLRm9yZXN0IEhpbGwxDzANBgNVBAoMBkFwYWNoZTELMAkGA1UECwwCSVQx 7 | HjAcBgNVBAMMFW1lZWNyb3dhdmUuYXBhY2hlLm9yZzCCASIwDQYJKoZIhvcNAQEB 8 | BQADggEPADCCAQoCggEBAKG//SkTXGB2tQTvIubVZmufe6v34BB5i2gqmdsTAOOj 9 | 5IOzB1ecXfis2j9z8sOGLyUIxB9BqVAZrSr0+O/GCS2IZ5mCTy3ol205tUUFP+9J 10 | 0k8D16RvtJ29tf+jraCMfolZ2dhAZjSdGKl5OoH9DLuGBz0TOXpZqrJp7Zv1e7eK 11 | heoeXsLCZ9pjhMvE+dCXkkSaIwpL7Hx86BWVgjEOtKCYo9SZ/kjMGuxmRRAubwYm 12 | 6ykN3+rVYXR1+Q0WQ1i8+a8cec7p3t3SxwHfByrsqMCrm4DsfFuPHW+vUdq9wZiA 13 | CFT6t1ydo2S+2f+3X3CKjmtGDFF42eyegFlvYcXLph8CAwEAAaN7MHkwCQYDVR0T 14 | BAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNh 15 | dGUwHQYDVR0OBBYEFCGCJyFaolIDfv3vb+Y4A+2vPj2ZMB8GA1UdIwQYMBaAFFU4 16 | 6lfGldzXKYS2jN/NcNEgYuxKMA0GCSqGSIb3DQEBCwUAA4ICAQAvQEoiTIXVxFoO 17 | 4oWA5Tdt+t6FBuFn1Kzwky01GLe7VuleaeoGLspbELCVI38RyifPihnsXXgYHebY 18 | D4+DsWiJgKHT3QBimqbBpV4584K/kf2if1rIwyLZP7WEvVGYzHJVblzyl79Pd2K4 19 | hpuqP1EqhBLnnmd6ajH850QYhi8HuNEXMTGrdmExO8uYVPFupaUKwL330rZtjpAJ 20 | k4tlRAVBFGKZYRqQT6DShaMTjak//ODj0ykur3q55QDEP9fBhmrTKvQYDhmCTyTa 21 | Oyd6tdYZ1QM4qmH2dxEA3C4WSjt3fdCKIO1ly7/15sRw+QuG2hP6quofpWMqv6fe 22 | XWtUey19MnFtyOYTyZ8HdZrbka+85dGDxXCRCyODagcn/fobd2X9G99e9iZNXM3g 23 | Q7ociiwHJcIjN4MKn4dID9z/2qRyqbRyrRusSFWxnzQytDQ6PV1O+ENRwwOWT0t6 24 | uU3Zj1eaVu/CKnDwH8CS/79K2VWIh51qkKaw6OwGm5VehLgfxYryVGvE5BkuLdZM 25 | DNJG0ndhgr0PNPwTYh4p7c9XmBj9Tq9zJ4WX74EXkEY/bGAF4nPvlAGP1XKu1mGF 26 | sYUQWI2xatvqSXEDkxlV7Oom8Ealq9cIMOGgZMWkq4f5sYUmtdjMmokEa5VoMcYw 27 | RP2ULWf0IOMefcZ81C5cMhqADct14w== 28 | -----END CERTIFICATE----- 29 | -------------------------------------------------------------------------------- /integration-tests/ssl/src/main/resources/meecrowave.key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQChv/0pE1xgdrUE 3 | 7yLm1WZrn3ur9+AQeYtoKpnbEwDjo+SDswdXnF34rNo/c/LDhi8lCMQfQalQGa0q 4 | 9PjvxgktiGeZgk8t6JdtObVFBT/vSdJPA9ekb7SdvbX/o62gjH6JWdnYQGY0nRip 5 | eTqB/Qy7hgc9Ezl6Waqyae2b9Xu3ioXqHl7CwmfaY4TLxPnQl5JEmiMKS+x8fOgV 6 | lYIxDrSgmKPUmf5IzBrsZkUQLm8GJuspDd/q1WF0dfkNFkNYvPmvHHnO6d7d0scB 7 | 3wcq7KjAq5uA7Hxbjx1vr1HavcGYgAhU+rdcnaNkvtn/t19wio5rRgxReNnsnoBZ 8 | b2HFy6YfAgMBAAECggEAQ2XoazEyEM/l5cRvWpgZMUcnFSUYLEU5HZKCwZJNkI0+ 9 | LtJugMcbMP91gXMi+O30vw3ECvIlRscsLPYetGpkcKCh6oktzQdZ8Z1WNwhU97Re 10 | +aW0OUSCkif2qirdskRYhYr3BvDupYXAPP3Sr09t+sWCRqS4Eo9CXU1eQNotTvCz 11 | 2L9IUOr8Hjf9lh1LX+eRN6G54jKFXBQqd6FMU8yeAWoMvB9ns75YO/W0RXITlEfS 12 | e+TlbEsE/sW6Wjjuld9OEs/EpeE5Er3rrcm5r4q2Zp+BRNi87uzxuD2whRngMBOg 13 | pXUL2UW/28wNlWcLtod750DkgsyAF7M1Vw+fOQZ/wQKBgQDUNkt+ZNpLpH+rGFuI 14 | TO+ZWxxbdv0wn8Aqv/81TxVIRCwQrqlrSoJggPYN9eIU+MqGgJq3t1u3X2V+toPk 15 | uBSvrX83I/k+gf9ZYTXf8kZ3wLEPlSzF4iD1uGoCIJfmGSFuKeQN4MfVa8FTHlP7 16 | Xp2E0RbwemWXL64uHHfZcIFzlwKBgQDDICBppU9LomiiG9rS7FxnKgkbzAnalh0p 17 | N+2iSxKkg6WNRzMFyH8WmyfEQPlvB3EakHTx0U0HjGVALdFlgD3B3jx7kxLVpNgh 18 | W+nXrQCUzrnJyiG3YKBb8JLQIdhpX09yOPwGrrSIeVjvOWP6/EJvfyPvvsRWYpy6 19 | YwS/fKWSuQKBgGNFqvdLsprkLx0Y3ejbJNK2voNDHJpcgQb+niKQBkKyMXL0Yijg 20 | yDDg4zoQplxtLkDRdI8w5WTY6Z/nPbgHLRYpsXNYDsbhBVUIlq1WpwRqTeoePL2t 21 | VQHd7Sllmel4JB1m11pupsz+BYgejebvkfyJ25NPjqq1EWRcyOwdJ1GtAoGANKUs 22 | WZSialOtS1+ckJ/45lSvFHLejb1GrOJMGSeMJhrmxdFZ8MuBjoXaGtc09UHawEIN 23 | a1j/IXQ9tS0ne+03vGDLjMPHpyDMt2NnGiuxJnUIJ2uD4UgOu/+SfNlE3Fk8xCKf 24 | zOXCC7hByHmBgiwheJejCII90tjUVG120Hs+6PECgYA1+5vJJBmSyPnve1Hm2CK6 25 | OA0kfIGtqqfvmQ7a5YK1GlI0v29Xt2U9xmw2N7Br/6y1YysETU6jwuytYagg+e6b 26 | W+oGLDhS5zpqeMe1d4quulDv7RM5H60b6p8lADGf69zIWQTSiyA9EYm6tHSADBg9 27 | IOwMedY4u4grIvSp401rGg== 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /integration-tests/ssl/src/main/resources/meecrowave_first_host.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/integration-tests/ssl/src/main/resources/meecrowave_first_host.jks -------------------------------------------------------------------------------- /integration-tests/ssl/src/main/resources/meecrowave_second_host.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/integration-tests/ssl/src/main/resources/meecrowave_second_host.jks -------------------------------------------------------------------------------- /integration-tests/ssl/src/main/resources/meecrowave_trust.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/integration-tests/ssl/src/main/resources/meecrowave_trust.jks -------------------------------------------------------------------------------- /integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TestSetup.java: -------------------------------------------------------------------------------- 1 | package org.apache.meecrowave.tests.ssl; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import jakarta.ws.rs.client.Client; 6 | import jakarta.ws.rs.client.ClientBuilder; 7 | import jakarta.ws.rs.core.MediaType; 8 | 9 | public class TestSetup { 10 | protected static String callJaxrsService(int portNumber) { 11 | Client client = ClientBuilder.newBuilder() 12 | .connectTimeout(5, TimeUnit.SECONDS) 13 | .readTimeout(5, TimeUnit.SECONDS) 14 | .build(); 15 | return client.target("https://localhost:" + portNumber + "/hello") 16 | .request(MediaType.TEXT_PLAIN) 17 | .get(String.class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration-tests/webservices/src/main/java/org/apache/meecrowave/tests/webservices/Contract1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.tests.webservices; 20 | 21 | import javax.jws.WebService; 22 | 23 | @WebService 24 | public interface Contract1 { 25 | String foo(); 26 | } 27 | -------------------------------------------------------------------------------- /integration-tests/webservices/src/main/java/org/apache/meecrowave/tests/webservices/Contract2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.tests.webservices; 20 | 21 | import javax.jws.WebService; 22 | 23 | @WebService 24 | public interface Contract2 { 25 | String bar(); 26 | } 27 | -------------------------------------------------------------------------------- /integration-tests/webservices/src/main/java/org/apache/meecrowave/tests/webservices/Endpoint1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.tests.webservices; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import javax.jws.WebService; 23 | 24 | @WebService 25 | @ApplicationScoped 26 | public class Endpoint1 implements Contract1 { 27 | @Override 28 | public String foo() { 29 | return "foo"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /integration-tests/webservices/src/main/java/org/apache/meecrowave/tests/webservices/Endpoint2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.tests.webservices; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import javax.jws.WebService; 23 | 24 | @WebService 25 | @ApplicationScoped 26 | public class Endpoint2 implements Contract2 { 27 | @Override 28 | public String bar() { 29 | return "bar"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /integration-tests/webservices/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.arquillian; 20 | 21 | import org.jboss.arquillian.container.spi.client.container.DeployableContainer; 22 | import org.jboss.arquillian.core.spi.LoadableExtension; 23 | 24 | public class MeecrowaveExtension implements LoadableExtension { 25 | @Override 26 | public void register(final ExtensionBuilder extensionBuilder) { 27 | extensionBuilder.service(DeployableContainer.class, MeecrowaveContainer.class); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /meecrowave-arquillian/src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /meecrowave-arquillian/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.arquillian.MeecrowaveExtension 2 | -------------------------------------------------------------------------------- /meecrowave-arquillian/src/test/java/org/app/Endpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import jakarta.inject.Inject; 23 | import jakarta.ws.rs.GET; 24 | import jakarta.ws.rs.Path; 25 | import jakarta.ws.rs.Produces; 26 | import jakarta.ws.rs.core.MediaType; 27 | 28 | @Path("test") 29 | @ApplicationScoped 30 | public class Endpoint { 31 | @Inject 32 | private Injectable injectable; 33 | 34 | @GET 35 | @Produces(MediaType.TEXT_PLAIN) 36 | public String simple() { 37 | return Boolean.parseBoolean(injectable.injected()) ? "simple" : "fail"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /meecrowave-arquillian/src/test/java/org/app/Injectable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | 23 | @ApplicationScoped 24 | public class Injectable { 25 | public String injected() { 26 | return "true"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-arquillian/src/test/java/org/app/RsApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.Dependent; 22 | import jakarta.ws.rs.ApplicationPath; 23 | import jakarta.ws.rs.core.Application; 24 | 25 | @Dependent 26 | @ApplicationPath("api") 27 | public class RsApp extends Application { 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/api/ListeningBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.api; 20 | 21 | import org.apache.catalina.Context; 22 | import org.apache.catalina.Host; 23 | import org.apache.catalina.connector.Connector; 24 | 25 | public abstract class ListeningBase { 26 | private final Connector connector; 27 | private final Context context; 28 | private final Host host; 29 | 30 | ListeningBase(final Connector connector, final Host host, final Context context) { 31 | this.connector = connector; 32 | this.host = host; 33 | this.context = context; 34 | } 35 | 36 | public Context getContext() { 37 | return context; 38 | } 39 | 40 | public Connector getConnector() { 41 | return connector; 42 | } 43 | 44 | public Host getHost() { 45 | return host; 46 | } 47 | 48 | public String getFirstBase() { 49 | return (connector.getSecure() ? "https" : "http") + "://" + 50 | host.getName() + (connector.getPort() > 0 ? ":" + connector.getPort() : "") + 51 | context.getPath(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/api/StartListening.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.api; 20 | 21 | import org.apache.catalina.Context; 22 | import org.apache.catalina.Host; 23 | import org.apache.catalina.connector.Connector; 24 | 25 | public class StartListening extends ListeningBase { 26 | public StartListening(final Connector connector, final Host host, final Context context) { 27 | super(connector, host, context); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/api/StopListening.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.api; 20 | 21 | import org.apache.catalina.Context; 22 | import org.apache.catalina.Host; 23 | import org.apache.catalina.connector.Connector; 24 | 25 | public class StopListening extends ListeningBase { 26 | public StopListening(final Connector connector, final Host host, final Context context) { 27 | super(connector, host, context); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/cdi/MeecrowaveSeContainerSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.cdi; 20 | 21 | import org.apache.openwebbeans.se.SeContainerSelector; 22 | 23 | import jakarta.enterprise.inject.se.SeContainerInitializer; 24 | 25 | public class MeecrowaveSeContainerSelector implements SeContainerSelector { 26 | @Override 27 | public SeContainerInitializer find() { 28 | return new MeecrowaveSeContainerInitializer(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/cxf/Cxfs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.cxf; 20 | 21 | public class Cxfs { 22 | public static final boolean IS_PRESENT; 23 | 24 | static { 25 | boolean present; 26 | try { 27 | Cxfs.class.getClassLoader().loadClass("org.apache.cxf.BusFactory"); 28 | present = true; 29 | } catch (ClassNotFoundException e) { 30 | present = false; 31 | } 32 | IS_PRESENT = present; 33 | } 34 | 35 | private Cxfs() { 36 | // no-op 37 | } 38 | 39 | public static boolean hasDefaultBus() { 40 | return org.apache.cxf.BusFactory.getDefaultBus(false) != null; 41 | } 42 | 43 | public static void resetDefaultBusIfEquals(final ConfigurableBus clientBus) { 44 | if (clientBus != null && org.apache.cxf.BusFactory.getDefaultBus(false) == clientBus) { 45 | org.apache.cxf.BusFactory.setDefaultBus(null); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/cxf/JAXWSAddressMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.cxf; 20 | 21 | public interface JAXWSAddressMapper { 22 | String map(Class type); 23 | } 24 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/cxf/WsMapping.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.cxf; 20 | 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 | * This annotation can be used in conjunction with @WebService 28 | * to define an endpoint path for the webservice. 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target(ElementType.TYPE) 32 | public @interface WsMapping 33 | { 34 | /** 35 | * @return the full endpoint path of the webservice 36 | */ 37 | String value(); 38 | } 39 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/logging/log4j2/Log4j2Shutdown.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.logging.log4j2; 20 | 21 | import org.apache.logging.log4j.LogManager; 22 | 23 | /** 24 | * Hide away Log4j2 stuff 25 | */ 26 | public class Log4j2Shutdown { 27 | 28 | public void shutdown() { 29 | try { 30 | // We disabled the log4j shutdown hook to gain more control and keep logs during shutdown. 31 | // See #disableLog4jShutdownHook() 32 | // Otoh that means we need to shutdown Log4j manually. 33 | // So here we go... 34 | LogManager.shutdown(); 35 | } catch (final Exception e) { 36 | System.out.println("A problem happened when shutting down Log4j: " + e + "\n" + e.getMessage()); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/logging/log4j2/Log4j2s.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.logging.log4j2; 20 | 21 | import org.apache.meecrowave.logging.tomcat.LogFacade; 22 | 23 | public class Log4j2s { 24 | public static final boolean IS_PRESENT; 25 | static { 26 | boolean hasLog4j2; 27 | try { 28 | LogFacade.class.getClassLoader().loadClass("org.apache.logging.log4j.Logger"); 29 | hasLog4j2 = true; 30 | } catch (final Exception | NoClassDefFoundError e) { 31 | hasLog4j2 = false; 32 | } 33 | IS_PRESENT = hasLog4j2; 34 | } 35 | 36 | private Log4j2s() { 37 | // no-op 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/logging/log4j2/MeecrowaveLog4j2ConfigurationFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.logging.log4j2; 20 | 21 | import org.apache.logging.log4j.core.LoggerContext; 22 | import org.apache.logging.log4j.core.config.Configuration; 23 | import org.apache.logging.log4j.core.config.ConfigurationSource; 24 | import org.apache.logging.log4j.core.config.Order; 25 | import org.apache.logging.log4j.core.config.plugins.Plugin; 26 | import org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory; 27 | 28 | @Order(100) 29 | @Plugin(name = "MeecrowaveConfigurationFactory", category = "ConfigurationFactory") 30 | public class MeecrowaveLog4j2ConfigurationFactory extends XmlConfigurationFactory { 31 | private static final String[] TYPES = {".xml"/*override*/, ".meecrowave-logging" /*our default*/, "*"}; 32 | 33 | @Override 34 | public String[] getSupportedTypes() { 35 | return TYPES; 36 | } 37 | 38 | @Override 39 | public Configuration getConfiguration(final LoggerContext loggerContext, final ConfigurationSource source) { 40 | return super.getConfiguration(loggerContext, source); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/logging/openwebbeans/Log4j2LoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.logging.openwebbeans; 20 | 21 | import org.apache.meecrowave.logging.jul.Log4j2Logger; 22 | import org.apache.webbeans.logger.WebBeansLoggerFactory; 23 | 24 | import java.util.Locale; 25 | import java.util.ResourceBundle; 26 | import java.util.logging.Logger; 27 | 28 | public class Log4j2LoggerFactory implements WebBeansLoggerFactory { 29 | @Override 30 | public Logger getLogger(final Class clazz, final Locale desiredLocale) { 31 | return new Log4j2Logger(clazz.getName(), ResourceBundle.getBundle("openwebbeans/Messages", desiredLocale).toString()); 32 | } 33 | 34 | @Override 35 | public Logger getLogger(final Class clazz) { 36 | return new Log4j2Logger(clazz.getName(), "openwebbeans/Messages"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/runner/cli/CliOption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.runner.cli; 20 | 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.Target; 23 | 24 | import static java.lang.annotation.ElementType.FIELD; 25 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 26 | 27 | @Target(FIELD) 28 | @Retention(RUNTIME) 29 | public @interface CliOption { 30 | String name(); 31 | String description(); 32 | String[] alias() default {}; 33 | } 34 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/service/Priotities.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.service; 20 | 21 | import static java.util.Optional.ofNullable; 22 | 23 | import jakarta.annotation.Priority; 24 | 25 | public final class Priotities { 26 | private Priotities() { 27 | // no-op 28 | } 29 | 30 | private static int priorityOf(final Object i) { 31 | return ofNullable(i.getClass().getAnnotation(Priority.class)) 32 | .map(Priority::value) 33 | .orElse(0); 34 | } 35 | 36 | public static int sortByPriority(final T a, final T b) { 37 | return priorityOf(a) - priorityOf(b); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/service/ValueTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.service; 20 | 21 | import java.util.function.Function; 22 | 23 | /** 24 | * Implementation transforming a configuration value to a clear value. 25 | * Ex: --foo=decode:bar:val will decode val with the ValueTransformer bar (name). 26 | */ 27 | public interface ValueTransformer extends Function { 28 | /** 29 | * @return name used to mark this transformer in values. 30 | */ 31 | String name(); 32 | } 33 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/LoggingAccessLogPattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.tomcat; 20 | 21 | import org.apache.catalina.valves.AbstractAccessLogValve; 22 | import org.apache.meecrowave.logging.tomcat.LogFacade; 23 | 24 | import java.io.CharArrayWriter; 25 | 26 | public class LoggingAccessLogPattern extends AbstractAccessLogValve { 27 | private final LogFacade logger; 28 | 29 | public LoggingAccessLogPattern(final String pattern) { 30 | logger = new LogFacade(LoggingAccessLogPattern.class.getName()); 31 | setAsyncSupported(true); 32 | setPattern(pattern); 33 | } 34 | 35 | @Override 36 | protected void log(final CharArrayWriter message) { 37 | logger.info(message); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/light/LightDigester.java: -------------------------------------------------------------------------------- 1 | package org.apache.meecrowave.tomcat.light; 2 | 3 | import org.apache.tomcat.util.descriptor.LocalResolver; 4 | import org.apache.tomcat.util.digester.Digester; 5 | import org.apache.tomcat.util.digester.RuleSet; 6 | import org.xml.sax.ext.EntityResolver2; 7 | 8 | import static java.util.Collections.emptyMap; 9 | 10 | // used to replace org.apache.tomcat.util.descriptor.DigesterFactory in some shades - see pom.xml 11 | public final class LightDigester { 12 | private LightDigester() { 13 | // no-op 14 | } 15 | 16 | public static Digester newDigester(boolean xmlValidation, 17 | boolean xmlNamespaceAware, 18 | RuleSet rule, 19 | boolean blockExternal) { 20 | if (xmlValidation) { 21 | throw new IllegalArgumentException("Light distribution does not support xml validation"); 22 | } 23 | final Digester digester = new Digester(); 24 | digester.setNamespaceAware(xmlNamespaceAware); 25 | digester.setValidating(false); 26 | digester.setUseContextClassLoader(true); 27 | final EntityResolver2 resolver = new LocalResolver(emptyMap(), emptyMap(), blockExternal); 28 | digester.setEntityResolver(resolver); 29 | if (rule != null) { 30 | digester.addRuleSet(rule); 31 | } 32 | return digester; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 26 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/resources/META-INF/openwebbeans/openwebbeans.properties: -------------------------------------------------------------------------------- 1 | #Licensed to the Apache Software Foundation (ASF) under one 2 | #or more contributor license agreements. See the NOTICE file 3 | #distributed with this work for additional information 4 | #regarding copyright ownership. The ASF licenses this file 5 | #to you under the Apache License, Version 2.0 (the 6 | #"License"); you may not use this file except in compliance 7 | #with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | #Unless required by applicable law or agreed to in writing, 12 | #software distributed under the License is distributed on an 13 | #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | #KIND, either express or implied. See the License for the 15 | #specific language governing permissions and limitations 16 | #under the License. 17 | configuration.ordinal=1000 18 | org.apache.xbean.finder.filter.Filter=org.apache.meecrowave.openwebbeans.KnownClassesFilter 19 | org.apache.webbeans.spi.ScannerService=org.apache.meecrowave.openwebbeans.OWBTomcatWebScannerService 20 | org.apache.webbeans.spi.SecurityService=org.apache.meecrowave.openwebbeans.MeecrowaveSecurityService 21 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.openwebbeans.MeecrowaveExtension 2 | org.apache.meecrowave.cxf.JAXWSCdiExtension 3 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/resources/META-INF/services/org.apache.juli.logging.Log: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.logging.tomcat.LogFacade 2 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/resources/META-INF/services/org.apache.openwebbeans.se.SeContainerSelector: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.cdi.MeecrowaveSeContainerSelector -------------------------------------------------------------------------------- /meecrowave-core/src/main/resources/log4j2.component.properties: -------------------------------------------------------------------------------- 1 | #Licensed to the Apache Software Foundation (ASF) under one 2 | #or more contributor license agreements. See the NOTICE file 3 | #distributed with this work for additional information 4 | #regarding copyright ownership. The ASF licenses this file 5 | #to you under the Apache License, Version 2.0 (the 6 | #"License"); you may not use this file except in compliance 7 | #with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | #Unless required by applicable law or agreed to in writing, 12 | #software distributed under the License is distributed on an 13 | #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | #KIND, either express or implied. See the License for the 15 | #specific language governing permissions and limitations 16 | #under the License. 17 | Log4jLogEventFactory = org.apache.meecrowave.logging.log4j2.MeecrowaveLogEventFactory 18 | -------------------------------------------------------------------------------- /meecrowave-core/src/main/resources/log4j2.meecrowave-logging: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/apache/meecrowave/ConfigInjection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave; 20 | 21 | import static org.junit.Assert.assertEquals; 22 | import static org.junit.Assert.assertNotNull; 23 | 24 | import jakarta.inject.Inject; 25 | 26 | import org.apache.meecrowave.configuration.Configuration; 27 | import org.apache.webbeans.config.WebBeansContext; 28 | import org.apache.webbeans.inject.OWBInjector; 29 | import org.junit.Test; 30 | 31 | public class ConfigInjection { 32 | @Inject 33 | private Configuration configuration; 34 | 35 | @Test 36 | public void inject() { 37 | try (final Meecrowave meecrowave = new Meecrowave( 38 | new Meecrowave.Builder() 39 | .randomHttpPort() 40 | .skipHttp(true) 41 | .includePackages(ConfigInjection.class.getName())).bake()) { 42 | OWBInjector.inject(WebBeansContext.currentInstance().getBeanManagerImpl(), this, null); 43 | assertNotNull(configuration); 44 | assertEquals(ConfigInjection.class.getName(), configuration.getScanningPackageIncludes()); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/apache/meecrowave/CustomSessionConfigTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave; 20 | 21 | import static org.junit.Assert.assertEquals; 22 | import static org.junit.Assert.assertTrue; 23 | 24 | import org.apache.catalina.Context; 25 | import org.junit.Test; 26 | 27 | public class CustomSessionConfigTest { 28 | @Test 29 | public void test() { 30 | try (final Meecrowave meecrowave = new Meecrowave( 31 | new Meecrowave.Builder() {{ 32 | setSkipHttp(true); 33 | setWebSessionTimeout(20); 34 | setWebSessionCookieConfig("secured=true"); 35 | }}.includePackages(CustomSessionConfigTest.class.getName())).bake()) { 36 | final Context context = Context.class.cast(meecrowave.getTomcat() 37 | .getHost() 38 | .findChildren()[0]); 39 | assertEquals(20, context.getSessionTimeout()); 40 | assertTrue(context.getServletContext().getSessionCookieConfig().isSecure()); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/apache/meecrowave/InterfaceBasedTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave; 20 | 21 | import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN_TYPE; 22 | import static org.junit.Assert.assertEquals; 23 | 24 | import jakarta.ws.rs.client.Client; 25 | import jakarta.ws.rs.client.ClientBuilder; 26 | 27 | import org.junit.Test; 28 | 29 | public class InterfaceBasedTest { 30 | @Test 31 | public void run() { 32 | try (final Meecrowave meecrowave = new Meecrowave(new Meecrowave.Builder() 33 | .randomHttpPort() 34 | .includePackages("org.superbiz.app.Interface")).bake()) { 35 | final Client client = ClientBuilder.newClient(); 36 | try { 37 | assertEquals("api", client 38 | .target("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/interfacebased") 39 | .request(TEXT_PLAIN_TYPE) 40 | .get(String.class)); 41 | } finally { 42 | client.close(); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/apache/meecrowave/SharedLibTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave; 20 | 21 | import org.apache.meecrowave.io.IO; 22 | import org.junit.Test; 23 | 24 | import java.io.IOException; 25 | import java.net.HttpURLConnection; 26 | import java.net.URL; 27 | 28 | import static org.junit.Assert.assertEquals; 29 | 30 | public class SharedLibTest { 31 | @Test 32 | public void run() throws IOException { 33 | try (final Meecrowave container = new Meecrowave(new Meecrowave.Builder() 34 | .randomHttpPort() 35 | .includePackages("org.superbiz.app,org.apache.deltaspike") 36 | .sharedLibraries("target/shared-test")) 37 | .bake()) { 38 | assertEquals( 39 | "org.apache.deltaspike.core.api.config.ConfigProperty", 40 | slurp(new URL("http://localhost:" + container.getConfiguration().getHttpPort() + "/api/test/load/true"))); 41 | } 42 | } 43 | 44 | private String slurp(final URL url) throws IOException { 45 | return IO.toString(HttpURLConnection.class.cast(url.openConnection()).getInputStream()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/apache/meecrowave/Streams.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.meecrowave; 18 | 19 | import java.io.ByteArrayOutputStream; 20 | import java.io.IOException; 21 | import java.io.InputStream; 22 | 23 | import static org.apache.tomcat.util.http.fileupload.util.Streams.copy; 24 | 25 | /** 26 | * helper previously has been in tomcat 27 | */ 28 | public class Streams { 29 | 30 | public static String asString(InputStream inputStream, String encoding) throws IOException { 31 | final ByteArrayOutputStream baos = new ByteArrayOutputStream(); 32 | copy(inputStream, baos, true); 33 | 34 | return baos.toString(encoding); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/apache/meecrowave/TestPrincipal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave; 20 | 21 | public interface TestPrincipal { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/apache/meecrowave/johnzon/DebugJohnzonBufferStrategy.java: -------------------------------------------------------------------------------- 1 | package org.apache.meecrowave.johnzon; 2 | 3 | import java.util.concurrent.atomic.AtomicInteger; 4 | 5 | import org.apache.johnzon.core.BufferStrategy; 6 | import org.apache.johnzon.core.BufferStrategyFactory; 7 | 8 | public class DebugJohnzonBufferStrategy implements BufferStrategy { 9 | 10 | private static AtomicInteger counter = new AtomicInteger(0); 11 | private BufferStrategy delegate; 12 | 13 | public DebugJohnzonBufferStrategy() { 14 | counter.incrementAndGet(); 15 | delegate = BufferStrategyFactory.valueOf("BY_INSTANCE"); 16 | } 17 | 18 | 19 | public static int getCounter() { 20 | return counter.get(); 21 | } 22 | 23 | public static void resetCounter() { 24 | counter.set(0); 25 | } 26 | 27 | @Override 28 | public BufferProvider newCharProvider(int size) { 29 | return delegate.newCharProvider(size); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/apache/meecrowave/lang/SubstitutorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.lang; 20 | 21 | import static java.util.Collections.emptyMap; 22 | import static java.util.Collections.singletonMap; 23 | import static org.junit.Assert.assertEquals; 24 | 25 | import org.junit.Test; 26 | 27 | public class SubstitutorTest { 28 | 29 | @Test 30 | public void noSubstitute() { 31 | assertEquals("${foo}", new Substitutor(emptyMap()).replace("${foo}")); 32 | } 33 | 34 | @Test 35 | public void substitute() { 36 | assertEquals("bar", new Substitutor(singletonMap("foo", "bar")).replace("${foo}")); 37 | } 38 | 39 | @Test 40 | public void defaultValue() { 41 | assertEquals("or", new Substitutor(emptyMap()).replace("${foo:-or}")); 42 | } 43 | 44 | @Test 45 | public void nested() { 46 | assertEquals("bar", new Substitutor(singletonMap("foo", "bar")).replace("${any:-${foo}}")); 47 | } 48 | 49 | @Test 50 | public void twiceNested() { 51 | assertEquals("bar", new Substitutor(singletonMap("other", "bar")).replace("${any:-${foo:-${other}}}")); 52 | } 53 | 54 | @Test 55 | public void composed() { 56 | assertEquals("pref-bar-suff", new Substitutor(singletonMap("foo", "bar")).replace("pref-${foo}-suff")); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/superbiz/app/Bounced.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import jakarta.annotation.PostConstruct; 22 | import jakarta.enterprise.context.ApplicationScoped; 23 | import jakarta.ws.rs.GET; 24 | import jakarta.ws.rs.Path; 25 | import jakarta.ws.rs.Produces; 26 | import jakarta.ws.rs.core.MediaType; 27 | 28 | @Path("bounced") 29 | @ApplicationScoped 30 | public class Bounced { 31 | private String time; 32 | 33 | @PostConstruct 34 | private void init() { 35 | time = Long.toString(System.nanoTime()); 36 | } 37 | 38 | @GET 39 | @Produces(MediaType.TEXT_PLAIN) 40 | public String app() { 41 | return time; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/superbiz/app/Injectable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | 23 | @ApplicationScoped 24 | public class Injectable { 25 | public String injected() { 26 | return "true"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/superbiz/app/InterfaceApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import jakarta.ws.rs.GET; 22 | import jakarta.ws.rs.Path; 23 | import jakarta.ws.rs.Produces; 24 | import jakarta.ws.rs.core.MediaType; 25 | 26 | @Produces(MediaType.TEXT_PLAIN) 27 | @Path("interfacebased") 28 | public interface InterfaceApi { 29 | @GET 30 | String get(); 31 | } 32 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/superbiz/app/InterfaceBased.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | 23 | @ApplicationScoped 24 | public class InterfaceBased implements InterfaceApi { 25 | @Override 26 | public String get() { 27 | return "api"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/superbiz/app/RsApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import jakarta.enterprise.context.Dependent; 22 | import jakarta.ws.rs.ApplicationPath; 23 | import jakarta.ws.rs.core.Application; 24 | 25 | @Dependent 26 | @ApplicationPath("api") 27 | public class RsApp extends Application { 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/superbiz/app/SomeFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import jakarta.inject.Inject; 22 | import jakarta.servlet.Filter; 23 | import jakarta.servlet.FilterChain; 24 | import jakarta.servlet.FilterConfig; 25 | import jakarta.servlet.ServletException; 26 | import jakarta.servlet.ServletRequest; 27 | import jakarta.servlet.ServletResponse; 28 | import jakarta.servlet.annotation.WebFilter; 29 | import java.io.IOException; 30 | 31 | @WebFilter("/filter") 32 | public class SomeFilter implements Filter { 33 | @Inject 34 | private Injectable injectable; 35 | 36 | @Override 37 | public void init(final FilterConfig filterConfig) throws ServletException { 38 | // no-op 39 | } 40 | 41 | @Override 42 | public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { 43 | response.getWriter().write("simplefilter" + injectable.injected()); 44 | } 45 | 46 | @Override 47 | public void destroy() { 48 | // no-op 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/java/org/superbiz/app/TestJsonEndpoint.java: -------------------------------------------------------------------------------- 1 | package org.superbiz.app; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | import jakarta.ws.rs.GET; 5 | import jakarta.ws.rs.Path; 6 | import jakarta.ws.rs.Produces; 7 | import jakarta.ws.rs.core.MediaType; 8 | 9 | @ApplicationScoped 10 | @Path("/testjsonendpoint") 11 | public class TestJsonEndpoint { 12 | 13 | 14 | @GET 15 | @Path("book") 16 | @Produces(MediaType.APPLICATION_JSON) 17 | public Book getBook() { 18 | return new Book("dummyisbn"); 19 | } 20 | 21 | 22 | public static class Book { 23 | private String isbn; 24 | 25 | public Book(String isbn) { 26 | this.isbn = isbn; 27 | } 28 | 29 | public String getIsbn() { 30 | return isbn; 31 | } 32 | 33 | public void setIsbn(String isbn) { 34 | this.isbn = isbn; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/resources/META-INF/openwebbeans/openwebbeans.properties: -------------------------------------------------------------------------------- 1 | org.apache.webbeans.component.PrincipalBean.proxyApis= 2 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer: -------------------------------------------------------------------------------- 1 | org.superbiz.app.Init 2 | org.apache.meecrowave.runner.CliTest$BeanTester 3 | org.apache.meecrowave.ServletContainerInitialierInjectionTest$Init 4 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/resources/META-INF/services/org.apache.meecrowave.runner.Cli$Options: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.runner.CliTest$MyOpts 2 | -------------------------------------------------------------------------------- /meecrowave-core/src/test/resources/sirona.properties: -------------------------------------------------------------------------------- 1 | #Licensed to the Apache Software Foundation (ASF) under one 2 | #or more contributor license agreements. See the NOTICE file 3 | #distributed with this work for additional information 4 | #regarding copyright ownership. The ASF licenses this file 5 | #to you under the Apache License, Version 2.0 (the 6 | #"License"); you may not use this file except in compliance 7 | #with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | #Unless required by applicable law or agreed to in writing, 12 | #software distributed under the License is distributed on an 13 | #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | #KIND, either express or implied. See the License for the 15 | #specific language governing permissions and limitations 16 | #under the License. 17 | 18 | # 19 | # to use add to the launcher 20 | # -javaagent:/.../sirona-javaagent-0.5-incubating-SNAPSHOT-shaded.jar=dumpOnExit=/tmp/sirona.csv 21 | # 22 | 23 | org.apache.sirona.javaagent.listener.CounterListener.excludes = \ 24 | container:jvm,\ 25 | prefix:org.apache.logging.log4j,\ 26 | prefix:org.apache.catalina.core.ContainerBase,\ 27 | prefix:org.apache.tomcat.util.descriptor.web.WebXml,\ 28 | prefix:org.apache.cxf.common.util.Spring,\ 29 | prefix:org.apache.sirona 30 | 31 | org.apache.sirona.javaagent.path.tracking.activate=false 32 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/java/org/apache/meecrowave/doc/generator/BaseGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.doc.generator; 20 | 21 | import java.io.File; 22 | import java.io.FileWriter; 23 | import java.io.IOException; 24 | import java.io.Writer; 25 | 26 | import static org.apache.ziplock.JarLocation.jarLocation; 27 | 28 | public abstract class BaseGenerator implements Runnable { 29 | @Override 30 | public void run() { 31 | final File output = new File(jarLocation(BaseGenerator.class).getParentFile()/*target*/, "generated-doc/" + getClass().getSimpleName() + ".adoc"); 32 | output.getParentFile().mkdirs(); 33 | try (final Writer w = new FileWriter(output)) { 34 | w.write(generate()); 35 | } catch (final IOException e) { 36 | throw new IllegalStateException(e); 37 | } 38 | } 39 | 40 | protected abstract String generate(); 41 | 42 | protected String tableConfig() { 43 | return "[opts=\"header\",role=\"table table-bordered\"]\n"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/java/org/apache/meecrowave/doc/generator/Configuration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.doc.generator; 20 | 21 | import static java.util.stream.Collectors.joining; 22 | 23 | import java.lang.reflect.Field; 24 | import java.util.Comparator; 25 | import java.util.stream.Stream; 26 | 27 | import org.apache.meecrowave.runner.cli.CliOption; 28 | 29 | public class Configuration extends BaseGenerator { 30 | @Override 31 | protected String generate() { 32 | return super.tableConfig() + "|===\n|Name|Description\n" + 33 | Stream.of(org.apache.meecrowave.configuration.Configuration.class.getDeclaredFields()) 34 | .filter(f -> f.isAnnotationPresent(CliOption.class)) 35 | .sorted(Comparator.comparing(Field::getName)) 36 | .map(f -> "|" + f.getName() + "|" + f.getAnnotation(CliOption.class).description()) 37 | .collect(joining("\n")) + "\n|===\n"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/java/org/apache/meecrowave/doc/generator/LetsEncryptConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.doc.generator; 20 | 21 | import static java.util.stream.Collectors.joining; 22 | 23 | import java.lang.reflect.Field; 24 | import java.util.Comparator; 25 | import java.util.stream.Stream; 26 | 27 | import org.apache.meecrowave.letencrypt.LetsEncryptReloadLifecycle; 28 | import org.apache.meecrowave.runner.cli.CliOption; 29 | 30 | public class LetsEncryptConfiguration extends BaseGenerator { 31 | @Override 32 | protected String generate() { 33 | return super.tableConfig() + "|===\n|Name|Description\n" + 34 | Stream.of(LetsEncryptReloadLifecycle.LetsEncryptConfig.class.getDeclaredFields()) 35 | .filter(f -> f.isAnnotationPresent(CliOption.class)) 36 | .sorted(Comparator.comparing(Field::getName)) 37 | .map(f -> f.getAnnotation(CliOption.class)) 38 | .map(opt -> "|--" + opt.name() + "|" + opt.description()) 39 | .collect(joining("\n")) + "\n|===\n"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/java/org/apache/meecrowave/doc/generator/OAuth2Configuration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.doc.generator; 20 | 21 | import org.apache.meecrowave.oauth2.configuration.OAuth2Options; 22 | import org.apache.meecrowave.runner.cli.CliOption; 23 | 24 | import java.util.Comparator; 25 | import java.util.stream.Stream; 26 | 27 | import static java.util.stream.Collectors.joining; 28 | 29 | public class OAuth2Configuration extends BaseGenerator { 30 | @Override 31 | protected String generate() { 32 | return super.tableConfig() + "|===\n|Name|Description\n" + 33 | Stream.of(OAuth2Options.class.getDeclaredFields()) 34 | .filter(f -> f.isAnnotationPresent(CliOption.class)) 35 | .map(f -> f.getAnnotation(CliOption.class)) 36 | .sorted(Comparator.comparing(CliOption::name)) 37 | .map(f -> "|--" + f.name() + "|" + f.description()) 38 | .collect(joining("\n")) + "\n|===\n"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/java/org/apache/meecrowave/doc/generator/ProxyConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.doc.generator; 20 | 21 | import static java.util.stream.Collectors.joining; 22 | 23 | import java.lang.reflect.Field; 24 | import java.util.Comparator; 25 | import java.util.stream.Stream; 26 | 27 | import org.apache.meecrowave.proxy.servlet.meecrowave.ProxyServletSetup; 28 | import org.apache.meecrowave.runner.cli.CliOption; 29 | 30 | public class ProxyConfiguration extends BaseGenerator { 31 | @Override 32 | protected String generate() { 33 | return super.tableConfig() + "|===\n|Name|Description\n" + 34 | Stream.of(ProxyServletSetup.Configuration.class.getDeclaredFields()) 35 | .filter(f -> f.isAnnotationPresent(CliOption.class)) 36 | .sorted(Comparator.comparing(Field::getName)) 37 | .map(f -> f.getAnnotation(CliOption.class)) 38 | .map(opt -> "|--" + opt.name() + "|" + opt.description()) 39 | .collect(joining("\n")) + "\n|===\n"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/images/empty.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/images/empty.gif -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/elegant_font/css/fonts/ElegantIcons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/elegant_font/css/fonts/ElegantIcons.eot -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/elegant_font/css/fonts/ElegantIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/elegant_font/css/fonts/ElegantIcons.ttf -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/elegant_font/css/fonts/ElegantIcons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/elegant_font/css/fonts/ElegantIcons.woff -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/assets/plugins/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/favicon.ico -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-doc/src/main/jbake/assets/favicon.png -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/content/community.adoc: -------------------------------------------------------------------------------- 1 | = Community 2 | :jbake-date: 2016-10-27 3 | :jbake-type: page 4 | :jbake-status: published 5 | :jbake-meecrowavepdf: 6 | :jbake-meecrowavetitleicon: icon icon_puzzle_alt 7 | :jbake-meecrowavecolor: body-green 8 | :icons: font 9 | 10 | For now please use OpenWebBeans mailing-lists, JIRA and IRC channel. 11 | 12 | See https://openwebbeans.apache.org/community.html[OpenWebBeans Community] page for more details. 13 | 14 | == Source code 15 | 16 | Source code can be found at https://gitbox.apache.org/repos/asf/openwebbeans-meecrowave.git 17 | 18 | [source] 19 | ---- 20 | $> git clone https://gitbox.apache.org/repos/asf/openwebbeans-meecrowave.git 21 | ---- 22 | 23 | A mirror is available on github at https://github.com/apache/openwebbeans-meecrowave. 24 | 25 | 26 | The github mirror is linked in both directions. 27 | That means it doesn't matter whether you push to GitHub or Apache GitBox. 28 | 29 | 30 | === Build it 31 | 32 | To build the project just run maven: 33 | 34 | [source] 35 | ---- 36 | mvn clean install 37 | ---- 38 | 39 | 40 | == Example Source Code 41 | 42 | The Apache Meecrowave community also hosts some examples which show how Meecrowave is to be used. 43 | Those examples are hosted in a separate repository and can be found at https://github.com/apache/openwebbeans-meecrowave-examples 44 | 45 | The github repo works fine for pull requests. 46 | Please use our official https://issues.apache.org/jira/projects/MEECROWAVE[Meecrowave Bug Tracker] for reporting bugs or enhancement requests. 47 | 48 | The canonical repository hosted directly at the Apache Software Foundation intended to be used by committers is 49 | 50 | [source] 51 | ---- 52 | git clone https://gitbox.apache.org/repos/asf/openwebbeans-meecrowave-examples.git 53 | ---- 54 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/content/companion-projects.adoc: -------------------------------------------------------------------------------- 1 | = Companion projects 2 | :jbake-date: 2016-11-05 3 | :jbake-type: page 4 | :jbake-status: published 5 | :jbake-meecrowavepdf: 6 | :jbake-meecrowavetitleicon: icon icon_puzzle_alt 7 | :jbake-meecrowavecolor: body-pink 8 | :icons: font 9 | 10 | == Apache DeltaSpike 11 | 12 | Apache DeltaSpike will cover several useful areas: 13 | 14 | - Configuration 15 | - Exception handling 16 | - Advanced CDI utilities like partial bean binding (you define a bean behavior from a CDI handler implementation) 17 | - Quartz integration 18 | - Data/JPA integration (it is different than the Meecrowave one but depending your need can be useful) 19 | - And much more 20 | 21 | See http://deltaspike.apache.org/ for more information. 22 | 23 | == Apache Sirona 24 | 25 | Sirona aims to provide some monitoring capabilities (metrics on the runtime). 26 | By default its servlet integration makes it smooth to integrate with Meecrowave. 27 | 28 | See http://sirona.apache.org/ for more information. 29 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/content/meecrowave-core/cli.adoc: -------------------------------------------------------------------------------- 1 | = Meecrowave Command Line Interface 2 | :jbake-date: 2016-10-24 3 | :jbake-type: page 4 | :jbake-status: published 5 | :jbake-meecrowavepdf: 6 | :jbake-meecrowavetitleicon: icon icon_puzzle_alt 7 | :jbake-meecrowavecolor: body-blue 8 | :icons: font 9 | 10 | 11 | Meecrowave provides a CLI (Command Line Interface) called `org.apache.meecrowave.runner.Cli`. 12 | 13 | It can be used to deploy the java classpath or a war. Here are the main options: 14 | 15 | include::../../../../../target/generated-doc/CliConfiguration.adoc[] 16 | 17 | Note that `help` command is supported as well. 18 | 19 | == Extending the CLI 20 | 21 | You can add your own CLI options implementing `org.apache.meecrowave.runner.Cli$Options` 22 | (just a marker interface, no logic to code) and use `@CliOption` to define fields 23 | as coming from the CLI arguments. To register your option bean just add it in `META-INF/services/org.apache.meecrowave.runner.Cli$Options`. 24 | 25 | TIP: `Meecrowave.Builder` provides a `getExtension(type)` which can be used to get this 26 | kind of extension. This is common and works in all modes (arquillian, JUnit, embedded etc...) 27 | replacing the arguments by properties on `Meecrowave.Builder` instance. 28 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/content/meecrowave-core/deploy-webapp.adoc: -------------------------------------------------------------------------------- 1 | = Meecrowave and webapps 2 | :jbake-date: 2019-01-23 3 | :jbake-type: page 4 | :jbake-status: published 5 | :jbake-meecrowavepdf: 6 | :jbake-meecrowavetitleicon: icon icon_puzzle_alt 7 | :jbake-meecrowavecolor: body-blue 8 | :icons: font 9 | 10 | Meecrowave is a development enabler and simplifier thanks to its classpath deployment. However it is 11 | still a plain Apache Tomcat and you can deploy existing webapp you developed with no particular constraint. 12 | 13 | From now on, we will assume you have a Servlet or Spring webapp `myapp.war`. 14 | 15 | == Deployment with a Meecrowave bundle 16 | 17 | This part assumed you built a bundle with link:../meecrowave-maven/index.html[Meecrowave Maven Plugin]. It gives 18 | you a zip which has a tomcat layout once exploded: 19 | 20 | [source] 21 | ---- 22 | . 23 | |- bin 24 | |- conf 25 | |- logs 26 | `- lib 27 | ---- 28 | 29 | If you didn't package a webapp at bundle time you can create a `webapps` folder in this layout and add your war inside. 30 | Then to launch this war you can either use a `server.xml` in `conf` and add as in any Tomcat your `` in it 31 | or you can launch it directly using: 32 | 33 | [source,sh] 34 | ---- 35 | ./bin/meecrowave.sh run --webapp=webapps/myapp.war 36 | ---- 37 | 38 | == Deployment with the runner 39 | 40 | If you prefer to use the runner you can deploy a war with the following command: 41 | 42 | [source,sh] 43 | ---- 44 | java -jar meecrowave-core-runner.jar --webapp=webapps/myapp.war 45 | ---- 46 | 47 | == Going further 48 | 49 | You can find more information about deployment checking out the link:cli.html[CLI] documentation 50 | which presents all options of the several ways to launch Meecrowave. 51 | 52 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/content/meecrowave-gradle/index.adoc: -------------------------------------------------------------------------------- 1 | = Meecrowave Gradle 2 | :jbake-date: 2016-10-24 3 | :jbake-type: page 4 | :jbake-status: published 5 | :jbake-meecrowavepdf: 6 | :jbake-meecrowavetitleicon: icon icon_puzzle_alt 7 | :jbake-meecrowavecolor: body-purple 8 | :icons: font 9 | 10 | [source,groovy] 11 | ---- 12 | buildscript { 13 | repositories { 14 | mavenCentral() 15 | } 16 | dependencies { 17 | classpath "org.apache.meecrowave:meecrowave-gradle-plugin:${meecrowave.version}" 18 | } 19 | } 20 | 21 | group 'com.app' 22 | version '1.0-SNAPSHOT' 23 | 24 | apply plugin: 'java' 25 | apply plugin: 'org.apache.meecrowave' 26 | 27 | meecrowave { 28 | httpPort = 9090 29 | // most of the meecrowave core configuration 30 | } 31 | 32 | ---- 33 | 34 | IMPORTANT: until version `1.2.7` the plugin id was `org.apache.microwave.microwave` so you had to use `apply plugin: 'org.apache.microwave.microwave'`. 35 | Alternatively you can use plugin class: `apply plugin: org.apache.meecrowave.gradle.MeecrowavePlugin`. 36 | 37 | == Configuration 38 | 39 | include::../../../../../target/generated-doc/GradleConfiguration.adoc[] 40 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/content/meecrowave-jta/index.adoc: -------------------------------------------------------------------------------- 1 | = Meecrowave JTA 2 | :jbake-date: 2016-12-22 3 | :jbake-type: page 4 | :jbake-status: published 5 | :jbake-meecrowavepdf: 6 | :jbake-meecrowavetitleicon: icon icon_puzzle_alt 7 | :jbake-meecrowavecolor: body-green 8 | :icons: font 9 | 10 | Coordinates: 11 | 12 | [source,xml] 13 | ---- 14 | 15 | org.apache.meecrowave 16 | meecrowave-jta 17 | ${meecrowave.version} 18 | 19 | ---- 20 | 21 | This allows to use `@Transactional` and `@TransactionScoped` features of JTA 1.2. 22 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/content/meecrowave-letsencrypt/index.adoc: -------------------------------------------------------------------------------- 1 | = Meecrowave Let's Encrypt Extension 2 | :jbake-date: 2018-07-05 3 | :jbake-type: page 4 | :jbake-status: published 5 | :jbake-meecrowavepdf: 6 | :jbake-meecrowavetitleicon: icon icon_shield 7 | :jbake-meecrowavecolor: body-blue 8 | :icons: font 9 | 10 | 11 | Meecrowave provides a Let's Encrypt integration which will grab the default tomcat connector 12 | and reload regularly its certificate based on Let's Encrypt protocol. 13 | 14 | You must configure the domain(s) to include during Let's Encrypt discussion to activate that feature. 15 | 16 | include::../../../../../target/generated-doc/LetsEncryptConfiguration.adoc[] 17 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/content/meecrowave-websocket/index.adoc: -------------------------------------------------------------------------------- 1 | = Meecrowave WebSocket 2 | :jbake-date: 2021-04-22 3 | :jbake-type: page 4 | :jbake-status: published 5 | :jbake-meecrowavepdf: 6 | :jbake-meecrowavetitleicon: icon icon_chat 7 | :jbake-meecrowavecolor: body-red 8 | :icons: font 9 | 10 | WARNING: this module is available with Apache Meecrowave >= 1.2.11. 11 | 12 | Coordinates: 13 | 14 | [source,xml] 15 | ---- 16 | 17 | org.apache.meecrowave 18 | meecrowave-websocket 19 | ${meecrowave.version} 20 | 21 | ---- 22 | 23 | IMPORTANT: this module requires `org.apache.tomcat:tomcat-websocket-api` but replaces `org.apache.tomcat:tomcat-websocket` until Tomcat enables a better way to extend its default. 24 | 25 | Once this module added, you can implement a server websocket endpoint as a CDI bean, it will use `CDI.current().select(endpointType).get()` to resolve it. 26 | 27 | NOTE: you can still pass a custom `Configurator` to your endpoint to customize the lookup or runtime of the endpoint. 28 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/jbake.properties: -------------------------------------------------------------------------------- 1 | #Licensed to the Apache Software Foundation (ASF) under one 2 | #or more contributor license agreements. See the NOTICE file 3 | #distributed with this work for additional information 4 | #regarding copyright ownership. The ASF licenses this file 5 | #to you under the Apache License, Version 2.0 (the 6 | #"License"); you may not use this file except in compliance 7 | #with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | #Unless required by applicable law or agreed to in writing, 12 | #software distributed under the License is distributed on an 13 | #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | #KIND, either express or implied. See the License for the 15 | #specific language governing permissions and limitations 16 | #under the License. 17 | content.rootpath = /meecrowave 18 | content_rootpath = /meecrowave 19 | 20 | default.status=published 21 | 22 | render.encoding=UTF-8 23 | render.tags = true 24 | render.archive = false 25 | render.feed = false 26 | render.sitemap = false 27 | 28 | template.folder = templates 29 | template.index.file = index.gsp 30 | template.page.file = page.gsp 31 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/jbake/templates/header.gsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Meecrowave :: the customizable server 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 |
34 | -------------------------------------------------------------------------------- /meecrowave-doc/src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | ---- 8 | 9 | This product bundles Pretty Doc theme: 10 | 11 | Template Name: PrettyDocs - Responsive Website Template for documentations 12 | Version: 1.0 13 | Author: Xiaoying Riley 14 | License: Creative Commons Attribution 3.0 License - https://creativecommons.org/licenses/by/3.0/ 15 | Twitter: @3rdwave_themes 16 | Website: http://themes.3rdwavemedia.com/ 17 | 18 | ---- 19 | 20 | This product bundles Twitter Bootstrap: 21 | 22 | Bootstrap v3.3.6 (http://getbootstrap.com) 23 | Copyright 2011-2015 Twitter, Inc. 24 | Licensed under the MIT license 25 | 26 | ---- 27 | 28 | This product bundles Elegant font: 29 | 30 | https://www.elegantthemes.com/blog/resources/elegant-icon-font 31 | Licensed under the MIT license 32 | 33 | ---- 34 | 35 | This product bundles font awesome: 36 | 37 | Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome 38 | License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 39 | 40 | ---- 41 | 42 | This product bundles jQuery match height: 43 | 44 | jquery.matchHeight-min.js v0.5.2 45 | http://brm.io/jquery-match-height/ 46 | License: MIT 47 | 48 | ---- 49 | 50 | This product bundles jQuery: 51 | 52 | jQuery v1.12.3 | (c) jQuery Foundation | jquery.org/license 53 | 54 | -------------------------------------------------------------------------------- /meecrowave-gradle-plugin/src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /meecrowave-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.apache.meecrowave.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | implementation-class=org.apache.meecrowave.gradle.MeecrowavePlugin 18 | -------------------------------------------------------------------------------- /meecrowave-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.apache.microwave.microwave.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | implementation-class=org.apache.meecrowave.gradle.MeecrowavePlugin 18 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/api/EntityManagerScoped.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jpa.api; 20 | 21 | import jakarta.enterprise.context.NormalScope; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.Target; 24 | 25 | import static java.lang.annotation.ElementType.METHOD; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | @NormalScope 30 | @Target({METHOD, TYPE}) 31 | @Retention(RUNTIME) 32 | public @interface EntityManagerScoped { 33 | } 34 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/api/Jpa.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jpa.api; 20 | 21 | import jakarta.interceptor.InterceptorBinding; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.Target; 24 | 25 | import static java.lang.annotation.ElementType.METHOD; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | @InterceptorBinding 30 | @Target({METHOD, TYPE}) 31 | @Retention(RUNTIME) 32 | public @interface Jpa { 33 | boolean transactional() default true; 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/api/Unit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jpa.api; 20 | 21 | import jakarta.inject.Qualifier; 22 | import jakarta.persistence.SynchronizationType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.Target; 25 | 26 | import static java.lang.annotation.ElementType.FIELD; 27 | import static java.lang.annotation.ElementType.METHOD; 28 | import static java.lang.annotation.ElementType.PARAMETER; 29 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 30 | 31 | @Qualifier 32 | @Target({FIELD, METHOD, PARAMETER}) 33 | @Retention(RUNTIME) 34 | public @interface Unit { 35 | String name(); 36 | SynchronizationType synchronization() default SynchronizationType.SYNCHRONIZED; 37 | } 38 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/AnyLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jpa.internal; 20 | 21 | import jakarta.enterprise.inject.Any; 22 | import jakarta.enterprise.util.AnnotationLiteral; 23 | import java.lang.annotation.Annotation; 24 | 25 | public class AnyLiteral extends AnnotationLiteral implements Any { 26 | public static final AnyLiteral INSTANCE = new AnyLiteral(); 27 | 28 | private static final String TOSTRING = "@javax.enterprise.inject.Any()"; 29 | private static final long serialVersionUID = -8922048102786275371L; 30 | 31 | @Override 32 | public Class annotationType() { 33 | return Any.class; 34 | } 35 | 36 | @Override 37 | public boolean equals(final Object other) { 38 | return Any.class.isInstance(other) 39 | || (AnnotationLiteral.class.isInstance(other) && AnnotationLiteral.class.cast(other).annotationType() == annotationType()); 40 | } 41 | 42 | @Override 43 | public int hashCode() { 44 | return 0; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return TOSTRING; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/JpaInterceptorBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jpa.internal; 20 | 21 | import jakarta.inject.Inject; 22 | import jakarta.interceptor.AroundInvoke; 23 | import jakarta.interceptor.InvocationContext; 24 | import java.io.Serializable; 25 | 26 | public abstract class JpaInterceptorBase implements Serializable { 27 | @Inject 28 | private JpaExtension extension; 29 | 30 | @AroundInvoke 31 | public Object inTransaction(final InvocationContext context) throws Exception { 32 | final EntityManagerContext entityManagerContext = extension.getEntityManagerContext(); 33 | final boolean owner = entityManagerContext.enter(isTransactional()); 34 | try { 35 | return context.proceed(); 36 | } catch (final Exception e) { 37 | entityManagerContext.failed(); 38 | throw e; 39 | } finally { 40 | entityManagerContext.exit(owner); 41 | } 42 | } 43 | 44 | protected abstract boolean isTransactional(); 45 | } 46 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/JpaLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jpa.internal; 20 | 21 | import org.apache.meecrowave.jpa.api.Jpa; 22 | 23 | import jakarta.enterprise.util.AnnotationLiteral; 24 | import java.lang.annotation.Annotation; 25 | 26 | class JpaLiteral extends AnnotationLiteral implements Jpa { 27 | public static final Annotation DEFAULT = new JpaLiteral(true); 28 | 29 | private final boolean transactional; 30 | private final int hash; 31 | 32 | JpaLiteral(final boolean transactional) { 33 | this.transactional = transactional; 34 | this.hash = hashCode(); 35 | } 36 | 37 | @Override 38 | public Class annotationType() { 39 | return Jpa.class; 40 | } 41 | 42 | @Override 43 | public boolean transactional() { 44 | return transactional; 45 | } 46 | 47 | @Override 48 | public boolean equals(final Object other) { 49 | return Jpa.class.isInstance(other) && Jpa.class.cast(other).transactional() == transactional; 50 | } 51 | 52 | @Override 53 | public int hashCode() { 54 | return hash; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | return "@Jpa(transactional)" + transactional + ")"; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/JpaNoTransactionInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jpa.internal; 20 | 21 | import org.apache.meecrowave.jpa.api.Jpa; 22 | 23 | import jakarta.annotation.Priority; 24 | import jakarta.interceptor.Interceptor; 25 | 26 | @Jpa(transactional = false) 27 | @Interceptor 28 | @Priority(Interceptor.Priority.LIBRARY_BEFORE) 29 | public class JpaNoTransactionInterceptor extends JpaInterceptorBase { 30 | @Override 31 | protected boolean isTransactional() { 32 | return false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/JpaTransactionInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jpa.internal; 20 | 21 | import org.apache.meecrowave.jpa.api.Jpa; 22 | 23 | import jakarta.annotation.Priority; 24 | import jakarta.interceptor.Interceptor; 25 | 26 | @Jpa 27 | @Interceptor 28 | @Priority(Interceptor.Priority.LIBRARY_BEFORE) 29 | public class JpaTransactionInterceptor extends JpaInterceptorBase { 30 | @Override 31 | protected boolean isTransactional() { 32 | return true; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/java/org/apache/meecrowave/jpa/internal/UnitLiteral.java: -------------------------------------------------------------------------------- 1 | package org.apache.meecrowave.jpa.internal; 2 | 3 | import org.apache.meecrowave.jpa.api.Unit; 4 | 5 | import jakarta.enterprise.util.AnnotationLiteral; 6 | import jakarta.persistence.SynchronizationType; 7 | 8 | class UnitLiteral extends AnnotationLiteral implements Unit { 9 | private final String name; 10 | private final SynchronizationType synchronization; 11 | 12 | UnitLiteral(final String name, final SynchronizationType synchronization) { 13 | this.name = name; 14 | this.synchronization = synchronization; 15 | } 16 | 17 | @Override 18 | public String name() { 19 | return name; 20 | } 21 | 22 | @Override 23 | public SynchronizationType synchronization() { 24 | return synchronization; 25 | } 26 | 27 | @Override 28 | public boolean equals(final Object o) { 29 | if (this == o) { 30 | return true; 31 | } 32 | if (o == null || getClass() != o.getClass()) { 33 | return false; 34 | } 35 | final UnitLiteral that = UnitLiteral.class.cast(o); 36 | return name.equals(that.name) && synchronization.equals(that.synchronization); 37 | 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return name.hashCode() + 31 * synchronization.hashCode(); 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return "@Unit(name=" + name + ",synchronization=" + synchronization.name() + ")"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.jpa.internal.JpaExtension 2 | -------------------------------------------------------------------------------- /meecrowave-jpa/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /meecrowave-jta/src/main/java/org/apache/meecrowave/jta/AnyLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jta; 20 | 21 | import jakarta.enterprise.inject.Any; 22 | import jakarta.enterprise.util.AnnotationLiteral; 23 | import java.lang.annotation.Annotation; 24 | 25 | public class AnyLiteral extends AnnotationLiteral implements Any { 26 | public static final AnyLiteral INSTANCE = new AnyLiteral(); 27 | 28 | private static final String TOSTRING = "@javax.enterprise.inject.Any()"; 29 | private static final long serialVersionUID = -8922048102786275371L; 30 | 31 | @Override 32 | public Class annotationType() { 33 | return Any.class; 34 | } 35 | 36 | @Override 37 | public boolean equals(final Object other) { 38 | return Any.class.isInstance(other) 39 | || (AnnotationLiteral.class.isInstance(other) && AnnotationLiteral.class.cast(other).annotationType() == annotationType()); 40 | } 41 | 42 | @Override 43 | public int hashCode() { 44 | return 0; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return TOSTRING; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /meecrowave-jta/src/main/java/org/apache/meecrowave/jta/DefaultLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF Default 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.jta; 20 | 21 | import jakarta.enterprise.inject.Default; 22 | import jakarta.enterprise.util.AnnotationLiteral; 23 | import java.lang.annotation.Annotation; 24 | 25 | public class DefaultLiteral extends AnnotationLiteral implements Default { 26 | public static final DefaultLiteral INSTANCE = new DefaultLiteral(); 27 | 28 | private static final String TOSTRING = "@javax.enterprise.inject.Default()"; 29 | private static final long serialVersionUID = -8922048102786275371L; 30 | 31 | @Override 32 | public Class annotationType() { 33 | return Default.class; 34 | } 35 | 36 | @Override 37 | public boolean equals(final Object other) { 38 | return Default.class.isInstance(other) 39 | || (AnnotationLiteral.class.isInstance(other) && AnnotationLiteral.class.cast(other).annotationType() == annotationType()); 40 | } 41 | 42 | @Override 43 | public int hashCode() { 44 | return 0; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return TOSTRING; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /meecrowave-jta/src/main/java/org/apache/meecrowave/jta/JtaConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.meecrowave.jta; 18 | 19 | import org.apache.meecrowave.runner.cli.CliOption; 20 | 21 | public class JtaConfig { 22 | @CliOption(name = "jta-handle-exception-only-for-client", description = "should JTA exception only be managed by client") 23 | boolean handleExceptionOnlyForClient; 24 | 25 | public boolean isHandleExceptionOnlyForClient() { 26 | return handleExceptionOnlyForClient; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-jta/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.jta.JtaExtension 2 | -------------------------------------------------------------------------------- /meecrowave-jta/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /meecrowave-junit/src/main/java/org/apache/meecrowave/junit5/AfterFirstInjection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5; 20 | 21 | import static java.lang.annotation.ElementType.METHOD; 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.Target; 26 | 27 | /** 28 | * Called after the first injection. 29 | * This is a kind of @BeforeAll but after injections with test instance (method is not static). 30 | */ 31 | @Target(METHOD) 32 | @Retention(RUNTIME) 33 | public @interface AfterFirstInjection { 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-junit/src/main/java/org/apache/meecrowave/junit5/AfterLastTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5; 20 | 21 | import static java.lang.annotation.ElementType.METHOD; 22 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 23 | 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.Target; 26 | 27 | /** 28 | * Called after the last test. 29 | * This is a kind of @AfterAll but with test instance (method is not static). 30 | */ 31 | @Target(METHOD) 32 | @Retention(RUNTIME) 33 | public @interface AfterLastTest { 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-junit/src/main/java/org/apache/meecrowave/junit5/MonoMeecrowaveConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5; 20 | 21 | import org.junit.jupiter.api.extension.ExtendWith; 22 | 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.Target; 25 | 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | @Target(TYPE) 30 | @Retention(RUNTIME) 31 | @ExtendWith(MonoMeecrowaveExtension.class) 32 | public @interface MonoMeecrowaveConfig { 33 | // no config since it is shared 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-junit/src/main/java/org/apache/meecrowave/junit5/Scopes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5; 20 | 21 | import static java.lang.annotation.ElementType.METHOD; 22 | import static java.lang.annotation.ElementType.TYPE; 23 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 24 | 25 | import java.lang.annotation.Annotation; 26 | import java.lang.annotation.Retention; 27 | import java.lang.annotation.Target; 28 | 29 | import org.junit.jupiter.api.extension.ExtendWith; 30 | 31 | @Target({TYPE, METHOD}) 32 | @Retention(RUNTIME) 33 | @ExtendWith(ScopesExtension.class) 34 | public @interface Scopes { 35 | Class[] scopes() default {}; 36 | } 37 | -------------------------------------------------------------------------------- /meecrowave-junit/src/main/java/org/apache/meecrowave/testing/ConfigurationInject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.testing; 20 | 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.Target; 23 | 24 | import static java.lang.annotation.ElementType.FIELD; 25 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 26 | 27 | @Target(FIELD) 28 | @Retention(RUNTIME) 29 | public @interface ConfigurationInject { 30 | } 31 | -------------------------------------------------------------------------------- /meecrowave-junit/src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/MeecrowaveConfigMetaAnnotationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5; 20 | 21 | import static org.junit.Assert.assertTrue; 22 | 23 | import jakarta.enterprise.context.RequestScoped; 24 | 25 | import org.apache.webbeans.config.WebBeansContext; 26 | import org.junit.jupiter.api.Test; 27 | 28 | @MeecrowaveRequestScopedConfig 29 | class MeecrowaveConfigMetaAnnotationTest { 30 | @Test 31 | void run() { 32 | assertTrue(WebBeansContext.currentInstance().getContextsService().getCurrentContext(RequestScoped.class, false).isActive()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/MeecrowaveConfigScopesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5; 20 | 21 | import static org.junit.Assert.assertTrue; 22 | 23 | import jakarta.enterprise.context.RequestScoped; 24 | 25 | import org.apache.webbeans.config.WebBeansContext; 26 | import org.junit.jupiter.api.Test; 27 | 28 | @MeecrowaveConfig(scopes = RequestScoped.class) 29 | class MeecrowaveConfigScopesTest { 30 | @Test 31 | void run() { 32 | assertTrue(WebBeansContext.currentInstance().getContextsService().getCurrentContext(RequestScoped.class, false).isActive()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/MeecrowaveConfigTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5; 20 | 21 | import org.apache.meecrowave.Meecrowave; 22 | import org.apache.meecrowave.io.IO; 23 | import org.apache.meecrowave.testing.ConfigurationInject; 24 | import org.junit.jupiter.api.Test; 25 | 26 | import java.io.IOException; 27 | import java.io.InputStream; 28 | import java.net.MalformedURLException; 29 | import java.net.URL; 30 | 31 | import static org.junit.Assert.assertEquals; 32 | import static org.junit.Assert.fail; 33 | 34 | @MeecrowaveConfig 35 | class MeecrowaveConfigTest { 36 | @ConfigurationInject 37 | private Meecrowave.Builder config; 38 | 39 | @Test 40 | void run() throws MalformedURLException { 41 | assertEquals("simple", slurp(new URL("http://localhost:" + config.getHttpPort() + "/api/test"))); 42 | } 43 | 44 | private String slurp(final URL url) { 45 | try (final InputStream is = url.openStream()) { 46 | return IO.toString(is); 47 | } catch (final IOException e) { 48 | fail(e.getMessage()); 49 | } 50 | return null; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/MeecrowaveRequestScopedConfig.java: -------------------------------------------------------------------------------- 1 | package org.apache.meecrowave.junit5; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import jakarta.enterprise.context.RequestScoped; 7 | 8 | import org.junit.platform.commons.annotation.Testable; 9 | 10 | @Testable 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @MeecrowaveConfig(scopes = RequestScoped.class) 13 | public @interface MeecrowaveRequestScopedConfig { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/ScopesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5; 20 | 21 | import static org.junit.Assert.assertNull; 22 | import static org.junit.Assert.assertTrue; 23 | 24 | import jakarta.enterprise.context.RequestScoped; 25 | import jakarta.enterprise.context.spi.Context; 26 | 27 | import org.apache.webbeans.config.WebBeansContext; 28 | import org.junit.jupiter.api.Test; 29 | 30 | @MonoMeecrowaveConfig 31 | @Scopes(scopes = RequestScoped.class) 32 | class ScopesTest { 33 | @Test 34 | @Scopes 35 | void overrided() { 36 | assertNull(getContext()); 37 | } 38 | 39 | @Test 40 | void clazz() { 41 | assertTrue(getContext().isActive()); 42 | } 43 | 44 | private Context getContext() { 45 | return WebBeansContext.currentInstance() 46 | .getContextsService() 47 | .getCurrentContext(RequestScoped.class, false); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/bean/Appender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.junit5.bean; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | 23 | @ApplicationScoped 24 | public class Appender { 25 | private String value; 26 | 27 | public void append(final String value) { 28 | this.value = (this.value != null ? this.value + '/' : "") + value; 29 | } 30 | 31 | public String get() { 32 | return value; 33 | } 34 | 35 | public void reset() { 36 | value = null; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/apache/meecrowave/junit5/bean/SomeCommonInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.meecrowave.junit5.bean; 18 | 19 | /** 20 | * Common interface to check whether Beans are really only picked up per class 21 | */ 22 | public interface SomeCommonInterface { 23 | int meaningOfLife(); 24 | } 25 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/app/Endpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import jakarta.inject.Inject; 23 | import jakarta.ws.rs.GET; 24 | import jakarta.ws.rs.Path; 25 | import jakarta.ws.rs.Produces; 26 | import jakarta.ws.rs.core.MediaType; 27 | 28 | @Path("test") 29 | @ApplicationScoped 30 | public class Endpoint { 31 | @Inject 32 | private Injectable injectable; 33 | 34 | @GET 35 | @Produces(MediaType.TEXT_PLAIN) 36 | public String simple() { 37 | return Boolean.parseBoolean(injectable.injected()) ? "simple" : "fail"; 38 | } 39 | 40 | @GET 41 | @Path("json") 42 | @Produces(MediaType.APPLICATION_JSON) 43 | public Simple json() { 44 | return new Simple("test"); 45 | } 46 | 47 | public static class Simple { 48 | private String name; 49 | 50 | public Simple() { 51 | // no-op 52 | } 53 | 54 | public Simple(final String name) { 55 | this.name = name; 56 | } 57 | 58 | public String getName() { 59 | return name; 60 | } 61 | 62 | public void setName(final String name) { 63 | this.name = name; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/app/Injectable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | 23 | @ApplicationScoped 24 | public class Injectable { 25 | public String injected() { 26 | return "true"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/app/MyAppClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.app; 18 | 19 | import jakarta.enterprise.context.ApplicationScoped; 20 | 21 | /** 22 | * @author Mark Struberg 23 | */ 24 | @ApplicationScoped 25 | public class MyAppClass { 26 | private String x = "init"; 27 | 28 | public String getX() { 29 | return x; 30 | } 31 | 32 | public void setX(String x) { 33 | this.x = x; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/app/MyReqClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.app; 18 | 19 | import jakarta.enterprise.context.RequestScoped; 20 | 21 | /** 22 | * @author Mark Struberg 23 | */ 24 | @RequestScoped 25 | public class MyReqClass { 26 | private String x = "init"; 27 | 28 | public String getX() { 29 | return x; 30 | } 31 | 32 | public void setX(String x) { 33 | this.x = x; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/java/org/app/RsApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.Dependent; 22 | import jakarta.ws.rs.ApplicationPath; 23 | import jakarta.ws.rs.core.Application; 24 | 25 | @Dependent 26 | @ApplicationPath("api") 27 | public class RsApp extends Application { 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-junit/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/openwebbeans-meecrowave/c85a30f0b872c30e01ac47c93fdf551e8964042c/meecrowave-junit/src/test/resources/META-INF/beans.xml -------------------------------------------------------------------------------- /meecrowave-letsencrypt/src/main/resources/META-INF/services/org.apache.meecrowave.runner.Cli$Options: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.letencrypt.LetsEncryptReloadLifecycle$LetsEncryptConfig 2 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveBakeMojo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.maven; 20 | 21 | import org.apache.maven.plugins.annotations.Mojo; 22 | 23 | import static org.apache.maven.plugins.annotations.ResolutionScope.RUNTIME_PLUS_SYSTEM; 24 | 25 | /** 26 | * Just an alias for run Mojo. 27 | */ 28 | @Mojo(name = "bake", requiresDependencyResolution = RUNTIME_PLUS_SYSTEM) 29 | public class MeecrowaveBakeMojo extends MeecrowaveRunMojo { 30 | } 31 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/main/resources/bin/catalina.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. 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 | # Plain copy of Tomcat with the script (EXECUTABLE) replacement 20 | # ----------------------------------------------------------------------------- 21 | 22 | # Better OS/400 detection: see Bugzilla 31132 23 | os400=false 24 | case "`uname`" in 25 | OS400*) os400=true;; 26 | esac 27 | 28 | # resolve links - $0 may be a softlink 29 | PRG="$0" 30 | 31 | while [ -h "$PRG" ] ; do 32 | ls=`ls -ld "$PRG"` 33 | link=`expr "$ls" : '.*-> \(.*\)$'` 34 | if expr "$link" : '/.*' > /dev/null; then 35 | PRG="$link" 36 | else 37 | PRG=`dirname "$PRG"`/"$link" 38 | fi 39 | done 40 | 41 | PRGDIR=`dirname "$PRG"` 42 | EXECUTABLE=meecrowave.sh 43 | 44 | if $os400; then 45 | eval 46 | else 47 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 48 | echo "Cannot find $PRGDIR/$EXECUTABLE" 49 | echo "The file is absent or does not have execute permission" 50 | echo "This file is needed to run this program" 51 | exit 1 52 | fi 53 | fi 54 | 55 | exec "$PRGDIR"/"$EXECUTABLE" "$@" 56 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/main/resources/bin/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. 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 | # Plain copy of Tomcat with the script (EXECUTABLE) replacement 20 | # ----------------------------------------------------------------------------- 21 | 22 | # Better OS/400 detection: see Bugzilla 31132 23 | os400=false 24 | case "`uname`" in 25 | OS400*) os400=true;; 26 | esac 27 | 28 | # resolve links - $0 may be a softlink 29 | PRG="$0" 30 | 31 | while [ -h "$PRG" ] ; do 32 | ls=`ls -ld "$PRG"` 33 | link=`expr "$ls" : '.*-> \(.*\)$'` 34 | if expr "$link" : '/.*' > /dev/null; then 35 | PRG="$link" 36 | else 37 | PRG=`dirname "$PRG"`/"$link" 38 | fi 39 | done 40 | 41 | PRGDIR=`dirname "$PRG"` 42 | EXECUTABLE=meecrowave.sh 43 | 44 | if $os400; then 45 | eval 46 | else 47 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 48 | echo "Cannot find $PRGDIR/$EXECUTABLE" 49 | echo "The file is absent or does not have execute permission" 50 | echo "This file is needed to run this program" 51 | exit 1 52 | fi 53 | fi 54 | 55 | exec "$PRGDIR"/"$EXECUTABLE" stop "$@" 56 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/main/resources/bin/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. 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 | # Plain copy of Tomcat, you can just replace it and customize EXECUTABLE value 20 | # ----------------------------------------------------------------------------- 21 | 22 | os400=false 23 | case "`uname`" in 24 | OS400*) os400=true;; 25 | esac 26 | 27 | PRG="$0" 28 | 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`/"$link" 36 | fi 37 | done 38 | 39 | PRGDIR=`dirname "$PRG"` 40 | EXECUTABLE=meecrowave.sh 41 | 42 | # Check that target executable exists 43 | if $os400; then 44 | eval 45 | else 46 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 47 | echo "Cannot find $PRGDIR/$EXECUTABLE" 48 | echo "The file is absent or does not have execute permission" 49 | echo "This file is needed to run this program" 50 | exit 1 51 | fi 52 | fi 53 | 54 | exec "$PRGDIR"/"$EXECUTABLE" start "$@" 55 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/java/org/app/AdditionalEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import jakarta.ws.rs.GET; 23 | import jakarta.ws.rs.Path; 24 | import jakarta.ws.rs.Produces; 25 | import jakarta.ws.rs.core.MediaType; 26 | 27 | @Path("additional") 28 | @ApplicationScoped 29 | public class AdditionalEndpoint { 30 | 31 | @GET 32 | @Produces(MediaType.TEXT_PLAIN) 33 | public String available() { 34 | return "available"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/java/org/app/Endpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import jakarta.inject.Inject; 23 | import jakarta.ws.rs.GET; 24 | import jakarta.ws.rs.Path; 25 | import jakarta.ws.rs.Produces; 26 | import jakarta.ws.rs.core.MediaType; 27 | 28 | @Path("test") 29 | @ApplicationScoped 30 | public class Endpoint { 31 | @Inject 32 | private Injectable injectable; 33 | 34 | @GET 35 | @Produces(MediaType.TEXT_PLAIN) 36 | public String simple() { 37 | return Boolean.parseBoolean(injectable.injected()) ? "simple" : "fail"; 38 | } 39 | 40 | @GET 41 | @Path("/model") 42 | @Produces(MediaType.APPLICATION_JSON) 43 | public Model simpleJsonModel() { 44 | Model model = new Model(); 45 | model.setFirstName("firstname"); 46 | return model; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/java/org/app/Injectable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | 23 | @ApplicationScoped 24 | public class Injectable { 25 | public String injected() { 26 | return "true"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/java/org/app/Model.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | public class Model { 22 | 23 | private String firstName; 24 | private String lastName; 25 | 26 | public String getFirstName() { 27 | return firstName; 28 | } 29 | 30 | public void setFirstName(String firstName) { 31 | this.firstName = firstName; 32 | } 33 | 34 | public String getLastName() { 35 | return lastName; 36 | } 37 | 38 | public void setLastName(String lastName) { 39 | this.lastName = lastName; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/java/org/app/RsApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.app; 20 | 21 | import jakarta.enterprise.context.Dependent; 22 | import jakarta.ws.rs.ApplicationPath; 23 | import jakarta.ws.rs.core.Application; 24 | 25 | @Dependent 26 | @ApplicationPath("api") 27 | public class RsApp extends Application { 28 | } 29 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/resources/MeecrowaveBundleMojoTest/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 25 | 4.0.0 26 | 27 | org.apache.meecrowave.test 28 | test 29 | 0.1-SNAPSHOT 30 | 31 | 32 | 33 | 34 | org.apache.meecrowave 35 | meecrowave-maven-plugin 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/resources/MeecrowaveBundleMojoTest/src/main/webapp/sub/index.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 |

Bundled

22 | 23 | 24 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/resources/MeecrowaveRunMojoTest/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 25 | 4.0.0 26 | 27 | org.apache.meecrowave.test 28 | test 29 | 0.1-SNAPSHOT 30 | 31 | 32 | 33 | 34 | org.apache.meecrowave 35 | meecrowave-maven-plugin 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/resources/MeecrowaveRunMojoTest/src/main/webapp/sub/index.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 |

yes

22 | 23 | 24 | -------------------------------------------------------------------------------- /meecrowave-maven-plugin/src/test/resources/meecrowave.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | jsonb-naming-strategy = LOWER_CASE_WITH_UNDERSCORES 19 | jsonb-nulls = true 20 | -------------------------------------------------------------------------------- /meecrowave-oauth2-minimal/src/main/java/org/apache/meecrowave/oauth2/provider/JCacheCodeDataProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.oauth2.provider; 20 | 21 | import org.apache.cxf.Bus; 22 | import org.apache.meecrowave.oauth2.configuration.OAuth2Options; 23 | 24 | import jakarta.enterprise.inject.Vetoed; 25 | 26 | @Vetoed 27 | public class JCacheCodeDataProvider extends org.apache.cxf.rs.security.oauth2.grants.code.JCacheCodeDataProvider { 28 | public JCacheCodeDataProvider(final OAuth2Options configuration, final Bus bus) throws Exception { 29 | super(configuration.getJcacheConfigUri(), bus); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /meecrowave-oauth2-minimal/src/main/resources/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Meecrowave 2 | Copyright 2016-2018 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | --- 8 | 9 | OpenJPA includes software developed by the SERP project 10 | Copyright (c) 2002-2006, A. Abram White. All rights reserved. 11 | 12 | --- 13 | 14 | OpenJPA includes the persistence and orm schemas from the JPA specifications. 15 | Copyright 2005-2009 Sun Microsystems, Inc. All rights reserved. 16 | 17 | --- 18 | 19 | OpenJPA includes software written by Miroslav Nachev 20 | -------------------------------------------------------------------------------- /meecrowave-oauth2-minimal/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /meecrowave-oauth2-minimal/src/main/resources/META-INF/services/org.apache.meecrowave.runner.Cli$Options: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.oauth2.configuration.OAuth2Options 2 | -------------------------------------------------------------------------------- /meecrowave-oauth2-minimal/src/main/resources/default-oauth2.jcs: -------------------------------------------------------------------------------- 1 | #Licensed to the Apache Software Foundation (ASF) under one 2 | #or more contributor license agreements. See the NOTICE file 3 | #distributed with this work for additional information 4 | #regarding copyright ownership. The ASF licenses this file 5 | #to you under the Apache License, Version 2.0 (the 6 | #"License"); you may not use this file except in compliance 7 | #with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | #Unless required by applicable law or agreed to in writing, 12 | #software distributed under the License is distributed on an 13 | #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | #KIND, either express or implied. See the License for the 15 | #specific language governing permissions and limitations 16 | #under the License. 17 | jcs.default= 18 | jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes 19 | jcs.default.cacheattributes.MaxObjects=200001 20 | jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache 21 | jcs.default.cacheattributes.UseMemoryShrinker=true 22 | jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 23 | jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 24 | jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes 25 | jcs.default.elementattributes.IsEternal=false 26 | jcs.default.elementattributes.MaxLife=700 27 | jcs.default.elementattributes.IdleTime=1800 28 | jcs.default.elementattributes.IsSpool=true 29 | jcs.default.elementattributes.IsRemote=true 30 | jcs.default.elementattributes.IsLateral=true 31 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/event/AfterResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.proxy.servlet.front.cdi.event; 20 | 21 | import jakarta.servlet.http.HttpServletRequest; 22 | import jakarta.servlet.http.HttpServletResponse; 23 | 24 | import org.apache.meecrowave.proxy.servlet.configuration.Routes; 25 | 26 | public class AfterResponse extends BaseEvent { 27 | private Routes.Route route; 28 | private String prefix; 29 | 30 | public AfterResponse(final HttpServletRequest request, final HttpServletResponse response) { 31 | super(request, response); 32 | } 33 | 34 | public String getPrefix() { 35 | return prefix; 36 | } 37 | 38 | public void setPrefix(final String prefix) { 39 | this.prefix = prefix; 40 | } 41 | 42 | public Routes.Route getRoute() { 43 | return route; 44 | } 45 | 46 | public void setRoute(final Routes.Route route) { 47 | this.route = route; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/event/BaseEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.proxy.servlet.front.cdi.event; 20 | 21 | import jakarta.servlet.http.HttpServletRequest; 22 | import jakarta.servlet.http.HttpServletResponse; 23 | 24 | public class BaseEvent { 25 | private final HttpServletRequest request; 26 | private final HttpServletResponse response; 27 | 28 | protected BaseEvent(final HttpServletRequest request, final HttpServletResponse response) { 29 | this.request = request; 30 | this.response = response; 31 | } 32 | 33 | public HttpServletRequest getRequest() { 34 | return request; 35 | } 36 | 37 | public HttpServletResponse getResponse() { 38 | return response; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/event/BeforeRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.proxy.servlet.front.cdi.event; 20 | 21 | import jakarta.servlet.http.HttpServletRequest; 22 | import jakarta.servlet.http.HttpServletResponse; 23 | 24 | import org.apache.meecrowave.proxy.servlet.configuration.Routes; 25 | 26 | public class BeforeRequest extends BaseEvent { 27 | private Routes.Route route; 28 | private String prefix; 29 | 30 | public BeforeRequest(final HttpServletRequest request, final HttpServletResponse response) { 31 | super(request, response); 32 | } 33 | 34 | public String getPrefix() { 35 | return prefix; 36 | } 37 | 38 | public void setPrefix(final String prefix) { 39 | this.prefix = prefix; 40 | } 41 | 42 | public Routes.Route getRoute() { 43 | return route; 44 | } 45 | 46 | public void setRoute(final Routes.Route route) { 47 | this.route = route; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/func/IOConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.proxy.servlet.front.cdi.func; 20 | 21 | import java.io.IOException; 22 | 23 | @FunctionalInterface 24 | public interface IOConsumer { 25 | void accept(T parameter) throws IOException; 26 | } 27 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/main/java/org/apache/meecrowave/proxy/servlet/front/cdi/func/IOFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.meecrowave.proxy.servlet.front.cdi.func; 20 | 21 | import java.io.IOException; 22 | 23 | @FunctionalInterface 24 | public interface IOFunction { 25 | T apply(A a) throws IOException; 26 | } 27 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.proxy.servlet.front.cdi.extension.SpyExtension 2 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/main/resources/META-INF/services/org.apache.meecrowave.Meecrowave$ContextCustomizer: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.proxy.servlet.meecrowave.ProxyServletSetup 2 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/test/resources/ConfigurationLoaderTest/ensureDefaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "routes": [ 3 | { 4 | "id": "get-simple", 5 | "requestConfiguration": { 6 | "method": "GET", 7 | "prefix": "/simple" 8 | } 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /meecrowave-proxy/src/test/resources/ConfigurationLoaderTest/mergeWithDefaultRoute.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultRoute": { 3 | "responseConfiguration": { 4 | "target": "http://localhost:${fake.server.port}" 5 | }, 6 | "clientConfiguration": { 7 | "timeouts": { 8 | "read": 1234, 9 | "connect": 1235 10 | }, 11 | "executor": { 12 | "core": 1 13 | } 14 | } 15 | }, 16 | "routes": [ 17 | { 18 | "id": "get-simple", 19 | "requestConfiguration": { 20 | "method": "GET", 21 | "prefix": "/simple" 22 | }, 23 | "clientConfiguration": { 24 | "timeouts": { 25 | "read": 6789 26 | } 27 | } 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /meecrowave-proxy/src/test/resources/ProxyServletTest/upload/file.txt: -------------------------------------------------------------------------------- 1 | test 2 | file 3 | with 4 | multiple 5 | lines 6 | -------------------------------------------------------------------------------- /meecrowave-proxy/src/test/resources/routes.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultRoute": { 3 | "responseConfiguration": { 4 | // configure our global fake server for all the endpoints 5 | "target": "http://localhost:${fake.server.port}" 6 | } 7 | }, 8 | "routes": [ 9 | { 10 | // used to test a plain simple static endpoint - simplest case 11 | "id": "get-simple", 12 | "requestConfiguration": { 13 | "method": "GET", 14 | "prefix": "/simple" 15 | } 16 | }, 17 | { 18 | /** 19 | * used to test a very trivial post without any query param or anything else 20 | */ 21 | "id": "post-simple", 22 | "requestConfiguration": { 23 | "method": "POST", 24 | "prefix": "/data1" 25 | } 26 | }, 27 | { 28 | "id": "multipart", 29 | "requestConfiguration": { 30 | "method": "POST", 31 | "prefix": "/upload1" 32 | } 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /meecrowave-websocket/src/main/resources/META-INF/services/jakarta.websocket.server.ServerEndpointConfig$Configurator: -------------------------------------------------------------------------------- 1 | org.apache.meecrowave.websocket.CDIServerConfigurator -------------------------------------------------------------------------------- /test-app/src/main/java/org/superbiz/app/Injectable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | 23 | @ApplicationScoped 24 | public class Injectable { 25 | public String injected() { 26 | return "true"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test-app/src/main/java/org/superbiz/app/OtherEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import jakarta.enterprise.context.ApplicationScoped; 22 | import jakarta.inject.Inject; 23 | import jakarta.ws.rs.GET; 24 | import jakarta.ws.rs.Path; 25 | import jakarta.ws.rs.Produces; 26 | 27 | @Path("other") 28 | @ApplicationScoped 29 | public class OtherEndpoint 30 | { 31 | @Inject 32 | private Injectable injectable; 33 | 34 | @GET 35 | @Produces({"text/plain"}) 36 | public String simple() 37 | { 38 | return Boolean.parseBoolean(this.injectable.injected()) ? "simple" : "fail"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test-app/src/main/java/org/superbiz/app/OtherFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.superbiz.app; 20 | 21 | import java.io.IOException; 22 | import java.io.PrintWriter; 23 | import jakarta.inject.Inject; 24 | import jakarta.servlet.Filter; 25 | import jakarta.servlet.FilterChain; 26 | import jakarta.servlet.FilterConfig; 27 | import jakarta.servlet.ServletException; 28 | import jakarta.servlet.ServletRequest; 29 | import jakarta.servlet.ServletResponse; 30 | import jakarta.servlet.annotation.WebFilter; 31 | 32 | @WebFilter({"/other"}) 33 | public class OtherFilter 34 | implements Filter 35 | { 36 | @Inject 37 | private Injectable injectable; 38 | 39 | public void init(FilterConfig filterConfig) 40 | throws ServletException 41 | {} 42 | 43 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 44 | throws IOException, ServletException 45 | { 46 | response.getWriter().write("filter" + this.injectable.injected()); 47 | } 48 | 49 | public void destroy() {} 50 | } 51 | --------------------------------------------------------------------------------