Package org.apache.tuscany.sca.implementation.bpel.xml

Examples of org.apache.tuscany.sca.implementation.bpel.xml.BPELPartnerLinkElement


   * Processes a partnerLink element from the BPEL process and creates a
   * BPELPartnerLink object
   */
  private BPELPartnerLinkElement processPartnerLinkElement( XMLStreamReader reader )
          throws ContributionReadException {
    BPELPartnerLinkElement partnerLink = new BPELPartnerLinkElement(
          reader.getAttributeValue(null, "name"),
          getQNameValue(reader, reader.getAttributeValue(null, "partnerLinkType") ),
          reader.getAttributeValue(null, "myRole"),
          reader.getAttributeValue(null, "partnerRole"));
      // See if there are any SCA extension attributes
      String scaService = reader.getAttributeValue( SCA_BPEL_NS, "service");
      String scaReference = reader.getAttributeValue( SCA_BPEL_NS, "reference");
      if( (scaService != null) && (scaReference != null) ) {
        // It is incorrect to set both service & reference attributes
          error("PartnerLinkHasBothAttr", partnerLink, reader.getAttributeValue(null, "name"));
        throw new ContributionReadException( "BPEL PartnerLink "
            + reader.getAttributeValue(null, "name") +
            " has both sca:reference and sca:service attributes set" );
      }
      // Set the SCA type and the related name, if present
      if( scaService != null ) partnerLink.setAsService( scaService );
      else if ( scaReference != null ) partnerLink.setAsReference( scaReference );
      return partnerLink;
  } // end processPartnerLinkElement
View Full Code Here


  /*
   * Mark a named partnerLink as a Service, unless it is already marked as a Reference
   */
  private void processPartnerLinkAsService( String partnerLinkName,
                    List<BPELPartnerLinkElement> partnerLinks ) {
    BPELPartnerLinkElement partnerLink = findPartnerLinkByName( partnerLinks, partnerLinkName );
    if( partnerLink == null ) {
        warning("ReferencePartnerLinkNotInList", partnerLinkName, partnerLinkName);
    } else {
      // Set the type of the partnerLink to "service" if not already set...
      if( !partnerLink.isSCATyped() ) partnerLink.setAsService( partnerLinkName );
    } // endif
  } // end processPartnerLinkAsReference
View Full Code Here

  /*
   * Mark a named partnerLink as a Reference, unless it is already marked as a Service
   */
  private void processPartnerLinkAsReference( String partnerLinkName,
      List<BPELPartnerLinkElement> partnerLinks ) {
    BPELPartnerLinkElement partnerLink = findPartnerLinkByName( partnerLinks, partnerLinkName );
    if( partnerLink == null ) {
        warning("ReferencePartnerLinkNotInList", partnerLinkName, partnerLinkName);
    } else {
      // Set the type of the partnerLink to "service" if not already set...
      if( !partnerLink.isSCATyped() ) partnerLink.setAsReference( partnerLinkName );
    } // endif
  } // end processPartnerLinkAsReference
View Full Code Here

  private BPELPartnerLinkElement findPartnerLinkByName( List<BPELPartnerLinkElement> partnerLinks,
                              String partnerLinkName ) {
    // Scan the list looking for a partner link with the supplied name
    Iterator<BPELPartnerLinkElement> it = partnerLinks.iterator();
    while( it.hasNext() ) {
      BPELPartnerLinkElement thePartnerLink = it.next();
      if( thePartnerLink.getName().equals(partnerLinkName) ) return thePartnerLink;
    }
    return null;
  } // end method findPartnerLinkByName
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.bpel.xml.BPELPartnerLinkElement

Copyright © 2018 www.massapicom. 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.