Returns current state of the Pool Manager as String.

<pre>
options:<br>
0 - default behavior, dump everything avalable.<br>
1 - dump everything except connection leak information.<br>
</pre>

@return java.lang.String
@concurrency concurrent
495769
public String toString2(int options) {

        StringBuffer aBuffer = new StringBuffer(500);
        StringBuffer bBuffer = new StringBuffer(500);
        ArrayList<ToStringStackElements> throwableStackTraceElements = new ArrayList<ToStringStackElements>();

        aBuffer.append("JNDI name:");
        aBuffer.append(gConfigProps.cfName);
        aBuffer.append(nl);
        aBuffer.append("PoolManager object:");
        aBuffer.append(this.hashCode());
        aBuffer.append(nl);
        aBuffer.append("Total number of connections: ");
        if (connectionPoolShutDown) {
            aBuffer.append("purging ");
        }
        aBuffer.append(totalConnectionCount.get());
        aBuffer.append(" (max/min ");
        aBuffer.append(maxConnections);
        aBuffer.append("/");
        aBuffer.append(minConnections);
        aBuffer.append(", reap/unused/aged ");
        aBuffer.append(reapTime);
        aBuffer.append("/");
        aBuffer.append(unusedTimeout);
        aBuffer.append("/");
        aBuffer.append(agedTimeout);
        aBuffer.append(", connectiontimeout/purge ");
        aBuffer.append(connectionTimeout);
        aBuffer.append("/");
        aBuffer.append(purgePolicy);
        aBuffer.append(")");

        /*
         * Log additional information only if function is enabled.
         */
        if (localConnection_ != null) {
            bBuffer.append(", maxTLS ");
            bBuffer.append(maxCapacity);
        }

        if (bBuffer.length() > 1) {
            aBuffer.append(nl);
            aBuffer.append("                              ");
            aBuffer.append(" (");
            aBuffer.append(bBuffer.substring(2));
            aBuffer.append(")");
        }

        bBuffer.delete(0, bBuffer.length());

        if (_quiesce) { //  include quiesce time
            aBuffer.append("  quiesce time:");
            aBuffer.append(_quiesceTime);
        }

        aBuffer.append(nl);

        if (waiterCount > 0) {
            aBuffer.append("The waiter count is ");
            aBuffer.append(waiterCount);
            aBuffer.append(nl);
            aBuffer.append("The mcWrappers in waiter queue ");
            try {
                aBuffer.append(mcWrapperWaiterList);
            } catch (ConcurrentModificationException cm) {
                aBuffer.append("info not available");
            }
            aBuffer.append(nl);
        }

        if (!gConfigProps.connectionPoolingEnabled) {
            aBuffer.append("Connection pooling is disabled, free connections are not pooled.");
        }
        /*
         * Shared connection information
         */
        int totalNumberOfSharedConnections = 0;
        StringBuffer connectionLeakBuffer = null;
        long currentTime = 0;
        int holdTimeLimit_loc = -1;
        if (options == 0) {
            holdTimeLimit_loc = holdTimeLimit;
        }
        if (holdTimeLimit_loc > -1) {
            connectionLeakBuffer = new StringBuffer();
            currentTime = System.currentTimeMillis();
        }
        aBuffer.append("Shared Connection information (shared partitions " + maxSharedBuckets + ")");
        aBuffer.append(nl);
        boolean atleastOne = false;
        currentTime = System.currentTimeMillis();
        mcToMCWMapWrite.lock();
        try {
            int mcToMCWSize = mcToMCWMap.size();
            if (mcToMCWSize > 0) {
                Object[] tempObject = mcToMCWMap.values().toArray();
                for (int ti = 0; ti < mcToMCWSize; ++ti) {
                    MCWrapper mcw = (MCWrapper) tempObject[ti];
                    if (mcw.getPoolState() == 2) {
                        aBuffer.append("    ");
                        if (mcw.isDestroyState()) {
                            aBuffer.append("Connection marked for thread supported cleanup and destroy.  Waiting ");
                            aBuffer.append("for transaction end and connection close - ");
                        } else {
                            if (mcw.isStale() || mcw.hasFatalErrorNotificationOccurred(freePool[0].getFatalErrorNotificationTime())
                                || ((this.agedTimeout != -1)
                                    && (mcw.hasAgedTimedOut(this.agedTimeoutMillis)))) {
                                aBuffer.append("Connection marked to be destroyed.  Waiting ");
                                aBuffer.append("for transaction end and connection close - ");
                            }
                        }
                        aBuffer.append(mcw.getSharedPoolCoordinator());
                        aBuffer.append("  ");
                        aBuffer.append(mcw);
                        if (holdTimeLimit_loc > -1) {
                            dumpHoldTimeAndStackInfo(mcw, aBuffer, connectionLeakBuffer, currentTime, throwableStackTraceElements);
                        }
                        ++totalNumberOfSharedConnections;
                        atleastOne = true;
                    }
                }
            }
        } finally {
            mcToMCWMapWrite.unlock();
        }
        if (atleastOne) {
            aBuffer.append("  Total number of connection in shared pool: ");
            aBuffer.append(totalNumberOfSharedConnections);
        } else {
            aBuffer.append("  No shared connections");
            aBuffer.append(nl);
        }

        /*
         * Free pool connection information
         */
        int totalNumberOfFreeConnections = 0;
        aBuffer.append(nl);
        aBuffer.append("Free Connection information (free distribution table " + maxFreePoolHashSize + ")");
        aBuffer.append(nl);
        atleastOne = false;
        mcToMCWMapWrite.lock();
        try {
            int mcToMCWSize = mcToMCWMap.size();
            if (mcToMCWSize > 0) {
                Object[] tempObject = mcToMCWMap.values().toArray();
                for (int ti = 0; ti < mcToMCWSize; ++ti) {
                    MCWrapper mcw = (MCWrapper) tempObject[ti];
                    if (mcw.getPoolState() == 1) {
                        aBuffer.append("  (" + mcw.getHashMapBucket() + ")");
                        aBuffer.append(mcw);
                        ++totalNumberOfFreeConnections;
                        atleastOne = true;
                    }
                }
            }
        } finally {
            mcToMCWMapWrite.unlock();
        }
        aBuffer.append(nl);
        if (atleastOne) {
            aBuffer.append("  Total number of connection in free pool: ");
            aBuffer.append(totalNumberOfFreeConnections);
        } else {
            aBuffer.append("  No free connections");
            aBuffer.append(nl);
        }

        /*
         * Inuse UnShared connection information
         */
        aBuffer.append(nl);
        int totalNumberOfUnSharedConnections = 0;
        aBuffer.append("UnShared Connection information");
        aBuffer.append(nl);
        atleastOne = false;
        mcToMCWMapWrite.lock();
        try {
            int mcToMCWSize = mcToMCWMap.size();
            if (mcToMCWSize > 0) {
                Object[] tempObject = mcToMCWMap.values().toArray();
                for (int ti = 0; ti < mcToMCWSize; ++ti) {
                    MCWrapper mcw = (MCWrapper) tempObject[ti];
                    if (mcw.getPoolState() == 3) {
                        aBuffer.append("    ");
                        if (mcw.isStale()
                            || mcw.hasFatalErrorNotificationOccurred(freePool[0].getFatalErrorNotificationTime())
                            || ((this.agedTimeout != -1) && (mcw.hasAgedTimedOut(this.agedTimeoutMillis)))) {
                            aBuffer.append("Connection marked to be destroyed.  Waiting ");
                            aBuffer.append("for transaction end and connection close - ");
                        }
                        aBuffer.append(mcw);
                        if (holdTimeLimit_loc > -1) {
                            dumpHoldTimeAndStackInfo(mcw, aBuffer, connectionLeakBuffer, currentTime, throwableStackTraceElements);
                        }
                        ++totalNumberOfUnSharedConnections;
                        atleastOne = true;
                    }
                }
            }
        } finally {
            mcToMCWMapWrite.unlock();
        }

        if (atleastOne) {
            aBuffer.append("  Total number of connection in unshared pool: ");
            aBuffer.append(totalNumberOfUnSharedConnections);
            aBuffer.append(nl);
        } else {
            aBuffer.append("  No unshared connections");
            aBuffer.append(nl);
        }
        int holdTimeLimit_loc_disabled = -1;
        if (localConnection_ != null) {
            displaySharedTLSConnections(aBuffer, connectionLeakBuffer, currentTime,
                                        holdTimeLimit_loc_disabled, throwableStackTraceElements);
            displayFreeTLSConnections(aBuffer, connectionLeakBuffer, currentTime,
                                      holdTimeLimit_loc_disabled, throwableStackTraceElements);
            displayUnsharedTLSConnections(aBuffer, connectionLeakBuffer, currentTime,
                                          holdTimeLimit_loc_disabled, throwableStackTraceElements);
        }
        // This is only for additional trace if needed.
        //    displayAllConnectionInPool(aBuffer, connectionLeakBuffer, currentTime,
        //    		holdTimeLimit_loc_disabled);
        int tscdSize = tscdList.size();
        if (tscdSize > 0) {
            aBuffer.append(nl + "Thread supported cleanup and destroy connection information" + nl);
            Object o = null;
            for (int i = 0; i < tscdList.size(); ++i) {
                /*
                 * Print as many mcWrapper in the list as possible.
                 */
                try {
                    o = tscdList.get(i);
                } catch (IndexOutOfBoundsException e) {
                    /*
                     * If this occurs, the list size most likely changed.
                     */
                    break;
                }
                if (o != null) {
                    aBuffer.append("  " + o.toString());
                }
            }
            aBuffer.append("  Total number of thread supported cleanup and destroy connections requests being processed: " + tscdSize + " (not included in total connection count)"
                           + nl);
        }
        /*
         * The initial length of the connectionLeakBuffer is 36.
         * If the length is larger than 36, we have added information
         * for the trace.
         */
        if (holdTimeLimit_loc > -1) {
            if (connectionLeakBuffer.length() > 0) {
                aBuffer.append(nl);
                aBuffer.append("Connection Leak Logic Information: (Note, applications using managed connections " +
                               "in this list may not be following the recommended " +
                               "getConnection(), use connection, close() connection " +
                               " programming model pattern)" + nl);
                aBuffer.append(connectionLeakBuffer);
            }
        }
        /*
         * All done return string buffer.
         */
        return aBuffer.toString();

    }
