Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.Format


    * @return The message format object.
    * @throws MetadataLookupException if the message format does not exist.
    */
   public Format getFormat(String sName)
   {
      Format messageFormat = (Format) m_formatMap.get(sName);

      if (messageFormat != null)
      {
         return messageFormat;
      }
View Full Code Here


   public void setUp()
   {
      m_context = (InvocationContext)Repository.getMetadata().getComponent("System.InvocationContext").getInstance(null);

      Format format = m_context.getMetadata().getFormat("XML");

      m_parser = (MessageParser)format.getParser().getInstance(m_context);
      m_formatter = (MessageFormatter)format.getFormatter().getInstance(m_context);
      m_referrerMessage = m_context.getMetadata().getMessage("XML_Inherit_Parent_Referrer");
   }
View Full Code Here

         return tobj;
      }

      MessageTable table = m_interface.getResponseTable();
      Format format = table.getFormat();

      if (format == null)
      {
         return tobj;
      }

      Input input;

      if (body instanceof Input)
      {
         input = (Input)body;
      }
      else
      {
         input = new ObjectInput(body);
      }

      return ((MessageParser)format.getParser().getInstance(context)).parse(input, table);
   }
View Full Code Here

               assert nArgCount == Pair.length(getArguments());

               InvocationContext context = (InvocationContext)machine.getContext();
               TransferObject tobj = (TransferObject)machine.getArg(0, nArgCount);
               Message message = context.getMetadata().getMessage(tobj.getClassName());
               Format format = message.getFormat();

               if (format == null || !format.getName().equals("Object"))
               {
                  throw new IntegrationException("err.integration.persistFormat",
                     new Object[]{message.getName(), (format == null) ? "" : message.getFormat().getName()});
               }

               context.getUnitOfWork().checkTransaction();

               ObjectOutput out = new ObjectOutput();
               MessageFormatter messageFormatter = (MessageFormatter)format.getFormatter().getInstance(context);

               cleanupToken = configureFormatter(messageFormatter, nArgCount, machine);

               if (messageFormatter instanceof ObjectMessageFormatter)
               {
                  ObjectMessageFormatter objMsgFmt = (ObjectMessageFormatter)messageFormatter;

                  logger = objMsgFmt.getLinkLogger();

                  if (logger != null && logger.isDumpEnabled())
                  {
                     logger.log(Logger.DUMP, "ids.sync.collectionFormattingStarted",
                        new Object[] {message.getName()}, null);
                  }
               }

               if (m_nOnError == FAIL_ON_ERROR)
               {
                  messageFormatter.format(tobj, message, out);
               }
               else
               {
                  ((ObjectMessageFormatter)messageFormatter).formatFailSafe(tobj, message, out, m_nOnError == COMMIT_ON_ERROR);
               }

               if (logger != null && logger.isDumpEnabled())
               {
                  logger.log(Logger.DUMP, "ids.sync.collectionFormattingCompleted",
                     new Object[] {message.getName()}, null);
               }

               Object obj = out.getObject();

               if (m_bRespond)
               {
                  Message response = message.getResponse();

                  if (response == null)
                  {
                     tobj = null;
                  }
                  else
                  {
                     tobj = ((MessageParser)format.getParser().getInstance(context))
                        .parse(new ObjectInput(obj), response);
                  }
               }

               machine.returnValue(tobj, nArgCount);
View Full Code Here

   public void setUp()
   {
      m_context = (InvocationContext)Repository.getMetadata().getComponent("System.InvocationContext").getInstance(null);

      Format format = m_context.getMetadata().getFormat("XML");

      m_parser = (MessageParser)format.getParser().getInstance(m_context);
      m_formatter = (MessageFormatter)format.getFormatter().getInstance(m_context);
      m_message = m_context.getMetadata().getMessage("XMLAnyTest");
   }
View Full Code Here

TOP

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

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.