Пример #1
0
 public static KeyStore createEmptyKeyStore() {
   KeyStore localKeyStore = null;
   try {
     localKeyStore = KeyStore.getInstance("JKS");
     localKeyStore.load(null, null);
   } catch (Exception localException) {
     Trace.ignoredException(localException);
   }
   return localKeyStore;
 }
 /*     */ public void run() {
   /*     */ try {
     /*  78 */ boolean doRun = true;
     /*  79 */ long tm = System.currentTimeMillis();
     /*  80 */ while (doRun) {
       /*  81 */ if (DeployPerfLogger.access$000() != null) {
         /*     */ try {
           /*  83 */ DeployPerfLogger.access$100();
           /*  84 */ DeployPerfLogger.access$202(false);
           /*     */ } catch (Exception e) {
           /*  86 */ if (DeployPerfLogger.gotError)
           /*     */ {
             /*  88 */ doRun = false;
             /*  89 */ Trace.ignoredException(e);
             /*     */ } else {
             /*  91 */ DeployPerfLogger.access$202(true);
             /*     */ }
           /*  93 */ synchronized (DeployPerfLogger.class) {
             /*  94 */ DeployPerfLogger.access$302(null);
             /*     */ }
           /*     */ }
         /*     */ }
       /*  98 */ else if (System.currentTimeMillis() - tm > 5000L) {
         /*  99 */ Trace.println("Stop perf tracing as could not get JS object");
         /*     */
         /* 101 */ doRun = false;
         /*     */ }
       /*     */
       /* 104 */ synchronized (DeployPerfLogger.queue)
       /*     */ {
         /*     */ try {
           /* 107 */ DeployPerfLogger.queue.wait(10000L);
           /*     */ } catch (InterruptedException ie) {
           /* 109 */ doRun = false;
           /*     */ }
         /*     */ }
       /*     */ }
     /*     */ } catch (Throwable t) {
     /* 114 */ Trace.ignored(t);
     /*     */ } finally {
     /* 116 */ synchronized (this) {
       /* 117 */ this.isActive = false;
       /*     */ }
     /*     */ }
   /*     */ }
  private Object openLockFileObject(int paramInt1, String paramString, int paramInt2, boolean paramBoolean1, boolean paramBoolean2)
    throws IOException
  {
    int i = paramInt2 == 0 ? 1 : 0;
    boolean bool = paramString.equals("r");
    SyncAccess.Lock localLock = this.fileAccSync.lock(bool ? 2 : 4);
    Object localObject1 = null;
    try
    {
      while (null == localObject1)
      {
        if (paramBoolean1)
          localObject1 = AccessController.doPrivileged(new PrivilegedAction(paramInt1, paramString, paramBoolean2)
          {
            private final int val$type;
            private final String val$mode;
            private final boolean val$fopt1;

            public Object run()
            {
              Object localObject = null;
              try
              {
                switch (this.val$type)
                {
                case 1:
                  localObject = new RandomAccessFile(SyncFileAccess.this.file, this.val$mode);
                  break;
                case 2:
                  localObject = new FileInputStream(SyncFileAccess.this.file);
                  break;
                case 3:
                  localObject = new FileOutputStream(SyncFileAccess.this.file.getPath(), this.val$fopt1);
                  break;
                default:
                  throw new InternalError("wrong fobj type: " + this.val$type);
                }
              }
              catch (FileNotFoundException localFileNotFoundException)
              {
                Trace.ignoredException(localFileNotFoundException);
              }
              return localObject;
            }
          });
        else
          try
          {
            switch (paramInt1)
            {
            case 1:
              localObject1 = new RandomAccessFile(this.file, paramString);
              break;
            case 2:
              localObject1 = new FileInputStream(this.file);
              break;
            case 3:
              localObject1 = new FileOutputStream(this.file.getPath(), paramBoolean2);
              break;
            default:
              throw new InternalError("wrong fobj type: " + paramInt1);
            }
          }
          catch (FileNotFoundException localFileNotFoundException)
          {
            Trace.ignoredException(localFileNotFoundException);
          }
        if (null == localObject1)
          throw new FileNotFoundException("index file not found");
        if (!Config.isJavaVersionAtLeast14())
        {
          if (localObject1 != null)
          {
            localObject2 = FObjLock.createFObjLock(paramInt1, localObject1, localLock);
            return localObject2;
          }
          localObject2 = null;
          return localObject2;
        }
        Object localObject2 = null;
        switch (paramInt1)
        {
        case 1:
          localObject2 = ((RandomAccessFile)localObject1).getChannel();
          break;
        case 2:
          localObject2 = ((FileInputStream)localObject1).getChannel();
          break;
        case 3:
          localObject2 = ((FileOutputStream)localObject1).getChannel();
          break;
        default:
          throw new InternalError("wrong fobj type: " + paramInt1);
        }
        if (!((FileChannel)localObject2).isOpen())
        {
          localObject2 = null;
          localObject1 = null;
          if ((i == 0) && (paramInt2 <= 0))
            throw new IOException("index file could not be opened, timeout reached");
          Trace.println("SyncFileAccess.openLock: index file not opened, remaining TO : " + paramInt2, TraceLevel.NETWORK);
          try
          {
            if (i == 0)
            {
              Thread.sleep(paramInt2);
              paramInt2 -= 100;
            }
            else
            {
              Thread.sleep(100L);
            }
          }
          catch (Exception localException1)
          {
          }
          continue;
        }
        try
        {
          FileLock localFileLock = null;
          while (localFileLock == null)
            try
            {
              localFileLock = ((FileChannel)localObject2).lock(0L, 9223372036854775807L, bool);
            }
            catch (OverlappingFileLockException localOverlappingFileLockException)
            {
              if ((i == 0) && (paramInt2 <= 0))
                throw new IOException("handled OverlappingFileLockException, timeout reached", localOverlappingFileLockException);
              Trace.println("SyncFileAccess.openLock: handled OverlappingFileLockException, remainint TO : " + paramInt2, TraceLevel.NETWORK);
              try
              {
                if (i == 0)
                {
                  Thread.sleep(paramInt2);
                  paramInt2 -= 100;
                }
                else
                {
                  Thread.sleep(100L);
                }
              }
              catch (Exception localException3)
              {
              }
              localFileLock = null;
            }
            catch (IOException localIOException)
            {
              localObject1 = null;
              Object localObject3 = null;
              if (localObject1 == null)
                localLock.release();
              return localObject3;
            }
        }
        catch (ClosedChannelException localClosedChannelException)
        {
          localObject2 = null;
          localObject1 = null;
          if ((i == 0) && (paramInt2 <= 0))
            throw new IOException("handled ClosedChannelException, timeout reached", localClosedChannelException);
          Trace.println("SyncFileAccess.openLock: handled ClosedChannelException, remaining TO: " + paramInt2, TraceLevel.NETWORK);
          try
          {
            if (i == 0)
            {
              Thread.sleep(paramInt2);
              paramInt2 -= 100;
            }
            else
            {
              Thread.sleep(100L);
            }
          }
          catch (Exception localException2)
          {
          }
        }
      }
    }
    finally
    {
      if (localObject1 == null)
        localLock.release();
    }
    if (localObject1 != null)
      return FObjLock.createFObjLock(paramInt1, localObject1, localLock);
    return null;
  }