Package nexj.core.runtime

Examples of nexj.core.runtime.InvocationContext


   }

   public void testDynamicRestrictedReadResponse() throws MarshallerException, IOException
   {
      StringWriter writer = new StringWriter();
      XMLUnmarshaller unmarshaller = new XMLUnmarshaller(new InvocationContext(Repository.getMetadata()));
      StringReader reader = new StringReader("<Principal-Read-Request xmlns=\"" + XML.NS_URI_TNS
         + "\"><class>User-test</class>"
         + "<attributes>(fullName)</attributes><where></where><orderBy></orderBy><count>8</count>"
         + "<offset>0</offset></Principal-Read-Request>");
      Response response = new Response();
View Full Code Here


   }

   public void testNestedMetaclassPolymorphism() throws MarshallerException, IOException
   {
      StringWriter writer = new StringWriter();
      XMLUnmarshaller unmarshaller = new XMLUnmarshaller(new InvocationContext(Repository.getMetadata()));
      StringReader reader = new StringReader("<Read-Request xmlns=\"" + XML.NS_URI_TNS + "\"><class>Patient</class>"
         + "<attributes>(fullName name)</attributes><where></where><orderBy></orderBy><count>8</count>"
         + "<offset>0</offset></Read-Request>");
      Response response = new Response();
      TransferObject tobj = new TransferObject("Patient");
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();

      m_metadata = Repository.getMetadata();
      m_context = new InvocationContext(m_metadata);
      ThreadContextHolder.setContext(m_context);
      m_tf = new Transformer(m_context);
   }
View Full Code Here

      System.err.println("XML vs. SOAP Marshaller Profiling Comparison");

      // --- XML test

      SOAPMarshaller marshaller =
         new XMLMarshaller(new InvocationContext(Repository.getMetadata()),
                           Repository.getMetadata());

      for (int i = 0; i < nWarmup; ++i)
      {
         marshaller.serialize(req, writer);
      }

      long lStartTime = System.currentTimeMillis();
     
      for (int i = 0; i < nIterations; ++i)
      {
         counterArray[0] = 0;
         marshaller.serialize(req, writer);
      }

      long lEndTime = System.currentTimeMillis();
      long nSizeXML = counterArray[0];
      long nTotalTimeXML = lEndTime - lStartTime;

      System.err.println("Run: " + nIterations + " iterations in: " + nTotalTimeXML/(double)1000 +
                         " sec");
      System.err.println("XML Time: " + nTotalTimeXML/(double)nIterations + " ms");
      System.err.println("XML Size: " + nSizeXML + " chars");
      System.err.println("XML Unit: " + nTotalTimeXML/(double)nIterations/nSizeXML * 1000000 +
                         " ns/char");

      //--- SOAP test

      marshaller = new SOAPMarshaller(new InvocationContext(Repository.getMetadata()));

      for (int i = 0; i < nWarmup; ++i)
      {
         marshaller.serialize(req, writer);
      }
View Full Code Here

      req.addFilter(instancesFilter);

      StringWriter xmlOut = new StringWriter();
      StringWriter soapOut = new StringWriter();
     
      new XMLMarshaller(new InvocationContext(Repository.getMetadata()), Repository.getMetadata())
             .serialize(req, xmlOut);
      new SOAPMarshaller(new InvocationContext(Repository.getMetadata())).serialize(req, soapOut);

      System.err.println("XML vs. SOAP Unmarshaller Profiling Comparison");

      // --- XML test

      SOAPUnmarshaller unmarshaller =
         new XMLUnmarshaller(new InvocationContext(Repository.getMetadata()),
                             Repository.getMetadata());
     
      for (int i = 0; i < nWarmup; ++i)
      {
         unmarshaller.deserialize(new StringReader(xmlOut.toString()));
      }
     
      long lStartTime = System.currentTimeMillis();
     
      for (int i = 0; i < nIterations; ++i)
      {
         unmarshaller.deserialize(new StringReader(xmlOut.toString()));
      }

      long lEndTime = System.currentTimeMillis();     
      long nSizeXML = xmlOut.toString().length();
      long nTotalTimeXML = lEndTime - lStartTime;

      System.err.println("Run: " + nIterations + " iterations in: " + nTotalTimeXML/(double)1000 +
                         " sec");
      System.err.println("XML Time: " + nTotalTimeXML/(double)nIterations + " ms");
      System.err.println("XML Size: " + nSizeXML + " chars");
      System.err.println("XML Unit: " + nTotalTimeXML/(double)nIterations/nSizeXML * 1000000 +
                         " ns/char");

      //--- SOAP test
      unmarshaller = new SOAPUnmarshaller(new InvocationContext(Repository.getMetadata()));
     
      for (int i = 0; i < nWarmup; ++i)
      {
         unmarshaller.deserialize(new StringReader(soapOut.toString()));
      }
View Full Code Here

      String sFileNameTemplate = "out.${seq}.txt";
     
      //Initialize DB
      DbSetup sqlTest = new DbSetup("");
      sqlTest.doSetUp();
      InvocationContext context = sqlTest.getInvocationContext();
     
      try
      {
         //Connection #1
         ConnectionObjects outgoing1 = createOutgoingConnection();
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
     
      m_env = new GlobalEnvironment();
      m_context = new InvocationContext(Repository.getMetadata());
   }
View Full Code Here

TOP

Related Classes of nexj.core.runtime.InvocationContext

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.