SlideShare une entreprise Scribd logo
1  sur  42
Télécharger pour lire hors ligne
OSGi & Eclipse RCP
Eric Jain
Seattle Java User Group, November 15, 2011
1 acctggat...
2 acctgaat...
3 acctggag...
1 A*24:36N
2 A*02:01:21
3 A*03:20/A*11:86
Samples


                                                                             1 A*24:36N
                                                                             2 A*02:01:21
                                                                             3 A*03:20/A*11:86




                                                                      Resolution
     Quantification
                                                    Sequencing




Extraction    Normalization     Amplification
                                                                                   SNP-Calling   Genotyping



                                                QC Failure / Repeat
             Other Workflows
standalone              client

              ui
h2                           fs-proxy

              logging

       fs
              core      pg
     exec



              fs-http


             server
Workflow A
                                                      (v2)




                                      SNP
                   Sequencing                      Workflow A
                                     Calling           (v1)
                           1.0.0




Amplification



                Sequencing
                   2.0.0


                                      SNP
                                   Discovery



                                                 Workflow B
META-INF/MANIFEST.MF




Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Demo Bundle
Bundle-SymbolicName: org.seajug.demo
Bundle-Version: 1.0.0
Import-Package:
 com.google.common.base;version="[10.0.0,11.0.0)",
 com.google.common.collect;version="[10.0.0,11.0.0)",
 com.google.common.io;version="[10.0.0,11.0.0)"
Export-Package:
 org.seajug.demo;version="1.0.0",
 org.seajug.demo.ui;version="1.0.0"
Bundle-ClassPath: lib/jxl.jar, conf/, .
Bundle-Activator: org.seajug.demo.Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bootstrap CL


            Extensions CL


       System Classpath CL



Context 1    Context 2      Context 3
Bootstrap CL


           Extensions CL


      System Classpath CL




             Bundle 2



Bundle 1                   Bundle 3
                           Fragment A


             Bundle 4
osgi> ss

Framework is launched.

id    State      Bundle
0     ACTIVE     org.eclipse.osgi_3.7.1.R37x_v20110808-1106
                 Fragments=1
1     RESOLVED   org.eclipse.equinox.weaving.hook_1.0.0.v20100108
                 Master=0
2     ACTIVE     org.eclipse.equinox.simpleconfigurator_1.0.200.v20110502
3     RESOLVED   ch.qos.logback.classic_0.9.29
                 Fragments=98
4     RESOLVED   ch.qos.logback.core_0.9.29
5     RESOLVED   com.google.guava_10.0.0
...
53    <<LAZY>>   org.eclipse.emf.ecore_2.7.0.v20110912-0920
...
78    RESOLVED   org.eclipse.swt_3.7.1.v3738a
                 Fragments=79
79    RESOLVED   org.eclipse.swt.win32.win32.x86_64_3.7.1.v3738a
                 Master=78
...
From: Creating Modular Applications in Java. Manning, 2011.
Activator.java




package org.seajug.demo;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

public class Activator implements BundleActivator {

    @Override
    public void start(BundleContext context) {
      context.registerService(Foo.class, new Foo(), null);
      ServiceReference<Bar> ref =
        context.getServiceReference(Bar.class);
      Bar bar = (Bar) context.getService(ref);
      ...
    }

    @Override
    public void stop(BundleContext context) {

    }
}
META-INF/spring-context.xml




<?xml version="1.0" encoding="UTF-8"?>

<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:osgi="http://www.springframework.org/schema/osgi"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="..."
>

 <osgi:reference id="foo" interface="org.seajug.demo.Foo"/>

 <bean id="bar" class="org.seajug.demo.internal.BarImpl"/>

 <osgi:service ref="bar" interface="org.seajug.demo.Bar"/>

 <context:annotation-config/>

</beans>
pom.xml
<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <version>2.1.0</version>
  <configuration>
    <instructions>
      <module>com.google.inject</module>
      <Bundle-Copyright>Copyright (C) 2006 Google Inc.</Bundle-Copyright>
      <Bundle-DocURL>http://code.google.com/p/google-guice/</Bundle-DocURL>
      <Bundle-Name>${project.artifactId}</Bundle-Name>
      <Bundle-SymbolicName>$(module)</Bundle-SymbolicName>
      <Bundle-RequiredExecutionEnvironment>
        J2SE-1.5,JavaSE-1.6
      </Bundle-RequiredExecutionEnvironment>
      <Import-Package>!com.google.inject.*,*</Import-Package>
      <_versionpolicy>
        [$(version;==;$(@)),$(version;+;$(@)))
      </_versionpolicy>
    </instructions>
  </configuration>
  <executions>
    <execution>
      <phase>prepare-package</phase>
      <goals>
        <goal>manifest</goal>
      </goals>
    </execution>
  </executions>
