Package com.arjuna.ats.arjuna.objectstore

Examples of com.arjuna.ats.arjuna.objectstore.ObjectStore


    }

    boolean restored = false;

    // Set up store
    ObjectStore aaStore = store();

    if (aaStore == null)
      return false;

    try
    {
      // Read object state

      InputObjectState oState = aaStore.read_committed(getSavingUid(), type());

      if (oState != null)
      {
        synchronized (this)
        {
View Full Code Here


    }

    boolean deactivated = false;

    // Set up store
    ObjectStore aaStore = store();

    if (aaStore == null)
      return false;

    try
    {
      // Write object state
      OutputObjectState oState = new OutputObjectState();

      if (save_state(oState, ObjectType.ANDPERSISTENT))
      {
        if (aaStore.write_committed(getSavingUid(), type(), oState))
        {
          deactivated = true;
        }
        else
        {
View Full Code Here

    }
      }

      if (osObjName == null)
      {
    objectStore = new ObjectStore(smAttributes.objectStoreType, storeRoot, sharedStatus);
      }
      else
      {
    objectStore = new ObjectStore(smAttributes.objectStoreType, osObjName);
      }
  }
  else
  {
      /*
 
View Full Code Here

  if (baType.charAt(0) == '/')
    baType = baType.substring(1);
  try
  {
      TxControl txc = new TxControl();
      ObjectStore imple = txc.getStore();

      InputObjectState types = new InputObjectState();

      if (imple.allTypes(types))
      {
    String theName = null;
    int count = 0;

    try
    {
        boolean endOfList = false;

        while (!endOfList)
        {
      theName = types.unpackString();

      if (theName.compareTo("") == 0)
          endOfList = true;
      else if (theName.startsWith(baType))
      {
          count++;
     
          System.out.println(count+": "+theName);

          InputObjectState uids = new InputObjectState();

          if (imple.allObjUids(theName, uids))
          {
        Uid theUid = new Uid(Uid.nullUid());

        try
        {
            boolean endOfUids = false;
           
            while (!endOfUids)
            {
          theUid.unpack(uids);

          if (theUid.equals(Uid.nullUid()))
              endOfUids = true;
          else
          {
              System.out.print("\t"+theUid+" state is ");
              System.out.print(ObjectStore.stateStatusString(imple.currentState(theUid, theName)));
              System.out.println();
          }
            }
        }
        catch (Exception e)
View Full Code Here

      }
  }

  try
  {
      ObjectStore imple = null;

      if (storeImple != null)
    imple = new ObjectStore(new ClassName(storeImple), root);
      else
    imple = new ObjectStore(root);
     
      InputObjectState types = new InputObjectState();

      if (imple.allTypes(types))
      {
    String theName = null;
    int count = 0;

    try
    {
        boolean endOfList = false;

        while (!endOfList)
        {
      theName = types.unpackString();

      if (theName.compareTo("") == 0)
          endOfList = true;
      else
      {
          count++;
     
          System.out.println(count+": "+theName);

          InputObjectState uids = new InputObjectState();

          if (imple.allObjUids(theName, uids))
          {
        Uid theUid = new Uid(Uid.nullUid());

        try
        {
            boolean endOfUids = false;
           
            while (!endOfUids)
            {
          theUid.unpack(uids);

          if (theUid.equals(Uid.nullUid()))
              endOfUids = true;
          else
          {
              System.out.print("\t"+theUid+" state is ");
              System.out.print(ObjectStore.stateStatusString(imple.currentState(theUid, theName)));

              System.out.println();
          }
            }
        }
View Full Code Here

      try
      {
    ClassName actionStoreType = new ClassName(arjPropertyManager.propertyManager.getProperty(Environment.ACTION_STORE,
                       ArjunaNames.Implementation_ObjectStore_defaultActionStore().stringForm()));
   
    ObjectStore imple = new ObjectStore(actionStoreType, root);
    InputObjectState types = new InputObjectState();

    startSweep();
   
    if (imple.allTypes(types))
    {
        String fullPathName = null;
        boolean found = false;
   
        try
        {
      boolean endOfList = false;
      DefaultMutableTreeNode currentNode = null;
      DefaultMutableTreeNode currentRoot = top;

      while (!endOfList)
      {
          fullPathName = types.unpackString();

          if (fullPathName.compareTo("") == 0)
        endOfList = true;
          else
          {
        found = true;
         
        InputObjectState uids = new InputObjectState();
        String nodeName = stripName(fullPathName);
        boolean added = false;

        currentNode = findNode(fullPathName);

        if (currentNode == null)
        {
            currentNode = new DefaultMutableTreeNode(nodeName);
            addDirectory(currentNode, fullPathName);
            currentRoot.add(currentNode);
           
            /*
             * New, so update view.
             */

            int i[] = new int[1];
           
            i[0] = currentRoot.getChildCount()-1;
           
            model.nodesWereInserted(currentRoot, i);

            added = true;
        }

        currentRoot = findRoot(top, currentNode);

        if (added)
            currentRoot.add(currentNode);

        if (imple.allObjUids(fullPathName, uids))
        {
            Uid theUid = new Uid(Uid.nullUid());
       
            try
            {
          boolean endOfUids = false;
          boolean first = true;
          boolean haveUids = false;
         
          while (!endOfUids)
          {
              theUid.unpack(uids);

              if (theUid.equals(Uid.nullUid()))
              {
            if (!haveUids)
            {
                if (emptyDirectory(currentNode))
                {
              currentNode.removeAllChildren();
              model.nodeChanged(currentNode);
                }
            }
           
            endOfUids = true;
              }
              else
              {
            haveUids = true;
           
            if (first)
            {
                currentNode.removeAllChildren();

                first = false;
            }
         
            DefaultMutableTreeNode tranID = new DefaultMutableTreeNode(theUid.stringForm());

            tranID.add(new DefaultMutableTreeNode(new String("status: "+statusToString(imple.currentState(theUid, fullPathName)))));

            currentNode.add(tranID);

            added = true;
              }
View Full Code Here

  try
  {
      ClassName actionStoreType = new ClassName(arjPropertyManager.propertyManager.getProperty(Environment.ACTION_STORE,
                      ArjunaNames.Implementation_ObjectStore_defaultActionStore().stringForm()));

      ObjectStore imple = new ObjectStore(actionStoreType, root);
      InputObjectState types = new InputObjectState();

      if (imple.allTypes(types))
      {
    String fullPathName = null;
    boolean found = false;
   
    try
    {
        boolean endOfList = false;
        DefaultMutableTreeNode currentNode = null;
        DefaultMutableTreeNode currentRoot = top;

        topTran.add(currentRoot);

        while (!endOfList)
        {
      fullPathName = types.unpackString();

      if (fullPathName.compareTo("") == 0)
          endOfList = true;
      else
      {
          found = true;
         
          InputObjectState uids = new InputObjectState();
          String nodeName = stripName(fullPathName);

          currentNode = new DefaultMutableTreeNode(nodeName);
          addDirectory(currentNode, fullPathName);

          currentRoot = findRoot(top, currentNode);
          currentRoot.add(currentNode);

          if (imple.allObjUids(fullPathName, uids))
          {
        Uid theUid = new Uid(Uid.nullUid());
       
        try
        {
            boolean endOfUids = false;
           
            while (!endOfUids)
            {
          theUid.unpack(uids);

          if (theUid.equals(Uid.nullUid()))
              endOfUids = true;
          else
          {
              DefaultMutableTreeNode tranID = new DefaultMutableTreeNode(theUid.stringForm());

              tranID.add(new DefaultMutableTreeNode(new String("status: "+statusToString(imple.currentState(theUid, fullPathName)))));

              currentNode.add(tranID);
          }
            }
        }
View Full Code Here

      }
  }

  try
  {
      ObjectStore imple = new ObjectStore();

      System.out.println("Status is "+imple.currentState(new Uid(uid), type));

      InputObjectState buff = new InputObjectState();
     
      imple.allObjUids(type, buff, ObjectStore.OS_UNCOMMITTED);
     
      Uid u = new Uid(Uid.nullUid());
     
      u.unpack(buff);
     
View Full Code Here

            /*
             * Defaults to ObjectStore.OS_UNSHARED
             */

            if (sharedTransactionLog)
                    return new ObjectStore(recoveryType, ObjectStore.OS_SHARED);
            else
                    return new ObjectStore(recoveryType);
        }
View Full Code Here

     * yes, it's unsynchronized. It does not matter much if we create more than once, we just want best
     * effort to avoid doing so on every call as it's a little bit expensive.
     */

    if (sharedTransactionLog)
      _objectStore = new ObjectStore(actionStoreType, ObjectStore.OS_SHARED);
    else
      _objectStore = new ObjectStore(actionStoreType);

        return _objectStore;
  }
View Full Code Here

TOP

Related Classes of com.arjuna.ats.arjuna.objectstore.ObjectStore

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.