{"id":18430700,"url":"https://github.com/kompiro/osgi-demo-bookstore","last_synced_at":"2025-04-13T22:45:23.526Z","repository":{"id":815470,"uuid":"525398","full_name":"kompiro/osgi-demo-bookstore","owner":"kompiro","description":"デブサミ2010でデモしたアプリケーションです。README.txtに手順を記載しています。","archived":false,"fork":false,"pushed_at":"2010-02-21T14:04:48.000Z","size":1357,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T09:15:22.270Z","etag":null,"topics":[],"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/kompiro.png","metadata":{"files":{"readme":"README.txt","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":"2010-02-19T02:36:52.000Z","updated_at":"2020-06-30T01:01:04.000Z","dependencies_parsed_at":"2022-08-16T11:00:34.702Z","dependency_job_id":null,"html_url":"https://github.com/kompiro/osgi-demo-bookstore","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/kompiro%2Fosgi-demo-bookstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kompiro%2Fosgi-demo-bookstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kompiro%2Fosgi-demo-bookstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kompiro%2Fosgi-demo-bookstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kompiro","download_url":"https://codeload.github.com/kompiro/osgi-demo-bookstore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794566,"owners_count":21162613,"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":[],"created_at":"2024-11-06T05:22:01.769Z","updated_at":"2025-04-13T22:45:23.491Z","avatar_url":"https://github.com/kompiro.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"bookstoreデモアプリケーション\n\nwritten by Hiroki Kondo\n\nこのアプリケーションでは、一般にMaven2のリポジトリで配布されていない、H2 databaseのJaQuというライブラリを使っています。\n(と言っても、H2のソースから簡単にビルドできます。)\n個人ではMaven2のリポジトリを運用していないため、JaQuをビルドしたライブラリをデモに同梱しています。\nバージョンの不整合を防ぐため、H2 Databaseも併せて試す前にローカルにインストールしてください。\n\nmvn install:install-file -Dfile=h2-1.2.128.jar -DgroupId=com.h2database -DartifactId=h2 -Dversion=1.2.128 -Dpackaging=jar\nmvn install:install-file -Dfile=h2jaqu-1.2.128.jar -DgroupId=com.h2database -DartifactId=h2jaqu -Dversion=1.2.128 -Dpackaging=jar\n\n== デモ実行のために必要なもの ==\n * Maven 2系\n * Pax Construct 1.4\nhttp://wiki.ops4j.org/display/paxconstruct/Downloadからダウンロードしてください。\n\n== 記号の意味 ==\n# : コマンド入力\n\u003e : OSGiコンソール上の操作\ne : ソース編集\n\n\n1. Mock Bundleでの起動\n# cd bookstore\n# mvn install\n... (各プロジェクトのビルドをします。)\n\n# pax-provision\n[OSGiランタイムが起動]\n\u003e ss (稼働中のBundleの状況が確認できます)\nid\tState       Bundle\n...\n34\tACTIVE      org.kompiro.bookstore.books.domain_1.0.0\n35\tACTIVE      org.kompiro.bookstore.books_0.1.0\n36\tACTIVE      org.kompiro.bookstore.web_0.1.0\n37\tACTIVE      org.springframework.bundle.spring.webmvc_2.5.4\n38\tACTIVE      org.kompiro.bookstore.web.admin_0.1.0\n39\tACTIVE      org.kompiro.bookstore.books.mock_0.1.0.mock\n\nという感じで表示されます。\nMockサービスとして動いていることを確認してください。\n\n検索画面\nhttp://localhost:8080/shop/search.htm\n\n登録画面\nhttp://localhost:8080/admin/register.htm\n\nそれぞれのページのHTMLソースを開くと、\n途中に現在動作中のサービス名が表示されています。\n\n2. Mock-\u003eimplへ変更\n# cd books.impl\n# mvn install\n\ninstallで指定できるJARのパスはURLです。今回はローカルのファイルのため、file://を接頭辞として指定します。Windowsの場合はfile://C:/...、LinuxやMacの場合は、file:///...(ルートからのパス)で指定してください。\n\u003e install file:///{bookstoreまでの絶対パス}/books2/target/books2-2.0.0.jar\n\u003e install file:///{bookstoreまでの絶対パス}/books.impl/target/books.impl-0.1.0.impl.jar\n\u003e install file:///{bookstoreまでの絶対パス}/h2-1.2.128.jar\n\u003e install file:///{bookstoreまでの絶対パス}/h2jaqu-1.2.128.jar\n\n\u003e stop org.kompiro.bookstore.books.mock\n\u003e uninstall org.kompiro.bookstore.books\n\u003e start org.kompiro.bookstore.books_2.0.0のID(左端の番号)\n\u003e start org.kompiro.bookstore.books.impl\n\u003e refresh\n\u003e ss\n[Bundle IDを確認]\n\n\u003e update org.kompiro.bookstore.web\n\u003e update org.kompiro.bookstore.web.admin\n(データが空の事を確認)\nhttp://localhost:8080/shop/search.htmにアクセスし、検索してみましょう。\nhttp://localhost:8080/admin/register.htmにアクセスし、登録してみましょう。\n(Like検索していることを確認)\n\nhttp://localhost:8080/shop/search.htmにアクセスし、Like検索してみましょう。\n＊残念ながら、日本語はLike検索できません。JaQuの振る舞いの確認ではないので既存の障害にしてください。\n\n3. impl-\u003eMockへ変更\n\u003e stop org.kompiro.bookstore.books.impl\n\u003e start org.kompiro.bookstore.books.mock\n\u003e update org.kompiro.bookstore.web\n\u003e upate org.kompiro.bookstore.web.admin\n\n(データが元のMockのデータを参照していることを確認)\n\n4. Mockとimplを同時実行(システムの中で同一系のサービスを起動)\ne JaQuBookServiceを開き、BookService以外にBookService2を実装していることを確認\ne src/main/webapp/WEB-INF/shop-osgi.xmlを開き、BookService→BookService2\n# cd ../web\n# mvn install\n\u003e start org.kompiro.bookstore.books.impl\n\u003e uninstall org.kompiro.bookstore.web\n\u003e install file://...(mvnでインストールしたパス)\n\u003e refresh\n\u003e start org.kompiro.bookstore.web\nHTMLソースをみて、それぞれ違うサービスで動いていることを確認しましょう。\n\n== OSGiコンソールコマンドの意味 ==\nss:現在稼働中のBundle状態を一覧表示\ninstall url:urlで指定したBundleを新たにインストールします。\nuninstall id or symbolic_name:指定したBundleをアンインストールします。\nstart id or symbolic_name:指定したBundleを活性化します。サービスのインストールもこの時に行われます。\nstop id or symbolic_name:指定したBundleを非活性化します。サービスのアンインストールもこの時に行われます。\nrefresh:現在installされているBundleのうち、更新されたものを読み込み直します。\nupdate id or symbolic_name:指定したBundleを更新します。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkompiro%2Fosgi-demo-bookstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkompiro%2Fosgi-demo-bookstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkompiro%2Fosgi-demo-bookstore/lists"}