</plugin>
module-info.java




module com.greetings @ 0.1 {
    requires jdk.base; // default to the highest available version
    requires org.astro @ 1.[1.1.1]+;
    class com.greetings.Hello;
}}




                                  http://openjdk.java.net/projects/jigsaw/
TableDemo.java




package org.seajug.demo;

import   org.eclipse.swt.SWT;
import   org.eclipse.swt.widgets.Composite;
import   org.eclipse.swt.widgets.Table;
import   org.eclipse.swt.widgets.TableItem;

public class TableDemo {

    public void show(String[] values, Composite parent) {
      Table table = new Table(parent, SWT.BORDER | SWT.V_SCROLL);
      for (String value : values) {
        TableItem item = new TableItem(table, SWT.NONE);
        item.setText(value);
      }
    }
}
TableViewerDemo.java




package org.seajug.demo;

import   org.eclipse.jface.viewers.ArrayContentProvider;
import   org.eclipse.jface.viewers.LabelProvider;
import   org.eclipse.jface.viewers.TableViewer;
import   org.eclipse.swt.SWT;
import   org.eclipse.swt.widgets.Composite;

public class TableViewerDemo {

    public void show(String[] values, Composite parent) {
      TableViewer viewer = new TableViewer(parent, SWT.BORDER | SWT.V_SCROLL);
      viewer.setLabelProvider(new LabelProvider());
      viewer.setContentProvider(new ArrayContentProvider());
      viewer.setInput(values);
    }
}
TableViewPartDemo.java

package org.seajug.demo;

import   org.eclipse.jface.viewers.TableViewer;
import   org.eclipse.swt.widgets.Composite;
import   org.eclipse.ui.IViewSite;
import   org.eclipse.ui.PartInitException;
import   org.eclipse.ui.part.ViewPart;

public class DemoViewPart extends ViewPart {

    private TableViewer viewer;

    @Override
    public void init(IViewSite site) throws PartInitException {
      super.init(site);
    }

    @Override
    public void createPartControl(Composite parent) {
      viewer = new TableViewer(parent, SWT.BORDER | SWT.V_SCROLL);
      ...
    }

    @Override
    public void setFocus() {
      viewer.getControl().setFocus();
    }

    @Override
    public void dispose() {
      super.dispose();
    }
}
plugin.xml



<extension point="org.eclipse.ui.views">
  <view
     id="demoView"
     name="Demo"
     class="org.seajug.demo.DemoViewPart"
  />
</extension>
plugin.xml


<extension point="org.eclipse.ui.commands">
  <command id="openItem" name="Open Item"/>
</extension>

<extension point="org.eclipse.ui.handlers">
  <handler class="org.seajug.demo.OpenItemHandler" commandId="openItem">
    <activeWhen>
      <with variable="activePartId">
        <equals value="demoView"/>
      </with>
    </activeWhen>
    <enabledWhen>
      <with variable="selection">
        <and>
          <count value="1"/>
          <iterate>
             <instanceof value="org.seajug.demo.Item"/>
          </iterate>
        </and>
      </with>
    </enabledWhen>
  </handler>
</extension>

<extension point="org.eclipse.ui.menus">
  <menuContribution locationURI="toolbar:demoView">
    <command commandId="openItem" icon="icons/open.png" style="push"/>
  </menuContribution>
</extension>
package org.fhcrc.gems.ui;

import   org.eclipse.core.runtime.IProgressMonitor;
import   org.eclipse.core.runtime.IStatus;
import   org.eclipse.core.runtime.Status;
import   org.eclipse.core.runtime.jobs.Job;

public class JobDemo {

    public void run() {
      new Job("Genotyping") {
        @Override
        protected IStatus run(IProgressMonitor monitor) {
          monitor.beginTask("Reticulating splines", 100);
          for (int i = 0; i < 100; ++i) {
            if (monitor.isCanceled()) {
              return Status.CANCEL_STATUS;
            }
            ...
          }
          monitor.done();
          return Status.OK_STATUS;
        }
      }.schedule();
    }
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0">

