关闭

关闭

关闭

封号提示

内容

首页 Introduce.OSGi.ppt

Introduce.OSGi.ppt

Introduce.OSGi.ppt

上传者: 07122294 2014-02-15 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《Introduce.OSGippt》,可适用于IT/计算机领域,主题内容包含IntroduceOSGiIntroduceOSGiBlueDavyhttp:wwwosgiorgcnhttp:blogbluedavycnAgen符等。

IntroduceOSGiIntroduceOSGiBlueDavyhttp:wwwosgiorgcnhttp:blogbluedavycnAgendaAgendaPlayOSGiWhouseOSGiWhatisOSGiOSGiRImplementionHowtodevelopOSGiappOSGiResourcesPlayOSGiPlayOSGiLet’sseeashortdemoFirstweseeanbulletinapplication,butonlyhavebulletinlistfunctionWewanttoaddnewbulletin,sowefindnewbulletinmodulefrommodulerespository,theninstallstartit,nowwecanaddnewbulletinWeseethefeatureofOSGiapplicationmodularitydynamic,”PlugandPlay”extensionablethesefeaturesaresupportedbyOSGi,themeaningisthatyoudon’tneedrealizethosefeaturesyourself,whatyouneeddoisjustuseitAgendaAgendaPlayOSGiWhouseOSGiWhatisOSGiOSGiRImplementionHowtodevelopOSGiappOSGiResourcesWhouseOSGiWhouseOSGiIBMWebsphereRSABEAmicroServices,AllBEAproductwillbebasedonmicroServicesEclipseApacheStrutsSpringSpringOSGiSimens,Nokia,BMW,CiscoetcSAP,Oracle,IONAetcareinterestedinOSGi,andbeOSGiEEGmemberAgendaAgendaPlayOSGiWhouseOSGiWhatisOSGiOSGiRImplementionHowtodevelopOSGiappOSGiResourcesWhatisOSGiWhatisOSGiDynamicModuleSystemForJavaJSRJSRUniversalMiddlewareBestpracticeguideandsupportforbuildingmodularitydynamicextensionablesystemModularitywithruleDynamicsupportformodule,OSGiservice,configurationExtensionsupportwithOSGiserviceOSGiBasicConceptsOSGiBasicConceptsModularityDefinemoduleinOSGiPublishfunctionsforothermodulesUsefunctionsprovidedbyothermodulesBundleBundleJAVAOperatingSystemHardwareOSGiFrameworkDefinemoduleinOSGiDefinemoduleinOSGiInOSGimodulecomposeofoneormorebundlesBundleisanormaljarfile,thedifferenceisitsManifestmffile,OSGiaddsomespecicalheaderinfopropertytodeclarativebundle,suchas:bundleversion,exportpackage,importpackagePublishfunctionsforotherbundlesPublishfunctionsforotherbundlesaddexportpackageheaderinfotoprovidepackageforotherbundlestouse,suchascnorgosgipptserviceaddFragmentHostheaderinfotoprovideallresourcesforhostbundletousepublishOSGiserviceforotherbundlesUseBundleContextregisterServicetoregisternormaljavainterfaceasOSGiserviceWritexmlwithruletodeclarativenormaljavaclassasOSGicomponent,andprovideserviceinterfaceforotherbundles,suchas:UsefunctionsprovidedbyothermodulesUsefunctionsprovidedbyothermodulesaddimportpackageheaderinfotoimportpackagesprovidedbyotherbundles,thenyoucanusethejavaclassinthosepackagesaddrequirebundleheaderinfotouseallexportpackagesandresourcesproviderbybundleuseOSGiserviceprovidedbyotherbundlesUseBundleContextgetServicetogetOSGiserviceprovidedbyotherbundlesWritexmlwithruletodeclarativenormaljavaclassasOSGicomponent,andinjectOSGiserviceprovidedbyotherbundles,suchas:OSGiBasicConceptsOSGiBasicConceptsDynamicBundlelifecycleOSGicomponentlifecycleHandlethedynamicwhenbundlelifecyclechangedwhenOSGicomponentlifecyclechangedwhenconfigurationchangedwhenframeworkchangedwhencustomeventpublishedBundlelifecycleBundlelifecycleOSGiprovideanAPIformanageingbundleslifecycle(InstallResolveStartStopRefreshUpdateUninstall),soOSGiframeworkRIwillcontrolbundlelifecycleselfINSTALLEDRESOLVEDUNINSTALLEDACTIVESTOPPINGSTARTINGstartstopOSGicomponentlifecycleOSGicomponentlifecycleComponentthatprovidenoservicewhenallneedOSGiservices(excluedoptionalservice)areusable,thecomponentwillbeactivedComponentthatprovideserviceswhenallneedOSGiservices(excluedoptionalservice)areusableothercomponentcallthisOSGiserviceimplementionHandlethedynamicHandlethedynamicwhenbundlelifecyclechangedOSGicomponentlifecyclewillchangeautomaticallyOSGiwillhandlebundlelifecycledynamicselfwhenOSGicomponentlifecyclechangedOSGiservicetrackercanbeusedtomonitorOSGiserviceDeclarativeServicesusebindmethod,unbindmethodtonotifythedynamicofOSGiservicewhenconfigurationchangedConfigurationAdminServiceautomaticallynotifytheconfigurationchangewhenframeworkchangedFrameworkEventListenercanbeimplementedtomonitorframeworkwhencustomeventpublishedEventAdminServicecantousedtopublishhandlecustomeventOSGiBasicConceptsOSGiBasicConceptsExtensionableServicefiltersupportedbyOSGicanbeusedtoextensionfunctionMultiservicereferencesupportedbyOSGicanbeusedtoextensionfunctionExtensionpointprovidedbyEquinoxcanbeusedtoextensionfunctionAgendaAgendaPlayOSGiWhouseOSGiWhatisOSGiOSGiRImplementionHowtodevelopOSGiappOSGiResourcesOSGiRImplementionOSGiRImplementionEquinoxRealizedbyEclipseteamAstheOSGiRRIhttp:wwweclipseorgequinoxUsedbyEclipseRCPEclipseotherproductsFelixRealizedbyApacheTeamhttp:felixapacheorgAgendaAgendaPlayOSGiWhouseOSGiWhatisOSGiOSGiRImplementionHowtodevelopOSGiappOSGiResourcesHowtodevelopOSGiappHowtodevelopOSGiappGetstartedWriteyourfirstbundleDeployManagefirstbundlePublishanduseOSGiServiceFAQGetstartedGetstartedDownloadEclipsefromwwweclipseorgDownloadEquinoxbundlesfromwwweclipseorgequinoxmostbundlesexistineclipseWriteyourfirstbundleWriteyourfirstbundleNewpluginproject,selectthispluginistargetedtorunwithanOSGiframeworkinprojectwizardpageWriteyourfirstbundleWriteyourfirstbundleThenentertheplugincontentpageWriteassociateinfo,thenclickfinishtocreatetheprojectWriteyourfirstbundleWriteyourfirstbundleWriteactivatorclassSay‘hello’whenbundlestartedSay‘byebye’whenbundlestoppedDeployManagefirstbundleDeployManagefirstbundleDeployineclipseDeployoutsidealoneManagebundleinconsoleDeployineclipseDeployineclipseOpenrundialog,newinEquinoxOSGiFramework,selectWorkspacePluginsandorgeclipseosgiinTargetplatformDeployineclipseDeployineclipseClickRunbutton,thenyoucanseethisinconsoleDeployoutsidealoneDeployoutsidealoneCreateequinoxframeworkappoutsidealonefirstcreateEquinoxdirectory,thencreateconfiguration,pluginsdirectoryinEquinoxdirectoryputorgeclipseosgijarorgeclipseosgiservicesjartopluginsdirectorycreateconfiginiinconfigurationdirectory,contentinconfiginilikethis:osginoShutdown=trueosgibundles=orgeclipseosgiservicesvjarstartosgibundlesdefaultStartLevel=osgiconfigurationcascaded=falseeclipseignoreApp=truecreaterunbatinEquinoxdirectory,contentinrunbat(windows)likethis:echooffjavajarpluginsorgeclipseosgiRxvjarconfigurationconfigurationconsoleDeployoutsidealoneDeployoutsidealoneStartequinoxframeworkandinstallfirstbundleinOSGiconsoleinstallfirstbundleusedirectorymodeInputcommandlikethisinOSGiconsole:installfile:D:workworkspaceOSGiBulletinFirstBundleinstallfirstbundleusejarfilepackagefirstbundleintojarfileExporttheprojectasdeployablepluginsandfragmentsInputcommandlikethisinOSGiconosle:installfile:D:OpendocEquinoxpluginsFirstBundlejarManagebundleinconsoleManagebundleinconsoleusesstofindbundleidusestart,stop,update,uninstalltomanagebundlewithbundleidstart(startbundle)stop(stopbundle)update(updatebundleonthefly)uninstall(uninstallbundle)PublishOSGiServicePublishOSGiServiceUseOSGideclarativeservicestopublishanduseOSGiService,thenwhenyourunOSGiapplication,youneedinstallEquinoxDSpluginCreateServiceBundletopublishOSGiserviceCreatecnorgosgipptserviceHelloServiceInterfaceCreatecnorgosgipptcomponentHelloComponenttoimplementionHelloServicePublishHelloServiceasOSGiserviceusingDScomponentxml<componentname="HelloComponent"><implementationclass="cnorgosgipptcomponentHelloComponent"><service><provideinterface="cnorgosgipptserviceHelloService"><service><component>AddcomponentxmltoMANIFESTMFServiceComponentpropertyExportpackagecnorgosgipptserviceUseOSGiServiceUseOSGiServiceAddcnorgosgipptservicetoimportpackageUseHelloServiceinfirstbundlewithtwokindmethodscontextgetServicemethodInActivatorclass:ServiceReferenceserviceRef=contextgetServiceReference(HelloServiceclassgetName())if(serviceRef!=){HelloServiceservice=(HelloService)contextgetService(serviceRef)servicesay("Activator")}DeclarativeServicesmethodcreatecnorgosgipptfirstbundleFirstComponentclasswithinjectservicemethod:publicvoidsetService(HelloServiceservice){thisservice=service}publicvoidunsetService(HelloServiceservice){if(thisservice!=service)returnthisservice=Systemoutprintln("HelloService不可用")}writedscomponentxmltoinjectOSGiserviceAddcomponentxmltoMANIFESTMFServiceComponentpropertyAgendaAgendaPlayOSGiWhouseOSGiWhatisOSGiOSGiRImplementionHowtodevelopOSGiappOSGiResourcesOSGiResourcesOSGiResourcesOSGiRSpecifications《OSGi实战》Opendoc《OSGi进阶》Opendochttp:wwwosgiorghttp:wwwosgiorgcnhttp:wwwaqutebizhttp:blogbluedavycnClicktoeditcompanysloganOSGiChinaUserGroup

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/35
1下载券 下载 加入VIP, 送下载券

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部