SlideShare uma empresa Scribd logo
1 de 63
--@sagacity

         -          -IT
www.ufida.com
www.rayootech.com
‣

‣

‣     WTP Facet XDoclet ANT

‣   OSGi——

‣            Java      Bundle
“   ”
            “
”
OSGi
‣   ‣

‣   ‣

‣   ‣

‣   ‣

‣   ‣

‣   ‣

‣   ‣
Metadata
                          Workflow
‣         ‣              RuleEngine
‣         ‣

‣         ‣

‣         ‣

‣         ‣

‣         ‣

‣         ‣


    Component Building
‣

‣


‣


‣        ——200

‣

‣


‣


‣   ——
...
                  ERP


Flex


      AJAX




             Main FrameWork
...
                  ERP


Flex


      AJAX




             Main FrameWork
...
                                  ERP
Here you are!
                Flex


                      AJAX




                             Main FrameWork
...
Flex    AJAX


                                ERP




                                      GAP-API



               Main FrameWork
‣   Eclipse WTP Facets
‣   XDoclet
‣   Ant
‣                        OSGi
‣


‣    Servlet

‣
Eclipse WTP Facets
‣

‣     WTP Web Tools Platform

‣       WTP

‣

‣   Facets


‣   Facets
WTP Faceted

  id            versions             requires      conflicts

jst.java     1.3, 1.4, 1.5, 1.6                      jst.ear

jst.web        2.2, 2.3, 2.4          jst.java   jst.ear, jst.ejb

jst.ear    1.2, 1.3, 1.4, 5.0, 6.0                   jst.java

jst.ejb    1.1, 2.0, 2.1, 3.0, 3.1    jst.java   jst.ear, jst.java
WTP Faceted

  id            versions             requires      conflicts

jst.java     1.3, 1.4, 1.5, 1.6                      jst.ear

jst.web        2.2, 2.3, 2.4          jst.java   jst.ear, jst.ejb

jst.ear    1.2, 1.3, 1.4, 5.0, 6.0                   jst.java

jst.ejb    1.1, 2.0, 2.1, 3.0, 3.1    jst.java   jst.ear, jst.java
Dynamic Web Project
Dynamic Web Project


Facets
XDoclet & Ant
‣   XDoclet

‣                            Merge Point

‣   Ant

‣

‣

‣             Facets   Ant     XDoclet
‣                           build.xml

‣                  -MergePoint i18n oid spring include

‣           TotalBuild

‣   Facet
TotalBuild
TotalBuild
TotalBuild
             Facets
‣

‣   build.xml       clean compile jar distribution



                                             db
                                             merge
                                             resource
‣                    ant                     src
                                             webModule
‣               Distribution
Merge
‣                                                             xdt
‣   applicationContext.xdt------------spring
‣   global.xdt---------------------------include global.jsp
‣   web.xdt-----------------------------web.xml
‣   ......



‣            Merge Point
    <XDtMerge:merge file="workflow-hbm.data"></XDtMerge:merge>
Merge
 <value>gap/wf/persistent/db/bo/GapwfProcessinstance.hbm.xml</value>
 <value>gap/wf/persistent/db/bo/GapwfActivityinstance.hbm.xml</value>
 <value>gap/wf/persistent/db/bo/GapwfActivityinstancepre.hbm.xml</value>
 <value>gap/wf/persistent/db/bo/GapwfRevelantdata.hbm.xml</value>
 <value>gap/wf/persistent/db/bo/GapwfWorkitem.hbm.xml</value>
 <value>gap/wf/persistent/db/bo/GapwfWorkitemdata.hbm.xml</value>
 <value>gap/wf/persistent/db/bo/GapwfDynprocessrelation.hbm.xml</value>



                                                                   db
                                                                   merge
                                                                   resource
                                                                   src
                                                                   webModule
XDoclet                                                                   <path id="xdoclet.classpath">
                                                                            <fileset dir="${lib.dir}">
                                                                               <include name="*.jar"/>
‣   XDoclet classpath                                                       </fileset>
                                                                            <pathelement location="classes"/>
                                                                          </path>
‣   Ant taskdef

‣   target                                      <taskdef name="xdoclet" classname="xdoclet.DocletTask"
                                                  classpathref="xdoclet.classpath" />



             <target name="gen-applicationContext.xml">
                <xdoclet destdir="${webmodule.dir}/WEB-INF/conf/applicationContext" force='true' mergedir="${merge.dir}">
                  <fileset dir="${source.dir}" includes="**/*.java" />
                  <template templateFile="template/applicationContext.xdt" destinationfile="applicationContext.xml" />
                </xdoclet>
             </target>
TotalBuild
‣   Facets
     <!--                  build.xml-->
     <target name="build">
        <ant dir="${gap-api}" antfile="build.xml" target="all" />
        <ant dir="${venus-frame}" antfile="build.xml" target="all" />
        <ant dir="${venus-page}" antfile="build.xml" target="all" />
        <ant dir="${venus-log}" antfile="build.xml" target="all" />
        ......
     </target>
     <!--       -->
     <target name="plugin">
       <available file="Templates" type="dir" property="Templates.present" />
       <antcall target="clean" />
       <move todir="Templates/0.               ">
             <fileset dir="${gap-api}/dist" />
             <fileset dir="${venus-frame}/dist" />
        </move>
        ......
     </target>
Facet
‣       org.eclipse.ui.newWizards

‣   category wizard
‣   org.eclipse.wst.common.project.facet.core.facets
‣    <category />——Facet

‣    <project-facet />——Facet

‣    <project-facet-version />——Facet

‣    <template />——             Facet

‣    <preset />——      Facet


                   ——