 <modelVersion>4.0.0</modelVersion>

 <groupId>org.seajug.demo</groupId>
 <artifactId>parent</artifactId>
 <version>1.0.0-SNAPSHOT</version>
 <packaging>pom</packaging>

 <properties>
   <tycho-version>0.13.0</tycho-version>
 </properties>

 <modules>
   <module>product</module>
   <module>org.seajug.demo.core</module>
   <module>org.seajug.demo.feature</module>
   <module>org.seajug.demo.test</module>
   <module>target-definition</module>
 </modules>

 <build>
   <plugins>
     <plugin>
       <groupId>org.eclipse.tycho</groupId>
       <artifactId>tycho-maven-plugin</artifactId>
       <version>${tycho-version}</version>
       <extensions>true</extensions>
     </plugin>
     <plugin>
       <groupId>org.eclipse.tycho</groupId>
       <artifactId>target-platform-configuration</artifactId>
       <version>${tycho-version}</version>
       <configuration>
          <resolver>p2</resolver>
          <target>
            <artifact>
              <groupId>org.seajug.demo</groupId>
              <artifactId>target-definition</artifactId>
              <version>1.0.0-SNAPSHOT</version>
              <classifier>build</classifier>
            </artifact>
          </target>
       </configuration>
     </plugin>
   </plugins>
 </build>
org.seajug.demo.core/pom.xml




<project xmlns="http://maven.apache.org/POM/4.0.0">

 <modelVersion>4.0.0</modelVersion>

 <groupId>org.seajug.demo</groupId>
 <artifactId>org.seajug.demo.core</artifactId>
 <version>1.0.0-SNAPSHOT</version>
 <packaging>eclipse-plugin</packaging>

