├── .asf.yaml
├── .gitattributes
├── .github
├── asf-slack-felix-atomos-yellow.svg
└── workflows
│ └── maven.yml
├── .gitignore
├── .gitpod.yml
├── .mvn
└── wrapper
│ └── maven-wrapper.properties
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── atomos-parent
└── pom.xml
├── atomos.examples
├── README.md
├── SUBSTRATE.md
├── atomos.examples.android
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── libs
│ │ │ ├── .gitignore
│ │ │ └── README.txt
│ │ ├── lint.xml
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── org
│ │ │ │ └── apache
│ │ │ │ └── felix
│ │ │ │ └── atomos
│ │ │ │ └── examples
│ │ │ │ └── android
│ │ │ │ └── MainActivity.java
│ │ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ └── ic_launcher_background.xml
│ │ │ ├── layout
│ │ │ └── activity_main.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── atomos.examples.index
│ ├── README.md
│ └── pom.xml
├── atomos.examples.jaxrs.bundle
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── apache
│ │ └── felix
│ │ └── atomos
│ │ └── examples
│ │ └── jaxrs
│ │ └── bundle
│ │ ├── HelloResource.java
│ │ └── HelloService.java
├── atomos.examples.jaxrs
│ ├── README.md
│ ├── additionalResourceConfig.json
│ ├── pom.xml
│ ├── proxy_config.json
│ ├── reflectAgentConfig.json
│ ├── reflectConfig_felix_atomos.json
│ ├── reflectConfig_felix_gogo.json
│ ├── reflectConfig_felix_web.json
│ ├── reflectConfig_jdk.json
│ ├── reflectConfig_jetty.json
│ └── resourceAgentConfig.json
├── atomos.examples.jlink
│ ├── README.md
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ ├── module-info.java
│ │ └── org
│ │ └── apache
│ │ └── felix
│ │ └── atomos
│ │ └── examples
│ │ └── jlink
│ │ └── GogoConsole.java
├── atomos.examples.springloader
│ ├── README.md
│ └── pom.xml
├── atomos.examples.substrate.lib
│ ├── README.md
│ ├── graal_class_config.json
│ ├── graal_proxy_config.json
│ ├── graal_resource_config.json
│ └── pom.xml
├── atomos.examples.substrate.maven
│ ├── README.md
│ ├── additionalResourceConfig.json
│ ├── pom.xml
│ ├── proxy_config.json
│ ├── reflectConfig_felix_atomos.json
│ ├── reflectConfig_felix_gogo.json
│ ├── reflectConfig_felix_web.json
│ ├── reflectConfig_jdk.json
│ └── reflectConfig_jetty.json
├── atomos.examples.webconsole.bom
│ └── pom.xml
└── pom.xml
├── atomos.maven
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── apache
│ └── felix
│ └── atomos
│ └── maven
│ ├── LauncherBuilderUtil.java
│ ├── configs
│ ├── MavenClassPathConfig.java
│ ├── MavenClassPathFileConfig.java
│ ├── MavenClasspathMavenConfig.java
│ ├── MavenIndexConfig.java
│ ├── MavenNativeImageConfig.java
│ └── MavenShadeConfig.java
│ ├── index
│ └── AtomosIndexMojo.java
│ └── nativeimage
│ └── NativeImageMojo.java
├── atomos.osgi.core
├── pom.xml
└── src
│ └── main
│ └── resources
│ └── README
├── atomos.substrate.config
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── apache
│ └── felix
│ └── atomos
│ └── substrate
│ └── config
│ ├── ReflectConfig.java
│ ├── ResourceConfig.java
│ └── SubstrateService.java
├── atomos.tests
├── atomos.tests.classpath.service
│ ├── pom.xml
│ └── src
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── apache
│ │ └── felix
│ │ └── atomos
│ │ └── tests
│ │ └── classpath
│ │ └── service
│ │ └── test
│ │ └── ClasspathLaunchTest.java
├── atomos.tests.index.bundles
│ ├── pom.xml
│ └── src
│ │ └── test
│ │ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── index
│ │ │ └── bundles
│ │ │ ├── IndexLaunchTest.java
│ │ │ ├── TestClass.java
│ │ │ ├── b1
│ │ │ └── ActivatorBundle1.java
│ │ │ ├── b2
│ │ │ └── ActivatorBundle2.java
│ │ │ ├── b3
│ │ │ └── ActivatorBundle3.java
│ │ │ └── b4
│ │ │ └── ActivatorBundle4.java
│ │ └── resources
│ │ ├── OSGI-INF
│ │ ├── bundle.1-1.txt
│ │ ├── bundle.1-2.txt
│ │ ├── bundle.2-1.txt
│ │ ├── bundle.2-2.txt
│ │ ├── bundle.3-1.txt
│ │ ├── bundle.3-2.txt
│ │ ├── bundle.4-1.txt
│ │ ├── bundle.4-2.txt
│ │ └── notFound.txt
│ │ ├── atomos
│ │ ├── 1
│ │ │ ├── META-INF
│ │ │ │ └── MANIFEST.MF
│ │ │ └── OSGI-INF
│ │ │ │ └── common.txt
│ │ ├── 2
│ │ │ ├── META-INF
│ │ │ │ └── MANIFEST.MF
│ │ │ └── OSGI-INF
│ │ │ │ └── common.txt
│ │ ├── 3
│ │ │ ├── META-INF
│ │ │ │ └── MANIFEST.MF
│ │ │ └── OSGI-INF
│ │ │ │ └── common.txt
│ │ ├── 4
│ │ │ ├── META-INF
│ │ │ │ └── MANIFEST.MF
│ │ │ └── OSGI-INF
│ │ │ │ └── common.txt
│ │ └── bundles.index
│ │ └── testIndex
│ │ ├── 3
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ └── OSGI-INF
│ │ │ └── common.txt
│ │ ├── 4
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ └── OSGI-INF
│ │ │ └── common.txt
│ │ └── test.index
├── atomos.tests.modulepath.service
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── modulepath
│ │ │ └── service
│ │ │ └── ModulepathLaunch.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── apache
│ │ └── felix
│ │ └── atomos
│ │ └── tests
│ │ └── modulepath
│ │ └── service
│ │ └── ModulepathLaunchTest.java
├── atomos.tests.testbundles
│ ├── atomos.tests.testbundles.bom
│ │ └── pom.xml
│ ├── atomos.tests.testbundles.dependency.a
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── dependency
│ │ │ └── a
│ │ │ ├── A.java
│ │ │ └── package-info.java
│ ├── atomos.tests.testbundles.dependency.b
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── dependency
│ │ │ └── b
│ │ │ ├── B.java
│ │ │ └── package-info.java
│ ├── atomos.tests.testbundles.dependent.x
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── dependent
│ │ │ └── x
│ │ │ ├── Activator.java
│ │ │ └── X.java
│ ├── atomos.tests.testbundles.reflect.command
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── reflect
│ │ │ └── command
│ │ │ ├── A.java
│ │ │ ├── AbstractCmd.java
│ │ │ ├── CmdExample.java
│ │ │ ├── CommandFunction.java
│ │ │ └── CommandScope.java
│ ├── atomos.tests.testbundles.reflect.dto
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── reflect
│ │ │ └── command
│ │ │ └── OneDTO.java
│ ├── atomos.tests.testbundles.resources.a
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ │ └── apache
│ │ │ │ └── felix
│ │ │ │ └── atomos
│ │ │ │ └── tests
│ │ │ │ └── testbundles
│ │ │ │ └── resource
│ │ │ │ └── a
│ │ │ │ └── Clazz.java
│ │ │ └── resources
│ │ │ ├── META-TEXT
│ │ │ └── file.txt
│ │ │ ├── file.txt
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── resource
│ │ │ └── a
│ │ │ └── file.txt
│ ├── atomos.tests.testbundles.service.contract
│ │ ├── bnd.bnd
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── service
│ │ │ └── contract
│ │ │ ├── Echo.java
│ │ │ └── package-info.java
│ ├── atomos.tests.testbundles.service.impl.a
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── service
│ │ │ └── impl
│ │ │ └── a
│ │ │ └── EchoImpl.java
│ ├── atomos.tests.testbundles.service.impl.activator
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── service
│ │ │ └── impl
│ │ │ └── activator
│ │ │ ├── Activator.java
│ │ │ └── ActivatorEcho.java
│ ├── atomos.tests.testbundles.service.impl.b
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── service
│ │ │ └── impl
│ │ │ └── b
│ │ │ └── EchoImpl.java
│ ├── atomos.tests.testbundles.service.impl
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── service
│ │ │ └── impl
│ │ │ └── EchoImpl.java
│ ├── atomos.tests.testbundles.service.library
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── service
│ │ │ └── library
│ │ │ ├── SomeUtil.java
│ │ │ └── package-info.java
│ ├── atomos.tests.testbundles.service.user
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ ├── module-info.java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── tests
│ │ │ └── testbundles
│ │ │ └── service
│ │ │ └── user
│ │ │ ├── EchoUser.java
│ │ │ └── EchoUser2.java
│ └── pom.xml
└── pom.xml
├── atomos.utils
├── atomos.utils.api
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── utils
│ │ │ └── api
│ │ │ ├── Config.java
│ │ │ ├── Context.java
│ │ │ ├── FileCollectionContext.java
│ │ │ ├── FileType.java
│ │ │ ├── IndexInfo.java
│ │ │ ├── Launcher.java
│ │ │ ├── LauncherBuilder.java
│ │ │ ├── PluginConfigBase.java
│ │ │ ├── RegisterServiceCall.java
│ │ │ ├── package-info.java
│ │ │ └── plugin
│ │ │ ├── BundleActivatorPlugin.java
│ │ │ ├── ClassPlugin.java
│ │ │ ├── ComponentDescription.java
│ │ │ ├── ComponentMetaDataPlugin.java
│ │ │ ├── FileCollectorPlugin.java
│ │ │ ├── FileHandlerPlugin.java
│ │ │ ├── FinalPlugin.java
│ │ │ ├── JarPlugin.java
│ │ │ ├── MethodPlugin.java
│ │ │ ├── ReferenceDescription.java
│ │ │ ├── RegisterServicepPlugin.java
│ │ │ ├── SubstratePlugin.java
│ │ │ └── package-info.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── apache
│ │ └── felix
│ │ └── atomos
│ │ └── utils
│ │ └── LauncherTest.java
├── atomos.utils.core
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── utils
│ │ │ └── core
│ │ │ ├── ComponentDescriptionImpl.java
│ │ │ ├── ContextImpl.java
│ │ │ ├── IndexInfoImpl.java
│ │ │ ├── LauncherBuilderImpl.java
│ │ │ ├── LauncherImpl.java
│ │ │ ├── ReferenceDescriptionImpl.java
│ │ │ ├── RegisterServiceCallImpl.java
│ │ │ ├── plugins
│ │ │ ├── ComponentDescriptionPlugin.java
│ │ │ ├── GogoPlugin.java
│ │ │ ├── OsgiDTOPlugin.java
│ │ │ ├── ResourcePlugin.java
│ │ │ ├── activator
│ │ │ │ ├── InvocatingBundleActivatorPlugin.java
│ │ │ │ └── ReflectionBundleActivatorPlugin.java
│ │ │ ├── collector
│ │ │ │ ├── PathCollectorPlugin.java
│ │ │ │ └── PathCollectorPluginConfig.java
│ │ │ ├── finaliser
│ │ │ │ ├── ni
│ │ │ │ │ ├── NativeImageBuilderConfig.java
│ │ │ │ │ └── NativeImagePlugin.java
│ │ │ │ └── shade
│ │ │ │ │ ├── ShadeConfig.java
│ │ │ │ │ ├── ShadePreHolder.java
│ │ │ │ │ └── ShaderPlugin.java
│ │ │ └── index
│ │ │ │ ├── IndexOutputType.java
│ │ │ │ ├── IndexPlugin.java
│ │ │ │ └── IndexPluginConfig.java
│ │ │ └── scr
│ │ │ └── mock
│ │ │ ├── EmptyBundeLogger.java
│ │ │ ├── PathBundle.java
│ │ │ └── package-info.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── apache
│ │ └── felix
│ │ └── atomos
│ │ └── utils
│ │ └── core
│ │ ├── FullTest.java
│ │ ├── GlobalTestConfig.java
│ │ ├── MojoTestExperiments.java
│ │ ├── ReflectConfigTest.java
│ │ ├── TestBase.java
│ │ ├── TestConstants.java
│ │ ├── TestContext.java
│ │ └── plugins
│ │ ├── DirectoryFileCollectorPluginTest.java
│ │ └── SubstrateTest.java
├── atomos.utils.substrate.api
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── apache
│ │ └── felix
│ │ └── atomos
│ │ └── utils
│ │ └── substrate
│ │ └── api
│ │ ├── NativeImageArguments.java
│ │ ├── NativeImageArgumentsBuilder.java
│ │ ├── NativeImageCli.java
│ │ ├── NativeImageCliBuilder.java
│ │ ├── NativeImageConfigJsonProvider.java
│ │ ├── dynproxy
│ │ ├── DynamicProxyConfiguration.java
│ │ └── package-info.java
│ │ ├── package-info.java
│ │ ├── reflect
│ │ ├── ReflectionClassConfig.java
│ │ ├── ReflectionConfiguration.java
│ │ ├── ReflectionConstructorConfig.java
│ │ ├── ReflectionFieldConfig.java
│ │ ├── ReflectionMethodConfig.java
│ │ └── package-info.java
│ │ └── resource
│ │ ├── ResourceConfiguration.java
│ │ └── package-info.java
├── atomos.utils.substrate.impl
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ └── utils
│ │ │ └── substrate
│ │ │ └── impl
│ │ │ ├── BaseNativeImageArguments.java
│ │ │ ├── DefaultNativeImageArguments.java
│ │ │ ├── NativeImageArgumentsBuilderImpl.java
│ │ │ ├── NativeImageArgumentsImpl.java
│ │ │ ├── NativeImageCliBuilderImpl.java
│ │ │ ├── NativeImageCliImpl.java
│ │ │ ├── NativeImageCliUtil.java
│ │ │ ├── NativeImageConfigJsonProviderImpl.java
│ │ │ ├── config
│ │ │ ├── DefaultDynamicProxyConfiguration.java
│ │ │ ├── DefaultReflectionClassConfiguration.java
│ │ │ ├── DefaultReflectionConfiguration.java
│ │ │ ├── DefaultReflectionConstructorConfiguration.java
│ │ │ ├── DefaultReflectionFieldConfiguration.java
│ │ │ ├── DefaultReflectionMethodConfiguration.java
│ │ │ ├── DefaultResourceConfiguration.java
│ │ │ └── package-info.java
│ │ │ ├── json
│ │ │ ├── DynamicProxyJsonUtil.java
│ │ │ ├── ReflectJsonUtil.java
│ │ │ ├── ResourceJsonUtil.java
│ │ │ └── package-info.java
│ │ │ └── package-info.java
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── apache
│ │ └── felix
│ │ └── atomos
│ │ └── utils
│ │ └── substrate
│ │ └── impl
│ │ └── json
│ │ ├── DynamicProcyJsonTest.java
│ │ ├── ReflectConfigJsonTest.java
│ │ └── ResourceConfigJsonTest.java
└── pom.xml
├── atomos
├── bnd.bnd
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── apache
│ │ │ └── felix
│ │ │ └── atomos
│ │ │ ├── Atomos.java
│ │ │ ├── AtomosContent.java
│ │ │ ├── AtomosLayer.java
│ │ │ ├── impl
│ │ │ ├── base
│ │ │ │ ├── AtomosBase.java
│ │ │ │ ├── AtomosClassPath.java
│ │ │ │ ├── AtomosCommands.java
│ │ │ │ ├── AtomosFrameworkHooks.java
│ │ │ │ ├── AtomosFrameworkUtilHelper.java
│ │ │ │ ├── AtomosModuleConnector.java
│ │ │ │ ├── AtomosStorage.java
│ │ │ │ ├── JavaServiceNamespace.java
│ │ │ │ └── package-info.java
│ │ │ ├── content
│ │ │ │ ├── ConnectContentCloseableJar.java
│ │ │ │ ├── ConnectContentFile.java
│ │ │ │ ├── ConnectContentIndexed.java
│ │ │ │ ├── ConnectContentJar.java
│ │ │ │ └── package-info.java
│ │ │ └── modules
│ │ │ │ ├── AtomosModules.java
│ │ │ │ ├── ConnectContentModule.java
│ │ │ │ ├── ModuleConnectLoader.java
│ │ │ │ └── package-info.java
│ │ │ └── package-info.java
│ └── resources
│ │ └── META-INF
│ │ └── services
│ │ ├── org.osgi.framework.connect.FrameworkUtilHelper
│ │ └── org.osgi.framework.connect.ModuleConnector
│ └── test
│ └── java
│ └── org
│ └── apache
│ └── felix
│ └── atomos
│ ├── AtomosTest.java
│ ├── GetConfigurationTest.java
│ └── impl
│ └── content
│ └── ConnectContentFileTest.java
├── mvnw
├── mvnw.cmd
└── pom.xml
/.asf.yaml:
--------------------------------------------------------------------------------
1 | github:
2 | description: "Apache Felix Atomos"
3 | homepage: https://felix.apache.org/
4 | labels:
5 | - osgi
6 | - modules
7 | - jlink
8 | - substrate
9 | ghp_branch: gh-pages
10 | features:
11 | issues: true
12 |
13 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Text files with LF eol
2 | *.awk crlf=input
3 | *.bnd crlf=input
4 | *.c crlf=input ident
5 | *.conf crlf=input
6 | *.cpp crlf=input ident
7 | *.css crlf=input
8 | *.groovy crlf=input
9 | *.h crlf=input ident
10 | *.html crlf=input ident
11 | *.java crlf=input ident
12 | *.js crlf=input
13 | *.MF crlf=input
14 | *.php crlf=input
15 | *.pl crlf=input
16 | *.prefs crlf=input
17 | *.properties crlf=input
18 | *.py crlf=input
19 | *.schema crlf=input
20 | *.sh crlf=input
21 | *.tcl crlf=input
22 | *.txt crlf=input
23 | *.xml crlf=input
24 | *.xsd crlf=input ident
25 | *.xsl crlf=input
26 | *.xslt crlf=input
27 | .classpath crlf=input
28 | .project crlf=input
29 | packageinfo crlf=input
30 | Makefile crlf=input
31 |
32 | # No EOL translation
33 | *.bat -crlf
34 |
35 | # Binary. No EOL translation, no diff
36 | *.ico binary
37 | *.jpeg binary
38 | *.jpg binary
39 | *.png binary
40 | *.crt binary
41 | *.pdf binary
42 | *.dll binary
43 | *.jar binary
44 | *.jnilib binary
45 | *.so binary
46 | *.zip binary
47 | *.doc binary
48 | *.ppt binary
49 | *.xls binary
50 | *.odg binary
51 | *.odp binary
52 | *.ods binary
53 | *.odt binary
54 | *.otg binary
55 | *.otp binary
56 | *.ots binary
57 | *.ott binary
58 | *.key binary
59 | *.numbers binary
60 | *.pages binary
61 |
--------------------------------------------------------------------------------
/.github/workflows/maven.yml:
--------------------------------------------------------------------------------
1 | name: Java CI
2 |
3 | on:
4 | push:
5 | pull_request:
6 | branches:
7 | - master
8 |
9 | jobs:
10 | test:
11 | name: Test on Java ${{ matrix.java_version }} and OS ${{ matrix.os }}
12 | runs-on: ${{ matrix.os }}
13 | strategy:
14 | matrix:
15 | java_version: ['11', '17', '21']
16 | os: [ubuntu-latest, windows-latest, macOS-latest]
17 | steps:
18 | - uses: actions/checkout@v1
19 | - name: Set up JDK ${{ matrix.java_version }}
20 | uses: actions/setup-java@v1.4.3
21 | with:
22 | java-version: ${{ matrix.java_version }}
23 | - name: Main build using Felix
24 | run: ./mvnw clean install -B -Pfelix -Pjava8
25 | - name: Main build using Equinox
26 | run: ./mvnw clean install -B -Pequinox -Pjava8
27 | - name: Build Android App
28 | if: matrix.java_version == '11' && matrix.os == 'ubuntu-latest'
29 | run: |
30 | cp atomos.examples/atomos.examples.index/target/org.apache.felix.atomos.examples.index-*.jar atomos.examples/atomos.examples.android/app/libs
31 | atomos.examples/atomos.examples.android/gradlew -b atomos.examples/atomos.examples.android/build.gradle build
32 |
33 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *#
2 | *.iml
3 | *.ipr
4 | *.iws
5 | *.jar
6 | *.sw?
7 | *~
8 | .#*
9 | .*.md.html
10 | .DS_Store
11 | .classpath
12 | .factorypath
13 | .gradle
14 | .idea
15 | .metadata
16 | .project
17 | .recommenders
18 | .settings
19 | .springBeans
20 | .theia
21 | /build
22 | /code
23 | _site/
24 | activemq-data
25 | bin
26 | build
27 | build.log
28 | dependency-reduced-pom.xml
29 | dump.rdb
30 | interpolated*.xml
31 | lib/
32 | manifest.yml
33 | overridedb.*
34 | settings.xml
35 | target
36 | transaction-logs
37 | .flattened-pom.xml
38 | secrets.yml
39 | .gradletasknamecache
40 | .sts4-cache
41 | configuration/
42 | felix-cache/
43 |
--------------------------------------------------------------------------------
/.gitpod.yml:
--------------------------------------------------------------------------------
1 | tasks:
2 | - init: ./mvnw install -Pjava8 -Pequinox -DskipTests=false
3 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.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 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
18 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
19 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 |
19 | Apache Software Foundation Code of Conduct
20 | ====
21 |
22 | Being an Apache project, Apache Felix adheres to the Apache Software Foundation's [Code of Conduct](https://www.apache.org/foundation/policies/conduct.html).
23 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
19 | Contributing
20 | ====
21 |
22 | Thanks for choosing to contribute!
23 |
24 | You will find all the necessary details about how you can do this at https://felix.apache.org/documentation/community/contributing.html.
25 |
--------------------------------------------------------------------------------
/atomos.examples/README.md:
--------------------------------------------------------------------------------
1 | # Atomos Examples
2 |
3 | The following examples are available:
4 | 1. [Atomos Index example](atomos.examples.index/README.md) - Assembles an executable JAR which uses an Atomos index for bundle entry content.
5 | 1. [Atomos jlink example](atomos.examples.jlink/README.md) - Assembles a jlink image that loads the framework and a set of bundles as modules included in a fit for purpose JVM image
6 | 1. [Atomos Spring Loader example](atomos.examples.springloader/README.md) - Assembles an executable JAR that uses the Spring Jar loader to load bundle content from embedded JAR files.
7 | 1. [Atomos native-image lib folder example](atomos.examples.substrate.lib/README.md) - Assembles a native image using Graal Substrate to load the framework and a set of bundles
8 | 1. [Atomos native-image maven plugin example](atomos.examples.substrate.maven/README.md) - Assembles a native image using Graal Substrate with the atomos-maven-plugin
9 | 1. [Atomos Android example](atomos.examples.android/README.md) - Uses the result of the [Atomos index example](atomos.examples.index/README.md) to build an Android application
10 | 1. [Atomos JAX-RS example](atomos.examples.jaxrs/README.md) - Uses Aries JAX-RS [whiteboard](https://github.com/apache/aries-jax-rs-whiteboard) implementation for a simple JAX-RS resource example.
11 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/README.md:
--------------------------------------------------------------------------------
1 | # Atomos Android Example
2 |
3 | This is a very simple Android example project that can be loaded by Android Studio and/or built with `gradlew` from command line:
4 |
5 | `gradlew build`
6 |
7 | Before building the example a JAR file containing an Atomos index and set of bundles must be copied to the `app/libs` folder. For this example it is assumed you copy the executable JAR produced by the [Atomos Index example](../atomos.examples.index/README.md) into the `app/libs` folder.
8 |
9 | The build will produce an APK andoid application at `app/build/outputs/apk/debug/app-debug.apk`. This application can then be installed on an emulator or an android device. The resulting application is very simple. It has a single `Launch Atomos` button. When clicked it will launch Atomos which will automatically install and start all the bundles included in the Atomos index JAR that got copied to the `app/libs` folder. The display should indicate when Atomos has launched and give a status of all the bundles that got started with the application. If using the [Atomos Index example](../atomos.examples.index/README.md) then you can bring up the browser on Android and access the web console with the URL [http://localhost:8080/system/console/bundles](http://localhost:8080/system/console/bundles) with the id/password of admin/admin.
10 |
11 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 |
6 | defaultConfig {
7 | applicationId "org.apache.felix.atomos.examples.android"
8 | minSdkVersion 27
9 | targetSdkVersion 27
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | compileOptions {
21 | sourceCompatibility JavaVersion.VERSION_1_8
22 | targetCompatibility JavaVersion.VERSION_1_8
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 |
29 | implementation 'androidx.appcompat:appcompat:1.1.0'
30 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
31 | testImplementation 'junit:junit:4.12'
32 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
33 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
34 | }
35 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/libs/.gitignore:
--------------------------------------------------------------------------------
1 | *.jar
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/libs/README.txt:
--------------------------------------------------------------------------------
1 | Place Atomos index JAR here
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
30 |
31 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6200EE
4 | #3700B3
5 | #03DAC5
6 |
7 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Atomos Android
3 | Launch Atomos
4 |
5 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.6.1'
12 |
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 |
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/felix-atomos/b796fc13a763498ea474f72cd91a5d98d9944f72/atomos.examples/atomos.examples.android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Mar 25 11:36:56 CDT 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
7 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name='Atomos Android'
2 | include ':app'
3 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.index/README.md:
--------------------------------------------------------------------------------
1 | # Atomos Index Example
2 |
3 | This example uses the `atomos-maven-plugin` to create an Atomos index. An Atomos index contains all the bundle entry resources of the bundles that are required by the example. For this example the necessary bundles are included to have a functional Felix Gogo console and a Felix WebConsole. The Atomos index can then be included into the final JAR along with all the required packages from all the bundles included in the JAR.
4 |
5 | This example uses `maven-assembly-plugin` to package all the dependent bundles into a single executable JAR which also includes the Atomos index. The Atomos class `org.apache.felix.atomos.Atomos` is used as the `main-class` for the executable JAR. If you introspect the JAR produced by this example you will notice it includes an `atomos/` folder which includes all the bundle entry resources for all the dependent bundles. This allows for duplicate bundle entry paths to be included in the JAR which Atomos can discover for each bundle included in the single JAR.
6 |
7 | The following command should produce a gogo shell prompt:
8 |
9 | `java -jar target/org.apache.felix.atomos.examples.index-.jar`
10 |
11 | Where `` is the current version of this example. When executed all the bundles are loaded using the single application class loader provided by the JVM. Additional bundles can be installed, but these additional bundles will be loaded by the typical bundle class loader provided by the OSGi Framework.
12 |
13 | Once the example is launched you can access the web console with the URL [http://localhost:8080/system/console/bundles](http://localhost:8080/system/console/bundles) with the id/password of admin/admin.
14 |
15 | On its own the Atomos Index example is not that interesting. But it does open the possibility to include it in other examples that need to compose the bundles into a single artifact. For example, to produce an Android application or a native-image which includes all the bundles of your application.
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs.bundle/src/main/java/org/apache/felix/atomos/examples/jaxrs/bundle/HelloResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.examples.jaxrs.bundle;
15 |
16 | import javax.ws.rs.GET;
17 | import javax.ws.rs.Path;
18 | import javax.ws.rs.PathParam;
19 |
20 | import org.osgi.service.component.annotations.Activate;
21 | import org.osgi.service.component.annotations.Component;
22 | import org.osgi.service.component.annotations.Deactivate;
23 | import org.osgi.service.component.annotations.Reference;
24 | import org.osgi.service.component.annotations.ServiceScope;
25 | import org.osgi.service.jaxrs.whiteboard.propertytypes.JaxrsResource;
26 |
27 | @Component(service = HelloResource.class, scope = ServiceScope.PROTOTYPE)
28 | @JaxrsResource
29 | public class HelloResource
30 | {
31 | private final HelloService helloService;
32 |
33 | @Activate
34 | public HelloResource(@Reference HelloService helloService)
35 | {
36 | this.helloService = helloService;
37 | System.out.println(getClass().getSimpleName() + " JAX-RS activated");
38 | }
39 |
40 | @Deactivate
41 | void deactivate()
42 | {
43 | System.out.println(getClass().getSimpleName() + " JAX-RS deactivated");
44 | }
45 |
46 | @GET
47 | @Path("hello/{name}")
48 | public String sayHello(@PathParam("name") String name)
49 | {
50 | return helloService.computeHelloMessage(name);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs.bundle/src/main/java/org/apache/felix/atomos/examples/jaxrs/bundle/HelloService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.examples.jaxrs.bundle;
15 |
16 | import org.osgi.service.component.annotations.Activate;
17 | import org.osgi.service.component.annotations.Component;
18 | import org.osgi.service.component.annotations.Deactivate;
19 |
20 | @Component(service = HelloService.class)
21 | public class HelloService
22 | {
23 | @Activate
24 | void activate()
25 | {
26 | System.out.println(getClass().getSimpleName() + " activated");
27 | }
28 |
29 | @Deactivate
30 | void deactivate()
31 | {
32 | System.out.println(getClass().getSimpleName() + " deactivated");
33 | }
34 |
35 | public String computeHelloMessage(String name)
36 | {
37 | return "Hello " + name;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs/README.md:
--------------------------------------------------------------------------------
1 | # Atomos Substrate Example (atomos-maven-plugin)
2 |
3 | This example builds a native image that includes the Equinox Framework implementation with a set of bundles using Graal Substrate. See the substrate [README](../SUBSTRATE.md) for instructions on building the Substrate examples. This example uses the `atomos-maven-plugin` plugin to generate an Atomos index which is then included in the native-image. This allows for a native-image that does not require the presence of the original bundle JARs at runtime in an `atomos_lib/` folder.
4 |
5 | Buiding this example will create a folder `target/native_image_build/bin` folder that contains the executable `org.apache.felix.atomos.examples.jaxrs`. If you launch `org.apache.felix.atomos.examples.jaxrs` it will give you a gogo `g!` prompt to run gogo commands. The example itself contains a bundle that provides a JAX-RS hello resource. The resource can be accessed using `http://localhost:8080/hello/{name}`. Also included in this example is a version of the Felix web console. The web console can be access with http://localhost:8080/system/console/bundles and the id/password is admin/admin.
6 |
7 | This example also builds an uber JAR using the Atomos Index. This example can be run with the following command:
8 |
9 | `java -jar target/org.apache.felix.atomos.examples.jaxrs-.jar`
10 |
11 | Where `` is the current version of this example. The index JAR contains the same bundles as the native image and the Atomos index used for both the native and the Atomos index JAR should be the same. This can be useful when debugging the behavior difference for the native image vs. a normal Java application running on the classpath. Such an approach also makes it easy to use the Atomos index JAR to run with the Graal tracing [agent](https://medium.com/graalvm/introducing-the-tracing-agent-simplifying-graalvm-native-image-configuration-c3b56c486271) for discovering the necessary substrate configuration.
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs/additionalResourceConfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "resources": [
3 | {
4 | "pattern": "META-INF/services/.*$"
5 | },
6 | {
7 | "pattern": "templates/.*$"
8 | },
9 | {
10 | "pattern": "res/.*$"
11 | },
12 | {
13 | "pattern": "/system/console/res/imgs/favicon.ico"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs/proxy_config.json:
--------------------------------------------------------------------------------
1 | [
2 | ["org.apache.felix.service.command.Converter"]
3 | ]
4 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs/reflectConfig_felix_atomos.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name":"org.apache.felix.atomos.impl.modules.AtomosModules",
4 | "methods":[{"name":"","parameterTypes":["java.util.Map","org.apache.felix.atomos.Atomos$HeaderProvider"] }]
5 | },
6 | {
7 | "name":"org.apache.felix.atomos.Atomos"
8 | },
9 | {
10 | "name" : "org.apache.felix.atomos.impl.base.AtomosCommands",
11 | "allPublicMethods" : true,
12 | "allDeclaredMethods" : true,
13 | "allPublicFields" : true,
14 | "allDeclaredFields" : true
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs/reflectConfig_felix_gogo.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name":"java.lang.Boolean",
4 | "methods":[{"name":"","parameterTypes":["java.lang.String"] }]
5 | },
6 | {
7 | "name":"org.apache.felix.service.command.Converter"
8 | },
9 | {
10 | "name" : "org.apache.felix.gogo.shell.Builtin",
11 | "allPublicMethods" : true,
12 | "allDeclaredMethods" : true,
13 | "allPublicFields" : true,
14 | "allDeclaredFields" : true
15 | },
16 | {
17 | "name" : "org.apache.felix.gogo.shell.Shell",
18 | "allPublicMethods" : true,
19 | "allDeclaredMethods" : true,
20 | "allPublicFields" : true,
21 | "allDeclaredFields" : true
22 | },
23 | {
24 | "name" : "org.apache.felix.gogo.shell.Procedural",
25 | "allPublicMethods" : true,
26 | "allDeclaredMethods" : true,
27 | "allPublicFields" : true,
28 | "allDeclaredFields" : true
29 | },
30 | {
31 | "name" : "org.apache.felix.gogo.shell.Posix",
32 | "allPublicMethods" : true,
33 | "allDeclaredMethods" : true,
34 | "allPublicFields" : true,
35 | "allDeclaredFields" : true
36 | },
37 | {
38 | "name" : "org.apache.felix.gogo.shell.Telnet",
39 | "allPublicMethods" : true,
40 | "allDeclaredMethods" : true,
41 | "allPublicFields" : true,
42 | "allDeclaredFields" : true
43 | }
44 | ]
45 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs/reflectConfig_felix_web.json:
--------------------------------------------------------------------------------
1 | [
2 |
3 | {
4 | "name" : "org.apache.felix.webconsole.internal.core.ServicesServlet",
5 | "allPublicConstructors" : true,
6 | "allPublicMethods" : true
7 | },
8 | {
9 | "name" : "org.apache.felix.webconsole.internal.system.VMStatPlugin",
10 | "allPublicConstructors" : true,
11 | "allPublicMethods" : true
12 | },
13 | {
14 | "name" : "org.apache.felix.webconsole.internal.configuration.ConfigManager",
15 | "allPublicConstructors" : true,
16 | "allPublicMethods" : true
17 | },
18 | {
19 | "name" : "org.apache.felix.webconsole.internal.core.BundlesServlet",
20 | "allPublicConstructors" : true,
21 | "allPublicMethods" : true
22 | },
23 | {
24 | "name" : "org.apache.felix.webconsole.internal.misc.LicenseServlet",
25 | "allPublicConstructors" : true,
26 | "allPublicMethods" : true
27 | },
28 | {
29 | "name" : "org.apache.felix.webconsole.internal.compendium.LogServlet",
30 | "allPublicConstructors" : true,
31 | "allPublicMethods" : true
32 | },
33 | {
34 | "name" : "org.apache.cxf.jaxrs.sse.client.SseEventSourceBuilderImpl",
35 | "allPublicConstructors" : true,
36 | "allPublicMethods" : true
37 | },
38 | {
39 | "name" : "org.apache.cxf.bus.managers.DestinationFactoryManagerImpl",
40 | "allPublicConstructors" : true,
41 | "allPublicMethods" : true
42 | }
43 | ]
44 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs/reflectConfig_jdk.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name" : "java.io.File",
4 | "allPublicConstructors" : true,
5 | "allPublicMethods" : true
6 | }
7 | ]
8 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jaxrs/reflectConfig_jetty.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name" : "org.eclipse.jetty.servlet.ServletMapping[]",
4 | "allPublicConstructors" : true,
5 | "allPublicMethods" : true
6 | },
7 | {
8 | "name" : "org.eclipse.jetty.servlet.FilterMapping[]",
9 | "allPublicConstructors" : true,
10 | "allPublicMethods" : true
11 | }
12 |
13 | ]
14 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jlink/README.md:
--------------------------------------------------------------------------------
1 | # Atomos jlink Example
2 |
3 | This example uses `jlink` in order to build a Java image that includes a set of bundle and the modules they require from the base JVM installation. This allows for a set of bundle modules to be used to build a fit for purpose Java image that only includes the required modules from the JVM.
4 |
5 | In order to successfully build a jlink image all bundles included in the image must contain a `module-info.class`, they cannot be automatic modules. This example uses the `1.0.0.Beta2` version of the `moditect-maven-plugin` to add `module-info.class` as necessary to the bundles used in the image.
6 |
7 | When this example is built a jlink image will be created under `target/atomos`. Executing the following command against the jlink image should produce a gogo shell prompt:
8 |
9 | `./bin/atomos`
10 |
11 | You should see the following output:
12 |
13 | ```
14 | Registered Echo service from activator.
15 | ____________________________
16 | Welcome to Apache Felix Gogo
17 |
18 | g!
19 | ```
20 |
21 | You can also load additional modules into atomos at:
22 |
23 | - System start
24 | by using the `atomos.modules` option when launching `atomos`. For example:
25 |
26 | ```
27 | atomos/bin/atomos atomos.modules=/path/to/more/modules
28 | ```
29 |
30 | - Runtime
31 | by using the gogo command `atomos:install`. For example:
32 |
33 | ```
34 | atomos:install MyLayerName OSGI /path/to/more/modules
35 | ```
36 |
37 | When doing that the additional modules will be loaded into a child layer where the Atomos OSGi Framework will control the class loaders. This will produce a class loader per module bundle installed. This has advantages because it allows the module class loader for the bundle to implement the `org.osgi.framework.BundleReference` interface.
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jlink/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License.
5 | * You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software
10 | * distributed under the License is distributed on an "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | * See the License for the specific language governing permissions and
13 | * limitations under the License.
14 | */
15 | import org.apache.felix.atomos.Atomos;
16 | module org.apache.felix.atomos.examples.jlink
17 | {
18 | requires org.apache.felix.atomos;
19 | requires org.apache.felix.atomos.tests.testbundles.service.impl;
20 | requires org.apache.felix.atomos.tests.testbundles.service.impl.activator;
21 | requires org.apache.felix.scr;
22 | requires org.apache.felix.gogo.command;
23 | requires org.apache.felix.gogo.runtime;
24 | requires org.apache.felix.gogo.shell;
25 | requires jdk.jdwp.agent;
26 |
27 | uses Atomos;
28 | }
29 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.jlink/src/main/java/org/apache/felix/atomos/examples/jlink/GogoConsole.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.examples.jlink;
15 |
16 | import java.io.File;
17 | import java.nio.file.Path;
18 | import java.util.Map;
19 | import java.util.concurrent.TimeUnit;
20 |
21 | import org.apache.felix.atomos.Atomos;
22 | import org.osgi.framework.BundleException;
23 | import org.osgi.framework.launch.Framework;
24 |
25 | public class GogoConsole
26 | {
27 | public static void main(String[] args) throws BundleException
28 | {
29 | long start = System.nanoTime();
30 | launch(args);
31 | long total = System.nanoTime() - start;
32 | System.out.println("Total time: " + TimeUnit.NANOSECONDS.toMillis(total));
33 | }
34 |
35 | private static void launch(String[] args) throws BundleException
36 | {
37 | Map config = Atomos.getConfiguration(args);
38 | Atomos atomos = Atomos.newAtomos(config);
39 | if (atomos.getBootLayer().isAddLayerSupported())
40 | {
41 | String modulesDirPath = config.get("atomos.modules");
42 | Path modulesPath = modulesDirPath == null ? null
43 | : new File(modulesDirPath).toPath();
44 | atomos.getBootLayer().addModules("modules", modulesPath);
45 | }
46 |
47 | Framework framework = atomos.newFramework(config);
48 | framework.start();
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.springloader/README.md:
--------------------------------------------------------------------------------
1 | # Atomos Spring Loader Example
2 |
3 | This example uses the `spring-boot-maven-plugin` to create an executable JAR that includes each required bundle as embedded JAR files inside the single executable JAR. This executable JAR includes the `org.springframework.boot.loader` which is then used to load all the bundles included in the JAR. For this example the necessary bundles are included to have a functional Felix Gogo console and a Felix WebConsole. The Atomos index can then be included into the final JAR along with all the required packages from all the bundles included in the JAR.
4 |
5 | This is not a Spring Boot example itself. It only Spring Boot loader which understands how to discover and load all the included JAR files with a single class loader. This class loader is able to load content from the embedded JAR files without requiring them to be extracted to disk first.
6 |
7 | The Atomos class `org.apache.felix.atomos.Atomos` is used as the `Start-Class` for the executable JAR. If you introspect the JAR produced by this example you will notice it includes a `BOOT-INF/lib/` folder which includes all the embedded JARs for all the dependent bundles. Atomos is able to discover all the included JARs and load the bundle entry resources from them.
8 |
9 | The following command should produce a gogo shell prompt:
10 |
11 | `java -jar target/org.apache.felix.atomos.examples.springloader-.jar`
12 |
13 | Where `` is the current version of this example. When executed all the bundles are loaded using the single class loader provided by the Spring loader. Additional bundles can be installed, but these additional bundles will be loaded by the typical bundle class loader provided by the OSGi Framework.
14 |
15 | Once the example is launched you can access the web console with the URL [http://localhost:8080/system/console/bundles](http://localhost:8080/system/console/bundles) with the id/password of admin/admin.
16 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.lib/README.md:
--------------------------------------------------------------------------------
1 | # Atomos Substrate Example
2 |
3 | This example builds a native image that includes the framework implementation with a set of bundles using Graal Substrate. See the substrate [README](../SUBSTRATE.md) for instructions on building the Substrate examples.
4 |
5 | Buiding this example will create a `target/atomos` executable. If you launch `atomos` it will give you a gogo `g!` prompt to run gogo commands. Also included in this example is a version of the Felix web console. The web console can be access with http://localhost:8080/system/console/bundles and the id/password is admin/admin.
6 |
7 | For this example a directory `target/atomos_lib/` is created. This contains all the original bundle JARs that got compiled into the native image `atomos`. In order to launch the native `atomos` you must be in the directory containing both `atomos` and the `atomos_lib/` folder. This is a simple way for Atomos to discover the available bundles and load additional bundle entries at runtime.
8 |
9 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.lib/graal_proxy_config.json:
--------------------------------------------------------------------------------
1 | [
2 | ["org.apache.felix.service.command.Converter"]
3 | ]
4 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.lib/graal_resource_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "resources": [
3 | {"pattern": "templates/.*$"},
4 | {"pattern": "res/.*$"},
5 | {"pattern": "META-INF/services/.*$"}
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.maven/README.md:
--------------------------------------------------------------------------------
1 | # Atomos Substrate Example (atomos-maven-plugin)
2 |
3 | This example builds a native image that includes the Equinox Framework implementation with a set of bundles using Graal Substrate. See the substrate [README](../SUBSTRATE.md) for instructions on building the Substrate examples. This example uses the `atomos-maven-plugin` plugin to generate an Atomos index which is then included in the native-image. This allows for a native-image that does not require the presence of the original bundle JARs at runtime in an `atomos_lib/` folder.
4 |
5 | Buiding this example will create a folder `target/native_image_build/bin` folder that contains the executable `org.apache.felix.atomos.examples.substrate.maven`. If you launch `org.apache.felix.atomos.examples.substrate.maven` it will give you a gogo `g!` prompt to run gogo commands. Also included in this example is a version of the Felix web console. The web console can be access with http://localhost:8080/system/console/bundles and the id/password is admin/admin.
6 |
7 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.maven/additionalResourceConfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "resources": [
3 | {
4 | "pattern": "META-INF/services/.*$"
5 | },
6 | {
7 | "pattern": "templates/.*$"
8 | },
9 | {
10 | "pattern": "res/.*$"
11 | },
12 | {
13 | "pattern": "/system/console/res/imgs/favicon.ico"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.maven/proxy_config.json:
--------------------------------------------------------------------------------
1 | [
2 | ["org.apache.felix.service.command.Converter"]
3 | ]
4 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.maven/reflectConfig_felix_atomos.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name":"org.apache.felix.atomos.impl.modules.AtomosModules",
4 | "methods":[{"name":"","parameterTypes":["java.util.Map","org.apache.felix.atomos.Atomos$HeaderProvider"] }]
5 | },
6 | {
7 | "name":"org.apache.felix.atomos.Atomos"
8 | },
9 | {
10 | "name" : "org.apache.felix.atomos.impl.base.AtomosCommands",
11 | "allPublicMethods" : true,
12 | "allDeclaredMethods" : true,
13 | "allPublicFields" : true,
14 | "allDeclaredFields" : true
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.maven/reflectConfig_felix_gogo.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name":"java.lang.Boolean",
4 | "methods":[{"name":"","parameterTypes":["java.lang.String"] }]
5 | },
6 | {
7 | "name":"org.apache.felix.service.command.Converter"
8 | },
9 | {
10 | "name" : "org.apache.felix.gogo.shell.Builtin",
11 | "allPublicMethods" : true,
12 | "allDeclaredMethods" : true,
13 | "allPublicFields" : true,
14 | "allDeclaredFields" : true
15 | },
16 | {
17 | "name" : "org.apache.felix.gogo.shell.Shell",
18 | "allPublicMethods" : true,
19 | "allDeclaredMethods" : true,
20 | "allPublicFields" : true,
21 | "allDeclaredFields" : true
22 | },
23 | {
24 | "name" : "org.apache.felix.gogo.shell.Procedural",
25 | "allPublicMethods" : true,
26 | "allDeclaredMethods" : true,
27 | "allPublicFields" : true,
28 | "allDeclaredFields" : true
29 | },
30 | {
31 | "name" : "org.apache.felix.gogo.shell.Posix",
32 | "allPublicMethods" : true,
33 | "allDeclaredMethods" : true,
34 | "allPublicFields" : true,
35 | "allDeclaredFields" : true
36 | },
37 | {
38 | "name" : "org.apache.felix.gogo.shell.Telnet",
39 | "allPublicMethods" : true,
40 | "allDeclaredMethods" : true,
41 | "allPublicFields" : true,
42 | "allDeclaredFields" : true
43 | }
44 | ]
45 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.maven/reflectConfig_felix_web.json:
--------------------------------------------------------------------------------
1 | [
2 |
3 | {
4 | "name" : "org.apache.felix.webconsole.internal.core.ServicesServlet",
5 | "allPublicConstructors" : true,
6 | "allPublicMethods" : true
7 | },
8 | {
9 | "name" : "org.apache.felix.webconsole.internal.system.VMStatPlugin",
10 | "allPublicConstructors" : true,
11 | "allPublicMethods" : true
12 | },
13 | {
14 | "name" : "org.apache.felix.webconsole.internal.configuration.ConfigManager",
15 | "allPublicConstructors" : true,
16 | "allPublicMethods" : true
17 | },
18 | {
19 | "name" : "org.apache.felix.webconsole.internal.core.BundlesServlet",
20 | "allPublicConstructors" : true,
21 | "allPublicMethods" : true
22 | },
23 | {
24 | "name" : "org.apache.felix.webconsole.internal.misc.LicenseServlet",
25 | "allPublicConstructors" : true,
26 | "allPublicMethods" : true
27 | },
28 | {
29 | "name" : "org.apache.felix.webconsole.internal.compendium.LogServlet",
30 | "allPublicConstructors" : true,
31 | "allPublicMethods" : true
32 | }
33 | ]
34 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.maven/reflectConfig_jdk.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name" : "java.io.File",
4 | "allPublicConstructors" : true,
5 | "allPublicMethods" : true
6 | }
7 | ]
8 |
--------------------------------------------------------------------------------
/atomos.examples/atomos.examples.substrate.maven/reflectConfig_jetty.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name" : "org.eclipse.jetty.servlet.ServletMapping[]",
4 | "allPublicConstructors" : true,
5 | "allPublicMethods" : true
6 | },
7 | {
8 | "name" : "org.eclipse.jetty.servlet.FilterMapping[]",
9 | "allPublicConstructors" : true,
10 | "allPublicMethods" : true
11 | }
12 |
13 | ]
14 |
--------------------------------------------------------------------------------
/atomos.maven/src/main/java/org/apache/felix/atomos/maven/configs/MavenClassPathConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.maven.configs;
15 |
16 | import java.util.List;
17 |
18 | import org.apache.maven.plugins.annotations.Parameter;
19 |
20 | public class MavenClassPathConfig
21 | {
22 |
23 | @Parameter(required = false, readonly = false)
24 | public List maven;
25 |
26 | @Parameter(required = false, readonly = false)
27 | public List paths;
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/atomos.maven/src/main/java/org/apache/felix/atomos/maven/configs/MavenClassPathFileConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.maven.configs;
15 |
16 | import java.io.File;
17 | import java.util.List;
18 |
19 | import org.apache.felix.atomos.utils.api.FileType;
20 | import org.apache.maven.plugins.annotations.Parameter;
21 |
22 | public class MavenClassPathFileConfig
23 | {
24 |
25 | @Parameter(required = false, readonly = false)
26 | public List files;
27 | @Parameter(required = false, readonly = false)
28 | public List filters;
29 | @Parameter(defaultValue = "ARTEFACT", required = false, readonly = false)
30 | public FileType fileType;
31 | }
32 |
--------------------------------------------------------------------------------
/atomos.maven/src/main/java/org/apache/felix/atomos/maven/configs/MavenClasspathMavenConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.maven.configs;
15 |
16 | import java.util.List;
17 |
18 | import org.apache.maven.plugins.annotations.Parameter;
19 |
20 | public class MavenClasspathMavenConfig
21 | {
22 |
23 | @Parameter(defaultValue = "false", required = false, readonly = false)
24 | public boolean includingParent;
25 | @Parameter(required = false, readonly = false)
26 | public List scopePatterns;
27 |
28 | @Parameter(required = false, readonly = false)
29 | public List groupIdPattern;
30 |
31 | @Parameter(required = false, readonly = false)
32 | public List artefictIdPattern;
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/atomos.maven/src/main/java/org/apache/felix/atomos/maven/configs/MavenIndexConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.maven.configs;
15 |
16 | import java.io.File;
17 |
18 | import org.apache.felix.atomos.utils.core.plugins.index.IndexOutputType;
19 | import org.apache.maven.plugins.annotations.Parameter;
20 |
21 | public class MavenIndexConfig
22 | {
23 | @Parameter(required = false, readonly = false)
24 | public IndexOutputType indexOutputType;
25 |
26 | @Parameter(required = false, readonly = false)
27 | public File indexOutputDirectory;
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/atomos.maven/src/main/java/org/apache/felix/atomos/maven/configs/MavenNativeImageConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.maven.configs;
15 |
16 | import java.io.File;
17 | import java.util.ArrayList;
18 | import java.util.List;
19 | import java.util.Map;
20 |
21 | import org.apache.maven.plugins.annotations.Parameter;
22 |
23 | public class MavenNativeImageConfig
24 | {
25 | final private static String ATOMOS_PATH = "ATOMOS";
26 | @Parameter(required = false, readonly = false)
27 | public List additionalInitializeAtBuildTime = new ArrayList<>();
28 | @Parameter(required = false, readonly = false)
29 | public List dynamicProxyConfigurationFiles = new ArrayList<>();
30 | @Parameter(required = false, readonly = false)
31 | public List reflectionConfigurationFiles = new ArrayList<>();
32 | @Parameter(required = false, readonly = false)
33 | public List resourceConfigurationFiles = new ArrayList<>();
34 | @Parameter(required = false, readonly = false)
35 | public Boolean noFallBack;
36 |
37 | @Parameter(defaultValue = "false") //TODO: CHECK GRAAL EE ONLY
38 | public boolean debug;
39 |
40 | @Parameter(defaultValue = "${project.artifactId}", required = false, readonly = false)
41 | public String applicationName;
42 |
43 | @Parameter(required = false, readonly = false)
44 | public String mainClass;
45 |
46 | @Parameter(defaultValue = "${project.build.directory}/" + ATOMOS_PATH)
47 | public File outputDirectory;
48 | @Parameter(defaultValue = "graal.native.image.build.args")
49 | public String nativeImageArgsPropertyName;
50 |
51 | @Parameter
52 | public File nativeImageExecutable;
53 |
54 | @Parameter
55 | public List vmFlags;
56 |
57 | @Parameter
58 | public Map vmSystemProperties;
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/atomos.maven/src/main/java/org/apache/felix/atomos/maven/configs/MavenShadeConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.maven.configs;
15 |
16 | import java.io.File;
17 |
18 | import org.apache.maven.plugins.annotations.Parameter;
19 |
20 | public class MavenShadeConfig
21 | {
22 | @Parameter(required = false, readonly = false)
23 | public File shadeOutputDirectory;
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/atomos.osgi.core/src/main/resources/README:
--------------------------------------------------------------------------------
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 | This module provides a facade for osgi.core to represent a framework implementation.
19 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/java/org/apache/felix/atomos/tests/index/bundles/TestClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.index.bundles;
15 |
16 | public class TestClass {
17 | // nothing needed here; just need a class to load
18 | }
19 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/java/org/apache/felix/atomos/tests/index/bundles/b1/ActivatorBundle1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.index.bundles.b1;
15 |
16 | import java.util.Hashtable;
17 | import java.util.Map;
18 |
19 | import org.osgi.framework.BundleActivator;
20 | import org.osgi.framework.BundleContext;
21 | import org.osgi.framework.FrameworkUtil;
22 |
23 | public class ActivatorBundle1 implements BundleActivator
24 | {
25 | @Override
26 | public void start(BundleContext context) throws Exception
27 | {
28 | context.registerService(BundleActivator.class, this,
29 | new Hashtable<>(Map.of("test.activator", this.getClass().getSimpleName(),
30 | "test.bundle", FrameworkUtil.getBundle(this.getClass()))));
31 | }
32 |
33 | @Override
34 | public void stop(BundleContext context) throws Exception
35 | {
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/java/org/apache/felix/atomos/tests/index/bundles/b2/ActivatorBundle2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.index.bundles.b2;
15 |
16 | import java.util.Hashtable;
17 | import java.util.Map;
18 |
19 | import org.osgi.framework.BundleActivator;
20 | import org.osgi.framework.BundleContext;
21 | import org.osgi.framework.FrameworkUtil;
22 |
23 | public class ActivatorBundle2 implements BundleActivator
24 | {
25 | @Override
26 | public void start(BundleContext context) throws Exception
27 | {
28 | context.registerService(BundleActivator.class, this,
29 | new Hashtable<>(Map.of("test.activator", this.getClass().getSimpleName(),
30 | "test.bundle", FrameworkUtil.getBundle(this.getClass()))));
31 | }
32 |
33 | @Override
34 | public void stop(BundleContext context) throws Exception
35 | {
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/java/org/apache/felix/atomos/tests/index/bundles/b3/ActivatorBundle3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.index.bundles.b3;
15 |
16 | import java.util.Hashtable;
17 | import java.util.Map;
18 |
19 | import org.osgi.framework.BundleActivator;
20 | import org.osgi.framework.BundleContext;
21 | import org.osgi.framework.FrameworkUtil;
22 |
23 | public class ActivatorBundle3 implements BundleActivator
24 | {
25 | @Override
26 | public void start(BundleContext context) throws Exception
27 | {
28 | context.registerService(BundleActivator.class, this,
29 | new Hashtable<>(Map.of("test.activator", this.getClass().getSimpleName(),
30 | "test.bundle", FrameworkUtil.getBundle(this.getClass()))));
31 | }
32 |
33 | @Override
34 | public void stop(BundleContext context) throws Exception
35 | {
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/java/org/apache/felix/atomos/tests/index/bundles/b4/ActivatorBundle4.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.index.bundles.b4;
15 |
16 | import java.util.Hashtable;
17 | import java.util.Map;
18 |
19 | import org.osgi.framework.BundleActivator;
20 | import org.osgi.framework.BundleContext;
21 | import org.osgi.framework.FrameworkUtil;
22 |
23 | public class ActivatorBundle4 implements BundleActivator
24 | {
25 | @Override
26 | public void start(BundleContext context) throws Exception
27 | {
28 | context.registerService(BundleActivator.class, this,
29 | new Hashtable<>(Map.of("test.activator", this.getClass().getSimpleName(),
30 | "test.bundle", FrameworkUtil.getBundle(this.getClass()))));
31 | }
32 |
33 | @Override
34 | public void stop(BundleContext context) throws Exception
35 | {
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/bundle.1-1.txt:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/bundle.1-2.txt:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/bundle.2-1.txt:
--------------------------------------------------------------------------------
1 | 2
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/bundle.2-2.txt:
--------------------------------------------------------------------------------
1 | 2
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/bundle.3-1.txt:
--------------------------------------------------------------------------------
1 | 3
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/bundle.3-2.txt:
--------------------------------------------------------------------------------
1 | 3
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/bundle.4-1.txt:
--------------------------------------------------------------------------------
1 | 4
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/bundle.4-2.txt:
--------------------------------------------------------------------------------
1 | 4
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/OSGI-INF/notFound.txt:
--------------------------------------------------------------------------------
1 | Should not be found by getEntry
2 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/1/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Bundle-ManifestVersion: 2
2 | Bundle-SymbolicName: bundle.1
3 | Bundle-Version: 1.0.0
4 | Bundle-Activator: org.apache.felix.atomos.tests.index.bundles.b1.ActivatorBundle1
5 |
6 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/1/OSGI-INF/common.txt:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/2/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Bundle-ManifestVersion: 2
2 | Bundle-SymbolicName: bundle.2
3 | Bundle-Version: 1.0.0
4 | Bundle-Activator: org.apache.felix.atomos.tests.index.bundles.b2.ActivatorBundle2
5 |
6 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/2/OSGI-INF/common.txt:
--------------------------------------------------------------------------------
1 | 2
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/3/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Bundle-ManifestVersion: 2
2 | Bundle-SymbolicName: bundle.3
3 | Bundle-Version: 1.0.0
4 | Bundle-Activator: org.apache.felix.atomos.tests.index.bundles.b3.ActivatorBundle3
5 |
6 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/3/OSGI-INF/common.txt:
--------------------------------------------------------------------------------
1 | 3
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/4/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Bundle-ManifestVersion: 2
2 | Bundle-SymbolicName: bundle.4
3 | Bundle-Version: 1.0.0
4 | Bundle-Activator: org.apache.felix.atomos.tests.index.bundles.b4.ActivatorBundle4
5 |
6 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/4/OSGI-INF/common.txt:
--------------------------------------------------------------------------------
1 | 4
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/atomos/bundles.index:
--------------------------------------------------------------------------------
1 | ATOMOS_BUNDLE
2 | 1
3 | bundle.1
4 | 1.0.0
5 | META-INF/
6 | META-INF/MANIFEST.MF
7 | OSGI-INF/
8 | OSGI-INF/common.txt
9 | OSGI-INF/bundle.1-1.txt
10 | OSGI-INF/bundle.1-2.txt
11 | org/
12 | org/apache/
13 | org/apache/felix/
14 | org/apache/felix/atomos/
15 | org/apache/felix/atomos/tests/
16 | org/apache/felix/atomos/tests/index/
17 | org/apache/felix/atomos/tests/index/bundles/
18 | org/apache/felix/atomos/tests/index/bundles/b1/
19 | org/apache/felix/atomos/tests/index/bundles/b1/ActivatorBundle1.class
20 | ATOMOS_BUNDLE
21 | 2
22 | bundle.2
23 | 1.0.0
24 | META-INF/
25 | META-INF/MANIFEST.MF
26 | OSGI-INF/
27 | OSGI-INF/common.txt
28 | OSGI-INF/bundle.2-1.txt
29 | OSGI-INF/bundle.2-2.txt
30 | org/
31 | org/apache/
32 | org/apache/felix/
33 | org/apache/felix/atomos/
34 | org/apache/felix/atomos/tests/
35 | org/apache/felix/atomos/tests/index/
36 | org/apache/felix/atomos/tests/index/bundles/
37 | org/apache/felix/atomos/tests/index/bundles/b2/
38 | org/apache/felix/atomos/tests/index/bundles/b2/ActivatorBundle2.class
39 | ATOMOS_BUNDLE
40 | 3
41 | bundle.3
42 | 1.0.0
43 | META-INF/
44 | META-INF/MANIFEST.MF
45 | OSGI-INF/
46 | OSGI-INF/common.txt
47 | OSGI-INF/bundle.3-1.txt
48 | OSGI-INF/bundle.3-2.txt
49 | org/
50 | org/apache/
51 | org/apache/felix/
52 | org/apache/felix/atomos/
53 | org/apache/felix/atomos/tests/
54 | org/apache/felix/atomos/tests/index/
55 | org/apache/felix/atomos/tests/index/bundles/
56 | org/apache/felix/atomos/tests/index/bundles/TestClass.class
57 | org/apache/felix/atomos/tests/index/bundles/b3/
58 | org/apache/felix/atomos/tests/index/bundles/b3/ActivatorBundle3.class
59 | ATOMOS_BUNDLE
60 | 4
61 | bundle.4
62 | 1.0.0
63 | META-INF/
64 | META-INF/MANIFEST.MF
65 | OSGI-INF/
66 | OSGI-INF/common.txt
67 | OSGI-INF/bundle.4-1.txt
68 | OSGI-INF/bundle.4-2.txt
69 | org/
70 | org/apache/
71 | org/apache/felix/
72 | org/apache/felix/atomos/
73 | org/apache/felix/atomos/tests/
74 | org/apache/felix/atomos/tests/index/
75 | org/apache/felix/atomos/tests/index/bundles/
76 | org/apache/felix/atomos/tests/index/bundles/b4/
77 | org/apache/felix/atomos/tests/index/bundles/b4/ActivatorBundle4.class
78 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/testIndex/3/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Bundle-ManifestVersion: 2
2 | Bundle-SymbolicName: bundle.3
3 | Bundle-Version: 1.0.0
4 | Bundle-Activator: org.apache.felix.atomos.tests.index.bundles.b3.ActivatorBundle3
5 |
6 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/testIndex/3/OSGI-INF/common.txt:
--------------------------------------------------------------------------------
1 | 3
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/testIndex/4/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Bundle-ManifestVersion: 2
2 | Bundle-SymbolicName: bundle.4
3 | Bundle-Version: 1.0.0
4 | Bundle-Activator: org.apache.felix.atomos.tests.index.bundles.b4.ActivatorBundle4
5 |
6 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/testIndex/4/OSGI-INF/common.txt:
--------------------------------------------------------------------------------
1 | 4
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.index.bundles/src/test/resources/testIndex/test.index:
--------------------------------------------------------------------------------
1 | ATOMOS_BUNDLE
2 | 3
3 | bundle.3
4 | 1.0.0
5 | META-INF/
6 | META-INF/MANIFEST.MF
7 | OSGI-INF/
8 | OSGI-INF/common.txt
9 | OSGI-INF/bundle.3-1.txt
10 | OSGI-INF/bundle.3-2.txt
11 | org/
12 | org/apache/
13 | org/apache/felix/
14 | org/apache/felix/atomos/
15 | org/apache/felix/atomos/tests/
16 | org/apache/felix/atomos/tests/index/
17 | org/apache/felix/atomos/tests/index/bundles/
18 | org/apache/felix/atomos/tests/index/bundles/TestClass.class
19 | org/apache/felix/atomos/tests/index/bundles/b3/
20 | org/apache/felix/atomos/tests/index/bundles/b3/ActivatorBundle3.class
21 | ATOMOS_BUNDLE
22 | 4
23 | bundle.4
24 | 1.0.0
25 | META-INF/
26 | META-INF/MANIFEST.MF
27 | OSGI-INF/
28 | OSGI-INF/common.txt
29 | OSGI-INF/bundle.4-1.txt
30 | OSGI-INF/bundle.4-2.txt
31 | org/
32 | org/apache/
33 | org/apache/felix/
34 | org/apache/felix/atomos/
35 | org/apache/felix/atomos/tests/
36 | org/apache/felix/atomos/tests/index/
37 | org/apache/felix/atomos/tests/index/bundles/
38 | org/apache/felix/atomos/tests/index/bundles/b4/
39 | org/apache/felix/atomos/tests/index/bundles/b4/ActivatorBundle4.class
40 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.modulepath.service/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License.
5 | * You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software
10 | * distributed under the License is distributed on an "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | * See the License for the specific language governing permissions and
13 | * limitations under the License.
14 | */
15 | import org.osgi.framework.connect.ConnectFrameworkFactory;
16 |
17 | module org.apache.felix.atomos.tests.modulepath.service
18 | {
19 | requires org.apache.felix.atomos;
20 | requires org.apache.felix.atomos.tests.testbundles.service.contract;
21 | requires org.apache.felix.atomos.tests.testbundles.service.impl;
22 | requires org.apache.felix.atomos.tests.testbundles.service.impl.activator;
23 | requires org.apache.felix.scr;
24 | requires osgi.promise;
25 |
26 | uses ConnectFrameworkFactory;
27 |
28 | opens org.apache.felix.atomos.tests.modulepath.service;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.modulepath.service/src/main/java/org/apache/felix/atomos/tests/modulepath/service/ModulepathLaunch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.modulepath.service;
15 |
16 | public class ModulepathLaunch
17 | {
18 | // Do nothing class only to make a module our tests can use
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependency.a/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | module org.apache.felix.atomos.tests.testbundles.dependency.a
15 | {
16 | requires static osgi.annotation;
17 |
18 | exports org.apache.felix.atomos.tests.testbundles.dependency.a;
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependency.a/src/main/java/org/apache/felix/atomos/tests/testbundles/dependency/a/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.dependency.a;
15 |
16 | public class A
17 | {
18 | public void doSomething(String msg)
19 | {
20 | System.out.println("Doing something: " + msg);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependency.a/src/main/java/org/apache/felix/atomos/tests/testbundles/dependency/a/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | package org.apache.felix.atomos.tests.testbundles.dependency.a;
17 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependency.b/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | module org.apache.felix.atomos.tests.testbundles.dependency.b
15 | {
16 | requires static osgi.annotation;
17 |
18 | exports org.apache.felix.atomos.tests.testbundles.dependency.b;
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependency.b/src/main/java/org/apache/felix/atomos/tests/testbundles/dependency/b/B.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.dependency.b;
15 |
16 | public class B
17 | {
18 | public void doSomething(String msg)
19 | {
20 | System.out.println("Doing something: " + msg);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependency.b/src/main/java/org/apache/felix/atomos/tests/testbundles/dependency/b/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | package org.apache.felix.atomos.tests.testbundles.dependency.b;
17 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependent.x/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.dependent.x
15 | {
16 | requires static osgi.annotation;
17 | requires osgi.core;
18 | requires org.apache.felix.atomos.tests.testbundles.dependency.a;
19 | requires org.apache.felix.atomos.tests.testbundles.dependency.b;
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependent.x/src/main/java/org/apache/felix/atomos/tests/testbundles/dependent/x/Activator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.dependent.x;
15 |
16 | import org.osgi.framework.BundleActivator;
17 | import org.osgi.framework.BundleContext;
18 | import org.osgi.framework.Constants;
19 |
20 | @org.osgi.annotation.bundle.Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")
21 | public class Activator implements BundleActivator
22 | {
23 |
24 |
25 | @Override
26 | public void start(BundleContext bc) throws Exception
27 | {
28 | new X().doSomething(bc.getBundle().toString());
29 | }
30 |
31 | @Override
32 | public void stop(BundleContext bc) throws Exception
33 | {
34 | new X().doSomething(bc.getBundle().toString());
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.dependent.x/src/main/java/org/apache/felix/atomos/tests/testbundles/dependent/x/X.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.dependent.x;
15 |
16 | import org.apache.felix.atomos.tests.testbundles.dependency.a.A;
17 | import org.apache.felix.atomos.tests.testbundles.dependency.b.B;
18 |
19 | public class X
20 | {
21 | void doSomething(String msg)
22 | {
23 | System.out.println("Doing something: " + msg);
24 | new A().doSomething(msg);
25 | new B().doSomething(msg);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.reflect.command/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.reflect.command
15 | {
16 | exports org.apache.felix.atomos.tests.testbundles.reflect.command;
17 | requires org.osgi.service.component.annotations;
18 | }
19 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.reflect.command/src/main/java/org/apache/felix/atomos/tests/testbundles/reflect/command/A.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.reflect.command;
15 |
16 |
17 | public class A
18 | {
19 | public String a;
20 | }
21 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.reflect.command/src/main/java/org/apache/felix/atomos/tests/testbundles/reflect/command/AbstractCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.reflect.command;
15 |
16 | public class AbstractCmd
17 | {
18 | public String multiple()
19 | {
20 | return "abstractmultiple";
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.reflect.command/src/main/java/org/apache/felix/atomos/tests/testbundles/reflect/command/CmdExample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.apache.felix.atomos.tests.testbundles.reflect.command;
16 |
17 | import org.osgi.service.component.annotations.Component;
18 |
19 | @Component(immediate = true, service = CmdExample.class)
20 | @CommandScope("reflect-test")
21 | @CommandFunction(value = { "a", "single", "multiple" })
22 | public class CmdExample extends AbstractCmd
23 | {
24 |
25 | public String single()
26 | {
27 | return "single";
28 | }
29 |
30 | public String multiple(String s)
31 | {
32 | return "multiple" + s;
33 | }
34 |
35 | public String multiple(String s, boolean b)
36 | {
37 | return "multiple" + s + b;
38 | }
39 |
40 | public A a()
41 | {
42 | A a = new A();
43 | a.a = "a";
44 | return a;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.reflect.command/src/main/java/org/apache/felix/atomos/tests/testbundles/reflect/command/CommandFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.apache.felix.atomos.tests.testbundles.reflect.command;
16 |
17 | import org.osgi.service.component.annotations.ComponentPropertyType;
18 |
19 |
20 | /**
21 | * The Interface CommandFunction.
22 | */
23 | @ComponentPropertyType
24 | public @interface CommandFunction {
25 |
26 | /** The Constant PREFIX_. */
27 | public static final String PREFIX_ = "osgi.";
28 |
29 | /**
30 | * Value.
31 | *
32 | * @return the string[]
33 | */
34 | public String[] value();
35 | }
36 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.reflect.command/src/main/java/org/apache/felix/atomos/tests/testbundles/reflect/command/CommandScope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.reflect.command;
15 |
16 | import org.osgi.service.component.annotations.ComponentPropertyType;
17 |
18 |
19 | /**
20 | * The Interface CommandScope.
21 | */
22 | @ComponentPropertyType
23 | public @interface CommandScope {
24 |
25 | /** The Constant PREFIX_. */
26 | public static final String PREFIX_ = "osgi.";
27 |
28 | /**
29 | * Value.
30 | *
31 | * @return the string
32 | */
33 | public String value();
34 | }
35 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.reflect.dto/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.reflect.command
15 | {
16 | exports org.apache.felix.atomos.tests.testbundles.reflect.command;
17 | requires org.osgi.dto;
18 | }
19 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.reflect.dto/src/main/java/org/apache/felix/atomos/tests/testbundles/reflect/command/OneDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.reflect.command;
15 |
16 | import org.osgi.dto.DTO;
17 |
18 | public class OneDTO extends DTO
19 | {
20 | public String one;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.resources.a/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.resource.a
15 | {
16 | exports org.apache.felix.atomos.tests.testbundles.resource.a;
17 | }
18 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.resources.a/src/main/java/org/apache/felix/atomos/tests/testbundles/resource/a/Clazz.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.apache.felix.atomos.tests.testbundles.resource.a;
16 |
17 | public class Clazz
18 | {
19 | // empty test resource
20 | }
21 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.resources.a/src/main/resources/META-TEXT/file.txt:
--------------------------------------------------------------------------------
1 | /META-TEXT/file.txt
2 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.resources.a/src/main/resources/file.txt:
--------------------------------------------------------------------------------
1 | /file.txt
2 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.resources.a/src/main/resources/org/apache/felix/atomos/tests/testbundles/resource/a/file.txt:
--------------------------------------------------------------------------------
1 | /org/atomos/tests/testbundles/resource/a/file.txt
2 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.contract/bnd.bnd:
--------------------------------------------------------------------------------
1 | Bundle-SymbolicName: atomos.service.contract
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.contract/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | module org.apache.felix.atomos.tests.testbundles.service.contract
15 | {
16 | requires static osgi.annotation;
17 |
18 | exports org.apache.felix.atomos.tests.testbundles.service.contract;
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.contract/src/main/java/org/apache/felix/atomos/tests/testbundles/service/contract/Echo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.contract;
15 |
16 | public interface Echo
17 | {
18 | String echo(String msg);
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.contract/src/main/java/org/apache/felix/atomos/tests/testbundles/service/contract/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | @org.osgi.annotation.bundle.Requirement(namespace = "osgi.ee", filter = "(&(osgi.ee=JavaSE)(version=1.8))")
17 | package org.apache.felix.atomos.tests.testbundles.service.contract;
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl.a/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.service.impl.a
15 | {
16 | requires transitive org.apache.felix.atomos.tests.testbundles.service.contract;
17 | requires static org.osgi.service.component.annotations;
18 | }
19 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl.a/src/main/java/org/apache/felix/atomos/tests/testbundles/service/impl/a/EchoImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.impl.a;
15 |
16 | import org.apache.felix.atomos.tests.testbundles.service.contract.Echo;
17 | import org.osgi.service.component.annotations.Component;
18 |
19 | @Component(property = { "type=impl.a.component" })
20 | public class EchoImpl implements Echo
21 | {
22 |
23 | @Override
24 | public String echo(String msg)
25 | {
26 | return "impl.a.component " + msg;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl.activator/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.service.impl.activator
15 | {
16 | requires transitive org.apache.felix.atomos.tests.testbundles.service.contract;
17 | requires osgi.core;
18 | requires static osgi.annotation;
19 | }
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl.activator/src/main/java/org/apache/felix/atomos/tests/testbundles/service/impl/activator/Activator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.impl.activator;
15 |
16 | import java.util.Hashtable;
17 |
18 | import org.apache.felix.atomos.tests.testbundles.service.contract.Echo;
19 | import org.osgi.framework.BundleActivator;
20 | import org.osgi.framework.BundleContext;
21 | import org.osgi.framework.Constants;
22 |
23 | @org.osgi.annotation.bundle.Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")
24 | @org.osgi.annotation.bundle.Requirement(namespace = "osgi.ee", filter = "(&(osgi.ee=JavaSE)(version=1.8))")
25 | public class Activator implements BundleActivator
26 | {
27 |
28 | @Override
29 | public void start(BundleContext context) throws Exception
30 | {
31 | Echo impl = new ActivatorEcho();
32 |
33 | Hashtable ht = new Hashtable<>();
34 | ht.put("type", "impl.activator");
35 | ht.put("osgi.command.scope", "echo");
36 | ht.put("osgi.command.function", new String[] { "echo" });
37 |
38 | context.registerService(Echo.class, impl, ht);
39 | System.out.println("Registered Echo service from activator.");
40 | }
41 |
42 | @Override
43 | public void stop(BundleContext context) throws Exception
44 | {
45 | // Do nothing; unregistration happens automatically
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl.activator/src/main/java/org/apache/felix/atomos/tests/testbundles/service/impl/activator/ActivatorEcho.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.impl.activator;
15 |
16 | import org.apache.felix.atomos.tests.testbundles.service.contract.Echo;
17 |
18 | public class ActivatorEcho implements Echo
19 | {
20 |
21 | @Override
22 | public String echo(String msg)
23 | {
24 | return "impl.activator " + msg;
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl.b/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.service.impl.b
15 | {
16 | requires transitive org.apache.felix.atomos.tests.testbundles.service.contract;
17 | requires static org.osgi.service.component.annotations;
18 | }
19 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl.b/src/main/java/org/apache/felix/atomos/tests/testbundles/service/impl/b/EchoImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.impl.b;
15 |
16 | import org.apache.felix.atomos.tests.testbundles.service.contract.Echo;
17 | import org.osgi.service.component.annotations.Component;
18 |
19 | @Component(property = { "type=impl.b.component" })
20 | public class EchoImpl implements Echo
21 | {
22 |
23 | @Override
24 | public String echo(String msg)
25 | {
26 | return "impl.b.component " + msg;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.service.impl
15 | {
16 | requires transitive org.apache.felix.atomos.tests.testbundles.service.contract;
17 | requires static org.osgi.service.component.annotations;
18 | }
19 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.impl/src/main/java/org/apache/felix/atomos/tests/testbundles/service/impl/EchoImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.impl;
15 |
16 | import org.apache.felix.atomos.tests.testbundles.service.contract.Echo;
17 | import org.osgi.service.component.annotations.Activate;
18 | import org.osgi.service.component.annotations.Component;
19 |
20 | @Component(property = { "type=impl.component" }, immediate = true)
21 | @org.osgi.annotation.bundle.Requirement(namespace = "osgi.ee", filter = "(&(osgi.ee=JavaSE)(version=1.8))")
22 | public class EchoImpl implements Echo
23 | {
24 |
25 | @Activate
26 | public void activate()
27 | {
28 | System.out.println("Activated: " + getClass().getName());
29 | }
30 |
31 | @Override
32 | public String echo(String msg)
33 | {
34 | return "impl.component " + msg;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.library/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | module org.apache.felix.atomos.tests.testbundles.service.library
15 | {
16 | requires static osgi.annotation;
17 |
18 | exports org.apache.felix.atomos.tests.testbundles.service.library;
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.library/src/main/java/org/apache/felix/atomos/tests/testbundles/service/library/SomeUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.library;
15 |
16 | public class SomeUtil
17 | {
18 | void doSomething(String msg)
19 | {
20 | System.out.println("Doing something: " + msg);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.library/src/main/java/org/apache/felix/atomos/tests/testbundles/service/library/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | package org.apache.felix.atomos.tests.testbundles.service.library;
17 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.user/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | open module org.apache.felix.atomos.tests.testbundles.service.user
15 | {
16 | requires org.apache.felix.atomos.tests.testbundles.service.contract;
17 | requires static org.osgi.service.component.annotations;
18 | requires static osgi.annotation;
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.user/src/main/java/org/apache/felix/atomos/tests/testbundles/service/user/EchoUser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.user;
15 |
16 | import org.apache.felix.atomos.tests.testbundles.service.contract.Echo;
17 | import org.osgi.annotation.bundle.Requirement;
18 | import org.osgi.service.component.annotations.Activate;
19 | import org.osgi.service.component.annotations.Component;
20 | import org.osgi.service.component.annotations.Reference;
21 |
22 | @Component(service = EchoUser.class, property = {
23 | "echo.reference:Boolean=true" }, immediate = true)
24 | @Requirement(namespace = "osgi.ee", filter = "(&(osgi.ee=JavaSE)(version=1.8))")
25 | public class EchoUser
26 | {
27 | @Activate
28 | public void activate()
29 | {
30 | System.out.println("Activated: " + getClass().getName());
31 | }
32 |
33 | @Reference
34 | protected void setEcho(Echo echo)
35 | {
36 | System.out.println("Echo service found: " + echo.echo("hello"));
37 | }
38 |
39 | protected void unsetEcho(Echo echo)
40 | {
41 | System.out.println("Echo service unset: " + echo.echo("goodbye"));
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/atomos.tests/atomos.tests.testbundles/atomos.tests.testbundles.service.user/src/main/java/org/apache/felix/atomos/tests/testbundles/service/user/EchoUser2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.tests.testbundles.service.user;
15 |
16 | import java.util.Map;
17 |
18 | import org.apache.felix.atomos.tests.testbundles.service.contract.Echo;
19 | import org.osgi.annotation.bundle.Requirement;
20 | import org.osgi.service.component.annotations.Activate;
21 | import org.osgi.service.component.annotations.Component;
22 | import org.osgi.service.component.annotations.Reference;
23 |
24 | @Component(service = EchoUser2.class, property = {
25 | "echo.reference:Boolean=true" }, immediate = true)
26 | @Requirement(namespace = "osgi.ee", filter = "(&(osgi.ee=JavaSE)(version=1.8))")
27 | public class EchoUser2
28 | {
29 | @Activate
30 | public EchoUser2(Map componentProps, @Reference Echo echo)
31 | {
32 | System.out.println("Activated via constructor: " + getClass().getName());
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/atomos.tests/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 | 4.0.0
23 |
24 | org.apache.felix
25 | atomos-parent
26 | 1.0.1-SNAPSHOT
27 | ../atomos-parent/pom.xml
28 |
29 | pom
30 | org.apache.felix.atomos.tests
31 | org.apache.felix.atomos.tests
32 | atomos.tests
33 |
34 | true
35 | true
36 |
37 |
38 | atomos.tests.testbundles
39 | atomos.tests.modulepath.service
40 | atomos.tests.classpath.service
41 | atomos.tests.index.bundles
42 |
43 |
44 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/Config.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api;
15 |
16 | public interface Config
17 | {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/FileCollectionContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api;
15 |
16 | public interface FileCollectionContext extends Context
17 | {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/FileType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api;
15 |
16 | public enum FileType
17 | {
18 | ARTIFACT, CONFIG, RESSOURCE, NATIVE_IMAGE_BINARY, INDEX_JAR, INDEX_DIR
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/IndexInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api;
15 |
16 | import java.nio.file.Path;
17 | import java.util.List;
18 |
19 | public interface IndexInfo
20 | {
21 | String getBundleSymbolicName();
22 |
23 | List getFiles();
24 |
25 | String getId();
26 |
27 | Path getOut();
28 |
29 | Path getPath();
30 |
31 | String getVersion();
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/Launcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api;
15 |
16 | import java.util.Optional;
17 | import java.util.ServiceLoader;
18 |
19 | import aQute.bnd.annotation.spi.ServiceConsumer;
20 |
21 | @ServiceConsumer(LauncherBuilder.class)
22 | public interface Launcher
23 | {
24 | String SYS_PROP_PLUGINS = "org.apache.felix.atomos.substrate.plugins";
25 | String SYS_PROP_SEPARATOR = ";";
26 |
27 | static LauncherBuilder builder()
28 | {
29 | final Optional oLauncherBuilder = ServiceLoader.load(
30 | LauncherBuilder.class).findFirst();
31 |
32 | if (oLauncherBuilder.isPresent())
33 | {
34 | return oLauncherBuilder.get();
35 | }
36 |
37 | LauncherBuilder launcherBuilder = ServiceLoader.load(
38 | Launcher.class.getModule().getLayer(),
39 | LauncherBuilder.class).findFirst().orElseThrow(
40 | () -> new RuntimeException(
41 | String.format("ServiceLoader could not find found: %s",
42 | LauncherBuilder.class.getName())));
43 |
44 | return launcherBuilder;
45 |
46 | }
47 |
48 | Context execute();
49 |
50 | Context execute(Context context);
51 | }
52 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/LauncherBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api;
15 |
16 | import java.util.Map;
17 |
18 | import org.apache.felix.atomos.utils.api.plugin.SubstratePlugin;
19 |
20 | public interface LauncherBuilder
21 | {
22 |
23 | LauncherBuilder addPlugin(Class extends SubstratePlugin>> pluginClasses,
24 | Map cfgMap);
25 |
26 | LauncherBuilder addPlugin(Class extends SubstratePlugin> pluginClasses,
27 | C cfg);
28 |
29 | LauncherBuilder addPlugin(String pluginClassNames, Map cfgMap);
30 |
31 | LauncherBuilder addPlugin(SubstratePlugin pluginClasses, C cfg);
32 |
33 | Launcher build();
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/PluginConfigBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api;
15 |
16 | import java.nio.file.Path;
17 |
18 | public interface PluginConfigBase
19 | {
20 | Path outputDirectory();
21 | }
22 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/RegisterServiceCall.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api;
15 |
16 | import java.util.Map;
17 |
18 | public interface RegisterServiceCall
19 | {
20 |
21 | String[] classes();
22 |
23 | Map config();
24 |
25 | Object service();
26 | }
27 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | @aQute.bnd.annotation.licenses.Apache_2_0
17 |
18 | package org.apache.felix.atomos.utils.api;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/BundleActivatorPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import org.apache.felix.atomos.utils.api.Context;
17 |
18 | public interface BundleActivatorPlugin extends SubstratePlugin
19 | {
20 |
21 | void doBundleActivator(Class> bundleActivatorClass, Context context,
22 | ClassLoader classLoader);
23 | }
24 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/ClassPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import org.apache.felix.atomos.utils.api.Context;
17 |
18 | public interface ClassPlugin extends SubstratePlugin
19 | {
20 |
21 | void doClass(Class> clazz, Context context);
22 | }
23 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/ComponentDescription.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import java.util.List;
17 | import java.util.Map;
18 |
19 | public interface ComponentDescription
20 | {
21 |
22 | String activate();
23 |
24 | List activationFields();
25 |
26 | List configurationPid();
27 |
28 | String configurationPolicy();
29 |
30 | String deactivate();
31 |
32 | boolean defaultEnabled();
33 |
34 | String factory();
35 |
36 | Map factoryProperties();
37 |
38 | boolean immediate();
39 |
40 | String implementationClass();
41 |
42 | String modified();
43 |
44 | String name();
45 |
46 | int numberOfConstructorParameters();
47 |
48 | Map properties();
49 |
50 | List references();
51 |
52 | String scope();
53 |
54 | String[] serviceInterfaces();
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/ComponentMetaDataPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import org.apache.felix.atomos.utils.api.Context;
17 |
18 | public interface ComponentMetaDataPlugin extends SubstratePlugin
19 | {
20 |
21 | void doComponentMetaData(ComponentDescription c, Context context,
22 | ClassLoader classLoader);
23 | }
24 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/FileCollectorPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import org.apache.felix.atomos.utils.api.Context;
17 |
18 | public interface FileCollectorPlugin extends SubstratePlugin
19 | {
20 | void collectFiles(Context context);
21 | }
22 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/FileHandlerPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import java.nio.file.Path;
17 |
18 | import org.apache.felix.atomos.utils.api.FileType;
19 | import org.apache.felix.atomos.utils.api.Context;
20 |
21 | public interface FileHandlerPlugin extends SubstratePlugin
22 | {
23 | void handleFile(Context context, Path path, FileType type);
24 | }
25 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/FinalPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import org.apache.felix.atomos.utils.api.Context;
17 |
18 | public interface FinalPlugin extends SubstratePlugin
19 | {
20 |
21 | void doFinal(Context context);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/JarPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import java.net.URLClassLoader;
17 | import java.util.jar.JarFile;
18 |
19 | import org.apache.felix.atomos.utils.api.Context;
20 |
21 | public interface JarPlugin extends SubstratePlugin
22 | {
23 |
24 | default void initJar(JarFile jar, Context context, URLClassLoader classLoader)
25 | {
26 | }
27 |
28 | void doJar(JarFile jar, Context context, URLClassLoader classLoader);
29 |
30 | default void postJars(Context context)
31 | {
32 | }
33 |
34 | default void preJars(Context context)
35 | {
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/MethodPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import java.lang.reflect.Method;
17 |
18 | import org.apache.felix.atomos.utils.api.Context;
19 |
20 | public interface MethodPlugin extends SubstratePlugin
21 | {
22 |
23 | void doMethod(Method method, Context context);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/ReferenceDescription.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License")();
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | public interface ReferenceDescription
17 | {
18 |
19 | String bind();
20 |
21 | String cardinality();
22 |
23 | String collectionType();
24 |
25 | String field();
26 |
27 | String fieldOption();
28 |
29 | String interfaceName();
30 |
31 | String name();
32 |
33 | Integer parameter();
34 |
35 | String policy();
36 |
37 | String policyOption();
38 |
39 | String scope();
40 |
41 | String target();
42 |
43 | String unbind();
44 |
45 | String updated();
46 | }
47 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/RegisterServicepPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | import org.apache.felix.atomos.utils.api.RegisterServiceCall;
17 | import org.apache.felix.atomos.utils.api.Context;
18 |
19 | public interface RegisterServicepPlugin extends SubstratePlugin
20 | {
21 |
22 | void doRegisterServiceCall(RegisterServiceCall registerServiceCall,
23 | Context context, ClassLoader classLoader);
24 | }
25 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/SubstratePlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.api.plugin;
15 |
16 | public interface SubstratePlugin
17 | {
18 |
19 | int DEFAULT_PLUGN_RANKING = 0;
20 |
21 | void init(T config);
22 |
23 | default int ranking(Class extends SubstratePlugin>> clazz)
24 | {
25 | return DEFAULT_PLUGN_RANKING;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/main/java/org/apache/felix/atomos/utils/api/plugin/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | @aQute.bnd.annotation.licenses.Apache_2_0
17 |
18 | package org.apache.felix.atomos.utils.api.plugin;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.api/src/test/java/org/apache/felix/atomos/utils/LauncherTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils;
15 |
16 | import static org.junit.jupiter.api.Assertions.assertThrows;
17 |
18 | import org.apache.felix.atomos.utils.api.Launcher;
19 | import org.junit.jupiter.api.Test;
20 |
21 | public class LauncherTest
22 | {
23 | @Test
24 | void testName() throws Exception
25 | {
26 | assertThrows(RuntimeException.class, () -> Launcher.builder());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/plugins/OsgiDTOPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core.plugins;
15 |
16 | import java.lang.reflect.Field;
17 |
18 | import org.apache.felix.atomos.utils.api.Config;
19 | import org.apache.felix.atomos.utils.api.Context;
20 | import org.apache.felix.atomos.utils.api.plugin.ClassPlugin;
21 |
22 | public class OsgiDTOPlugin implements ClassPlugin
23 | {
24 |
25 | @Override
26 | public void doClass(Class> clazz, Context context)
27 | {
28 | boolean isDTO = false;
29 | Class> c = clazz;
30 | while (c != null && c != Object.class)
31 | {
32 | if ("org.osgi.dto.DTO".equals(c.getName()))
33 | {
34 | isDTO = true;
35 | break;
36 | }
37 | c = c.getSuperclass();
38 | }
39 |
40 | if (isDTO)
41 | {
42 | for (Field field : clazz.getFields())
43 | {
44 | context.addReflectionField(field.getName(), clazz);
45 | }
46 | }
47 | }
48 |
49 | @Override
50 | public void init(Config config)
51 | {
52 |
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/plugins/activator/ReflectionBundleActivatorPlugin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core.plugins.activator;
15 |
16 | import org.apache.felix.atomos.utils.api.Config;
17 | import org.apache.felix.atomos.utils.api.Context;
18 | import org.apache.felix.atomos.utils.api.plugin.BundleActivatorPlugin;
19 |
20 | public class ReflectionBundleActivatorPlugin implements BundleActivatorPlugin
21 | {
22 |
23 | @Override
24 | public void doBundleActivator(Class> bundleActivatorClass, Context context,
25 | ClassLoader classLoader)
26 | {
27 |
28 | try
29 | {
30 | Class> bundleContextClass = classLoader.loadClass(
31 | "org.osgi.framework.BundleContext");
32 | context.addReflectionConstructor(bundleActivatorClass, new Class[] {});
33 |
34 | context.addReflecionMethod("start", new Class[] { bundleContextClass },
35 | bundleActivatorClass);
36 | context.addReflecionMethod("stop", new Class[] { bundleContextClass },
37 | bundleActivatorClass);
38 | }
39 | catch (ClassNotFoundException e)
40 | {
41 | e.printStackTrace();
42 | }
43 |
44 | }
45 |
46 | @Override
47 | public void init(Config config)
48 | {
49 |
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/plugins/collector/PathCollectorPluginConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core.plugins.collector;
15 |
16 | import java.nio.file.Path;
17 | import java.util.List;
18 |
19 | import org.apache.felix.atomos.utils.api.FileType;
20 |
21 | public interface PathCollectorPluginConfig
22 | {
23 | FileType fileType();
24 |
25 | List filters();
26 |
27 | List paths();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/plugins/finaliser/ni/NativeImageBuilderConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core.plugins.finaliser.ni;
15 |
16 | import java.nio.file.Path;
17 | import java.util.List;
18 | import java.util.Map;
19 |
20 | public interface NativeImageBuilderConfig
21 | {
22 | List nativeImageAdditionalInitializeAtBuildTime();
23 |
24 | String nativeImageApplicationName();
25 |
26 | Path nativeImageExecutable();
27 |
28 | String nativeImageMainClass();
29 |
30 | Path nativeImageOutputDirectory();
31 |
32 | List nativeImageVmFlags();
33 |
34 | Map nativeImageVmSystemProperties();
35 |
36 | Boolean noFallback();
37 |
38 |
39 | List dynamicProxyConfigurationFiles();
40 |
41 | List reflectionConfigurationFiles();
42 |
43 | List resourceConfigurationFiles();
44 | }
45 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/plugins/finaliser/shade/ShadeConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core.plugins.finaliser.shade;
15 |
16 | import java.nio.file.Path;
17 |
18 | public interface ShadeConfig
19 | {
20 |
21 | /**
22 | * @return
23 | */
24 | Path shadeOutputDirectory();
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/plugins/index/IndexOutputType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core.plugins.index;
15 |
16 | public enum IndexOutputType
17 | {
18 | JAR, DIRECTORY
19 | }
20 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/plugins/index/IndexPluginConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core.plugins.index;
15 |
16 | import java.nio.file.Path;
17 |
18 | public interface IndexPluginConfig
19 | {
20 |
21 | Path indexOutputDirectory();
22 |
23 | default IndexOutputType indexOutputType()
24 | {
25 | return IndexOutputType.JAR;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/scr/mock/EmptyBundeLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core.scr.mock;
15 |
16 | import org.apache.felix.scr.impl.logger.BundleLogger;
17 | import org.apache.felix.scr.impl.logger.ComponentLogger;
18 | import org.osgi.framework.Bundle;
19 |
20 | public class EmptyBundeLogger implements BundleLogger, ComponentLogger
21 | {
22 |
23 | @Override
24 | public void log(Level level, String message, Throwable ex)
25 | {
26 | }
27 |
28 | @Override
29 | public void log(Level level, String message, Throwable ex, Object... args)
30 | {
31 | }
32 |
33 | @Override
34 | public boolean isLogEnabled(Level level)
35 | {
36 | return false;
37 | }
38 |
39 | @Override
40 | public ComponentLogger component(Bundle m_bundle, String implementationClassName,
41 | String name)
42 | {
43 | return this;
44 | }
45 |
46 | @Override
47 | public void setComponentId(long m_componentId)
48 | {
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/main/java/org/apache/felix/atomos/utils/core/scr/mock/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.versioning.Version("1.0.0")
15 | @org.osgi.annotation.bundle.Export
16 | package org.apache.felix.atomos.utils.core.scr.mock;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/test/java/org/apache/felix/atomos/utils/core/FullTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core;
15 |
16 | import static org.apache.felix.atomos.utils.core.TestConstants.DEP_ATOMOS_TESTS_TESTBUNDLES_SERVICE_CONTRACT;
17 | import static org.apache.felix.atomos.utils.core.TestConstants.DEP_ATOMOS_TESTS_TESTBUNDLES_SERVICE_IMPL;
18 |
19 | import java.nio.file.Path;
20 | import java.util.List;
21 |
22 | import org.apache.felix.atomos.utils.substrate.api.reflect.ReflectionConfiguration;
23 | import org.junit.jupiter.api.Test;
24 | import org.junit.jupiter.api.io.TempDir;
25 |
26 | public class FullTest extends TestBase
27 | {
28 |
29 | @Test
30 | void testDirectoryFileCollectorPlugin(@TempDir Path tempDir) throws Exception
31 | {
32 |
33 | List paths = TestConstants.getDependencys(
34 | DEP_ATOMOS_TESTS_TESTBUNDLES_SERVICE_CONTRACT,
35 | DEP_ATOMOS_TESTS_TESTBUNDLES_SERVICE_IMPL);
36 |
37 | ContextImpl context = launch(paths, tempDir);
38 |
39 | ReflectionConfiguration rcs = context.getReflectConfig();
40 | // assertThat(testP).containsExactlyInAnyOrder(paths.toArray(Path[]::new));
41 | System.out.println(context);
42 | }
43 |
44 | }
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.core/src/test/java/org/apache/felix/atomos/utils/core/MojoTestExperiments.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.core;
15 |
16 | import static org.apache.felix.atomos.utils.core.TestConstants.DEP_FELIX_HTTP_SERVLET_API;
17 | import static org.apache.felix.atomos.utils.core.TestConstants.DEP_FELIX_WEBCONSOLE;
18 | import static org.apache.felix.atomos.utils.core.TestConstants.DEP_ORG_OSGI_FRAMEWORK;
19 | import static org.apache.felix.atomos.utils.core.TestConstants.DEP_ORG_OSGI_SERVICE_HTTP;
20 | import static org.apache.felix.atomos.utils.core.TestConstants.DEP_ORG_OSGI_SERVICE_LOG;
21 | import static org.apache.felix.atomos.utils.core.TestConstants.getDependencys;
22 |
23 | import java.nio.file.Path;
24 | import java.util.List;
25 |
26 | import org.junit.jupiter.api.Test;
27 | import org.junit.jupiter.api.io.TempDir;
28 |
29 | public class MojoTestExperiments extends TestBase
30 | {
31 |
32 | @Test
33 | void testReflectBundleActivatorMagicTests(@TempDir Path tempDir) throws Exception
34 | {
35 | List paths = getDependencys(DEP_FELIX_WEBCONSOLE, DEP_ORG_OSGI_SERVICE_LOG,
36 | // DEP_FELIX_GOGO_RUNTIME, DEP_FELIX_GOGO_COMMAND, DEP_FELIX_SCR,
37 | DEP_ORG_OSGI_FRAMEWORK, DEP_FELIX_HTTP_SERVLET_API,
38 | DEP_ORG_OSGI_SERVICE_HTTP);
39 |
40 | // List rcs = ReflectConfigUtil.reflectConfig(paths);
41 |
42 | // System.out.println(ReflectConfigUtil.json(rcs));
43 |
44 | }
45 |
46 | }
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/NativeImageArguments.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api;
15 |
16 | import java.util.List;
17 | import java.util.Optional;
18 | import java.util.ServiceLoader;
19 |
20 | import aQute.bnd.annotation.spi.ServiceConsumer;
21 |
22 | @ServiceConsumer(value = NativeImageArgumentsBuilder.class)
23 | public interface NativeImageArguments
24 | {
25 |
26 | static NativeImageArgumentsBuilder builder()
27 | {
28 | final Optional oargsBuilder = ServiceLoader.load(
29 | NativeImageArgumentsBuilder.class).findFirst();
30 |
31 | if (oargsBuilder.isPresent())
32 | {
33 | return oargsBuilder.get();
34 | }
35 | final NativeImageArgumentsBuilder argsBuilder = ServiceLoader.load(
36 | NativeImageArguments.class.getModule().getLayer(),
37 | NativeImageArgumentsBuilder.class).findFirst().orElseThrow(
38 | () -> new RuntimeException(
39 | String.format("ServiceLoader could not find found: %s",
40 | NativeImageArgumentsBuilder.class.getName())));
41 | return argsBuilder;
42 | }
43 |
44 | List arguments();
45 |
46 | String name();
47 | }
48 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/NativeImageCliBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api;
15 |
16 | import java.nio.file.Path;
17 | import java.util.Optional;
18 |
19 | public interface NativeImageCliBuilder
20 | {
21 | Optional findNativeImageExecutable();
22 |
23 | Optional findNativeImageExecutable(Path exec);
24 |
25 | Optional fromExecutable(Path path);
26 | }
27 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/dynproxy/DynamicProxyConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api.dynproxy;
15 |
16 | import java.util.Set;
17 |
18 | public interface DynamicProxyConfiguration
19 | {
20 |
21 | Set> getItems();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/dynproxy/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | package org.apache.felix.atomos.utils.substrate.api.dynproxy;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | @aQute.bnd.annotation.licenses.Apache_2_0
17 |
18 | package org.apache.felix.atomos.utils.substrate.api;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/reflect/ReflectionClassConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api.reflect;
15 |
16 | import java.util.Set;
17 |
18 | public interface ReflectionClassConfig
19 | {
20 |
21 | String getClassName();
22 |
23 | Set getConstructors();
24 |
25 | Set getFields();
26 |
27 | Set getMethods();
28 |
29 | boolean isAllPublicConstructors();
30 |
31 | boolean isAllPublicFields();
32 |
33 | boolean isAllPublicMethods();
34 | }
35 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/reflect/ReflectionConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api.reflect;
15 |
16 | import java.util.List;
17 |
18 | public interface ReflectionConfiguration
19 | {
20 |
21 | List getClassConfigs();
22 | }
23 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/reflect/ReflectionConstructorConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api.reflect;
15 |
16 | public interface ReflectionConstructorConfig
17 | {
18 |
19 | String[] getMethodParameterTypes();
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/reflect/ReflectionFieldConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api.reflect;
15 |
16 | public interface ReflectionFieldConfig
17 | {
18 |
19 | String getFieldName();
20 | }
21 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/reflect/ReflectionMethodConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api.reflect;
15 |
16 | public interface ReflectionMethodConfig extends ReflectionConstructorConfig
17 | {
18 |
19 | String getName();
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/reflect/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | package org.apache.felix.atomos.utils.substrate.api.reflect;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/resource/ResourceConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.api.resource;
15 |
16 | import java.util.List;
17 |
18 | public interface ResourceConfiguration
19 | {
20 |
21 | List getResourceBundles();
22 |
23 | List getResourcePackages();
24 |
25 | List getResourcePatterns();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.api/src/main/java/org/apache/felix/atomos/utils/substrate/api/resource/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | package org.apache.felix.atomos.utils.substrate.api.resource;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/NativeImageCliBuilderImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.impl;
15 |
16 | import java.nio.file.Path;
17 | import java.util.Optional;
18 |
19 | import org.apache.felix.atomos.utils.substrate.api.NativeImageCli;
20 | import org.apache.felix.atomos.utils.substrate.api.NativeImageCliBuilder;
21 |
22 | @aQute.bnd.annotation.spi.ServiceProvider(NativeImageCliBuilder.class)
23 | public class NativeImageCliBuilderImpl implements NativeImageCliBuilder
24 | {
25 |
26 | public NativeImageCliBuilderImpl()
27 | {
28 | }
29 |
30 | @Override
31 | public Optional findNativeImageExecutable()
32 | {
33 | return findNativeImageExecutable(null);
34 | }
35 |
36 | @Override
37 | public Optional findNativeImageExecutable(final Path exec)
38 | {
39 | final Optional oExecPath = NativeImageCliUtil.findNativeImageExecutable(
40 | exec);
41 | if (oExecPath.isEmpty())
42 | {
43 | return Optional.empty();
44 | }
45 | return Optional.of(new NativeImageCliImpl(oExecPath.get()));
46 | }
47 |
48 | @Override
49 | public Optional fromExecutable(final Path exec)
50 | {
51 | final String version = NativeImageCliUtil.getVersion(exec);
52 |
53 | if (version == null)
54 | {
55 | return Optional.empty();
56 | }
57 |
58 | return Optional.of(new NativeImageCliImpl(exec));
59 | }
60 |
61 | }
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/NativeImageCliImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.impl;
15 |
16 | import java.nio.file.Path;
17 |
18 | import org.apache.felix.atomos.utils.substrate.api.NativeImageArguments;
19 | import org.apache.felix.atomos.utils.substrate.api.NativeImageCli;
20 |
21 | public class NativeImageCliImpl implements NativeImageCli
22 | {
23 |
24 | private Path nativeImageExec;
25 |
26 | private NativeImageCliImpl()
27 | {
28 |
29 | }
30 |
31 | NativeImageCliImpl(final Path nativeImageExec)
32 | {
33 | this();
34 | this.nativeImageExec = nativeImageExec;
35 | }
36 |
37 | @Override
38 | public Path execute(final Path executionDir, final NativeImageArguments arguments)
39 | throws Exception
40 | {
41 | return NativeImageCliUtil.execute(nativeImageExec, executionDir, arguments);
42 | }
43 |
44 | @Override
45 | public String getVersion()
46 | {
47 | return NativeImageCliUtil.getVersion(nativeImageExec);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/NativeImageConfigJsonProviderImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.impl;
15 |
16 | import aQute.bnd.annotation.spi.ServiceProvider;
17 | import org.apache.felix.atomos.utils.substrate.api.NativeImageConfigJsonProvider;
18 | import org.apache.felix.atomos.utils.substrate.api.dynproxy.DynamicProxyConfiguration;
19 | import org.apache.felix.atomos.utils.substrate.api.reflect.ReflectionConfiguration;
20 | import org.apache.felix.atomos.utils.substrate.api.resource.ResourceConfiguration;
21 | import org.apache.felix.atomos.utils.substrate.impl.json.DynamicProxyJsonUtil;
22 | import org.apache.felix.atomos.utils.substrate.impl.json.ReflectJsonUtil;
23 | import org.apache.felix.atomos.utils.substrate.impl.json.ResourceJsonUtil;
24 |
25 | @ServiceProvider(NativeImageConfigJsonProvider.class)
26 | public class NativeImageConfigJsonProviderImpl implements NativeImageConfigJsonProvider
27 | {
28 |
29 | @Override
30 | public String json(final DynamicProxyConfiguration dynamicProxyConfig)
31 | throws Exception
32 | {
33 | return DynamicProxyJsonUtil.json(dynamicProxyConfig);
34 | }
35 |
36 | @Override
37 | public String json(final ReflectionConfiguration reflectConfig) throws Exception
38 | {
39 | return ReflectJsonUtil.json(reflectConfig);
40 | }
41 |
42 | @Override
43 | public String json(final ResourceConfiguration resourceConfig) throws Exception
44 | {
45 |
46 | return ResourceJsonUtil.json(resourceConfig);
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/config/DefaultDynamicProxyConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.impl.config;
15 |
16 | import java.util.HashSet;
17 | import java.util.Set;
18 | import java.util.stream.Collectors;
19 | import java.util.stream.Stream;
20 |
21 | import org.apache.felix.atomos.utils.substrate.api.dynproxy.DynamicProxyConfiguration;
22 |
23 | public class DefaultDynamicProxyConfiguration implements DynamicProxyConfiguration
24 | {
25 |
26 | private final Set> items = new HashSet<>();
27 |
28 | public DefaultDynamicProxyConfiguration()
29 | {
30 | }
31 |
32 | public void addItem(final Set item)
33 | {
34 | items.add(item);
35 | }
36 |
37 | public void addItem(final String... item)
38 | {
39 | addItem(Stream.of(item).collect(Collectors.toSet()));
40 | }
41 |
42 | @Override
43 | public Set> getItems()
44 | {
45 | return items;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/config/DefaultReflectionConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.impl.config;
15 |
16 | import java.util.List;
17 |
18 | import org.apache.felix.atomos.utils.substrate.api.reflect.ReflectionClassConfig;
19 | import org.apache.felix.atomos.utils.substrate.api.reflect.ReflectionConfiguration;
20 |
21 | public class DefaultReflectionConfiguration implements ReflectionConfiguration
22 | {
23 |
24 | private final List reflectClassConfigs;
25 |
26 | public DefaultReflectionConfiguration(final List reflectClassConfigs)
27 | {
28 | this.reflectClassConfigs = reflectClassConfigs;
29 | }
30 |
31 | @Override
32 | public List getClassConfigs()
33 | {
34 | return reflectClassConfigs;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/config/DefaultReflectionConstructorConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.impl.config;
15 |
16 | import org.apache.felix.atomos.utils.substrate.api.reflect.ReflectionConstructorConfig;
17 |
18 | public class DefaultReflectionConstructorConfiguration implements ReflectionConstructorConfig
19 | {
20 | private final String[] methodParameterTypes;
21 |
22 | public DefaultReflectionConstructorConfiguration()
23 | {
24 | this(new String[] {});
25 | }
26 |
27 | public DefaultReflectionConstructorConfiguration(final String[] methodParameterTypes)
28 | {
29 |
30 | this.methodParameterTypes = methodParameterTypes;
31 | }
32 |
33 | @Override
34 | public String[] getMethodParameterTypes()
35 | {
36 | return methodParameterTypes;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/config/DefaultReflectionFieldConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.impl.config;
15 |
16 | import org.apache.felix.atomos.utils.substrate.api.reflect.ReflectionFieldConfig;
17 |
18 | public class DefaultReflectionFieldConfiguration implements ReflectionFieldConfig
19 | {
20 | private String fieldName;
21 |
22 | private DefaultReflectionFieldConfiguration()
23 | {
24 | }
25 |
26 | public DefaultReflectionFieldConfiguration(final String fieldName)
27 | {
28 | this();
29 | this.fieldName = fieldName;
30 | }
31 |
32 | @Override
33 | public String getFieldName()
34 | {
35 | return fieldName;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/config/DefaultReflectionMethodConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.utils.substrate.impl.config;
15 |
16 | import org.apache.felix.atomos.utils.substrate.api.reflect.ReflectionMethodConfig;
17 |
18 | public class DefaultReflectionMethodConfiguration extends DefaultReflectionConstructorConfiguration implements ReflectionMethodConfig
19 | {
20 |
21 | private final String name;
22 |
23 | public DefaultReflectionMethodConfiguration(final String name, final String[] methodParameters)
24 | {
25 | super(methodParameters);
26 | this.name = name;
27 | }
28 |
29 | @Override
30 | public String getName()
31 | {
32 | return name;
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/config/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 |
17 | package org.apache.felix.atomos.utils.substrate.impl.config;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/json/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.versioning.Version("1.0.0")
15 |
16 | package org.apache.felix.atomos.utils.substrate.impl.json;
--------------------------------------------------------------------------------
/atomos.utils/atomos.utils.substrate.impl/src/main/java/org/apache/felix/atomos/utils/substrate/impl/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.versioning.Version("1.0.0")
15 | @aQute.bnd.annotation.licenses.Apache_2_0
16 |
17 | package org.apache.felix.atomos.utils.substrate.impl;
--------------------------------------------------------------------------------
/atomos.utils/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 | 4.0.0
23 |
24 | org.apache.felix
25 | atomos-parent
26 | 1.0.1-SNAPSHOT
27 | ../atomos-parent/pom.xml
28 |
29 | pom
30 | org.apache.felix.atomos.utils
31 | org.apache.felix.atomos.utils
32 | atomos.utils
33 | 0.9.1-SNAPSHOT
34 |
35 | scm:git:https://github.com/apache/felix-atomos.git
36 | scm:git:https://github.com/apache/felix-atomos.git
37 | https://github.com/apache/felix-atomos
38 | HEAD
39 |
40 |
41 |
42 | true
43 |
44 |
45 | atomos.utils.api
46 | atomos.utils.core
47 | atomos.utils.substrate.api
48 | atomos.utils.substrate.impl
49 |
50 |
51 |
--------------------------------------------------------------------------------
/atomos/bnd.bnd:
--------------------------------------------------------------------------------
1 | Import-Package: \
2 | !java.lang.module,\
3 | org.apache.felix.service.command; resolution:=optional,\
4 | sun.misc; resolution:=optional,\
5 | *
6 |
7 |
--------------------------------------------------------------------------------
/atomos/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Licensed under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License.
5 | * You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software
10 | * distributed under the License is distributed on an "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | * See the License for the specific language governing permissions and
13 | * limitations under the License.
14 | */
15 | import org.apache.felix.atomos.impl.base.AtomosFrameworkUtilHelper;
16 | import org.apache.felix.atomos.impl.base.AtomosModuleConnector;
17 | import org.osgi.framework.connect.ConnectFrameworkFactory;
18 | import org.osgi.framework.connect.FrameworkUtilHelper;
19 | import org.osgi.framework.connect.ModuleConnector;
20 |
21 | open module org.apache.felix.atomos
22 | {
23 | exports org.apache.felix.atomos;
24 |
25 | requires transitive osgi.core;
26 | requires static osgi.annotation;
27 | requires static jdk.unsupported;
28 | requires static org.apache.felix.gogo.runtime;
29 |
30 | uses ConnectFrameworkFactory;
31 | uses ModuleConnector;
32 |
33 | provides FrameworkUtilHelper with AtomosFrameworkUtilHelper;
34 | provides ModuleConnector with AtomosModuleConnector;
35 | }
36 |
--------------------------------------------------------------------------------
/atomos/src/main/java/org/apache/felix/atomos/impl/base/AtomosFrameworkUtilHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package org.apache.felix.atomos.impl.base;
16 |
17 | import java.util.Optional;
18 | import java.util.Set;
19 | import java.util.concurrent.CopyOnWriteArraySet;
20 |
21 | import org.osgi.framework.Bundle;
22 | import org.osgi.framework.connect.FrameworkUtilHelper;
23 |
24 | public class AtomosFrameworkUtilHelper implements FrameworkUtilHelper
25 | {
26 | static private final Set helpers = new CopyOnWriteArraySet<>();
27 |
28 | static void addHelper(FrameworkUtilHelper helper)
29 | {
30 | helpers.add(helper);
31 | }
32 |
33 | static void removeHelper(FrameworkUtilHelper helper)
34 | {
35 | helpers.remove(helper);
36 | }
37 |
38 | @Override
39 | public Optional getBundle(Class> classFromBundle)
40 | {
41 | return helpers.stream().map(h -> h.getBundle(classFromBundle)) //
42 | .filter(Optional::isPresent) //
43 | .map(Optional::get) //
44 | .findFirst();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/atomos/src/main/java/org/apache/felix/atomos/impl/base/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.impl.base;
--------------------------------------------------------------------------------
/atomos/src/main/java/org/apache/felix/atomos/impl/content/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.impl.content;
--------------------------------------------------------------------------------
/atomos/src/main/java/org/apache/felix/atomos/impl/modules/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.impl.modules;
--------------------------------------------------------------------------------
/atomos/src/main/java/org/apache/felix/atomos/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | @org.osgi.annotation.bundle.Export
15 | @org.osgi.annotation.versioning.Version("1.0.0")
16 | @org.osgi.annotation.bundle.Requirement(namespace = "osgi.ee", filter = "(&(osgi.ee=JavaSE)(version=1.8))")
17 | package org.apache.felix.atomos;
--------------------------------------------------------------------------------
/atomos/src/main/resources/META-INF/services/org.osgi.framework.connect.FrameworkUtilHelper:
--------------------------------------------------------------------------------
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 | org.apache.felix.atomos.impl.base.AtomosFrameworkUtilHelper
18 |
--------------------------------------------------------------------------------
/atomos/src/main/resources/META-INF/services/org.osgi.framework.connect.ModuleConnector:
--------------------------------------------------------------------------------
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 | org.apache.felix.atomos.impl.base.AtomosModuleConnector
--------------------------------------------------------------------------------
/atomos/src/test/java/org/apache/felix/atomos/impl/content/ConnectContentFileTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 | package org.apache.felix.atomos.impl.content;
15 |
16 | import static org.junit.jupiter.api.Assertions.assertTrue;
17 |
18 | import java.io.IOException;
19 | import java.nio.file.Files;
20 | import java.nio.file.Path;
21 | import java.util.Optional;
22 |
23 | import org.junit.jupiter.api.Test;
24 | import org.junit.jupiter.api.io.TempDir;
25 | import org.osgi.framework.connect.ConnectContent;
26 | import org.osgi.framework.connect.ConnectContent.ConnectEntry;
27 |
28 | public class ConnectContentFileTest
29 | {
30 | @Test
31 | void testBreakout(@TempDir Path tmpDir) throws IOException
32 | {
33 | Files.createDirectories(tmpDir);
34 | Path content1 = tmpDir.resolve("testcontent");
35 | Path content2 = tmpDir.resolve("testcontentbreakout");
36 | Files.createDirectory(content1);
37 | Files.createDirectory(content2);
38 | Path file = content2.resolve("file");
39 | Files.createFile(file);
40 | ConnectContent connectContent = new ConnectContentFile(content1.toFile(),
41 | Optional::empty);
42 | Optional entry = connectContent.getEntry(
43 | "../testcontentbreakout/file");
44 | assertTrue(entry.isEmpty(), "Found unexpected entry.");
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 | 4.0.0
23 |
24 | org.apache.felix
25 | felix-parent
26 | 8
27 |
28 |
29 | atomos-distribution
30 | 1.0.1-SNAPSHOT
31 | pom
32 | atomos-distribution
33 |
34 |
35 | scm:git:https://github.com/apache/felix-atomos.git
36 | scm:git:https://github.com/apache/felix-atomos.git
37 | https://github.com/apache/felix-atomos
38 | HEAD
39 |
40 |
41 |
42 | atomos-parent
43 | atomos.osgi.core
44 | atomos
45 | atomos.tests
46 | atomos.utils
47 | atomos.maven
48 | atomos.examples
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------