‣   org.eclipse.wst.common.project.facet.ui.images
‣   org.eclipse.wst.common.project.facet.ui.wizard
Facet
    <!--Facet                -->
    <project-facet id="gap.mainframe">
      <label>0.             </label>
        <description>GAP                  </description>
       <category>gap.category</category>
    </project-facet>

    <!--    Facet                                                   -->
    <project-facet-version facet="gap.mainframe" version="3.7">
      <action id="gap.mainframe.install" type="INSTALL">
         <delegate class="venus.tools.ide.facet.GAPFacetInstallDelegate"/>
      </action>
      <constraint>
         <requires facet="jst.web" version="[2.4"/>
      </constraint>
    </project-facet-version>
Facet
‣                org.eclipse.wst.common.project.facet.core.IDelegate

‣   GAPFacetInstallDelegate                    Facet
‣   BuildFacetsDelegate
‣       Facet            Facet

‣       Facet

‣                     XDoclet          classpath

‣       project nature .tomcatplugin

‣
‣

‣

‣

‣

‣
‣

‣       jar

‣               Install Update Remove
‣   Time For:
‣

‣       jar

‣                   Time For:Update
                       Install        Remove
‣   Time For:



                O            Gi
OSGi
‣

‣   2005 R4.0     ——

‣   2010 3      OSGi   4.2

‣                            Bundle
update
        install           refresh



       INSTALLED                            STARTING

  resolve              update
                                    start
                       refresh


       RESOLVED                              ACTIVE    stop

uninstall         uninstall                     stop


     UNINSTALLED                            STOPPING
OSGi
‣                 Declarative Services

‣               Framework Launching

‣   Blueprint      Blueprint Service

‣   Web         Web Application Bundle

‣                      JPA JTA JDBC......
OSGi
‣                 Declarative Services

‣               Framework Launching

‣   Blueprint      Blueprint Service

‣   Web         Web Application Bundle

‣                      JPA JTA JDBC......
‣   Service Component Model
‣                         OSGi

‣       xml           Component Service

‣

‣             Java POJO                   OSGi

‣
——
‣       Bundle Manifest
    Bundle-ManifestVersion: 2
    ...
    Service-Component: OSGI-INF/component.xml [, ...]*


‣       OSGI-INF/
    <?xml version="1.0" encoding="UTF-8"?>
    <scr:component name="bookstore-order" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
    
   <!--             -->

    
   <implementation class="com.osgi.ds.OrderService"/>
    
   <!--       -->

    
   <service><provide interface="com.osgi.ds.IOrder"/></service>
    
   <!--       -->

    
   <reference interface="com.osgi.ds.ICart" bind="setCart" unbind="unsetCart"
    
   
   policy="dynamic" cardinality="1..1"/>
    </scr:component>
——
‣   Enabled——

‣   Satisfied——

‣   Immediate Component——

‣   Delayed Component——

‣   Factory Component——
<=>%42.*%0$1-.*$0%*+$%#(45("$"*%#(")-120&*-("%&.%&%.$09-#$%-"%*+$%.$09-#$%0$1-.*0'%&
                                                                  *+$%#(45("$"*%#(")-120&*-("7%?+$%.$09-#$%50(5$0*-$.%)(0%*+-.%0$1-.*0&*-("%#(".-.*%()
                                                                  50(5$0*-$.%&.%/$)-"$/%-"%+), - & .)/0,12), %&)#%("%5&1$ @AB7
                                                                  ?+$%.*&*$%/-&10&4%-.%.+(:"%-"%C-120$%@@D7D7%

                  ——                   3 & 4 ! , ) / 556 7 6      8 9 9 )* & $ % ) / : 1 9 21 " ) " % / : 1 " ( & 4 ! , $ % & 1 "
                                                                                                                                           )(+=,*>+,(
                                                                                                  6789:&8;&<3
‣   Enabled——                                                                                                B&)/0&2
                                                                                                             2,-$2.$&C                               B&)/0&2
                                                                                                                                                     D62,-$2.$&C