 <parent>
   <groupId>org.seajug.demo</groupId>
   <artifactId>parent</artifactId>
   <version>1.0.0-SNAPSHOT</version>
 </parent>

</project>
OSGi and Eclipse RCP
OSGi and Eclipse RCP
OSGi and Eclipse RCP

Contenu connexe

Tendances

Jersey framework
Jersey frameworkJersey framework
Jersey framework
knight1128
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
elliando dias
 
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
julien.ponge
 
Hello click click boom
Hello click click boomHello click click boom
Hello click click boom
symbian_mgl
 

Tendances (20)

Тестирование на Android с Dagger 2
Тестирование на Android с Dagger 2Тестирование на Android с Dagger 2
Тестирование на Android с Dagger 2
 
Java8 tgtbatu javaone
Java8 tgtbatu javaoneJava8 tgtbatu javaone
Java8 tgtbatu javaone
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
Java(8) The Good, The Bad and the Ugly
Java(8) The Good, The Bad and the UglyJava(8) The Good, The Bad and the Ugly
Java(8) The Good, The Bad and the Ugly
 
Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017Making the most of your gradle build - Gr8Conf 2017
Making the most of your gradle build - Gr8Conf 2017
 
Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017Making the most of your gradle build - Greach 2017
Making the most of your gradle build - Greach 2017
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
 
#11.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원학원,재직자/실업자교육학원,스프링교육,마이바...
#11.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원학원,재직자/실업자교육학원,스프링교육,마이바...#11.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원학원,재직자/실업자교육학원,스프링교육,마이바...
#11.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_국비지원학원,재직자/실업자교육학원,스프링교육,마이바...
 
Easy REST APIs with Jersey and RestyGWT
Easy REST APIs with Jersey and RestyGWTEasy REST APIs with Jersey and RestyGWT
Easy REST APIs with Jersey and RestyGWT
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
 
The Ring programming language version 1.10 book - Part 94 of 212
The Ring programming language version 1.10 book - Part 94 of 212The Ring programming language version 1.10 book - Part 94 of 212
The Ring programming language version 1.10 book - Part 94 of 212
 
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
 
Java 7 LavaJUG
Java 7 LavaJUGJava 7 LavaJUG
Java 7 LavaJUG
 
Google I/O 2021 Recap
Google I/O 2021 RecapGoogle I/O 2021 Recap
Google I/O 2021 Recap
 
Turbo Charged Test Suites
Turbo Charged Test SuitesTurbo Charged Test Suites
Turbo Charged Test Suites
 
Ejemplo radio
Ejemplo radioEjemplo radio
Ejemplo radio
 
Under the Hood: Using Spring in Grails
Under the Hood: Using Spring in GrailsUnder the Hood: Using Spring in Grails
Under the Hood: Using Spring in Grails
 
Hello click click boom
Hello click click boomHello click click boom
Hello click click boom
 

En vedette

Eclipse Extensions Vs OSGI Services Tikal@ EclipseDemoCamps Tel Aviv
Eclipse Extensions Vs OSGI Services   Tikal@ EclipseDemoCamps Tel AvivEclipse Extensions Vs OSGI Services   Tikal@ EclipseDemoCamps Tel Aviv
Eclipse Extensions Vs OSGI Services Tikal@ EclipseDemoCamps Tel Aviv
guestb69b980e
 
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBMOSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
mfrancis
 

En vedette (11)

Eclipse Plug-in Develompent Tips And Tricks
Eclipse Plug-in Develompent Tips And TricksEclipse Plug-in Develompent Tips And Tricks
Eclipse Plug-in Develompent Tips And Tricks
 
Eclipse RCP 4
Eclipse RCP 4Eclipse RCP 4
Eclipse RCP 4
 
OSGi For Eclipse Developers
OSGi For Eclipse DevelopersOSGi For Eclipse Developers
OSGi For Eclipse Developers
 
Eclipse Extensions Vs OSGI Services Tikal@ EclipseDemoCamps Tel Aviv
Eclipse Extensions Vs OSGI Services   Tikal@ EclipseDemoCamps Tel AvivEclipse Extensions Vs OSGI Services   Tikal@ EclipseDemoCamps Tel Aviv
Eclipse Extensions Vs OSGI Services Tikal@ EclipseDemoCamps Tel Aviv
 
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBMOSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
 
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API ToolingOSGi, Eclipse and API Tooling
OSGi, Eclipse and API Tooling
 
PDE Good Practices
PDE Good PracticesPDE Good Practices
PDE Good Practices
 
Intro to OSGi and Eclipse Virgo
Intro to OSGi and Eclipse VirgoIntro to OSGi and Eclipse Virgo
Intro to OSGi and Eclipse Virgo
 
Mastering your Eclipse IDE - Tips, Tricks, Java 8 tooling & More!
Mastering your Eclipse IDE - Tips, Tricks, Java 8 tooling & More!Mastering your Eclipse IDE - Tips, Tricks, Java 8 tooling & More!
Mastering your Eclipse IDE - Tips, Tricks, Java 8 tooling & More!
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in development
 
The Eclipse IDE - The Force Awakens (Devoxx France 2016)
The Eclipse IDE - The Force Awakens (Devoxx France 2016)The Eclipse IDE - The Force Awakens (Devoxx France 2016)
The Eclipse IDE - The Force Awakens (Devoxx France 2016)
 

Similaire à OSGi and Eclipse RCP

Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
telestax
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 

Similaire à OSGi and Eclipse RCP (20)

CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Annotation processing
Annotation processingAnnotation processing
Annotation processing
 
Eric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build systemEric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build system
 
Javascript tdd byandreapaciolla
Javascript tdd byandreapaciollaJavascript tdd byandreapaciolla
Javascript tdd byandreapaciolla
 
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJava
 
JBoss AS Upgrade
JBoss AS UpgradeJBoss AS Upgrade
JBoss AS Upgrade
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
Maven
MavenMaven
Maven
 
devday2012
devday2012devday2012
devday2012
 
Spring Performance Gains
Spring Performance GainsSpring Performance Gains
Spring Performance Gains
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Java Quiz - Meetup
Java Quiz - MeetupJava Quiz - Meetup
Java Quiz - Meetup
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 

Plus de Eric Jain (6)

Image classification with Deeplearning4j
Image classification with Deeplearning4jImage classification with Deeplearning4j
Image classification with Deeplearning4j
 
Combining your data with Zenobase
Combining your data with ZenobaseCombining your data with Zenobase
Combining your data with Zenobase
 
Java Time Puzzlers
Java Time PuzzlersJava Time Puzzlers
Java Time Puzzlers
 
beta.uniprot.org - 5 Lessons Learned
beta.uniprot.org - 5 Lessons Learnedbeta.uniprot.org - 5 Lessons Learned
beta.uniprot.org - 5 Lessons Learned
 
UniProt REST API
UniProt REST APIUniProt REST API
UniProt REST API
 
UniProt & Ontologies
UniProt & OntologiesUniProt & Ontologies
UniProt & Ontologies
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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...
 
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
 
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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

OSGi and Eclipse RCP

