Examples of BundleContribution


Examples of org.eclipse.corona.management.osgi.BundleContribution

        return;
      }
      BundleContribution[] dependencies = contribution.getBundleDependents();
      if(dependencies == null) return;
      for(int i=0;i<dependencies.length;i++){
        BundleContribution dependency = dependencies[i];
        WsResource targetResource = (WsResource)resourceForContribution.get(dependency);
        if(targetResource == null){
          continue;
        }
        Participant[] participants = new Participant[2];
View Full Code Here

Examples of org.eclipse.corona.management.osgi.BundleContribution

  private void handleServiceRelationships(ServiceContribution contribution, WsResource resource){
    try {
      Relationships relCap = (Relationships)resource.getCapability(MuwsConstants.RELATIONSHIPS_URI);
      if(relCap == null) return;

      BundleContribution provider = contribution.getServiceProvider();
      if(provider != null){
        WsResource targetResource = (WsResource)resourceForContribution.get(provider);
        if(targetResource != null){
          Participant[] participants = new Participant[2];
          QName typeNames[] = {new QName("http://resource.management.osgi/Service","ServiceProvider","osgi")};
          RelationshipType type = new SimpleRelationshipType(typeNames);
          participants[0] = new SimpleParticipant(resource, "service");
          participants[1] = new SimpleParticipant(targetResource, "provider");
          relCap.addRelationship("ServiceConsumer", type, participants);

          //Now add reciprocal relationship to the bundle resource
          relCap = (Relationships)targetResource.getCapability(MuwsConstants.RELATIONSHIPS_URI);
          participants = new Participant[2];
          QName serviceTypeNames[] = {new QName("http://resource.management.osgi/Bundle","RegisteredService","osgi")};
          type = new SimpleRelationshipType(serviceTypeNames);
          participants[0] = new SimpleParticipant(resource, "service");
          participants[1] = new SimpleParticipant(targetResource, "provider");
          relCap.addRelationship("RegisteredService", type, participants);
        }
      }

      BundleContribution[] consumers = contribution.getServiceConsumers();
      if(consumers == null) return;
      for(int i=0;i<consumers.length;i++){
        BundleContribution dependency = consumers[i];
        WsResource targetResource = (WsResource)resourceForContribution.get(dependency);
        if(targetResource == null){
          continue;
        }
        Participant[] participants = new Participant[2];
View Full Code Here

Examples of org.eclipse.corona.management.osgi.BundleContribution

  }

  public static BundleContribution[] getBundleDependencies(Bundle bundle) throws Exception {
    Set deps = computeDependencies(bundle);
    if(deps.size() == 0) return null;
    BundleContribution contributions[] = new BundleContribution[deps.size()];
    Iterator i = deps.iterator();
    int j = 0;
    while(i.hasNext()){
      BundleSpecification spec = (BundleSpecification)i.next();
      BundleContribution contribution = (BundleContribution)bundleToContributionMap.get(new Long(spec.getBundle().getBundleId()));
      contributions[j++] = contribution;
    }
    return contributions;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.