‣   Satisfied——                                                                                +=,*>+,(                                                       $.%CA6,0$)E
                                                                                                                                            9.:&?<
                           !"#$"%&%'()*+&(!,-.&(                                                                                    /&-.010'*2&(3&12*-&4(3$&-*+*-0'*"%(5&
                                                                                                                                                              '&B$6C$69


‣   Immediate Component——                  !"#$%&#'&()*+&#(&,*'$&(&-#./#0#+12314&4$#+14"*,5(0$*14#.&+12&'#545'&-#.&+05'&#$%&(&#0(&#4
                                           .54-6&'#5'*4,#*$7#$%&4#89:#'%156-#-&0+$*)0$&#$%0$#+12314&4$#+14"*,5(0$*14;#<%*'#0661='#89
                                       !!"#$#2            3(4+5()-./'0/1(1,-
                                           2&4$0$*14'#$1#&0,&(6/#(&+60*2#0+$*)0$&-#+12314&4$#+14"*,5(0$*14';
                                                          8%E$'%&**0-62*$%()%&%/$,&'$/%#(45("$"*%-.%*+$%/$,&'-"1%()%#,&..%,(&/-"1%&"/%(6F$#*%#0
‣   Delayed Component——
                      !"#$%&'(()*+                        *+$%&#*-9&*-("%()%&%/$,&'$/%#(45("$"*%#(")-120&*-("%/($.%"(*%(##20%2"*-,%*+$0$%-.%&
                                               ,&-./&0'123425&56'1257"#$%.6"25
                                                          )(0%&%.$09-#$%(6F$#*7%8%#(45("$"*%-.%&%/$,&'$/%#(45("$"*%:+$"%-*%.5$#-)-$.%&%.$09-#$
                                                          *(0'%#(45("$"*%&"/%/($.%"(*%+&9$%*+$%!""#$!%&#%&**0-62*$%()%*+$%'(")(*#*&%$,$4
                                                                                                  <1&'(:;&(1
                                                                             2345674%789
‣   Factory Component——                                           <=>%42.*%0$1-.*$0%&%.$09-#$%&)*$0%*+$%#(45("$"*%#(")-120&*-("%6$#(4$.%.&*-.)-$/7%?
                                                                  *+-.%.$09-#$%42.*%,((E%*(%(6.$09$0.%()%*+$%.$09-#$%0$1-.*0'%&.%-)%*+$%#(45("$"*I.%62"
                                                                 B&-"#&4               B&-"#&4
                                                                  *$0$/%*+-.%.$09-#$7%?+-.%.*0&*$1'%4&E$.%-*%5(..-6,$%*(%0$1-.*$0%.$09-#$.%:-*+(2*%#0$&*-"
                                                                 D%40'*4+*&C           40'*4+*&C
                                                                  )(0%*+$%62"/,$%&"/%,(&/-"1%#,&..$.3%*+$0$6'%&,,(:-"1%0$/2#*-("%-"%-"-*-&,-J&*-("%*-4
                                                                  4$4(0'%)((*50-"*7
                                                                           >8?7468>89                  D%9&'           B&-"#&4
                                                                                                         4&12*-&                           D%40'*4+*&C
                                                                  K+$"%<=>%0$1-.*$0.%*+$%.$09-#$%("%6$+&,)%()%&%#(45("$"*%#(")-120&*-("3%-*%42.*%&9(
                                                                                  6
                                                                                    9&'
                                                               4&12*-&+0-'"1,E(F77%
                                                                  ,(&/%*(%(##20%)0(4%*+$%#(45("$"*L.%62"/,$7%<=>%#&"%$".20$%*+-.%6'%0$1-.*$0-"1%&%-#
                                                                                    4&12*-&
                                                               "'G&1H*4&E(6
                                                                  (6F$#*%:-*+%*+$%C0&4$:(0E%)(0%*+&*%.$09-#$7%M'%0$1-.*$0-"1%&%-#+.!'#/%'&(+0%(6F$#*3%*
                                                                          &'(:;&(1
                                                                  (6F$#*%-.%"(*%"$$/$/%2"*-,%*+$%-#+.!'#/%'&(+0%-.%#&,,$/%*(%50(9-/$%*+$%.$09-#$%(6F$#*7%
                                                                                                                                  *+(C,%0#*-E
                                                                                                               5-67=8
                                                                  $0*-$.%)(0%*+-.%0$1-.*0&*-("%#(".-.*%()%*+$%#(45("$"*%50(5$0*-$.%&.%/$)-"$/%-"%+), - & .)/
                                                                                                                                  1&B*%C*%9
                                                                  @AB7
‣   R4.2                            API               OSGi
‣    OSGi                ——org.osgi.framework.launch.FrameworkFactory

‣                   OSGi              web            listener     OSGi

‣
    Class<FrameworkFactory> factoryClass = ServiceLoader.load(FrameworkFactory.class);
    FrameworkFactory factory = factoryClass.newInstance();
    Map<Object, Object> conf;
    ......//
    Framework framework=factory.newFramework(conf);
    framework.init();
    BundleContext bundleContext = framework.getBundleContext();
    ......//   bundle
    framework.start();
BluePrint
‣   BluePrint             ——Spring Dynamic Modules-->Eclipse Gemini

‣      OSGi                             dependency injection

‣         OSGi

‣      POJO
‣   OSGI-INF/blueprint/
    <?xml version="1.0" encoding="UTF-8"?>
    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
        ...
    </blueprint>
3&45"$,67689       :$0;,(%"5)%5"$
                                                                              5&'(
BluePrint                    ——Bean
‣                                          Java                                      9


‣
                                                                  ',+7/&(1               0,.0&,18

‣   argument, property, scope
‣                  className, factoryMethod, factoryComponent
                 !"!#$#"            45&'(6
                                     !"#$G#%&2&%&$3.'$&$7#&-$/&-&(#'$+,$'#*'#,#-%#2$+-$%"#$$/&.#0&'.1.'.$+-%#'3&
    <bean id="order" class="com.osgi.bs.OrderService" init-method="init"
       destroy-method="destroy">     2(3)(#&#'0&'.1.'.<$!&70# CBC<C$.-$*&(# BCI$*'.5+2#,$&-$.5#'5+#9$.3$%"#$'#
       <argument value="1"/>
       <argument value="2"/>
                                     &-2$%"#$/&.#0&'.1.'.$+-%#'3&6#<$!"#$%&70#$.-0)$*'.5+2#,$&$,1//&')4$%"#$,./
                                     %+.-,$7#%9##-$%"#$2+33#'#-%$3#&%1'#,$&'#$2+,61,,#2$+-$0&%#'$,#6%+.-,<
       <property name="Description" value="This is the order"/>
    </bean>                          <01/$,67686        :$0;,=0;04$",3$0%5"$'
                                    :11,;571&).,)<=&/&(1 >8(1'?         %&'()*&1'@'1'               A&BC,;01;.(

                                    "1                     45           "16                         !"#$+2$.3$&$%.*$0
BluePrint                ——
   <!--          -->
   <service id="orderService" interface="com.osgi.bs.IOrderService" ref="order">
   	   <service-properties>
   	   	   <entry key="order.discount" value="0.8"/>
   	   </service-properties>
   </service>




     <!--          -->
     OrderService os = new OrderService(1, 2);
     os.setDescription( "This is the order" );
     Hashtable props = new Hashtable();
     props.put("order.discount", "0.8");
     bundleContext.registerService(com.osgi.bs.OrderService.class.getName(), os,
     props);
BluePrint                ——
   <!--reference         -->
   <reference id="orderRef" interface="com.osgi.bs.IOrderService" timeout="1000"
   availability="optional"/>
   <bean id="orderClient" class="...">
   	   <property name="order" ref="orderRef"/>
   </bean>




   <!--reference-list          -->
   <reference-list id="orderRefs" interface="com.osgi.bs.IOrderService"
   availability="optional">
   	   <reference-listener bind-method="bind" unbind-method="unbind">
   	   	   <bean class="com.osgi.bs.ReferenceListener"/>
   	   </reference-listener>
   </reference-list>
BluePrint                ——
   <!--reference         -->
   <reference id="orderRef" interface="com.osgi.bs.IOrderService" timeout="1000"
   availability="optional"/>
   <bean id="orderClient" class="...">
                                                                List
   	   <property name="order" ref="orderRef"/>
   </bean>
                                                               List



   <!--reference-list          -->
   <reference-list id="orderRefs" interface="com.osgi.bs.IOrderService"
   availability="optional">
   	   <reference-listener bind-method="bind" unbind-method="unbind">
   	   	   <bean class="com.osgi.bs.ReferenceListener"/>
   	   </reference-listener>
   </reference-list>
BluePrint             VS
‣

‣

‣   BluePrint                   Java

‣   R4.0        DS R4.2    BS

‣       DS                 BS
OSGi Web
‣   Web            OSGi
✓   Modularity——

✓   Lifecycle——      |    |   |

✓   Services——
OSGi Web
‣

✓   HttpService
✓   Bridged
tion we have been using in Toast.
                      Bridged—In the Bridged approach, the coding and exposure model
                      same as in Solo, but here the OSGi framework is embedded into a w
OSGi Web
                                                  Servlets

‣
                   JSPs

✓   HttpService
✓   Bridged               HTTP

                                   OSGi

                                    Java

                  Figure 19–1 Solo server-side configuration
tion we have been using in Toast.
                                                                                          Bridged—In the Bridged approach, the coding and exposure model
                                                                                          same as in Solo, but here the OSGi framework is embedded into a w
OSGi Web
                                                                                                                   Servlets

‣
              !"#$$%&'()*+,-../00123%0454006%78%972:;0<28=2&:0>4;05?>?00@A>50#!        JSPs

✓   HttpService
✓   Bridged          19.2 Embedding the Back End in a Web Application                         HTTP                            323


                                                                                                     OSGi
                                                                            Servlets
                                                                                                     Java
                                     JSPs
                                                                                   Figure 19–1 Solo server-side configuration



                                            HTTP


                                                    Lite HTTP Bridge

                                                   OSGiEquinox
                                                        Framework


                                                   Application Server

                                  Figure 19–2 Bridged server-side configuration
——WAB
‣   WAB——Web Application Bundle1.0 R4.2

‣      Bundle                       OSGi                         Web

‣         Servlet2.5 JSP2.1

    Manifest-Version: 1.0
    Import-Package: ...
    ...
    Bundle-Version: 1.0
    Bundle-Name: orderManager
    Bundle-ClassPath: WEB-INF/lib/commons-logging.jar,WEB-INF/
    classes
    Web-ContextPath: /order
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: com.osgi.bs.order
Web Bundle Architecture

 Web Application
                            Bundles
    Bundles




 Deploy Bundle       Admin Console Bundle




   Application Server/OSGi Runtime


                   JVM
Web Bundle Architecture

 Web Application
                            Bundles
    Bundles




 Deploy Bundle       Admin Console Bundle




   Application Server/OSGi Runtime


                   JVM
‣   Equinox——                OSGi             Eclipse

‣   Gemini (Spring DM)——           R4.2

‣   Virgo (Spring DM Server)——      OSGi Application Server

‣   Felix——                      OSGi

‣   Nuxeo——             CMS                 OSGi
Questions?   Follow me at
             twitter.com/sagacity
             t.sina.com.cn/n/

Mais conteúdo relacionado

Mais procurados

Wicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On TimeWicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On Time
Will Hoover
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
DjangoCon2008
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
glassfish
 
Step By Step Guide For Buidling Simple Struts App
Step By Step Guide For Buidling Simple Struts AppStep By Step Guide For Buidling Simple Struts App
Step By Step Guide For Buidling Simple Struts App
Syed Shahul
 

Mais procurados (20)

Dynamic Groovy Edges
Dynamic Groovy EdgesDynamic Groovy Edges
Dynamic Groovy Edges
 
Redux vs Alt
Redux vs AltRedux vs Alt
Redux vs Alt
 
A portlet-API based approach for application integration
A portlet-API based approach for application integrationA portlet-API based approach for application integration
A portlet-API based approach for application integration
 
Basic JSTL
Basic JSTLBasic JSTL
Basic JSTL
 
Wicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On TimeWicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On Time
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
jQuery Mobile: For Fun and Profit
jQuery Mobile: For Fun and ProfitjQuery Mobile: For Fun and Profit
jQuery Mobile: For Fun and Profit
 
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
 
High Performance Django
High Performance DjangoHigh Performance Django
High Performance Django
 
Speed up your GWT coding with gQuery
Speed up your GWT coding with gQuerySpeed up your GWT coding with gQuery
Speed up your GWT coding with gQuery
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010
 
React 소개 및 구현방법 Demo
React 소개 및 구현방법 DemoReact 소개 및 구현방법 Demo
React 소개 및 구현방법 Demo
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJSBuilding a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
 
Step By Step Guide For Buidling Simple Struts App
Step By Step Guide For Buidling Simple Struts AppStep By Step Guide For Buidling Simple Struts App
Step By Step Guide For Buidling Simple Struts App
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorial
 

Destaque

■Play+Stay商品カタログ(プレビュー)
■Play+Stay商品カタログ(プレビュー)■Play+Stay商品カタログ(プレビュー)
■Play+Stay商品カタログ(プレビュー)
WilsonAdvisoryStaff
 

Destaque (16)

Copy_of_SAFI
Copy_of_SAFICopy_of_SAFI
Copy_of_SAFI
 
Rapport de la Cour des Comptes de l'Union sur les mécanismes de stabilité fin...
Rapport de la Cour des Comptes de l'Union sur les mécanismes de stabilité fin...Rapport de la Cour des Comptes de l'Union sur les mécanismes de stabilité fin...
Rapport de la Cour des Comptes de l'Union sur les mécanismes de stabilité fin...
 
■Play+Stay商品カタログ(プレビュー)
■Play+Stay商品カタログ(プレビュー)■Play+Stay商品カタログ(プレビュー)
■Play+Stay商品カタログ(プレビュー)
 
Manual web2.0 professores
Manual web2.0 professoresManual web2.0 professores
Manual web2.0 professores
 
Boletín Informativo de febreiro 2017 da Biblioteca Sagrada Familia da Coruña
Boletín Informativo de febreiro 2017 da Biblioteca Sagrada Familia da CoruñaBoletín Informativo de febreiro 2017 da Biblioteca Sagrada Familia da Coruña
Boletín Informativo de febreiro 2017 da Biblioteca Sagrada Familia da Coruña
 
PHP & AppServ
PHP & AppServPHP & AppServ
PHP & AppServ
 
Japan drama, novel, short stories
Japan drama, novel, short storiesJapan drama, novel, short stories
Japan drama, novel, short stories
 
MÁLAGA RECIBE EL PREMIO NACIONAL CIUDADANÍA POR EL PROYECTO MUSEOS DE MÁLAGA,...
MÁLAGA RECIBE EL PREMIO NACIONAL CIUDADANÍA POR EL PROYECTO MUSEOS DE MÁLAGA,...MÁLAGA RECIBE EL PREMIO NACIONAL CIUDADANÍA POR EL PROYECTO MUSEOS DE MÁLAGA,...
MÁLAGA RECIBE EL PREMIO NACIONAL CIUDADANÍA POR EL PROYECTO MUSEOS DE MÁLAGA,...
 
Raus aus den Silos - Datenmanagement im digitalen Zeitalter
Raus aus den Silos - Datenmanagement im digitalen ZeitalterRaus aus den Silos - Datenmanagement im digitalen Zeitalter
Raus aus den Silos - Datenmanagement im digitalen Zeitalter
 
Comment trouver une idée pour entreprendre ?
Comment trouver une idée pour entreprendre ?Comment trouver une idée pour entreprendre ?
Comment trouver une idée pour entreprendre ?
 
Cifras de empleo y pobreza
Cifras de empleo y pobrezaCifras de empleo y pobreza
Cifras de empleo y pobreza
 
Aspectos fiscales del sector primario
Aspectos fiscales del sector primarioAspectos fiscales del sector primario
Aspectos fiscales del sector primario
 
A day at the football slide word
A day at the football slide wordA day at the football slide word
A day at the football slide word
 
Sonatina for trumpet alone - Alfred Bartles
Sonatina for trumpet alone - Alfred BartlesSonatina for trumpet alone - Alfred Bartles
Sonatina for trumpet alone - Alfred Bartles
 
Divertimento for trompet soli
Divertimento for trompet soliDivertimento for trompet soli
Divertimento for trompet soli
 
Olha pra mim
Olha pra mimOlha pra mim
Olha pra mim
 

Semelhante a 企业级软件的组件化和动态化开发实践

Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
Igor Khotin
 

Semelhante a 企业级软件的组件化和动态化开发实践 (20)

Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Os Haase
Os HaaseOs Haase
Os Haase
 
The Dojo Build System
The Dojo Build SystemThe Dojo Build System
The Dojo Build System
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
Ultimate Survival - React-Native edition
Ultimate Survival - React-Native editionUltimate Survival - React-Native edition
Ultimate Survival - React-Native edition
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle Story
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard Introduction
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: Gradle
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

企业级软件的组件化和动态化开发实践

  • 1. --@sagacity - -IT www.ufida.com www.rayootech.com
  • 2. ‣ ‣ ‣ WTP Facet XDoclet ANT ‣ OSGi—— ‣ Java Bundle
  • 3.
  • 4. ” “ ”
  • 5.
  • 6.
  • 7.
  • 9. ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣
  • 10. Metadata Workflow ‣ ‣ RuleEngine ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ Component Building
  • 11. ‣ ‣ ‣ ‣ ——200 ‣ ‣ ‣ ‣ ——
  • 12. ... ERP Flex AJAX Main FrameWork
  • 13. ... ERP Flex AJAX Main FrameWork
  • 14. ... ERP Here you are! Flex AJAX Main FrameWork
  • 15. ... Flex AJAX ERP GAP-API Main FrameWork
  • 16. Eclipse WTP Facets ‣ XDoclet ‣ Ant ‣ OSGi ‣ ‣ Servlet ‣
  • 17. Eclipse WTP Facets ‣ ‣ WTP Web Tools Platform ‣ WTP ‣ ‣ Facets ‣ Facets
  • 18. WTP Faceted id versions requires conflicts jst.java 1.3, 1.4, 1.5, 1.6 jst.ear jst.web 2.2, 2.3, 2.4 jst.java jst.ear, jst.ejb jst.ear 1.2, 1.3, 1.4, 5.0, 6.0 jst.java jst.ejb 1.1, 2.0, 2.1, 3.0, 3.1 jst.java jst.ear, jst.java
  • 19. WTP Faceted id versions requires conflicts jst.java 1.3, 1.4, 1.5, 1.6 jst.ear jst.web 2.2, 2.3, 2.4 jst.java jst.ear, jst.ejb jst.ear 1.2, 1.3, 1.4, 5.0, 6.0 jst.java jst.ejb 1.1, 2.0, 2.1, 3.0, 3.1 jst.java jst.ear, jst.java
  • 22. XDoclet & Ant ‣ XDoclet ‣ Merge Point ‣ Ant ‣ ‣ ‣ Facets Ant XDoclet
  • 23. build.xml ‣ -MergePoint i18n oid spring include ‣ TotalBuild ‣ Facet
  • 24.
  • 27. TotalBuild Facets
  • 28. ‣ ‣ build.xml clean compile jar distribution db merge resource ‣ ant src webModule ‣ Distribution
  • 29. Merge ‣ xdt ‣ applicationContext.xdt------------spring ‣ global.xdt---------------------------include global.jsp ‣ web.xdt-----------------------------web.xml ‣ ...... ‣ Merge Point <XDtMerge:merge file="workflow-hbm.data"></XDtMerge:merge>
  • 30. Merge <value>gap/wf/persistent/db/bo/GapwfProcessinstance.hbm.xml</value> <value>gap/wf/persistent/db/bo/GapwfActivityinstance.hbm.xml</value> <value>gap/wf/persistent/db/bo/GapwfActivityinstancepre.hbm.xml</value> <value>gap/wf/persistent/db/bo/GapwfRevelantdata.hbm.xml</value> <value>gap/wf/persistent/db/bo/GapwfWorkitem.hbm.xml</value> <value>gap/wf/persistent/db/bo/GapwfWorkitemdata.hbm.xml</value> <value>gap/wf/persistent/db/bo/GapwfDynprocessrelation.hbm.xml</value> db merge resource src webModule
  • 31. XDoclet <path id="xdoclet.classpath"> <fileset dir="${lib.dir}"> <include name="*.jar"/> ‣ XDoclet classpath </fileset> <pathelement location="classes"/> </path> ‣ Ant taskdef ‣ target <taskdef name="xdoclet" classname="xdoclet.DocletTask" classpathref="xdoclet.classpath" /> <target name="gen-applicationContext.xml"> <xdoclet destdir="${webmodule.dir}/WEB-INF/conf/applicationContext" force='true' mergedir="${merge.dir}"> <fileset dir="${source.dir}" includes="**/*.java" /> <template templateFile="template/applicationContext.xdt" destinationfile="applicationContext.xml" /> </xdoclet> </target>
  • 32. TotalBuild ‣ Facets <!-- build.xml--> <target name="build"> <ant dir="${gap-api}" antfile="build.xml" target="all" /> <ant dir="${venus-frame}" antfile="build.xml" target="all" /> <ant dir="${venus-page}" antfile="build.xml" target="all" /> <ant dir="${venus-log}" antfile="build.xml" target="all" /> ...... </target> <!-- --> <target name="plugin"> <available file="Templates" type="dir" property="Templates.present" /> <antcall target="clean" /> <move todir="Templates/0. "> <fileset dir="${gap-api}/dist" /> <fileset dir="${venus-frame}/dist" /> </move> ...... </target>
  • 33. Facet ‣ org.eclipse.ui.newWizards ‣ category wizard
  • 34. org.eclipse.wst.common.project.facet.core.facets ‣ <category />——Facet ‣ <project-facet />——Facet ‣ <project-facet-version />——Facet ‣ <template />—— Facet ‣ <preset />—— Facet —— ‣ org.eclipse.wst.common.project.facet.ui.images ‣ org.eclipse.wst.common.project.facet.ui.wizard
  • 35. Facet <!--Facet --> <project-facet id="gap.mainframe"> <label>0. </label> <description>GAP </description> <category>gap.category</category> </project-facet> <!-- Facet --> <project-facet-version facet="gap.mainframe" version="3.7"> <action id="gap.mainframe.install" type="INSTALL"> <delegate class="venus.tools.ide.facet.GAPFacetInstallDelegate"/> </action> <constraint> <requires facet="jst.web" version="[2.4"/> </constraint> </project-facet-version>
  • 36. Facet ‣ org.eclipse.wst.common.project.facet.core.IDelegate ‣ GAPFacetInstallDelegate Facet ‣ BuildFacetsDelegate ‣ Facet Facet ‣ Facet ‣ XDoclet classpath ‣ project nature .tomcatplugin ‣
  • 38. ‣ ‣ jar ‣ Install Update Remove ‣ Time For:
  • 39. ‣ ‣ jar ‣ Time For:Update Install Remove ‣ Time For: O Gi
  • 40. OSGi ‣ ‣ 2005 R4.0 —— ‣ 2010 3 OSGi 4.2 ‣ Bundle
  • 41. update install refresh INSTALLED STARTING resolve update start refresh RESOLVED ACTIVE stop uninstall uninstall stop UNINSTALLED STOPPING
  • 42. OSGi ‣ Declarative Services ‣ Framework Launching ‣ Blueprint Blueprint Service ‣ Web Web Application Bundle ‣ JPA JTA JDBC......
  • 43. OSGi ‣ Declarative Services ‣ Framework Launching ‣ Blueprint Blueprint Service ‣ Web Web Application Bundle ‣ JPA JTA JDBC......
  • 44. Service Component Model ‣ OSGi ‣ xml Component Service ‣ ‣ Java POJO OSGi ‣
  • 45. —— ‣ Bundle Manifest Bundle-ManifestVersion: 2 ... Service-Component: OSGI-INF/component.xml [, ...]* ‣ OSGI-INF/ <?xml version="1.0" encoding="UTF-8"?> <scr:component name="bookstore-order" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"> <!-- --> <implementation class="com.osgi.ds.OrderService"/> <!-- --> <service><provide interface="com.osgi.ds.IOrder"/></service> <!-- --> <reference interface="com.osgi.ds.ICart" bind="setCart" unbind="unsetCart" policy="dynamic" cardinality="1..1"/> </scr:component>
  • 46. —— ‣ Enabled—— ‣ Satisfied—— ‣ Immediate Component—— ‣ Delayed Component—— ‣ Factory Component——
  • 47. <=>%42.*%0$1-.*$0%*+$%#(45("$"*%#(")-120&*-("%&.%&%.$09-#$%-"%*+$%.$09-#$%0$1-.*0'%& *+$%#(45("$"*%#(")-120&*-("7%?+$%.$09-#$%50(5$0*-$.%)(0%*+-.%0$1-.*0&*-("%#(".-.*%() 50(5$0*-$.%&.%/$)-"$/%-"%+), - & .)/0,12), %&)#%("%5&1$ @AB7 ?+$%.*&*$%/-&10&4%-.%.+(:"%-"%C-120$%@@D7D7% —— 3 & 4 ! , ) / 556 7 6 8 9 9 )* & $ % ) / : 1 9 21 " ) " % / : 1 " ( & 4 ! , $ % & 1 " )(+=,*>+,( 6789:&8;&<3 ‣ Enabled—— B&)/0&2 2,-$2.$&C B&)/0&2 D62,-$2.$&C ‣ Satisfied—— +=,*>+,( $.%CA6,0$)E 9.:&?< !"#$"%&%'()*+&(!,-.&( /&-.010'*2&(3&12*-&4(3$&-*+*-0'*"%(5& '&B$6C$69 ‣ Immediate Component—— !"#$%&#'&()*+&#(&,*'$&(&-#./#0#+12314&4$#+14"*,5(0$*14#.&+12&'#545'&-#.&+05'&#$%&(&#0(&#4 .54-6&'#5'*4,#*$7#$%&4#89:#'%156-#-&0+$*)0$&#$%0$#+12314&4$#+14"*,5(0$*14;#<%*'#0661='#89 !!"#$#2 3(4+5()-./'0/1(1,- 2&4$0$*14'#$1#&0,&(6/#(&+60*2#0+$*)0$&-#+12314&4$#+14"*,5(0$*14'; 8%E$'%&**0-62*$%()%&%/$,&'$/%#(45("$"*%-.%*+$%/$,&'-"1%()%#,&..%,(&/-"1%&"/%(6F$#*%#0 ‣ Delayed Component—— !"#$%&'(()*+ *+$%&#*-9&*-("%()%&%/$,&'$/%#(45("$"*%#(")-120&*-("%/($.%"(*%(##20%2"*-,%*+$0$%-.%& ,&-./&0'123425&56'1257"#$%.6"25 )(0%&%.$09-#$%(6F$#*7%8%#(45("$"*%-.%&%/$,&'$/%#(45("$"*%:+$"%-*%.5$#-)-$.%&%.$09-#$ *(0'%#(45("$"*%&"/%/($.%"(*%+&9$%*+$%!""#$!%&#%&**0-62*$%()%*+$%'(")(*#*&%$,$4 <1&'(:;&(1 2345674%789 ‣ Factory Component—— <=>%42.*%0$1-.*$0%&%.$09-#$%&)*$0%*+$%#(45("$"*%#(")-120&*-("%6$#(4$.%.&*-.)-$/7%? *+-.%.$09-#$%42.*%,((E%*(%(6.$09$0.%()%*+$%.$09-#$%0$1-.*0'%&.%-)%*+$%#(45("$"*I.%62" B&-"#&4 B&-"#&4 *$0$/%*+-.%.$09-#$7%?+-.%.*0&*$1'%4&E$.%-*%5(..-6,$%*(%0$1-.*$0%.$09-#$.%:-*+(2*%#0$&*-" D%40'*4+*&C 40'*4+*&C )(0%*+$%62"/,$%&"/%,(&/-"1%#,&..$.3%*+$0$6'%&,,(:-"1%0$/2#*-("%-"%-"-*-&,-J&*-("%*-4 4$4(0'%)((*50-"*7 >8?7468>89 D%9&' B&-"#&4 4&12*-& D%40'*4+*&C K+$"%<=>%0$1-.*$0.%*+$%.$09-#$%("%6$+&,)%()%&%#(45("$"*%#(")-120&*-("3%-*%42.*%&9( 6 9&' 4&12*-&+0-'"1,E(F77% ,(&/%*(%(##20%)0(4%*+$%#(45("$"*L.%62"/,$7%<=>%#&"%$".20$%*+-.%6'%0$1-.*$0-"1%&%-# 4&12*-& "'G&1H*4&E(6 (6F$#*%:-*+%*+$%C0&4$:(0E%)(0%*+&*%.$09-#$7%M'%0$1-.*$0-"1%&%-#+.!'#/%'&(+0%(6F$#*3%* &'(:;&(1 (6F$#*%-.%"(*%"$$/$/%2"*-,%*+$%-#+.!'#/%'&(+0%-.%#&,,$/%*(%50(9-/$%*+$%.$09-#$%(6F$#*7% *+(C,%0#*-E 5-67=8 $0*-$.%)(0%*+-.%0$1-.*0&*-("%#(".-.*%()%*+$%#(45("$"*%50(5$0*-$.%&.%/$)-"$/%-"%+), - & .)/ 1&B*%C*%9 @AB7
  • 48. R4.2 API OSGi ‣ OSGi ——org.osgi.framework.launch.FrameworkFactory ‣ OSGi web listener OSGi ‣ Class<FrameworkFactory> factoryClass = ServiceLoader.load(FrameworkFactory.class); FrameworkFactory factory = factoryClass.newInstance(); Map<Object, Object> conf; ......// Framework framework=factory.newFramework(conf); framework.init(); BundleContext bundleContext = framework.getBundleContext(); ......// bundle framework.start();
  • 49. BluePrint ‣ BluePrint ——Spring Dynamic Modules-->Eclipse Gemini ‣ OSGi dependency injection ‣ OSGi ‣ POJO ‣ OSGI-INF/blueprint/ <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> ... </blueprint>
  • 50. 3&45"$,67689 :$0;,(%"5)%5"$ 5&'( BluePrint ——Bean ‣ Java 9 ‣ ',+7/&(1 0,.0&,18 ‣ argument, property, scope ‣ className, factoryMethod, factoryComponent !"!#$#" 45&'(6 !"#$G#%&2&%&$3.'$&$7#&-$/&-&(#'$+,$'#*'#,#-%#2$+-$%"#$$/&.#0&'.1.'.$+-%#'3& <bean id="order" class="com.osgi.bs.OrderService" init-method="init" destroy-method="destroy"> 2(3)(#&#'0&'.1.'.<$!&70# CBC<C$.-$*&(# BCI$*'.5+2#,$&-$.5#'5+#9$.3$%"#$'# <argument value="1"/> <argument value="2"/> &-2$%"#$/&.#0&'.1.'.$+-%#'3&6#<$!"#$%&70#$.-0)$*'.5+2#,$&$,1//&')4$%"#$,./ %+.-,$7#%9##-$%"#$2+33#'#-%$3#&%1'#,$&'#$2+,61,,#2$+-$0&%#'$,#6%+.-,< <property name="Description" value="This is the order"/> </bean> <01/$,67686 :$0;,=0;04$",3$0%5"$' :11,;571&).,)<=&/&(1 >8(1'? %&'()*&1'@'1' A&BC,;01;.( "1 45 "16 !"#$+2$.3$&$%.*$0
  • 51. BluePrint —— <!-- --> <service id="orderService" interface="com.osgi.bs.IOrderService" ref="order"> <service-properties> <entry key="order.discount" value="0.8"/> </service-properties> </service> <!-- --> OrderService os = new OrderService(1, 2); os.setDescription( "This is the order" ); Hashtable props = new Hashtable(); props.put("order.discount", "0.8"); bundleContext.registerService(com.osgi.bs.OrderService.class.getName(), os, props);
  • 52. BluePrint —— <!--reference --> <reference id="orderRef" interface="com.osgi.bs.IOrderService" timeout="1000" availability="optional"/> <bean id="orderClient" class="..."> <property name="order" ref="orderRef"/> </bean> <!--reference-list --> <reference-list id="orderRefs" interface="com.osgi.bs.IOrderService" availability="optional"> <reference-listener bind-method="bind" unbind-method="unbind"> <bean class="com.osgi.bs.ReferenceListener"/> </reference-listener> </reference-list>
  • 53. BluePrint —— <!--reference --> <reference id="orderRef" interface="com.osgi.bs.IOrderService" timeout="1000" availability="optional"/> <bean id="orderClient" class="..."> List <property name="order" ref="orderRef"/> </bean> List <!--reference-list --> <reference-list id="orderRefs" interface="com.osgi.bs.IOrderService" availability="optional"> <reference-listener bind-method="bind" unbind-method="unbind"> <bean class="com.osgi.bs.ReferenceListener"/> </reference-listener> </reference-list>
  • 54. BluePrint VS ‣ ‣ ‣ BluePrint Java ‣ R4.0 DS R4.2 BS ‣ DS BS
  • 55. OSGi Web ‣ Web OSGi ✓ Modularity—— ✓ Lifecycle—— | | | ✓ Services——
  • 56. OSGi Web ‣ ✓ HttpService ✓ Bridged
  • 57. tion we have been using in Toast. Bridged—In the Bridged approach, the coding and exposure model same as in Solo, but here the OSGi framework is embedded into a w OSGi Web Servlets ‣ JSPs ✓ HttpService ✓ Bridged HTTP OSGi Java Figure 19–1 Solo server-side configuration
  • 58. tion we have been using in Toast. Bridged—In the Bridged approach, the coding and exposure model same as in Solo, but here the OSGi framework is embedded into a w OSGi Web Servlets ‣ !"#$$%&'()*+,-../00123%0454006%78%972:;0<28=2&:0>4;05?>?00@A>50#! JSPs ✓ HttpService ✓ Bridged 19.2 Embedding the Back End in a Web Application HTTP 323 OSGi Servlets Java JSPs Figure 19–1 Solo server-side configuration HTTP Lite HTTP Bridge OSGiEquinox Framework Application Server Figure 19–2 Bridged server-side configuration
  • 59. ——WAB ‣ WAB——Web Application Bundle1.0 R4.2 ‣ Bundle OSGi Web ‣ Servlet2.5 JSP2.1 Manifest-Version: 1.0 Import-Package: ... ... Bundle-Version: 1.0 Bundle-Name: orderManager Bundle-ClassPath: WEB-INF/lib/commons-logging.jar,WEB-INF/ classes Web-ContextPath: /order Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.osgi.bs.order
  • 60. Web Bundle Architecture Web Application Bundles Bundles Deploy Bundle Admin Console Bundle Application Server/OSGi Runtime JVM
  • 61. Web Bundle Architecture Web Application Bundles Bundles Deploy Bundle Admin Console Bundle Application Server/OSGi Runtime JVM
  • 62. Equinox—— OSGi Eclipse ‣ Gemini (Spring DM)—— R4.2 ‣ Virgo (Spring DM Server)—— OSGi Application Server ‣ Felix—— OSGi ‣ Nuxeo—— CMS OSGi
  • 63. Questions? Follow me at twitter.com/sagacity t.sina.com.cn/n/

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n