676666
public Object getPersistentState() {
    Map<String, Object> persistentState = new HashMap<String, Object>();
    persistentState.put("suspensionState", this.suspensionState);
    persistentState.put("historyTimeToLive", this.historyTimeToLive);
    return persistentState;
  }
1262269
public String getOriginalString() {

    if (this.string != null) {
      this.string = new String(this.buffer, this.initialOffset, getLength());
    }
    return this.string;
  }
707124
ServerStatus getState() {
        final InternalState requiredState = this.requiredState;
        final InternalState state = internalState;
        if(requiredState == InternalState.FAILED) {
            return ServerStatus.FAILED;
        }
        switch (state) {
            case STOPPED:
                return ServerStatus.STOPPED;
            case SERVER_STARTED:
                return  ServerStatus.STARTED;
            default: {
                if(requiredState == InternalState.SERVER_STARTED) {
                    return ServerStatus.STARTING;
                } else {
                    return ServerStatus.STOPPING;
                }
            }
        }
    }
391611
public String getValueString() {
		if (current == State.KEY) {
			return valueStr;
		} else if (current == State.VALUE_STRING) {
			return valueStr;
		} else if (current == State.VALUE_NULL) {
			return null;
		} else {
			throw new IllegalStateException("unexpected state. state=" + current);
		}
	}
