{"id":15339011,"url":"https://github.com/bdelacretaz/osgi-for-mere-mortals","last_synced_at":"2025-10-08T09:17:30.062Z","repository":{"id":143358417,"uuid":"2563197","full_name":"bdelacretaz/OSGi-for-mere-mortals","owner":"bdelacretaz","description":"Sample code for my \"OSGi for mere mortals\" presentation at ApacheCon NA 2011","archived":false,"fork":false,"pushed_at":"2014-11-27T15:09:57.000Z","size":217,"stargazers_count":26,"open_issues_count":0,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T15:11:22.374Z","etag":null,"topics":["apachecon","java","osgi","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bdelacretaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-12T15:13:28.000Z","updated_at":"2023-10-04T19:14:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"f21931db-e12a-423e-96de-ab4eb092afb0","html_url":"https://github.com/bdelacretaz/OSGi-for-mere-mortals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdelacretaz%2FOSGi-for-mere-mortals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdelacretaz%2FOSGi-for-mere-mortals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdelacretaz%2FOSGi-for-mere-mortals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdelacretaz%2FOSGi-for-mere-mortals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdelacretaz","download_url":"https://codeload.github.com/bdelacretaz/OSGi-for-mere-mortals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248995106,"owners_count":21195497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apachecon","java","osgi","tutorial"],"created_at":"2024-10-01T10:28:13.003Z","updated_at":"2025-10-08T09:17:29.950Z","avatar_url":"https://github.com/bdelacretaz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OSGi for mere mortals\n\nThis is the code of my \"OSGi for mere mortals\" presentation at [ApacheCon](http://apachecon.com) NA 2011, EU 2012 and EU 2014.\n\n\u003cdiv style=\"float:right\"\u003e\u003ca href=\"http://events.linuxfoundation.org/events/apachecon-europe/program/schedule\"\u003e\n\u003cimg src=\"http://bit.ly/1ttg6CE\"/\u003e\u003c/a\u003e\u003c/div\u003e\n\nIt's a minimal standalone RESTful server built from scratch using OSGi Declarative Services, meant\nto demonstrate that OSGi is not only for superhuman guru programmers.\n\nThis example demonstrates the complete lifecycle of an OSGi application,\nfrom starting the framework and installing the required bundles to running\nthe app itself.\n\nIt also demonstrates the svelteness of the OSGi framework and core services: the total size of the build-time \ndependencies (jar files) is around 3 megabytes and additional runtime baggage amounts to ten OSGi bundles (also jar files) representing about 2 megabytes more, including all runtime features like the OSGi web console, interactive OSGi shell, the OSGi configuration mechanism and front-end and the servlet engine. Startup time is around 300 msec on my laptop.\n\nThe Maven build is also a useful example of how to create OSGi bundles in a simple way.\n\nThe slides at http://www.slideshare.net/bdelacretaz/osgi-for-mere-mortals should help you walk through the code.\n\n## How to build and start\nTo build the runnable jar, run `mvn clean install` at the top of the source\ncode tree (using \u003ca href=\"http://maven.apache.org\"\u003eApache Maven\u003c/a\u003e\n3.0.3 or later).\n\nYou can then start the server from the *launcher* subfolder by running\n\n    java -jar target/osgi-for-mere-mortals-launcher-0.0.1-SNAPSHOT.jar\n\n(or whatever the name of that jar file is).\n\nThe OSGi console shown in the slides is at http://localhost:8080/system/console - use admin/admin to log in.\n\n## How to use the server\nThe server doesn't do much, that's not the point, the goal is just to demonstrate how it is assembled.\n\nYou can store data via HTTP POST requests:\n\n    $ date | curl -X POST -D - http://localhost:8080/store/testing\n    HTTP/1.1 201 Created\n    Location: /store/testing\n    Content-Type: text/plain; charset=utf-8\n    Content-Length: 149\n    Server: Jetty(6.1.x)\n    \n    Stored at /store/testing\n    StoredBy:ch.x42.osgi.samples.osgi101.app.servlets.StorageServlet\n    StoredAt:Fri Nov 14 17:03:36 CET 2014\n    \nAnd retrieve it via HTTP GET:\n\n    curl http://localhost:8080/store/testing\n    StoredBy:ch.x42.osgi.samples.osgi101.app.servlets.StorageServlet\n    StoredAt:Fri Nov 14 17:03:36 CET 2014\n    Path:/store/testing \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdelacretaz%2Fosgi-for-mere-mortals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdelacretaz%2Fosgi-for-mere-mortals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdelacretaz%2Fosgi-for-mere-mortals/lists"}