Examples of Relationships


Examples of org.apache.camel.component.yammer.model.Relationships

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);
        assertMockEndpointsSatisfied();
       
        Exchange exchange = mock.getExchanges().get(0);
        Relationships relationships = exchange.getIn().getBody(Relationships.class);

        assertEquals(1, relationships.getSuperiors().size());
        assertEquals("Joe Camel", relationships.getSuperiors().get(0).getFullName());       
    }
View Full Code Here

Examples of org.apache.camel.component.yammer.model.Relationships

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);
        assertMockEndpointsSatisfied();
       
        Exchange exchange = mock.getExchanges().get(0);
        Relationships relationships = exchange.getIn().getBody(Relationships.class);

        assertEquals(1, relationships.getSuperiors().size());
        assertEquals("Joe Camel", relationships.getSuperiors().get(0).getFullName());       
    }
View Full Code Here

Examples of org.apache.camel.component.yammer.model.Relationships

        try {
            String jsonBody = endpoint.getConfig().getRequestor(apiUrl).get();

            if (!endpoint.getConfig().isUseJson()) {
                ObjectMapper jsonMapper = new ObjectMapper();
                Relationships relationships = jsonMapper.readValue(jsonBody, Relationships.class);
               
                exchange.getIn().setBody(relationships);
            } else {
                exchange.getIn().setBody(jsonBody);
            }
View Full Code Here

Examples of org.apache.camel.component.yammer.model.Relationships

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);
        assertMockEndpointsSatisfied();
       
        Exchange exchange = mock.getExchanges().get(0);
        Relationships relationships = exchange.getIn().getBody(Relationships.class);

        assertEquals(1, relationships.getSuperiors().size());
        assertEquals("Joe Camel", relationships.getSuperiors().get(0).getFullName());       
    }
View Full Code Here

Examples of org.apache.geronimo.jee.openejb.Relationships

            OpenejbJar openejb = (OpenejbJar)source;
            ResourceLocator locator = openejb.getCmpConnectionFactory();
            if (locator != null && isEmpty(locator.getResourceLink()) && isEmpty(locator.getUrl()) && isEmpty(locator.getPattern())) {
                openejb.setCmpConnectionFactory(null);
            }
            Relationships relationships = openejb.getRelationships();
            if (relationships != null && relationships.getEjbRelation().size() == 0) {
                openejb.setRelationships(null);
            }
        } else if (source instanceof PersistenceContextRef) {
            PersistenceContextRef contextRef = (PersistenceContextRef)source;
            if (contextRef.getPattern() != null && isEmpty(contextRef.getPattern())) {
View Full Code Here

Examples of org.apache.geronimo.jee.openejb.Relationships

            if (relation == null) {
                relation = (EjbRelation)getEFactory().create(EjbRelation.class);
                JAXBElement plan = section.getPlan();
               
                if (JAXBModelUtils.getEjbRelationships(plan) == null) {
                    Relationships relationships = (Relationships)getEFactory().create(Relationships.class);

                    JAXBModelUtils.setEjbRelationships(plan, relationships);
                    ((EjbRelationSection)section).resetInput(relationships);
                }
                JAXBModelUtils.getEjbRelationships(plan).add(relation);
View Full Code Here

Examples of org.apache.muse.ws.dm.muws.Relationships

    }
  }

  private void handleBundleDependencies(BundleContribution contribution, WsResource resource){
    try {
      Relationships relCap = (Relationships)resource.getCapability(MuwsConstants.RELATIONSHIPS_URI);
      if(relCap == null){
        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];
        QName typeNames[] = {new QName("http://resource.management.osgi/Bundle","Requires","osgi")};
        RelationshipType type = new SimpleRelationshipType(typeNames);
        participants[0] = new SimpleParticipant(resource, "required");
        participants[1] = new SimpleParticipant(targetResource, "requires");
        relCap.addRelationship("Bundle Requirement", type, participants);
      }
    } catch(Throwable t){
      t.printStackTrace();
    }
  }
View Full Code Here

Examples of org.apache.muse.ws.dm.muws.Relationships

    }
  }

  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];
        QName typeNames[] = {new QName("http://resource.management.osgi/Service","ServiceConsumer")};
        RelationshipType type = new SimpleRelationshipType(typeNames);
        participants[0] = new SimpleParticipant(resource, "service");
        participants[1] = new SimpleParticipant(targetResource, "consumer");
        relCap.addRelationship("Service Consumer", type, participants);
      }
    } catch(Throwable t){
      t.printStackTrace();
    }
  }
View Full Code Here

Examples of org.apache.openejb.jee.Relationships

                }
            }
        }
        entityMappings.getMappedSuperclass().addAll(mappedSuperclassByClass.values());

        Relationships relationships = ejbJar.getRelationships();
        if (relationships != null) {
            for (EjbRelation relation : relationships.getEjbRelation()) {
                List<EjbRelationshipRole> roles = relation.getEjbRelationshipRole();
                // if we don't have two roles, the relation is bad so we skip it
                if (roles.size() != 2) {
                    continue;
                }
View Full Code Here

Examples of org.apache.openejb.jee.Relationships

  void addRelationshipAnnotations(AppModule appModule) {
    List<EjbModule> ejbModules = appModule.getEjbModules();
    for (EjbModule ejbModule : ejbModules) {
      EjbJar ejbJar = ejbModule.getEjbJar();
      Relationships relationships = ejbJar.getRelationships();
     
      if (relationships == null)
        return;
     
      List<EjbRelation> relations = relationships.getEjbRelation();
     
      for (EjbRelation relation : relations) {
        List<EjbRelationshipRole> roles = relation.getEjbRelationshipRole();
        if (roles == null || roles.size() != 2) {
          // dunno what to do with this
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.