565819
public synchronized Entry current()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "current");

    checkEntryParent();
      
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "current", current);

    return current;
  }
704859
public synchronized String getString()
   {
      checkReleased();

      String returningString = null;

      // Read the length in
      short stringLength = receivedBuffer.getShort();
      // Allocate the right amount of space for it
      byte[] stringBytes = new byte[stringLength];
      // And copy the data in
      receivedBuffer.get(stringBytes);

      // If the length is 1, and the byte is 0x00, then this is null - so do nothing
      if (stringLength == 1 && stringBytes[0] == 0)
      {
         // String is null...
      }
      else
      {
         try
         {
            returningString = new String(stringBytes, stringEncoding);
         }
         catch (UnsupportedEncodingException e)
         {
            FFDCFilter.processException(e, CLASS_NAME + ".getString",
                                        CommsConstants.COMMSBYTEBUFFER_GETSTRING_01,
                                        this);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            {
               SibTr.debug(tc, "Unable to encode String: ", e);
               SibTr.exception(tc, e);
            }

            SibTr.error(tc, "UNSUPPORTED_STRING_ENCODING_SICO8005", new Object[] {stringEncoding, e});

            throw new SIErrorException(
               TraceNLS.getFormattedMessage(CommsConstants.MSG_BUNDLE, "UNSUPPORTED_STRING_ENCODING_SICO8005", new Object[] {stringEncoding, e}, null)
            );
         }
      }

      return returningString;
   }
684291
public synchronized String getText() {
        if(lines.length == 0) {
            return "";
        }
        StringBuilder bob = new StringBuilder(lines[0]);
        for(int i = 1; i < lines.length; i++) {
            bob.append("\n").append(lines[i]);
        }
        return bob.toString();
    }
