1 / 36

Getting Started with Eclipse RT

Getting Started with Eclipse RT. Shaun Smith Hugues Malphettes Greg Wilkins Doug Clarke . About Us. Hugues Malphettes Software engineer at Intalio Based in the Bay Area. Eclipse BPMN original committer Jetty and Orbit committer. Agenda. JPA in OSGi with EclipseLink

cato
Télécharger la présentation

Getting Started with Eclipse RT

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Getting Started with Eclipse RT Shaun Smith Hugues Malphettes Greg Wilkins Doug Clarke

  2. About Us • Hugues Malphettes • Software engineer at Intalio • Based in the Bay Area. • Eclipse BPMN original committer • Jetty and Orbit committer.

  3. Agenda JPA in OSGi with EclipseLink Web-applications in OSGi with Jetty Show-down: JSF backed by JPA and run with Jetty purely with OSGi bundles.

  4. Part I: JPA in OSGi with EclipseLink Shaun's slides

  5. Part II: Web-applications in OSGi with Jetty Hugues Malphettes hmalphettes@intalio.com Greg Wilkins gregw@webtide.com

  6. Jetty-OSGi: why Jetty Architecture Application Server? Software Component? Eclipse plugins are great: Development environment Run / Debug in place Complexity scales thanks to OSGi Back to J2EE? Asked to build a set of well integrated web-applications Required to support existing web-applications

  7. Agenda: Jetty OSGi Web-Bundle: presentation and first demo Runtime environment Jetty-OSGi: Architecture Debugging a runtimeSlides and samples:http://www.intalio.org/public/maven2/org/intalio/osgi/eclipse-con/

  8. Web-Bundle: presentation OSGi's RFC66 Bundle's internals coincide with a WAR/WEB-INF /web.xml /lib /classesindex.html… And with an OSGi manifest:/META-INF/MANIFEST.MF New header: WebContext-Path: /theContextPath

  9. Jetty-OSGi Bootstrap jetty from an OSGi container Support for web-bundles RFC-66 style Support legacy J2EE applications

  10. Web-Bundle: fast track Eclipse-3.6M6 PDE Install Jetty SDK: http://download.eclipse.org/jetty/nightly/jetty7/ Make a new OSGi project

  11. Web-Bundle: fast track Choose the Plugin Template: “RFC66”

  12. Web-Bundle: fast track Investigate the structure of the bundle and the headers in the MANIFEST.MF

  13. Web-Bundle: fast track Right-click on the project and choose “Run As.../Jetty on OSGi.”

  14. Web-Bundle:fast track

  15. Web-Bundle: Fast Track Run / debug in place just like an eclipse plugin Hint: include the entire target platform to access all sources

  16. Web-Bundle: the SDK is optional The SDK only helps with The project template The launch configuration When the SDK is not in place: org.eclipse.jetty.osgi.boot should be set to start -Djetty.home=path/to/jetty/home

  17. Web-Bundle: Target Platform Use a target platform instead of the bundles defined in the eclipse installation Unzip jetty-osgi-min.zip Import the jettyhome-min project into the workspace

  18. Web-Bundle: Target Platform Investigate the default jetty-home setup. The minimum target-platform consists ofjetty's jars, the servlet jar and the osgi jar. Run the web-bundle from PDE Using a standard OSGi launcher The web-bundle is started by default

  19. Web-Bundle: Launch Configuration Jetty-OSGi SDK provides some additional UI

  20. Runtime Export the web-bundle with the sources “Deploy” both the bundle and the source in the runtime:copy them in the plugins folder

  21. Runtime Start on the command line: ./start.sh Try the runtime. 404. Type in the OSGi console “ss” Start the web-bundle if it is not Active.

  22. Runtime Use the OSGi console and type 'services' look at the deployed web-app

  23. Round trip back to PDE Back to PDE. Delete or rename the web-bundle. Import as project with sources the testbundle and org.eclipse.osgi

  24. Round trip back to PDE Show the BundleLoader and put a system error there when the servlet is loaded.

  25. Jetty OSGi: Architecture From J2EE to OSGi Supporting J2EE apps

  26. Traditional J2EE webapp container Hierarchical classloader Each web-app lives in a safe silo decoupled from one other start.jar: bootstrap Shared libraries: lib/ext ... Web-application WEB-INF/lib WEB-INF/classes • Communication between webapps is hard • Share libraries with everyone or no one Web-application #2

  27. Jetty Running inside OSGi Bootstrap Jetty from OSGi Support the Web-Bundles via the Web-Extender OSGI container Jetty bootstrapper Jetty bundles & dependencies Web-extender Web-Bundle

  28. Web-Bundles OSGi benefits: Shared libraries Webapp starting order: Web-Bundle-3 starts before Web-Bundle-2 Logging Web-Bundle 1 Shared-A JPA Web-Bundle 2 Shared B Web-Bundle 3

  29. Web-Bundle deployment Similar to the HttpService: bundleContext.register(ContextHandler.class.getName, …)a service tracker will deploy the corresponding Web-app Web-Bundle support via an extender:A BundleListener registers the ContextHandler service to deploy Web-Bundles. Examples: Custom service tracker to monitor webapps deployment Multiple webapps in a bunlde Custom path to the base resources for a webapp

  30. Jetty in OSGi: supporting J2EE features Bootstrap Jetty from OSGi Setup the J2EE classloaders and traditional web-app deployers Setup the context-classloader during the execution of a webapp OSGI container Jetty bundles Jetty bootstrapper Optional Bundles: JSP, JSF, Central Logging Legacy shared libraries: lib/ext Legacy Web-application WEB-INF/lib WEB-INF/classes

  31. Jetty in OSGi: complete picture OSGI container Jetty bundles Jetty bootstrap Optional Bundles: JSP, JSF, Central Logging Legacy shared libraries: lib/ext Web-Bundle Legacy Web-application WEB-INF/lib WEB-INF/classes

  32. OSGi and J2EE OSGi bundle in PDE Execute in place Debug in place Thousands of plugins, no duplication Tight integration OSGi services: direct access to the objects Encapsulation Libraries and services provided by the platform vendor • J2EE • Build, deploy, execute • Remote debug • 100s of libraries often duplicated • Loosely coupled silos • Web-apps send messages to on another or use EJB Beans • Static layers confined by a hierarchical class-loader • Libraries and services provided by the app developer.

  33. Jetty-OSGi default runtime Jetty-OSGi runtime package Similar to a standard jetty distribution Support for all the traditional J2EE features: Shared libraries Legacy J2EE webapps Central logging with slf4j and logback Jetty – JNDI, Policies... JSP-2.1 JSF: Sun's MyFaces (or Apache MyFaces) Examples: Jasig's CAS (spring web-flow), active-MQ's console ...

  34. Part III: JSF webapp on Jetty with a JPA model with EclipseLink: 100% OSGi Demo

  35. Next steps Manage multiple instances of jetty Contribute JSP and other dependencies to Orbit Refactor the jetty features Support for servlet-3 features: anotations etc Make sure Gemini can use jetty Work on tycho to build those web-bundles What would you like to see?

  36. Q & A You can reach us on IRC@Freenode #jetty Thank you!

More Related