Package nexj.core.rpc

Examples of nexj.core.rpc.Request


                   ((ValidationException)fault.getException()).getErrorCode());
   }

   public void testSerializeTransferObject() throws IOException
   {
      Request request = new Request();
      TransferObject tobj = new TransferObject();
      List/*<String>*/ list = new ArrayList/*<String>*/(3);

      list.add("name1");
      list.add("name2");
      list.add("name3");
      tobj.setClassName("User");
      tobj.setValue("firstName", "fName");
      tobj.setValue("names", list);
      request.setVersion("0");
      request.addInvocation(tobj);
      m_marshaller.serialize(request, m_writer);
      XMLUtil.parse(new StringReader(m_writer.toString()), m_xsdMap); // validate to XSD

      request = (Request)m_unmarshaller.deserialize(new StringReader(m_writer.toString()));

      TransferObject processed = request.getObject(0);

      assertEquals(tobj.getClassName(), processed.getClassName());
      assertEquals(tobj.getValueCount(), processed.getValueCount());
      assertEquals(tobj.getValue("firstName"), processed.getValue("firstName"));

View Full Code Here


         else
         {
            correlator = null;
         }

         Request request = new Request();
         Object[] arguments = null;

         request.setLocale(m_context.getLocale());
         request.setTimeZone(m_context.getTimeZone());
         request.setCorrelator(correlator);

         if (m_arguments != null)
         {
            arguments = new Object[m_arguments.length];

            for (int i = 0; i < arguments.length; ++i)
            {
               arguments[i] = RPCUtil.transferState(m_arguments[i], null, identityMap, RPCUtil.TF_ALL);
            }
         }

         request.addInvocation(tobj, arguments);
         m_tobj.setValue(Sender.BODY, request);

         return super.getMessage();
      }
View Full Code Here

         return false;
      }

      s_logger.debug("Processing a generic asynchronous server request");

      Request request = (Request)obj;

      request.setAsync(false);
      ((Server)m_server.getInstance(context)).invoke(request);

      return true;
   }
View Full Code Here

    * @see nexj.core.rpc.GenericCharacterStreamServer#getRequest(java.io.Reader)
    */
   protected Request getRequest(Reader reader) throws IOException
   {
      TextUnmarshaller unmsh = (TextUnmarshaller)getRequestUnmarshaller();
      Request request = (Request)unmsh.deserialize(reader);

      m_nVersion = unmsh.getVersion();

      return request;
   }
View Full Code Here

      if (m_sProperties != null)
      {
         tobj.setValue(m_sProperties, properties);
      }

      Request request = new Request();

      request.addInvocation(tobj);

      Response response = ((Server)m_server.getInstance(context)).invoke(request);

      return response.getResult(0);
   }
View Full Code Here

    */
   public void invoke(Reader reader, Writer writer, Preprocessor preprocessor) throws RPCException
   {
      try
      {
         Request request = ((SOAPRequest)new SOAPUnmarshaller(m_context).deserialize(reader)).getRequest();

         if (preprocessor != null)
         {
            preprocessor.preprocess(request);
         }
View Full Code Here

         return false;
      }

      s_logger.debug("Processing a generic asynchronous server request");

      Request request = (Request)message;

      request.setAsync(false);
      ((Server)m_server.getInstance(context)).invoke(request);

      return true;
   }
View Full Code Here

   /**
    * @see nexj.core.rpc.xml.Invoker#invoke(nexj.core.rpc.Server)
    */
   public Object invoke(Server server)
   {
      Request request = new Request();

      if (m_instance == null)
      {
         request.addInvocation(
            m_event.getMetaclass().getName(), m_event.getName(),
            (m_argList == null) ? null : m_argList.toArray(), null);
      }
      else
      {
         request.addInvocation(
            m_instance, m_event.getName(), (m_argList == null) ? null : m_argList.toArray(), null);
      }

      Argument result = m_event.getResult();
      Type resultType = (result == null) ? null : result.getType();
View Full Code Here

      if (sqlWork.getTable() == column.getTable())
      {
         TransferObject tobj = (TransferObject)RPCUtil.transferState(
            instance.getValueDirect(m_objectAttribute.getOrdinal()), null, new HashTab(), RPCUtil.TF_ALL);

         Request request = new Request();

         tobj.setEventName(symbol.toString());
         request.addInvocation(tobj);

         try
         {
            sqlWork.setInstanceValue(column, Binary.fromObject(request));
         }
View Full Code Here

public class XMLMarshallerProfiler
{  
   public static void profileMarshaller() throws IOException
   {
      Request req = new Request();
      List instanceList = new ArrayList();
      int nIterations = 0xffff;
      int nWarmup = nIterations * 4; // 80%
      int nSizeMultiplier = 5; // ~50k chars
     
      for (int i = 0; i < nSizeMultiplier; ++i)
      {
         // create argument transfer object
         req.addInvocation(sizedTransferObject("arg", i, nSizeMultiplier), new Pair("pair" + i));

         // create filter transfer object
         // (don't reuse arg because SOAP can map same object to multiple places,
         //  XML can't and hence skews results)
         req.addFilter(sizedTransferObject("filter", i, nSizeMultiplier));

         // create instance transfer object
         // (don't reuse arg because SOAP can map same object to multiple places,
         //  XML can't and hence skews results)
         instanceList.add(sizedTransferObject("instance", i, nSizeMultiplier));
      }

      TransferObject instancesFilter = new TransferObject();
      instancesFilter.setValue("instances", instanceList);
      req.addFilter(instancesFilter);

      final long[] counterArray = new long[1];
      Writer writer = new Writer() {
         public void close() {}
         public void flush() {}
View Full Code Here

TOP

Related Classes of nexj.core.rpc.Request

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.