Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.Message


         return ((Element)element.getParentNode()).getAttribute("name");
      }
     
      public Message[] parseInputOutputMessages(Element portType, final String fOperationName, final List msgList)
      {
         final Message fRetValue[] = new Message[2];

         if (m_messageMap != null)
         {
            XMLUtil.forEachElementRecur(portType, null, new ElementHandler()
            {              
               public void handleElement(Element element)
               {
                  if ("input".equals(element.getLocalName()))
                  {
                     if (parentName(element).equals(fOperationName))
                     {
                        fRetValue[0] = parseMessage(element);
                     }
                  }
                  else if ("output".equals(element.getLocalName()))
                  {
                     if (parentName(element).equals(fOperationName))
                     {
                        fRetValue[1] = parseMessage(element);
                     }
                  }
               }
              
               private Message parseMessage(Element element)
               {
                  Element wsdlMessage = (Element)m_messageMap.get(stripNamespacePrefix(element.getAttribute("message")));
                 
                  if (wsdlMessage != null)
                  {
                     final Message fRetVal[] = new Message[1];
                    
                     XMLUtil.forEachChildElement(wsdlMessage, null, new ElementHandler()
                     {
                        public void handleElement(Element element)
                        {
                           if ("part".equals(element.getLocalName()))
                           {
                              String elementName = stripNamespacePrefix(element.getAttribute("element"));
                             
                              if (elementName.length() > 0)
                              {
                                 for (Iterator itr = msgList.iterator(); itr.hasNext();)
                                 {
                                    Message msg = (Message)itr.next();
                                   
                                    if (elementName.equals(((XMLMessagePartMapping)msg.getRoot().getMapping()).getNodeName()))
                                    {
                                       fRetVal[0] = msg;
                                    }
                                 }
                              }
View Full Code Here


      String[] sPartNameArray = null;

      for (int i = 0, nCount = message.getDerivedMessageCount(); i < nCount; i++)
      {
         Message derivedMessage = message.getDerivedMessage(i);

         if (sPartNameArray == null)
         {
            int nSize = 0;

            for (MessagePart parent = part; parent.getParent() != null; parent = parent.getParent())
            {
               nSize++;
            }

            sPartNameArray = new String[nSize];

            for (int k = nSize - 1; k >= 0; k--)
            {
               sPartNameArray[k] = part.getName();
               part = part.getParent();
            }
         }

         if (sPartNameArray != null)
         {
            part = derivedMessage.getRoot();

            for (int k = 0; k < sPartNameArray.length; k++)
            {
               part = ((CompositeMessagePart)part).getPart(sPartNameArray[k]);
            }
View Full Code Here

      return (Message[])messageList.toArray(new Message[messageList.size()]);
   }

   public static Message createMessagePart(URL xsdURL, final Metadata metadata, final String rootElement, final MessageNameResolver msgNameResolver) throws IOException
   {
      final Message retVal[] = new Message[1];
      final Lookup namespaceRegistry = new HashTab();
     
      forEachXSModel(xsdURL, new IXSModelHandler()
      {
         public boolean handle(XSModel xsModel, Document wsdlDoc) throws IOException
View Full Code Here

            for (Iterator operationItr = manager.operationIterator(binding); operationItr.hasNext();)
            {
               Element bindingOperation = (Element)operationItr.next();
               String operationName = bindingOperation.getAttribute("name");
              
               Message messages[] = manager.parseInputOutputMessages(portType, operationName, m_msgList);
              
               if (messages[0] != null)
               {
                  messages[0].setResponse(messages[1]);
                 
View Full Code Here

      if (m_classMessageMap == null)
      {
         m_classMessageMap = new HashTab();
      }

      Message other = (Message)m_classMessageMap.put(clazz, mappedMessage);
      Message baseMessage;

      if (other == null)
      {
         // No collision, add mapping to parent as well.
         if ((baseMessage = m_message.getBaseMessage()) != null)
         {
            ((ObjectMessagePartMapping)baseMessage.getRoot().getMapping()).addClassMessage(clazz, mappedMessage);
         }
      }
      else
      {
         // If old entry is base of new entry, new entry is left in map: it is more specific.
         // Otherwise, update map with a more general entry.
         if (!other.isUpcast(mappedMessage))
         {
            if (!mappedMessage.isUpcast(other))
            {
               // The old entry and new entry do not inherit from each other.
               ObjectMessagePartMapping mappedMessageMapping = (ObjectMessagePartMapping)other.getRoot().getMapping();
               ObjectMessagePartMapping otherMapping = (ObjectMessagePartMapping)other.getRoot().getMapping();

               if (otherMapping.isPrimary() ^ mappedMessageMapping.isPrimary())
               {
                  if (otherMapping.isPrimary())
                  {
                     // The old entry takes precedence over the new entry.
                     m_classMessageMap.put(clazz, mappedMessage = other);
                  }
               }
               else
               {
                  // Unable to disambiguate; map to their common base.
                  assert m_message.isUpcast(other) && m_message.isUpcast(mappedMessage);
                  m_classMessageMap.put(clazz, mappedMessage = m_message);
               }
            }

            // Add the mapping to our parent as well.
            if ((baseMessage = m_message.getBaseMessage()) != null)
            {
               ((ObjectMessagePartMapping)baseMessage.getRoot().getMapping()).addClassMessage(clazz, mappedMessage);
            }
         }
      }
   }
View Full Code Here

      }
   }
  
   public Message createMessage(XSElementDeclaration childDecl)
   {
      Message msg[] = new Message[1];

      createMessagePart(null, childDecl, msg);

      return msg[0];
   }
View Full Code Here

      // Add attributes from derived messages
      if (refPart != null)
      {
         ObjectMessagePartMapping refMapping = (ObjectMessagePartMapping)refPart.getMapping();
         Message refMessage = refMapping.getMessage();

         for (int i = 0, nCount = refMessage.getDerivedMessageCount(); i < nCount; i++)
         {
            Message derivedMessage = refMessage.getDerivedMessage(i);
            CompositeMessagePart derivedRoot = derivedMessage.getRoot();
            ObjectMessagePartMapping derivedMapping = (ObjectMessagePartMapping)derivedRoot.getMapping();
            Object derivedAttributes = derivedMapping.getAttributes(derivedRoot, currPathSet, refMessage);

            if (derivedAttributes != null)
            {
View Full Code Here

      boolean bNillable, Message msgArray[])
   {
      assert isComposite(complexDef, parent == null);

      CompositeMessagePartInstance newInstance;
      Message newMsg = null;
      String sMsgName = sNodeName;
      XSComplexTypeDefinition base = findBase(complexDef);

      if (parent == null)
      {
         sMsgName = generateMessageName(sMsgName);

         registerMessageName(sMsgName);
        
         newMsg = new Message(sMsgName);
        
         m_msgList.add(newMsg);
        
         if (msgArray != null)
         {
            msgArray[0] = newMsg;
         }
        
         if (m_metadata != null)
         {
            newMsg.setMetadata(m_metadata);
            newMsg.setFormat(m_metadata.getFormat("XML"));
         }

         if (isRegistered(complexDef))
         {
            String sName = generateDefaultMessageName(sNodeName, null);
            CompositeMessagePartRef ref = new CompositeMessagePartRef(sName);

            ref.setDescription(sElemDesc);
            newMsg.setRoot(ref);
            setMapping(ref, newMsg, sNodeName, sNamespace, bNillable, complexDef);

            addFixup(new MessageRefFixup(ref, sNodeName, sNamespace, bNillable, complexDef));

            return ref;
         }
        
         registerMessage(complexDef, newMsg);

         newInstance = new CompositeMessagePartInstance(sMsgName);
         newMsg.setRoot(newInstance);
        
         if (base != null)
         {
            addFixup(new MessageBaseFixup(base, newMsg));
         }
View Full Code Here

      return true;
   }
  
   private Message getRootMessage(XSComplexTypeDefinition typeDef)
   {
      Message retVal = (Message)getMessageRegistry().get(typeDef);
     
      if (retVal == null)
      {
         throw new PersistenceException("err.persistence.messageNotFoundForElementTypeDefinition", new Object[] {typeDef.getName()});
      }
View Full Code Here

      if (sNamespaceURI == null)
      {
         sNamespaceURI = NO_NAMESPACE;
      }

      Message rootBaseMessage = m_message.getRootBaseMessage();
      RootXMLMessagePartMapping rsmMapping = (RootXMLMessagePartMapping)rootBaseMessage.getRoot().getMapping();

      if (rsmMapping.m_xsdTypeMessageMap == null)
      {
         rsmMapping.m_xsdTypeMessageMap = new HashTab2D();
      }

      Message oldMessage = (Message)rsmMapping.m_xsdTypeMessageMap.put(sNamespaceURI, sXSDType, message);

      if (oldMessage != null && message != oldMessage)
      {
         rsmMapping.m_xsdTypeMessageMap.put(sNamespaceURI, sXSDType, oldMessage);
View Full Code Here

TOP

Related Classes of nexj.core.meta.integration.Message

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.