Package org.speakright.core

Examples of org.speakright.core.SRPersistentState


    TrailWrapper wrap1 = new TrailWrapper(flow);
   
   
    SRInstance run = StartIt(wrap1);
    String path = String.format("tmpfiles\\sr_1.out");
    SRPersistentState state = new SRPersistentState(run, path);
   
    try
    {
      FileOutputStream fout = new FileOutputStream(path);
      boolean b = state.passivate(fout, path);
      assertEquals("b",true,b);
      fout.close();
    }
    catch(Exception e)
    {}

    try
    {
      path = state.m_streamId;
      FileInputStream fin = new FileInputStream(path);
      boolean b = state.activate(fin);
      assertEquals("b",true,b);
      fin.close();
      state.m_run.finishActivation();
      state.m_run.restoreModelBinder(new ModelBinder());
    }
View Full Code Here


  SRPersistentState passivate(SRInstance run, String path)
  {
    //first get the SRInstance to clear its transient fields
    run.prepareToPassivate();   
   
    SRPersistentState state = new SRPersistentState(run, path);
    try
    {
      FileOutputStream fout = new FileOutputStream(path);
      boolean b = state.passivate(fout, path);
      log("passivate..");
      assertEquals("b",true,b);
      fout.close();
    }
    catch(Exception e)
View Full Code Here

  {
    return persistentProceed(key, input, slot, SRResults.ResultCode.SUCCESS);
  }
  SRInstance persistentProceed(String key, String input, String slot, SRResults.ResultCode code)
  {
    SRPersistentState state = new SRPersistentState();
    state.m_streamId = key; //not really needed

    String path = key;
    try
    {
      path = state.m_streamId;
      FileInputStream fin = new FileInputStream(path);
      boolean b = state.activate(fin);
      state.m_run.restoreModelBinder(new ModelBinder());
      log("activate..");
      assertEquals("b",true,b);
      fin.close();
    }
View Full Code Here

TOP

Related Classes of org.speakright.core.SRPersistentState

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.