Examples of StateTransitionObj


Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    logger.log(BasicLevel.INFO, "========================");
  }

  void applyOperation(int operation, StateTransitionObj stobj)
  {
    StateTransitionObj obj = (StateTransitionObj) stobj;
    switch( operation ){
    case MAKEPERSISTENT:
    {
      pm.makePersistent(obj);
      break;
    }
    case DELETEPERSISTENT:
    {
      pm.deletePersistent(obj);
      break;
    }
    case MAKETRANSACTIONAL:
    {
      pm.makeTransactional(obj);
      break;
    }
    case MAKENONTRANSACTIONAL:
    {
      pm.makeNontransactional(obj);
      break;
    }
    case MAKETRANSIENT:
    {
      pm.makeTransient(obj);
      break;
    }
    case COMMITNORETAINVALUES:
    {
      pm.currentTransaction().commit();
      break;
    }
    case COMMITRETAINVALUES:
    {
      pm.currentTransaction().commit();
      break;
    }
    case ROLLBACKNORETAINVALUES:
    {
      pm.currentTransaction().rollback();
      break;
    }
    case ROLLBACKRETAINVALUES:
    {
      pm.currentTransaction().rollback();
      break;
    }
    case REFRESHDATASTORE:
    {
      pm.refresh(obj);
      break;
    }
    case REFRESHOPTIMISTIC:
    {
      pm.refresh(obj);
      break;
    }
    case EVICT:
    {
      pm.evict(obj);
      break;
    }
    case READOUTSIDETX:
    {
      int val = obj.readField();
      break;
    }
    case READOPTIMISTIC:
    {
      int val = obj.readField();
      break;
    }
    case READDATASTORE:
    {
      int val = obj.readField();
      break;
    }
    case WRITEOUTSIDETX:
    {
      obj.writeField(42);
      break;
    }
    case WRITEINSIDETX:
    {
      obj.writeField(42);
      break;
    }
    default:
    {
      logger.log(BasicLevel.ERROR, "StateTransitions internal error, illegal operation "+operation);
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    }
  }

  private StateTransitionObj getTransientInstance()
  {
    StateTransitionObj obj = new StateTransitionObj(23);
    int curr = currentState(obj);
    if( curr != TRANSIENT ){
      logger.log(BasicLevel.INFO, "StateTransitions: Unable to create transient instance, state is "+states[curr]);
      printSituation();
      return null;
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    return obj;
  }

  private StateTransitionObj getPersistentNewInstance()
  {
    StateTransitionObj obj = getTransientInstance();
    if( obj == null ) return null;
    pm.makePersistent(obj); // should transition to persistent-new
    int curr = currentState(obj);
    if( curr != PERSISTENT_NEW ){
      logger.log(BasicLevel.INFO, "StateTransitions: Unable to create persistent-new instance");
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    return obj;
  }

  public StateTransitionObj getPersistentCleanInstance()
  {
    StateTransitionObj obj = getHollowInstance();
    if( obj == null ) return null;
    StateTransitionObj sto = (StateTransitionObj) obj;
    int val = sto.readField();
    int curr = currentState(sto);
    if( curr != PERSISTENT_CLEAN ){
      logger.log(BasicLevel.INFO, "StateTransitions: Unable to create persistent-clean instance");
      logger.log(BasicLevel.INFO, " from a hollow instance by reading a field, state is "+states[curr]);
      printSituation();
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    return obj;
  }

  public StateTransitionObj getPersistentDirtyInstance()
  {
    StateTransitionObj obj = getHollowInstance();
    if( obj == null ) return null;
    StateTransitionObj pcobj = (StateTransitionObj) obj;
    pcobj.writeField(23);
    int curr = currentState(obj);
    if( curr != PERSISTENT_DIRTY ){
      logger.log(BasicLevel.INFO, "StateTransitions: Unable to create persistent-dirty instance");
      logger.log(BasicLevel.INFO, " from a hollow instance by writing a field, state is "+states[curr]);
      printSituation();
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    Iterator iter = extent.iterator();
    if( !iter.hasNext() ){
      logger.log(BasicLevel.INFO, "Extent for StateTransitionObj should not be empty");
      return null;
    }
    StateTransitionObj obj = (StateTransitionObj) iter.next();
    int curr = currentState(obj);
    if( curr != HOLLOW && curr != PERSISTENT_NONTRANSACTIONAL ){
      logger.log(BasicLevel.INFO, "StateTransition: Attempt to get hollow instance via accessing extent failed, state is "+states[curr]);
      printSituation();
      return null;
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    return obj;
  }

  public StateTransitionObj getTransientCleanInstance()
  {
    StateTransitionObj obj = getTransientInstance();
    if( obj == null ) return null;
    pm.makeTransactional(obj);
    int curr = currentState(obj);
    if( curr != TRANSIENT_CLEAN ){
      logger.log(BasicLevel.INFO, "StateTransitions: Unable to create transient-clean instance");
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    return obj;
  }

  public StateTransitionObj getTransientDirtyInstance()
  {
    StateTransitionObj obj = getTransientCleanInstance();
    if( obj == null ) return null;
    StateTransitionObj pcobj = (StateTransitionObj) obj;
    pcobj.writeField(23);
    int curr = currentState(obj);
    if( curr != TRANSIENT_DIRTY ){
      logger.log(BasicLevel.INFO, "StateTransitions: Unable to create transient-dirty instance");
      logger.log(BasicLevel.INFO, " from a transient clean instance via modifying a field, state is "+states[curr]);
      printSituation();
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    return obj;
  }

  public StateTransitionObj getPersistentNewDeletedInstance()
  {
    StateTransitionObj obj = getPersistentNewInstance();
    if( obj == null ) return null;
    pm.deletePersistent(obj);   // should transition to persistent-new-deleted
    int curr = currentState(obj);
    if( curr != PERSISTENT_NEW_DELETED ){
      logger.log(BasicLevel.INFO, "StateTransitions: Unable to create transient-new-deleted instance");
View Full Code Here

Examples of org.objectweb.speedo.pobjects.tck.StateTransitionObj

    return obj;
  }

  public StateTransitionObj getPersistentDeletedInstance()
  {
    StateTransitionObj obj = getHollowInstance();
    if( obj == null ) return null;
    pm.deletePersistent(obj);
    int curr = currentState(obj);
    if( curr != PERSISTENT_DELETED ){
      logger.log(BasicLevel.INFO, "StateTransitions: Unable to create persistent-deleted instance");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.