Package com.arjuna.ats.arjuna.state

Examples of com.arjuna.ats.arjuna.state.InputObjectState


        return null;
    }

    public void allTypes(ObjStoreTypeBean parent, String storeName, Collection<ObjStoreTypeBean> names)
    {
        InputObjectState types = new InputObjectState();

        try {
            if (getObjectStore(store.storeDir(), storeName).allTypes(types)) {
                while (true) {
                    try {
                        String theName = types.unpackString();

                        if (theName.length() == 0)
                            break;
                        else
                            names.add(new ObjStoreTypeBean(parent, storeName, theName));
View Full Code Here


   {
       boolean ret_status = false ;
      
       try
      {
    InputObjectState objstate = getStore().read_committed( _pidUid,
                 _typeName ) ;
   
    if ( restore_state( objstate) )
        {
            return ret_status = true ;
View Full Code Here

        return on;
    }

    private void allUids(Collection<Uid> uis)
    {
        InputObjectState uids = new InputObjectState();

        try {
            if (getStore().allObjUids(type, uids)) {
                try {
                    boolean endOfUids = false;
View Full Code Here

    private InputObjectState read(Uid u, String tn, int state) throws ObjectStoreException
    {
        byte[] data = stateMap.get(u);

        if(data != null) {
            InputObjectState new_image = new InputObjectState(u, tn, data);
            return new_image;
        } else {
            return null;
        }
    }
View Full Code Here

{
    private static final int MAX_RETRIES = 10 ;

  public InputObjectState read_state (Uid objUid, String tName, int ft, String tableName) throws ObjectStoreException
  {
    InputObjectState newImage = null;

    if (!storeValid())
      return newImage;

    if (tName != null)
    {
      if ((ft == ObjectStore.OS_COMMITTED) || (ft == ObjectStore.OS_UNCOMMITTED))
      {
        int pool = getPool();
        ResultSet rs = null;

                try
                {
                    for(int count = 0 ; count < MAX_RETRIES ; count++)
                    {
                try
                {
                  PreparedStatement pstmt = _preparedStatements[pool][READ_STATE];

                  if (pstmt == null)
                  {
                    pstmt = _theConnection[pool].prepareStatement("SELECT ObjectState FROM "+tableName+" WHERE UidString = ? AND TypeName = ? AND StateType = ?");

                    _preparedStatements[pool][READ_STATE] = pstmt;
                  }

                  pstmt.setString(1, objUid.stringForm());
                  pstmt.setString(2, tName);
                  pstmt.setInt(3, ft);

                  rs = pstmt.executeQuery();

                  if(! rs.next()) {
                    return null; // no matching state in db
                  }

                  Blob myBlob = (Blob)rs.getBlob(1);
                  byte[] buffer = myBlob.getBytes(1, (int)myBlob.length());

                  if (buffer != null)
                  {
                    newImage = new InputObjectState(objUid, tName, buffer);
                  }
                  else {
                      if (tsLogger.arjLoggerI18N.isWarnEnabled())
                    tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.jdbc.oracle_1");
                  }
View Full Code Here

/* 1060 */       this.stateLoaded = true;
/*      */
/* 1062 */       return true;
/*      */     }
/*      */
/* 1066 */     InputObjectState S = null;
/*      */
/* 1068 */     if ((this.systemKey == null) && (!initialise()))
/*      */     {
/* 1070 */       return false;
/*      */     }
/*      */
/* 1073 */     if ((this.mutex == null) || (this.mutex.lock() != 0))
/*      */     {
/* 1075 */       return false;
/*      */     }
/*      */
/* 1078 */     this.stateLoaded = false;
/* 1079 */     this.objectLocked = true;
/*      */     try
/*      */     {
/* 1088 */       S = this.lockStore.read_state(get_uid(), type());
/*      */
/* 1092 */       if (S != null)
/*      */       {
/* 1094 */         Uid u = new Uid(Uid.nullUid());
/* 1095 */         Lock current = null;
/* 1096 */         int count = 0;
/*      */         try
/*      */         {
/* 1100 */           count = S.unpackInt();
/*      */
/* 1102 */           boolean cleanLoad = true;
/*      */
/* 1104 */           if (txojLogger.aitLogger.isDebugEnabled())
/*      */           {
View Full Code Here

/*     */
/* 276 */     Vector matchingUidVector = new Vector();
/* 277 */     Vector matchingUidTypeVector = new Vector();
/*     */     try
/*     */     {
/* 281 */       InputObjectState types = new InputObjectState();
/*     */
/* 284 */       if (_objectStore.allTypes(types))
/*     */       {
/* 286 */         String theTypeName = null;
/*     */         try
/*     */         {
/* 290 */           boolean endOfList = false;
/*     */
/* 292 */           while (!endOfList)
/*     */           {
/* 295 */             theTypeName = types.unpackString();
/*     */
/* 297 */             if (theTypeName.compareTo("") == 0)
/*     */             {
/* 299 */               endOfList = true; continue;
/*     */             }
/*     */
/* 303 */             InputObjectState uids = new InputObjectState();
/*     */             try
/*     */             {
/* 307 */               boolean endOfUids = false;
/*     */
/* 309 */               if (_objectStore.allObjUids(theTypeName, uids))
View Full Code Here

/*     */     {
/*  84 */       ObjectStore imple = new ObjectStore();
/*     */
/*  86 */       System.out.println("Status is " + imple.currentState(new Uid(uid), type));
/*     */
/*  88 */       InputObjectState buff = new InputObjectState();
/*     */
/*  90 */       imple.allObjUids(type, buff, 2);
/*     */
/*  92 */       Uid u = new Uid(Uid.nullUid());
/*     */
View Full Code Here

/*     */
/*     */   public void updateTSMI()
/*     */   {
/* 162 */     boolean tsmis = false;
/*     */
/* 164 */     InputObjectState uids = new InputObjectState();
/* 165 */     Vector tsmiVector = new Vector();
/*     */     try
/*     */     {
/* 169 */       tsmis = _objStore.allObjUids(_typeName, uids);
/*     */     }
View Full Code Here

/*     */
/* 128 */     if (this.state != null)
/*     */     {
/* 130 */       if (this.state.notempty())
/*     */       {
/* 132 */         InputObjectState oldState = new InputObjectState(this.state);
/*     */
/* 134 */         int result = this.objectAddr.restore_state(oldState, 0) ? 7 : 8;
/*     */
/* 136 */         if (result == 8)
/*     */         {
View Full Code Here

TOP

Related Classes of com.arjuna.ats.arjuna.state.InputObjectState

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.