774139
public DDPSTATE getState() {
        // used by the UI to figure out what the current DDP connection state is
        if (getDDP().getState() == CONNSTATE.Closed) {
            mDDPState = DDPSTATE.Closed;
        }
        return mDDPState;
    }
594858
public String toMixedString() {
		String result;
		if(hasNoStringCache() || (result = stringCache.mixedString) == null) {
			if(hasZone()) {
				stringCache.mixedString = result = toNormalizedString(IPv6StringCache.mixedParams);
			} else {
				result = getSection().toMixedString();//the cache is shared so no need to update it here
			}
		}
		return result;
	}
952716
public Object getSessionMutex() {
		Object mutex = getAttribute(SESSION_MUTEX_NAME);
		if (mutex == null) {
			mutex = this.webSocketSession.getAttributes();
		}
		return mutex;
	}
921321
private PoolStats getPoolStats()
   {
      return new PoolStats(SECONDS.toMillis(1)) {
         @Override
         protected void update() {
            this.pendingThreads = HikariPool.this.getThreadsAwaitingConnection();
            this.idleConnections = HikariPool.this.getIdleConnections();
            this.totalConnections = HikariPool.this.getTotalConnections();
            this.activeConnections = HikariPool.this.getActiveConnections();
            this.maxConnections = config.getMaximumPoolSize();
            this.minConnections = config.getMinimumIdle();
         }
      };
   }
543371
public Object getPersistentState() {
    Map<String, Object> persistentState = new HashMap<>();
    persistentState.put("processDefinitionId", this.processDefinitionId);
    persistentState.put("businessKey", businessKey);
    persistentState.put("activityId", this.activityId);
    persistentState.put("activityInstanceId", this.activityInstanceId);
    persistentState.put("isActive", this.isActive);
    persistentState.put("isConcurrent", this.isConcurrent);
    persistentState.put("isScope", this.isScope);
    persistentState.put("isEventScope", this.isEventScope);
    persistentState.put("parentId", parentId);
    persistentState.put("superExecution", this.superExecutionId);
    persistentState.put("superCaseExecutionId", this.superCaseExecutionId);
    persistentState.put("caseInstanceId", this.caseInstanceId);
    persistentState.put("suspensionState", this.suspensionState);
    persistentState.put("cachedEntityState", getCachedEntityState());
    persistentState.put("sequenceCounter", getSequenceCounter());
    return persistentState;
  }
406554
@Override
    public int getStatus() {
        int state = Status.STATUS_UNKNOWN;

        switch (_status.getState()) {
            case TransactionState.STATE_NONE:
                state = Status.STATUS_NO_TRANSACTION;
                break;
            case TransactionState.STATE_ACTIVE:
                if (_rollbackOnly)
                    state = Status.STATUS_MARKED_ROLLBACK;
                else
                    state = Status.STATUS_ACTIVE;
                break;
            case TransactionState.STATE_PREPARING:
            case TransactionState.STATE_LAST_PARTICIPANT:
                state = Status.STATUS_PREPARING;
                break;
            case TransactionState.STATE_PREPARED:
                state = Status.STATUS_PREPARED;
                break;
            case TransactionState.STATE_COMMITTING:
            case TransactionState.STATE_COMMITTING_ONE_PHASE:
                state = Status.STATUS_COMMITTING;
                break;
            case TransactionState.STATE_HEURISTIC_ON_COMMIT:
            case TransactionState.STATE_COMMITTED:
                state = Status.STATUS_COMMITTED;
                break;
            case TransactionState.STATE_ROLLING_BACK:
                state = Status.STATUS_ROLLING_BACK;
                break;
            case TransactionState.STATE_HEURISTIC_ON_ROLLBACK:
            case TransactionState.STATE_ROLLED_BACK:
                state = Status.STATUS_ROLLEDBACK;
                break;
        }

        if (tc.isDebugEnabled())
            Tr.debug(tc, "getStatus (SPI)", Util.printStatus(state));
        return state;
    }
986019
def get_current_state(self):
        
        try:
            session_id = session.sessionId
            return self.session_machines.current_state(session_id)
        except UninitializedStateMachine as e:
            logger.error(e)
431459
public String asString() {
		if (current == null)
			return null;
		if (current instanceof String)
			return (String) current;
		return current.toString();
	}
1245075
private static long getCurrentPID() {
    try {
      String n = ManagementFactory.getRuntimeMXBean().getName();
      int i = n.indexOf('@');
      if(i != -1) {
        return Long.parseLong(n.substring(0, i));
      } else {
        return -1L;
      }
    } catch(Throwable ignore) {
      return -1L;
    }
  }