  • 1. OSGi & Eclipse RCP Eric Jain Seattle Java User Group, November 15, 2011
  • 2.
  • 4. 1 A*24:36N 2 A*02:01:21 3 A*03:20/A*11:86
  • 5. Samples 1 A*24:36N 2 A*02:01:21 3 A*03:20/A*11:86 Resolution Quantification Sequencing Extraction Normalization Amplification SNP-Calling Genotyping QC Failure / Repeat Other Workflows
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. standalone client ui h2 fs-proxy logging fs core pg exec fs-http server
  • 17. Workflow A (v2) SNP Sequencing Workflow A Calling (v1) 1.0.0 Amplification Sequencing 2.0.0 SNP Discovery Workflow B
  • 18. META-INF/MANIFEST.MF Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Demo Bundle Bundle-SymbolicName: org.seajug.demo Bundle-Version: 1.0.0 Import-Package: com.google.common.base;version="[10.0.0,11.0.0)", com.google.common.collect;version="[10.0.0,11.0.0)", com.google.common.io;version="[10.0.0,11.0.0)" Export-Package: org.seajug.demo;version="1.0.0", org.seajug.demo.ui;version="1.0.0" Bundle-ClassPath: lib/jxl.jar, conf/, . Bundle-Activator: org.seajug.demo.Activator Bundle-RequiredExecutionEnvironment: JavaSE-1.6
  • 19. Bootstrap CL Extensions CL System Classpath CL Context 1 Context 2 Context 3
  • 20. Bootstrap CL Extensions CL System Classpath CL Bundle 2 Bundle 1 Bundle 3 Fragment A Bundle 4
  • 21.
  • 22. osgi> ss Framework is launched. id State Bundle 0 ACTIVE org.eclipse.osgi_3.7.1.R37x_v20110808-1106 Fragments=1 1 RESOLVED org.eclipse.equinox.weaving.hook_1.0.0.v20100108 Master=0 2 ACTIVE org.eclipse.equinox.simpleconfigurator_1.0.200.v20110502 3 RESOLVED ch.qos.logback.classic_0.9.29 Fragments=98 4 RESOLVED ch.qos.logback.core_0.9.29 5 RESOLVED com.google.guava_10.0.0 ... 53 <<LAZY>> org.eclipse.emf.ecore_2.7.0.v20110912-0920 ... 78 RESOLVED org.eclipse.swt_3.7.1.v3738a Fragments=79 79 RESOLVED org.eclipse.swt.win32.win32.x86_64_3.7.1.v3738a Master=78 ...
  • 23. From: Creating Modular Applications in Java. Manning, 2011.
  • 24. Activator.java package org.seajug.demo; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; public class Activator implements BundleActivator { @Override public void start(BundleContext context) { context.registerService(Foo.class, new Foo(), null); ServiceReference<Bar> ref = context.getServiceReference(Bar.class); Bar bar = (Bar) context.getService(ref); ... } @Override public void stop(BundleContext context) { } }
  • 25. META-INF/spring-context.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="..." > <osgi:reference id="foo" interface="org.seajug.demo.Foo"/> <bean id="bar" class="org.seajug.demo.internal.BarImpl"/> <osgi:service ref="bar" interface="org.seajug.demo.Bar"/> <context:annotation-config/> </beans>
  • 26.
  • 27. pom.xml <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.1.0</version> <configuration> <instructions> <module>com.google.inject</module> <Bundle-Copyright>Copyright (C) 2006 Google Inc.</Bundle-Copyright> <Bundle-DocURL>http://code.google.com/p/google-guice/</Bundle-DocURL> <Bundle-Name>${project.artifactId}</Bundle-Name> <Bundle-SymbolicName>$(module)</Bundle-SymbolicName> <Bundle-RequiredExecutionEnvironment> J2SE-1.5,JavaSE-1.6 </Bundle-RequiredExecutionEnvironment> <Import-Package>!com.google.inject.*,*</Import-Package> <_versionpolicy> [$(version;==;$(@)),$(version;+;$(@))) </_versionpolicy> </instructions> </configuration> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>manifest</goal> </goals> </execution> </executions> </plugin>
  • 28. module-info.java module com.greetings @ 0.1 { requires jdk.base; // default to the highest available version requires org.astro @ 1.[1.1.1]+; class com.greetings.Hello; }} http://openjdk.java.net/projects/jigsaw/
  • 29. TableDemo.java package org.seajug.demo; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; public class TableDemo { public void show(String[] values, Composite parent) { Table table = new Table(parent, SWT.BORDER | SWT.V_SCROLL); for (String value : values) { TableItem item = new TableItem(table, SWT.NONE); item.setText(value); } } }
  • 30. TableViewerDemo.java package org.seajug.demo; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; public class TableViewerDemo { public void show(String[] values, Composite parent) { TableViewer viewer = new TableViewer(parent, SWT.BORDER | SWT.V_SCROLL); viewer.setLabelProvider(new LabelProvider()); viewer.setContentProvider(new ArrayContentProvider()); viewer.setInput(values); } }
  • 31. TableViewPartDemo.java package org.seajug.demo; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IViewSite; import org.eclipse.ui.PartInitException; import org.eclipse.ui.part.ViewPart; public class DemoViewPart extends ViewPart { private TableViewer viewer; @Override public void init(IViewSite site) throws PartInitException { super.init(site); } @Override public void createPartControl(Composite parent) { viewer = new TableViewer(parent, SWT.BORDER | SWT.V_SCROLL); ... } @Override public void setFocus() { viewer.getControl().setFocus(); } @Override public void dispose() { super.dispose(); } }
  • 32. plugin.xml <extension point="org.eclipse.ui.views"> <view id="demoView" name="Demo" class="org.seajug.demo.DemoViewPart" /> </extension>
  • 33. plugin.xml <extension point="org.eclipse.ui.commands"> <command id="openItem" name="Open Item"/> </extension> <extension point="org.eclipse.ui.handlers"> <handler class="org.seajug.demo.OpenItemHandler" commandId="openItem"> <activeWhen> <with variable="activePartId"> <equals value="demoView"/> </with> </activeWhen> <enabledWhen> <with variable="selection"> <and> <count value="1"/> <iterate> <instanceof value="org.seajug.demo.Item"/> </iterate> </and> </with> </enabledWhen> </handler> </extension> <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="toolbar:demoView"> <command commandId="openItem" icon="icons/open.png" style="push"/> </menuContribution> </extension>
  • 34.
  • 35.
  • 36. package org.fhcrc.gems.ui; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; public class JobDemo { public void run() { new Job("Genotyping") { @Override protected IStatus run(IProgressMonitor monitor) { monitor.beginTask("Reticulating splines", 100); for (int i = 0; i < 100; ++i) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } ... } monitor.done(); return Status.OK_STATUS; } }.schedule(); } }
  • 37.
  • 38. pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"> <modelVersion>4.0.0</modelVersion> <groupId>org.seajug.demo</groupId> <artifactId>parent</artifactId> <version>1.0.0-SNAPSHOT</version> <packaging>pom</packaging> <properties> <tycho-version>0.13.0</tycho-version> </properties> <modules> <module>product</module> <module>org.seajug.demo.core</module> <module>org.seajug.demo.feature</module> <module>org.seajug.demo.test</module> <module>target-definition</module> </modules> <build> <plugins> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-maven-plugin</artifactId> <version>${tycho-version}</version> <extensions>true</extensions> </plugin> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>target-platform-configuration</artifactId> <version>${tycho-version}</version> <configuration> <resolver>p2</resolver> <target> <artifact> <groupId>org.seajug.demo</groupId> <artifactId>target-definition</artifactId> <version>1.0.0-SNAPSHOT</version> <classifier>build</classifier> </artifact> </target> </configuration> </plugin> </plugins> </build>
  • 39. org.seajug.demo.core/pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0"> <modelVersion>4.0.0</modelVersion> <groupId>org.seajug.demo</groupId> <artifactId>org.seajug.demo.core</artifactId> <version>1.0.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> <parent> <groupId>org.seajug.demo</groupId> <artifactId>parent</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> </project>