1 Reply Latest reply on Oct 23, 2007 2:04 PM by Scott Stark

    jboss.xml service-ref

    Scott Stark Master

      We are not using the full jboss overriden service-ref in the jboss_5_0.xsd. The jndiEnvironmentRefsGroup is referring to a remapped javaee:service-refGroup:

       <xsd:group name="jndiEnvironmentRefsGroup">
       <xsd:sequence>
      ...
       <xsd:group ref="jboss:service-refGroup" />
      ...
       </xsd:sequence>
       </xsd:group>
      
       <!-- Bring service-refGroup into jboss namespace from javaee_web_services_client_1_2 -->
       <xsd:group name="service-refGroup">
       <xsd:sequence>
       <xsd:element name="service-ref" type="javaee:service-refType"
       minOccurs="0" maxOccurs="unbounded">
       <xsd:key name="service-ref_handler-name-key">
       <xsd:selector xpath="javaee:handler" />
       <xsd:field xpath="javaee:handler-name" />
       </xsd:key>
       </xsd:element>
       </xsd:sequence>
       </xsd:group>
      
      ...
      


      Some beans are referring to the javaee:service-refType:
       <xsd:complexType name="message-driven-beanType">
       <xsd:sequence>
       <xsd:group ref="javaee:descriptionGroup"/>
       <xsd:element name="ejb-name" type="javaee:ejb-nameType"/>
      ...
       <xsd:element name="service-ref" type="javaee:service-refType" minOccurs="0"
       maxOccurs="unbounded"/>
      


      while the full jboss-service-refType type is unused:
       <xsd:complexType name="jboss-service-refType">
       <xsd:sequence>
       <xsd:element name="service-ref-name" type="xsd:string"/>
       <xsd:element name="service-impl-class" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="service-qname" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="config-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="config-file" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="handler-chain" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="port-component-ref" type="jboss:port-component-ref-type" minOccurs="0" maxOccurs="unbounded"/>
       <xsd:element name="wsdl-override" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       </xsd:sequence>
       <xsd:attribute name="id" type="xsd:ID"/>
       </xsd:complexType>
      
       <xsd:complexType name="port-component-ref-type">
       <xsd:sequence>
       <xsd:element name="service-endpoint-interface" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="port-qname" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="config-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="config-file" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="stub-property" type="jboss:stub-property-type" minOccurs="0" maxOccurs="unbounded"/>
       </xsd:sequence>
       </xsd:complexType>
      
       <xsd:complexType name="stub-property-type">
       <xsd:sequence>
       <xsd:element name="prop-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       <xsd:element name="prop-value" type="xsd:string" minOccurs="0" maxOccurs="1"/>
       </xsd:sequence>
       </xsd:complexType>
      


      All of the service-refs need to be of type jboss-service-refType, and we need to add a JBossServiceReferencesMetaData extension. The associated jira issue I'm working on is:
      http://jira.jboss.com/jira/browse/JBAS-4895


        • 1. Re: jboss.xml service-ref
          Scott Stark Master

          The general approach we are taking is to make the jboss metadata an extension of any corresponding spec metadata. The JBossServiceReferenceMetaData would then include the javaee:service-refGroup and jboss:service-refGroup types for something like:

          package org.jboss.metadata.javaee.jboss;
          
          import javax.xml.bind.annotation.XmlElement;
          import javax.xml.bind.annotation.XmlType;
          import javax.xml.namespace.QName;
          
          import org.jboss.metadata.javaee.spec.PortComponentRef;
          import org.jboss.metadata.javaee.spec.ResourceInjectionMetaData;
          import org.jboss.metadata.javaee.spec.ServiceReferenceHandlerChainsMetaData;
          import org.jboss.metadata.javaee.spec.ServiceReferenceHandlersMetaData;
          import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
          import org.jboss.metadata.javaee.support.MergeableMappedMetaData;
          
          @XmlType(name="service-refType")
          public class JBossServiceReferenceMetaData
           extends ResourceInjectionMetaData
           implements MergeableMappedMetaData<JBossServiceReferenceMetaData>
          {
           /** The serialVersionUID */
           private static final long serialVersionUID = 1;
          
           /** The service interface */
           private String serviceInterface;
          
           /** The service reference type */
           private String serviceRefType;
          
           /** The wsdl file */
           private String wsdlFile;
          
           /** The jaxrpc mapping file */
           private String jaxrpcMappingFile;
          
           /** The service qname */
           private QName serviceQname;
          
           /** The port-component-ref */
           private PortComponentRef portComponentRef;
          
           /** The handlers */
           private ServiceReferenceHandlersMetaData handlers;
          
           /** The handler chains */
           private ServiceReferenceHandlerChainsMetaData handlerChains;
          
           /** The service-impl-class */
           private String serviceClass;
          
           /** The config-name */
           private String configName;
           /** The config-file */
           private String configFile;
          
           /** The handler-chain */
           private String handlerChain;
          
           /** The wsdl file override */
           private String wsdlOverride;
          
           /**
           * Create a new JBossServiceReferenceMetaData.
           */
           public JBossServiceReferenceMetaData()
           {
           // For serialization
           }
          
           public JBossServiceReferenceMetaData merge(JBossServiceReferenceMetaData original)
           {
           JBossServiceReferenceMetaData merged = new JBossServiceReferenceMetaData();
           merged.merge(this, original);
           return merged;
           }
          
          
           /**
           * Get the serviceRefName.
           *
           * @return the serviceRefName.
           */
           public String getServiceRefName()
           {
           return getName();
           }
          
           public ServiceReferenceHandlerChainsMetaData getHandlerChains()
           {
           return handlerChains;
           }
          
           public void setHandlerChains(ServiceReferenceHandlerChainsMetaData handlerChains)
           {
           this.handlerChains = handlerChains;
           }
          
           public ServiceReferenceHandlersMetaData getHandlers()
           {
           return handlers;
           }
          
           public void setHandlers(ServiceReferenceHandlersMetaData handlers)
           {
           this.handlers = handlers;
           }
          
           public String getJaxrpcMappingFile()
           {
           return jaxrpcMappingFile;
           }
          
           public void setJaxrpcMappingFile(String jaxrpcMappingFile)
           {
           this.jaxrpcMappingFile = jaxrpcMappingFile;
           }
          
           public String getServiceInterface()
           {
           return serviceInterface;
           }
          
           public void setServiceInterface(String serviceInterface)
           {
           this.serviceInterface = serviceInterface;
           }
          
           public String getServiceRefType()
           {
           return serviceRefType;
           }
          
           public void setServiceRefType(String serviceRefType)
           {
           this.serviceRefType = serviceRefType;
           }
          
           public String getWsdlFile()
           {
           return wsdlFile;
           }
          
           public void setWsdlFile(String wsdlFile)
           {
           this.wsdlFile = wsdlFile;
           }
          
           /**
           * Set the serviceRefName.
           *
           * @param serviceRefName the serviceRefName.
           * @throws IllegalArgumentException for a null serviceRefName
           */
           @XmlElement(name="service-ref-name")
           public void setServiceRefName(String serviceRefName)
           {
           setName(serviceRefName);
           }
          
           public String getConfigFile()
           {
           return configFile;
           }
          
           public void setConfigFile(String configFile)
           {
           this.configFile = configFile;
           }
          
           public String getConfigName()
           {
           return configName;
           }
          
           public void setConfigName(String configName)
           {
           this.configName = configName;
           }
          
           public String getHandlerChain()
           {
           return handlerChain;
           }
          
           public void setHandlerChain(String handlerChain)
           {
           this.handlerChain = handlerChain;
           }
          
           public PortComponentRef getPortComponentRef()
           {
           return portComponentRef;
           }
          
           public void setPortComponentRef(PortComponentRef portComponentRef)
           {
           this.portComponentRef = portComponentRef;
           }
          
           public String getServiceClass()
           {
           return serviceClass;
           }
          
           public void setServiceClass(String serviceClass)
           {
           this.serviceClass = serviceClass;
           }
          
           public QName getServiceQname()
           {
           return serviceQname;
           }
          
           public void setServiceQname(QName serviceQname)
           {
           this.serviceQname = serviceQname;
           }
          
           public String getWsdlOverride()
           {
           return wsdlOverride;
           }
          
           public void setWsdlOverride(String wsdlOverride)
           {
           this.wsdlOverride = wsdlOverride;
           }
          }
          


          One could either specify the full metadata via the jboss descriptor, or compose it from the spec descriptor + the jboss descriptor settings that only provided the legacy override only information.