Package nexj.core.integration

Examples of nexj.core.integration.IntegrationException


    */
   public void initializeMessageTable(MessageTable table) throws IntegrationException
   {
      if (table.getMessageCount() != 1)
      {
         throw new IntegrationException("err.integration.zip.messageTableConflict");
      }

      table.setParserTable(table.getMessage(0));
   }
View Full Code Here


            }
         }
      }
      catch (IOException ex)
      {
         throw new IntegrationException("err.integration.io", ex);
      }
      finally
      {
         IOUtil.close(zipStream);
         IOUtil.close(istream);
View Full Code Here

    */
   public TransferObject parse(Input in, MessageTable table) throws IntegrationException
   {
      if (table == null || !(table.getParserTable() instanceof Message))
      {
         throw new IntegrationException("err.integration.messageTableUninitialized");
      }

      return parse(in, (Message)table.getParserTable());
   }
View Full Code Here

         append1(tobj, message.getRoot(), null);
      }
      catch (Exception e)
      {
         throw new IntegrationException("err.integration.format",
            new Object[]{message.getName()}, e);
      }
      finally
      {
         m_namespaceMap.clear();
View Full Code Here

      {
         if (obj == null)
         {
            if (part.isRequired())
            {
               throw new IntegrationException("err.integration.minPartCount", new Object[]{part.getFullPath()});
            }
         }
         else
         {
            List list = (List)obj;
            int nCount = list.size();
           
            if (nCount < part.getMinCount())
            {
               throw new IntegrationException("err.integration.minPartCount", new Object[]{part.getFullPath()});
            }
           
            if (nCount > part.getMaxCount())
            {
               throw new IntegrationException("err.integration.maxPartCount", new Object[]{part.getFullPath()});
            }
           
            for (int i = 0; i < nCount; ++i)
            {
               append1(list.get(i), part, parentPart);
View Full Code Here

      String sNodeName = derivedMapping.getNodeName();
      boolean bAppendType = false;

      if (obj == null && part.isRequired())
      {
         throw new IntegrationException("err.integration.minPartCount", new Object[]{part.getFullPath()});
      }

      if (obj != null && part instanceof CompositeMessagePart)
      {
         TransferObject tobj = (TransferObject)obj;
         String sDerivedMessageName = tobj.getClassName();

         if (!StringUtil.isEmpty(sDerivedMessageName))
         {
            Message derivedMessage = m_context.getMetadata().getMessage(sDerivedMessageName);
            Message baseMessage = null;

            if (parentPart == null// root of message (includes root part referencing another message)
            {
               baseMessage = ((RootXMLMessagePartMapping)part.getRoot().getMapping()).getRootMessage();
            }
            else if (part instanceof CompositeMessagePartRef)
            {
               CompositeMessagePart referencedPart = ((CompositeMessagePartRef)part).getRefPart();

               baseMessage = ((RootXMLMessagePartMapping)referencedPart.getMapping()).getRootMessage();
            }

            if (baseMessage != null)
            {
               Message.validatePolymorphism(baseMessage, derivedMessage, part);

               if (baseMessage != derivedMessage)
               {
                  part = derivedMessage.getRoot();
                  bAppendType = true;
                  derivedMapping = (XMLMessagePartMapping)part.getMapping();
               }
            }
         }
      }

      if (((RootXMLMessagePartMapping)part.getRoot().getMapping()).getRootMessage().getDerivation() == Message.DERIVATION_ABSTRACT)
      {
         throw new IntegrationException("err.integration.abstractMessage",
            new Object[]{((RootXMLMessagePartMapping)part.getRoot().getMapping()).getRootMessage().getName(), part.getFullPath()});
      }

      if (part instanceof CompositeMessagePart)
      {
View Full Code Here

            {
               if (bSingle)
               {
                  if (bMatch)
                  {
                     throw new IntegrationException("err.integration.multipleParts",
                           new Object[]{part.getFullPath()});
                  }

                  bMatch = true;
               }

               if (bEmpty)
               {
                  m_writer.closeElement();
               }

               bEmpty = false;
               append(tobj.findValue(childPart.getName()), childPart, part);
            }
            else if (!bSingle && childPart.isRequired())
            {
               throw new IntegrationException("err.integration.minPartCount", new Object[]{childPart.getFullPath()});
            }
         }
         else if (nNodeType == XMLMessagePartMapping.VALUE)
         {
            PrimitiveMessagePart contentPart = (PrimitiveMessagePart)childPart;

            if (contentPart.getType() == Primitive.ANY)
            {
               Object value = tobj.findValue(contentPart.getName());

               if (bEmpty)
               {
                  m_writer.closeElement();
               }

               bEmpty = false;
               appendValue(value, contentPart, true);
            }
         }
      }

      if (bRequired && !bMatch)
      {
         throw new IntegrationException("err.integration.missingPart",
               new Object[]{part.getFullPath()});
      }

      // Append element content, if exists
      XMLMessagePartMapping mapping = (XMLMessagePartMapping)part.getMapping();
View Full Code Here

            }
            else
            {
               if (childPart.isRequired())
               {
                  throw new IntegrationException("err.integration.minPartCount", new Object[]{childPart.getFullPath()});
               }
            }
         }
      }
View Full Code Here

            list = (List)data;
            nCount = list.size();

            if (nCount < part.getMinCount())
            {
               throw new IntegrationException("err.integration.minPartCount", new Object[]{part.getFullPath()});
            }

            if (nCount > part.getMaxCount())
            {
               throw new IntegrationException("err.integration.maxPartCount", new Object[]{part.getFullPath()});
            }
         }

         for (int i = 0; i < nCount; i++)
         {
            if (list != null)
            {
               data = list.get(i);
            }

            if (data instanceof TransferObject)
            {
               // Write non-primitive ANY-type data
               String sClassName = ((TransferObject)data).getClassName();
               Interface iface = ((XMLMessagePartMapping)part.getMapping()).getInterface();
               Message msg;

               try
               {
                  if (iface != null)
                  {
                     msg = iface.getRequestTable().findMessage(sClassName);

                     if (msg == null)
                     {
                        msg = iface.getResponseTable().findMessage(sClassName);
                     }

                     // Support inheritance in xsd:anyType tables
                     if (msg == null)
                     {
                        Message derivedMessage = m_context.getMetadata().getMessage(sClassName);

                        msg = iface.getRequestTable().findBaseMessage(derivedMessage);

                        if (msg == null)
                        {
                           msg = iface.getResponseTable().findBaseMessage(derivedMessage);
                        }

                        if (msg == null)
                        {
                           throw new IntegrationException("err.integration.xml.unknownMessage",
                              new Object[] {sClassName, part.getFullPath()});
                        }
                     }
                  }
                  else
                  {
                     msg = m_context.getMetadata().getMessage(sClassName);
                  }
               }
               catch (MetadataLookupException ex)
               {
                  throw new IntegrationException("err.integration.xml.unknownMessage",
                     new Object[] {sClassName, part.getFullPath()}, ex);
               }

               append(data, msg.getRoot(), null);
            }
View Full Code Here

            }
         }
      }
      catch (IOException ex)
      {
         throw new IntegrationException("err.integration.io", ex);
      }
      finally
      {
         try
         {
            if (zipStream != null)
            {
               zipStream.finish();
            }
         }
         catch (IOException ex2)
         {
            throw new IntegrationException("err.integration.io", ex2);
         }
      }
   }
View Full Code Here

TOP

Related Classes of nexj.core.integration.IntegrationException

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.