• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Managing enterprise client deployment with p2

on

  • 573 views

 

Statistics

Views

Total Views
573
Views on SlideShare
566
Embed Views
7

Actions

Likes
0
Downloads
2
Comments
0

1 Embed 7

http://www.eclipsecon.org 7

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Managing enterprise client deployment with p2 Managing enterprise client deployment with p2 Presentation Transcript

    • Managing enterprise client deployment with p2
      Thomas Kratz
      12.11.2010
      thomas.kratz@eiswind.de
    • About me
      Born 1970,
      Started on a ZX81 in the early 80‘s
      Doing a daytime job with JSF Frontend
      (leave that uncommented)
      Developing a commercial book publisher‘s software
      with my own company Eiswind Software on
      OSGi, Spring, Hibernate, Eclipse RCP since 2007
      Casual Eclipse and Apache project contributor
      (could you provide a patch ?)
      Sometimes dreaming in code.
    • The scenario
      RCP Client talks to backend over HttpInvoker
      Server talks to client through XMPP
      Synchronous
      Remote procedure calls
      Asynchronous messaging
      (XMPP)
    • Client-Server compatibility
      Client and Server share domain classes and service interfaces
      Client bundles
      Server bundles
      Shared bundles must be
      „wire compatible“
    • Definition of „wire compatible“
      OSGi versioning gives us
      major, minor, micro
      qualifier
      We defined that „wire compatible“ means major,minor and micro must match.
      Qualifier my change, shared bundles must be API compatible
      Manifest-Version: 1.0
      Bundle-ManifestVersion: 2
      Bundle-Name: Domain Plugin
      Bundle-SymbolicName: de.eiswind.mango.domain
      Bundle-Version: 1.7.0.20101020
    • Uhh, we have customers
      We are not multi-tenant, so each customer has his own server instance.
      Updating the server at customer site happens at different times
      Client and server should update from single central repository
    • Managing the client
      At login time the client first queries the server for his OSGi version of the shared bundles
      Then he looks in the repo for updates that match the servers version in terms of „wire compatible“
    • Managing the client (2)
      If, at login time, server and client version do not match, Workbench starts up for getting the update with user interface disabled.
      If an update is available, but would need server upgrade first, it is ignored.
    • The solution: p2 queries
      We know the servers shared Bundle version, so we do a query for compatible updates of the product Installable Unit:
      IQueryable<IInstallableUnit> queryable =
      provisioningContext.getMetadata(new NullProgressMonitor());
      IQueryResult<IInstallableUnit> matches =
      queryable.query(
      QueryUtil.createIUQuery("de.eiswind.mango.client.core.mango",
      new VersionRange(Version.createOSGi(major, minor, micro), true,
      Version.createOSGi(major, minor, micro + 1), false)),
      new NullProgressMonitor());
    • Building the Update
      The QueryResult gives us all compatible IU‘s from the repository. We pick the latest and construct an update:
      IQueryResult<IInstallableUnit> allIUFromRepo =
      getAllInstallableUnitFromRepository(provisioningContext);
      List<IInstallableUnit> units = new ArrayList<IInstallableUnit>();
      for (Iterator<IInstallableUnit> it = allIUFromRepo.iterator(); it.hasNext();) {
      newIUFromRepo = it.next();
      units.add(newIUFromRepo);
      }
      // check if something is available at all omitted here
      Collections.sort(units);
      // get the latest matching update
      newIUFromRepo = units.get(units.size() - 1);
    • The UpdateOperation
      // nowwe must ensurethatwedon‘tgetupdateswe
      // do not want
      Update update = new Update(oldIUFromProfile, newIUFromRepo);
      ProvisioningSession session = new ProvisioningSession(agent);
      final UpdateOperation operation = new UpdateOperation(session);
      status = operation.resolveModal(sub.newChild(100));
      // check statusomittedhere
      operation.setSelectedUpdates(new Update[0]);
      for (Update available : operation.getPossibleUpdates()) {
      if (available.equals(update)) {
      log(IStatus.INFO, "Update matches available: " + update, null);
      selected[0] = available;
      operation.setSelectedUpdates(selected);
      }
      // nowruntheProvisioningJob
    • Coming up: The server
      Currentlyserverisbeeingportedtothevirgoruntime
      Virgodoesn‘tworkwith p2 yet, but knowstheconceptof a „remote repository“
    • Server updates
      P2 andvirgorepo on eiswind.de
      Pick upvirgo
      repositoryupdates
      Server at Customer B
      Server at Customer A
    • The update cycle
      P2 andvirgorepo on eiswind.de
      1)
      Server at Customer A
      3) Client pulls update from p2 repo
      2) Client recognizesserver update
    • Thanksforlistening
      Ifyou‘dliketoseethefull update codeexample, just ask.
      Youcanreachme on
      thomas.kratz@eiswind.de
      http://www.eiswind.de