idx
int64 0
165k
| question
stringlengths 73
5.81k
| target
stringlengths 5
918
|
---|---|---|
163,100 | public final void enforceAutoCommit ( boolean autoCommit ) throws SQLException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "enforceAutoCommit" , autoCommit ) ; if ( autoCommit != currentAutoCommit || helper . alwaysSetAutoCommit ( ) ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "currentAutoCommit: " + currentAutoCommit + " + autoCommit ) ; sqlConn . setAutoCommit ( autoCommit ) ; currentAutoCommit = autoCommit ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "enforceAutoCommit" ) ; } } | Enforce the autoCommit setting in the underlying database and update the current value on the MC . This method must be invoked by the Connection handle before doing any work on the database . |
163,101 | private CacheMap getStatementCache ( ) { int newSize = dsConfig . get ( ) . statementCacheSize ; if ( statementCache == null && newSize > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "enable statement cache with size" , newSize ) ; statementCache = new CacheMap ( newSize ) ; } else if ( statementCache != null && statementCache . getMaxSize ( ) != newSize ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "resize statement cache to" , newSize ) ; CacheMap oldCache = statementCache ; statementCache = newSize > 0 ? new CacheMap ( newSize ) : null ; Object [ ] discards = newSize > 0 ? statementCache . addAll ( oldCache ) : oldCache . removeAll ( ) ; for ( Object stmt : discards ) destroyStatement ( stmt ) ; } return statementCache ; } | Processes any dynamic updates to the statement cache size and then returns the statement cache . |
163,102 | public final boolean isGlobalTransactionActive ( ) { UOWCurrent uow = ( UOWCurrent ) mcf . connectorSvc . getTransactionManager ( ) ; UOWCoordinator coord = uow == null ? null : uow . getUOWCoord ( ) ; return coord != null && coord . isGlobal ( ) ; } | Returns true if a global transaction is active on the thread otherwise false . |
163,103 | public final boolean isTransactional ( ) { if ( transactional == null ) { transactional = mcf . dsConfig . get ( ) . transactional ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "transactional=" , transactional ) ; } return transactional ; } | This method checks if transaction enlistment is enabled on the MC |
163,104 | public void processConnectionClosedEvent ( WSJdbcConnection handle ) throws ResourceException { if ( cleaningUpHandles ) return ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; connEvent . recycle ( ConnectionEvent . CONNECTION_CLOSED , null , handle ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Firing CONNECTION CLOSED" , handle ) ; try { removeHandle ( handle ) ; } catch ( NullPointerException nullX ) { if ( handlesInUse == null ) { if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "ManagedConnection already closed" ) ; return ; } else throw nullX ; } if ( numHandlesInUse == 0 ) { if ( haveVendorConnectionPropertiesChanged ) { try { helper . doConnectionVendorPropertyReset ( this . sqlConn , CONNECTION_VENDOR_DEFAULT_PROPERTIES ) ; } catch ( SQLException sqle ) { FFDCFilter . processException ( sqle , getClass ( ) . getName ( ) , "1905" , this ) ; throw new DataStoreAdapterException ( "DSA_ERROR" , sqle , getClass ( ) ) ; } haveVendorConnectionPropertiesChanged = false ; } } for ( int i = 0 ; i < numListeners ; i ++ ) { ivEventListeners [ i ] . connectionClosed ( connEvent ) ; } } | Process request for a CONNECTION_CLOSED event . |
163,105 | public void processLocalTransactionStartedEvent ( Object handle ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "processLocalTransactionStartedEvent" , handle ) ; if ( tc . isDebugEnabled ( ) ) { String cId = null ; try { cId = mcf . getCorrelator ( this ) ; } catch ( SQLException x ) { Tr . debug ( this , tc , "got an exception trying to get the correlator in commit, exception is: " , x ) ; } if ( cId != null ) { StringBuffer stbuf = new StringBuffer ( 200 ) ; stbuf . append ( "Correlator: DB2, ID: " ) ; stbuf . append ( cId ) ; if ( xares != null ) { stbuf . append ( " Transaction : " ) ; stbuf . append ( xares ) ; } stbuf . append ( " BEGIN" ) ; Tr . debug ( this , tc , stbuf . toString ( ) ) ; } } } ResourceException re = stateMgr . isValid ( WSStateManager . LT_BEGIN ) ; if ( re == null ) { if ( currentAutoCommit ) { try { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "current autocommit is true, set to false" ) ; setAutoCommit ( false ) ; } catch ( SQLException sqle ) { FFDCFilter . processException ( sqle , getClass ( ) . getName ( ) + ".processLocalTransactionStartedEvent" , "550" , this ) ; throw new DataStoreAdapterException ( "DSA_ERROR" , sqle , getClass ( ) ) ; } } stateMgr . transtate = WSStateManager . LOCAL_TRANSACTION_ACTIVE ; } else { throw re ; } connEvent . recycle ( ConnectionEvent . LOCAL_TRANSACTION_STARTED , null , handle ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Firing LOCAL TRANSACTION STARTED event for: " + handle , this ) ; for ( int i = 0 ; i < numListeners ; i ++ ) { ivEventListeners [ i ] . localTransactionStarted ( connEvent ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "processLocalTransactionStartedEvent" , handle ) ; } } | Process request for a LOCAL_TRANSACTION_STARTED event . |
163,106 | public void processLocalTransactionCommittedEvent ( Object handle ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "processLocalTransactionCommittedEvent" , handle ) ; if ( tc . isDebugEnabled ( ) ) { String cId = null ; try { cId = mcf . getCorrelator ( this ) ; } catch ( SQLException x ) { Tr . debug ( this , tc , "got an exception trying to get the correlator in commit, exception is: " , x ) ; } if ( cId != null ) { StringBuffer stbuf = new StringBuffer ( 200 ) ; stbuf . append ( "Correlator: DB2, ID: " ) ; stbuf . append ( cId ) ; if ( xares != null ) { stbuf . append ( " Transaction : " ) ; stbuf . append ( xares ) ; } stbuf . append ( " COMMIT" ) ; Tr . debug ( this , tc , stbuf . toString ( ) ) ; } } } ResourceException re = stateMgr . isValid ( WSStateManager . LT_COMMIT ) ; if ( re == null ) { if ( ! currentAutoCommit ) try { sqlConn . commit ( ) ; } catch ( SQLException se ) { FFDCFilter . processException ( se , "com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processLocalTransactionCommittedEvent" , "554" , this ) ; throw AdapterUtil . translateSQLException ( se , this , true , getClass ( ) ) ; } stateMgr . transtate = WSStateManager . NO_TRANSACTION_ACTIVE ; } else { throw re ; } connEvent . recycle ( ConnectionEvent . LOCAL_TRANSACTION_COMMITTED , null , handle ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Firing LOCAL TRANSACTION COMMITTED event for: " + handle , this ) ; for ( int i = 0 ; i < numListeners ; i ++ ) { ivEventListeners [ i ] . localTransactionCommitted ( connEvent ) ; } wasLazilyEnlistedInGlobalTran = false ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "processLocalTransactionCommittedEvent" ) ; } } | Process request for a LOCAL_TRANSACTION_COMMITTED event . |
163,107 | public void processConnectionErrorOccurredEvent ( Object handle , Exception ex , boolean logEvent ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( inCleanup ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "An error occured during connection cleanup. Since the container drives " + "the cleanup op, it will directly receive the exception." ) ; return ; } if ( connectionErrorDetected ) { if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "CONNECTION_ERROR_OCCURRED event already fired" ) ; return ; } if ( ex instanceof SQLException && mcf . helper . isAnAuthorizationException ( ( SQLException ) ex ) ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "CONNECTION_ERROR_OCCURRED will fire an event to only purge and destroy this connection" ) ; connectionErrorDetected = true ; closeHandles ( ) ; connEvent . recycle ( WSConnectionEvent . SINGLE_CONNECTION_ERROR_OCCURRED , ex , handle ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Firing Single CONNECTION_ERROR_OCCURRED" , handle ) ; for ( int i = 0 ; i < numListeners ; i ++ ) { ivEventListeners [ i ] . connectionErrorOccurred ( connEvent ) ; } return ; } mcf . fatalErrorCount . incrementAndGet ( ) ; if ( mcf . oracleRACXARetryDelay > 0l ) mcf . oracleRACLastStale . set ( System . currentTimeMillis ( ) ) ; connectionErrorDetected = true ; closeHandles ( ) ; connEvent . recycle ( ( logEvent ? ConnectionEvent . CONNECTION_ERROR_OCCURRED : WSConnectionEvent . CONNECTION_ERROR_OCCURRED_NO_EVENT ) , ex , handle ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Firing " + ( logEvent ? "CONNECTION_ERROR_OCCURRED" : "CONNECTION_ERROR_OCCURRED_NO_EVENT" ) , handle ) ; for ( int i = 0 ; i < numListeners ; i ++ ) { ivEventListeners [ i ] . connectionErrorOccurred ( connEvent ) ; } } | Process request for a CONNECTION_ERROR_OCCURRED event . |
163,108 | public void statementClosed ( javax . sql . StatementEvent event ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "statementClosed" , "Notification of statement closed received from the JDBC driver" , AdapterUtil . toString ( event . getSource ( ) ) , AdapterUtil . toString ( event . getStatement ( ) ) ) ; } | Invoked by the JDBC driver when a prepared statement is closed . |
163,109 | public void statementErrorOccurred ( StatementEvent event ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "statementErrorOccurred" , "Notification of a fatal statement error received from the JDBC driver" , AdapterUtil . toString ( event . getSource ( ) ) , AdapterUtil . toString ( event . getStatement ( ) ) , event . getSQLException ( ) ) ; for ( int i = 0 ; i < numHandlesInUse ; i ++ ) ( ( WSJdbcConnection ) handlesInUse [ i ] ) . setPoolableFlag ( event . getStatement ( ) , false ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "statementErrorOccurred" ) ; } | Invoked by the JDBC driver when a fatal statement error occurs . |
163,110 | public void lazyEnlistInGlobalTran ( LazyEnlistableConnectionManager lazyEnlistableConnectionManager ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "lazyEnlist" , lazyEnlistableConnectionManager ) ; if ( tc . isDebugEnabled ( ) ) { String cId = null ; try { cId = mcf . getCorrelator ( this ) ; } catch ( SQLException x ) { Tr . debug ( this , tc , "got an exception trying to get the correlator in commit, exception is: " , x ) ; } if ( cId != null ) { StringBuffer stbuf = new StringBuffer ( 200 ) ; stbuf . append ( "Correlator: DB2, ID: " ) ; stbuf . append ( cId ) ; if ( xares != null ) { stbuf . append ( " Transaction : " ) ; stbuf . append ( xares ) ; stbuf . append ( " BEGIN" ) ; } Tr . debug ( this , tc , stbuf . toString ( ) ) ; } } } if ( wasLazilyEnlistedInGlobalTran ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "lazyEnlist" , "already enlisted" ) ; } else { lazyEnlistableConnectionManager . lazyEnlist ( this ) ; wasLazilyEnlistedInGlobalTran |= stateMgr . transtate != WSStateManager . NO_TRANSACTION_ACTIVE ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "lazyEnlist" , wasLazilyEnlistedInGlobalTran ) ; } } | Signal the Application Server for lazy enlistment if we aren t already enlisted in a transaction . The lazy enlistment signal should only be sent once for a transaction . Connection handles will always invoke this method when doing work in the database regardless of whether we are already enlisted . In the case where we are already enlisted this request should be ignored . |
163,111 | void refreshCachedAutoCommit ( ) { try { boolean autoCommit = sqlConn . getAutoCommit ( ) ; if ( currentAutoCommit != autoCommit ) { currentAutoCommit = autoCommit ; for ( int i = 0 ; i < numHandlesInUse ; i ++ ) handlesInUse [ i ] . setCurrentAutoCommit ( autoCommit , key ) ; } } catch ( SQLException x ) { processConnectionErrorOccurredEvent ( null , x ) ; } } | After XAResource . end Oracle resets the autocommit value to whatever it was before the transaction instead of leaving it as the value that the application set during the transaction . Refresh our cached copy of the autocommit value to be consistent with the JDBC driver s behavior . |
163,112 | private final boolean removeHandle ( WSJdbcConnection handle ) { for ( int i = numHandlesInUse ; i > 0 ; ) if ( handle == handlesInUse [ -- i ] ) { handlesInUse [ i ] = handlesInUse [ -- numHandlesInUse ] ; handlesInUse [ numHandlesInUse ] = null ; return true ; } return false ; } | Remove a handle from the list of handles associated with this ManagedConnection . |
163,113 | private void replaceCRI ( WSConnectionRequestInfoImpl newCRI ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "replaceCRI" , "Current:" , cri , "New:" , newCRI ) ; if ( numHandlesInUse > 0 || ! cri . isReconfigurable ( newCRI , false ) ) { if ( numHandlesInUse > 0 ) { ResourceException resX = new DataStoreAdapterException ( "WS_INTERNAL_ERROR" , null , getClass ( ) , "ConnectionRequestInfo cannot be changed on a ManagedConnection with active handles." , AdapterUtil . EOLN + "Existing CRI: " + cri , AdapterUtil . EOLN + "Requested CRI: " + newCRI ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "replaceCRI" , resX ) ; throw resX ; } else { ResourceException resX = new DataStoreAdapterException ( "WS_INTERNAL_ERROR" , null , getClass ( ) , "ConnectionRequestInfo cannot be changed because the users, passwords, or DataSource configurations do not match." , AdapterUtil . EOLN + "Existing CRI: " + cri , AdapterUtil . EOLN + "Requested CRI: " + newCRI ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "replaceCRI" , resX ) ; throw resX ; } } if ( ! newCRI . isCRIChangable ( ) ) newCRI = WSConnectionRequestInfoImpl . createChangableCRIFromNon ( newCRI ) ; newCRI . setDefaultValues ( defaultCatalog , defaultHoldability , defaultReadOnly , defaultTypeMap , defaultSchema , defaultNetworkTimeout ) ; cri = newCRI ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "replaceCRI" ) ; } | Replace the CRI of this ManagedConnection with the new CRI . |
163,114 | private WSJdbcConnection [ ] resizeHandleList ( ) { System . arraycopy ( handlesInUse , 0 , handlesInUse = new WSJdbcConnection [ maxHandlesInUse > numHandlesInUse ? maxHandlesInUse : ( maxHandlesInUse = numHandlesInUse * 2 ) ] , 0 , numHandlesInUse ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Handle limit increased to: " + maxHandlesInUse ) ; return handlesInUse ; } | Increase the size of the array that keeps track of handles associated with this ManagedConnection . |
163,115 | private void handleCleanReuse ( ) throws ResourceException { try { currentTransactionIsolation = sqlConn . getTransactionIsolation ( ) ; currentHoldability = defaultHoldability ; currentAutoCommit = sqlConn . getAutoCommit ( ) ; } catch ( SQLException sqlX ) { FFDCFilter . processException ( sqlX , getClass ( ) . getName ( ) + ".handleCleanReuse" , "2787" , this ) ; throw AdapterUtil . translateSQLException ( sqlX , this , true , getClass ( ) ) ; } loggingEnabled = false ; if ( helper . shouldTraceBeEnabled ( this ) ) { helper . enableJdbcLogging ( this ) ; } } | used to do some cleanup after a reuse of connection |
163,116 | public final Object getStatement ( StatementCacheKey key ) { Object stmt = statementCache . remove ( key ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( stmt == null ) { Tr . debug ( this , tc , "No Matching Prepared Statement found in cache" ) ; } else { Tr . debug ( this , tc , "Matching Prepared Statement found in cache: " + stmt ) ; } } return stmt ; } | Return a statement from the cache matching the key provided . Null is returned if no statement matches . |
163,117 | public final void cacheStatement ( Statement statement , StatementCacheKey key ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "cacheStatement" , AdapterUtil . toString ( statement ) , key ) ; CacheMap cache = getStatementCache ( ) ; Object discardedStatement = cache == null ? statement : statementCache . add ( key , statement ) ; if ( discardedStatement != null ) destroyStatement ( discardedStatement ) ; } | Returns the statement into the cache . The statement is closed if an error occurs attempting to cache it . This method will only called if statement caching was enabled at some point although it might not be enabled anymore . |
163,118 | public void dissociateHandle ( WSJdbcConnection connHandle ) { if ( ! cleaningUpHandles && ! removeHandle ( connHandle ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Unable to dissociate Connection handle with current ManagedConnection because it is not currently associated with the ManagedConnection." , connHandle ) ; } } | This method is invoked by the connection handle during dissociation to signal the ManagedConnection to remove all references to the handle . If the ManagedConnection is not associated with the specified handle this method is a no - op and a warning message is traced . |
163,119 | public final void clearStatementCache ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( statementCache == null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "statement cache is null. caching is disabled" ) ; return ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "clearStatementCache" ) ; Object [ ] stmts = statementCache . removeAll ( ) ; for ( int i = stmts . length ; i > 0 ; ) try { ( ( Statement ) stmts [ -- i ] ) . close ( ) ; } catch ( SQLException closeX ) { FFDCFilter . processException ( closeX , getClass ( ) . getName ( ) + ".clearStatementCache" , "2169" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Error closing statement" , closeX ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "clearStatementCache" ) ; } | Removes and closes all statements in the statement cache for this ManagedConnection . |
163,120 | private ResourceException closeHandles ( ) { ResourceException firstX = null ; Object conn = null ; cleaningUpHandles = true ; for ( int i = numHandlesInUse ; i > 0 ; ) { conn = handlesInUse [ -- i ] ; handlesInUse [ i ] = null ; try { ( ( WSJdbcConnection ) conn ) . close ( ) ; } catch ( SQLException closeX ) { FFDCFilter . processException ( closeX , getClass ( ) . getName ( ) + ".closeHandles" , "1414" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Error closing handle. Continuing..." , conn ) ; ResourceException resX = new DataStoreAdapterException ( "DSA_ERROR" , closeX , getClass ( ) ) ; if ( firstX == null ) firstX = resX ; } } numHandlesInUse = 0 ; cleaningUpHandles = false ; return firstX ; } | Closes all handles associated with this ManagedConnection . Processing continues even if close fails on a handle . All errors are logged and the first error is saved to be returned when processing completes . |
163,121 | public XAResource getXAResource ( ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getXAResource" ) ; if ( xares != null ) { if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Returning existing XAResource" , xares ) ; } else if ( is2Phase ) { try { XAResource xa = ( ( javax . sql . XAConnection ) poolConn ) . getXAResource ( ) ; xares = new WSRdbXaResourceImpl ( xa , this ) ; } catch ( SQLException se ) { FFDCFilter . processException ( se , "com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.getXAResource" , "1638" , this ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getXAResource" , se ) ; throw AdapterUtil . translateSQLException ( se , this , true , getClass ( ) ) ; } } else { xares = new WSRdbOnePhaseXaResourceImpl ( sqlConn , this ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getXAResource" ) ; return xares ; } | Returns a javax . transaction . xa . XAresource instance . An application server enlists this XAResource instance with the Transaction Manager if the ManagedConnection instance is being used in a JTA transaction that is being coordinated by the Transaction Manager . |
163,122 | public final LocalTransaction getLocalTransaction ( ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getLocalTransaction" ) ; localTran = localTran == null ? new WSRdbSpiLocalTransactionImpl ( this , sqlConn ) : localTran ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getLocalTransaction" , localTran ) ; return localTran ; } | Returns an javax . resource . spi . LocalTransaction instance . The LocalTransaction interface is used by the container to manage local transactions for a RM instance . |
163,123 | public final void setTransactionIsolation ( int isoLevel ) throws SQLException { if ( currentTransactionIsolation != isoLevel ) { if ( isoLevel == Connection . TRANSACTION_NONE ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "DSRA4011.tran.none.iso.switch.unsupported" , dsConfig . get ( ) . id ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Set Isolation Level to " + AdapterUtil . getIsolationLevelString ( isoLevel ) ) ; sqlConn . setTransactionIsolation ( isoLevel ) ; currentTransactionIsolation = isoLevel ; isolationChanged = true ; } if ( cachedConnection != null ) cachedConnection . setCurrentTransactionIsolation ( currentTransactionIsolation , key ) ; } | Set the transactionIsolation level to the requested Isolation Level . If the requested and current are the same then do not drive it to the database If they are different drive it all the way to the database . |
163,124 | public final int getTransactionIsolation ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { try { Tr . debug ( this , tc , "The current isolation level from our tracking is: " , currentTransactionIsolation ) ; Tr . debug ( this , tc , "Isolation reported by the JDBC driver: " , sqlConn . getTransactionIsolation ( ) ) ; } catch ( Throwable x ) { } } return currentTransactionIsolation ; } | Get the transactionIsolation level |
163,125 | public final void setHoldability ( int holdability ) throws SQLException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setHoldability" , "Set Holdability to " + AdapterUtil . getCursorHoldabilityString ( holdability ) ) ; sqlConn . setHoldability ( holdability ) ; currentHoldability = holdability ; holdabilityChanged = true ; } | Set the cursor holdability value to the request value |
163,126 | public final void setCatalog ( String catalog ) throws SQLException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Set Catalog to " + catalog ) ; sqlConn . setCatalog ( catalog ) ; connectionPropertyChanged = true ; } | Updates the value of the catalog property . |
163,127 | public final void setReadOnly ( boolean isReadOnly ) throws SQLException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Set readOnly to " + isReadOnly ) ; sqlConn . setReadOnly ( isReadOnly ) ; connectionPropertyChanged = true ; } | Updates the value of the readOnly property . |
163,128 | public final void setShardingKeys ( Object shardingKey , Object superShardingKey ) throws SQLException { if ( mcf . beforeJDBCVersion ( JDBCRuntimeVersion . VERSION_4_3 ) ) throw new SQLFeatureNotSupportedException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Set sharding key/super sharding key to " + shardingKey + "/" + superShardingKey ) ; mcf . jdbcRuntime . doSetShardingKeys ( sqlConn , shardingKey , superShardingKey ) ; currentShardingKey = shardingKey ; if ( superShardingKey != JDBCRuntimeVersion . SUPER_SHARDING_KEY_UNCHANGED ) currentSuperShardingKey = superShardingKey ; connectionPropertyChanged = true ; } | Updates the value of the sharding keys . |
163,129 | public final boolean setShardingKeysIfValid ( Object shardingKey , Object superShardingKey , int timeout ) throws SQLException { if ( mcf . beforeJDBCVersion ( JDBCRuntimeVersion . VERSION_4_3 ) ) throw new SQLFeatureNotSupportedException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Set sharding key/super sharding key to " + shardingKey + "/" + superShardingKey + " within " + timeout + " seconds" ) ; boolean updated = mcf . jdbcRuntime . doSetShardingKeysIfValid ( sqlConn , shardingKey , superShardingKey , timeout ) ; if ( updated ) { currentShardingKey = shardingKey ; if ( superShardingKey != JDBCRuntimeVersion . SUPER_SHARDING_KEY_UNCHANGED ) currentSuperShardingKey = superShardingKey ; connectionPropertyChanged = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "successful? " + updated ) ; return updated ; } | Updates the value of the sharding keys after validating them . |
163,130 | public final void setTypeMap ( Map < String , Class < ? > > typeMap ) throws SQLException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Set TypeMap to " + typeMap ) ; try { sqlConn . setTypeMap ( typeMap ) ; } catch ( SQLFeatureNotSupportedException nse ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "supportsGetTypeMap false due to " , nse ) ; mcf . supportsGetTypeMap = false ; throw nse ; } catch ( UnsupportedOperationException uoe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "supportsGetTypeMap false due to " , uoe ) ; mcf . supportsGetTypeMap = false ; throw uoe ; } connectionPropertyChanged = true ; } | Updates the value of the typeMap property . |
163,131 | public final Object getSQLJConnectionContext ( Class < ? > DefaultContext , WSConnectionManager cm ) throws SQLException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getSQLJConnectionContext" ) ; if ( sqljContext == null ) { try { sqljContext = helper . getSQLJContext ( this , DefaultContext , cm ) ; } catch ( SQLException se ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getSQLJConnectionContext" , se ) ; throw se ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getSQLJConnectionContext" , sqljContext ) ; return sqljContext ; } | This method returns the SQLJ ConnectionContext . This method is only called by the WSJccConnection class . The ConnectionContext caches all the RTStatements |
163,132 | public void setClaimedVictim ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "marking this mc as _claimedVictim" ) ; _claimedVictim = true ; } | Claim the unused managed connection as a victim connection which can then be reauthenticated and reused . |
163,133 | public void setSchema ( String schema ) throws SQLException { Transaction suspendTx = null ; if ( mcf . beforeJDBCVersion ( JDBCRuntimeVersion . VERSION_4_1 ) ) throw new SQLFeatureNotSupportedException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Set Schema to " + schema ) ; if ( AdapterUtil . isZOS ( ) && isGlobalTransactionActive ( ) ) suspendTx = suspendGlobalTran ( ) ; try { mcf . jdbcRuntime . doSetSchema ( sqlConn , schema ) ; currentSchema = schema ; connectionPropertyChanged = true ; } catch ( SQLException sqle ) { throw sqle ; } finally { if ( suspendTx != null ) resumeGlobalTran ( suspendTx ) ; } } | Set a schema for this managed connection . |
163,134 | public String getSchema ( ) throws SQLException { Transaction suspendTx = null ; if ( mcf . beforeJDBCVersion ( JDBCRuntimeVersion . VERSION_4_1 ) ) return null ; if ( AdapterUtil . isZOS ( ) && isGlobalTransactionActive ( ) ) suspendTx = suspendGlobalTran ( ) ; String schema ; try { schema = mcf . jdbcRuntime . doGetSchema ( sqlConn ) ; } catch ( SQLException sqle ) { throw sqle ; } finally { if ( suspendTx != null ) resumeGlobalTran ( suspendTx ) ; } return schema ; } | Retrieve the schema being used by this managed connection . |
163,135 | void setFileTag ( File file ) throws IOException { if ( initialized && fileEncodingCcsid != 0 ) { int returnCode = setFileTag ( file . getAbsolutePath ( ) , fileEncodingCcsid ) ; if ( returnCode != 0 ) { issueTaggingFailedMessage ( returnCode ) ; } } } | Tag the specified file as ISO8859 - 1 text . |
163,136 | private synchronized void issueTaggingFailedMessage ( int returnCode ) { if ( taggingFailedIssued ) { return ; } System . err . println ( MessageFormat . format ( BootstrapConstants . messages . getString ( "warn.unableTagFile" ) , returnCode ) ) ; taggingFailedIssued = true ; } | Issue the tagging failed message . |
163,137 | private static boolean registerNatives ( ) { try { final String methodDescriptor = "zJNIBOOT_" + TaggedFileOutputStream . class . getCanonicalName ( ) . replaceAll ( "\\." , "_" ) ; long dllHandle = NativeMethodHelper . registerNatives ( TaggedFileOutputStream . class , methodDescriptor , null ) ; if ( dllHandle > 0 ) { return true ; } if ( dllHandle == 0 ) { return false ; } } catch ( Throwable t ) { } System . err . println ( MessageFormat . format ( BootstrapConstants . messages . getString ( "warn.registerNative" ) , TaggedFileOutputStream . class . getCanonicalName ( ) ) ) ; return false ; } | Register the native method needed for file tagging . |
163,138 | private static int acquireFileEncodingCcsid ( ) { Charset charset = null ; String fileEncoding = System . getProperty ( "file.encoding" ) ; try { charset = Charset . forName ( fileEncoding ) ; } catch ( Throwable t ) { } int ccsid = getCcsid ( charset ) ; if ( ccsid == 0 ) { System . err . println ( MessageFormat . format ( BootstrapConstants . messages . getString ( "warn.fileEncodingNotFound" ) , fileEncoding ) ) ; } return ccsid ; } | Get the character code set identifier that represents the JVM s file encoding . This should only be called by the class static initializer . |
163,139 | public static ParsedScheduleExpression parse ( ScheduleExpression expr ) { ParsedScheduleExpression parsedExpr = new ParsedScheduleExpression ( expr ) ; parse ( parsedExpr ) ; return parsedExpr ; } | Parses the specified schedule expression and returns the result . |
163,140 | static void parse ( ParsedScheduleExpression parsedExpr ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "parse: " + toString ( parsedExpr . getSchedule ( ) ) ) ; ScheduleExpression expr = parsedExpr . getSchedule ( ) ; ScheduleExpressionParser parser = new ScheduleExpressionParser ( ) ; try { parser . parseTimeZone ( parsedExpr , expr . getTimezone ( ) ) ; parser . parseAttribute ( parsedExpr , Attribute . SECOND , expr . getSecond ( ) ) ; parser . parseAttribute ( parsedExpr , Attribute . MINUTE , expr . getMinute ( ) ) ; parser . parseAttribute ( parsedExpr , Attribute . HOUR , expr . getHour ( ) ) ; parser . parseAttribute ( parsedExpr , Attribute . DAY_OF_MONTH , expr . getDayOfMonth ( ) ) ; parser . parseAttribute ( parsedExpr , Attribute . MONTH , expr . getMonth ( ) ) ; parser . parseAttribute ( parsedExpr , Attribute . DAY_OF_WEEK , expr . getDayOfWeek ( ) ) ; parser . parseAttribute ( parsedExpr , Attribute . YEAR , expr . getYear ( ) ) ; } catch ( IllegalArgumentException ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . exit ( tc , "parse" , ex ) ; throw ex ; } parsedExpr . start = parser . parseDate ( expr . getStart ( ) , 0 ) ; parsedExpr . end = parser . parseDate ( expr . getEnd ( ) , Long . MAX_VALUE ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "parse" , parsedExpr ) ; } | Parses the schedule expression contained within the ParsedScheduleExpression object and store the results in that object . |
163,141 | private void parseTimeZone ( ParsedScheduleExpression parsedExpr , String string ) { if ( parsedExpr . timeZone == null ) { if ( string == null ) { parsedExpr . timeZone = TimeZone . getDefault ( ) ; } else { parsedExpr . timeZone = TimeZone . getTimeZone ( string . trim ( ) ) ; if ( parsedExpr . timeZone . getID ( ) . equals ( "GMT" ) && ! string . equalsIgnoreCase ( "GMT" ) ) { throw new ScheduleExpressionParserException ( ScheduleExpressionParserException . Error . VALUE , "timezone" , string ) ; } } } } | Parses the time zone ID and stores the result in parsedExpr . If the parsed schedule already has a time zone then it is kept . If the time zone ID is null then the default time zone is used . |
163,142 | private long parseDate ( Date date , long defaultValue ) { if ( date == null ) { return defaultValue ; } long value = date . getTime ( ) ; if ( value > 0 ) { long remainder = value % 1000 ; if ( remainder != 0 ) { long newValue = value - remainder + 1000 ; value = newValue > 0 || value < 0 ? newValue : Long . MAX_VALUE ; } } return value ; } | Parses the date to milliseconds and rounds up to the nearest second . |
163,143 | private void error ( ScheduleExpressionParserException . Error error ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "parse error in " + ivAttr + " at " + ivPos ) ; throw new ScheduleExpressionParserException ( error , ivAttr . getDisplayName ( ) , ivString ) ; } | Issues a lexical analysis or parsing error . |
163,144 | private void parseAttribute ( ParsedScheduleExpression parsedExpr , Attribute attr , String string ) { ivAttr = attr ; ivString = string ; ivPos = 0 ; if ( string == null ) { error ( ScheduleExpressionParserException . Error . VALUE ) ; } for ( boolean inList = false ; ; inList = true ) { skipWhitespace ( ) ; int value = readSingleValue ( ) ; skipWhitespace ( ) ; if ( ivPos < ivString . length ( ) && ivString . charAt ( ivPos ) == '-' ) { ivPos ++ ; skipWhitespace ( ) ; int maxValue = readSingleValue ( ) ; skipWhitespace ( ) ; if ( value == ENCODED_WILD_CARD || maxValue == ENCODED_WILD_CARD ) { error ( ScheduleExpressionParserException . Error . RANGE_BOUND ) ; } attr . addRange ( parsedExpr , value , maxValue ) ; } else if ( ivPos < ivString . length ( ) && ivString . charAt ( ivPos ) == '/' ) { ivPos ++ ; skipWhitespace ( ) ; int interval = readSingleValue ( ) ; skipWhitespace ( ) ; if ( interval == ENCODED_WILD_CARD ) { error ( ScheduleExpressionParserException . Error . INCREMENT_INTERVAL ) ; } if ( inList ) { error ( ScheduleExpressionParserException . Error . LIST_VALUE ) ; } if ( ! ivAttr . isIncrementable ( ) ) { error ( ScheduleExpressionParserException . Error . UNINCREMENTABLE ) ; } if ( value == ENCODED_WILD_CARD ) { value = 0 ; } if ( interval == 0 ) { attr . add ( parsedExpr , value ) ; } else { for ( ; value <= ivAttr . getMax ( ) ; value += interval ) { attr . add ( parsedExpr , value ) ; } } break ; } else if ( value == ENCODED_WILD_CARD ) { if ( inList ) { error ( ScheduleExpressionParserException . Error . LIST_VALUE ) ; } attr . setWildCard ( parsedExpr ) ; break ; } else { attr . add ( parsedExpr , value ) ; } if ( ivPos >= ivString . length ( ) || ivString . charAt ( ivPos ) != ',' ) { break ; } ivPos ++ ; } skipWhitespace ( ) ; if ( ivPos < ivString . length ( ) ) { error ( ScheduleExpressionParserException . Error . VALUE ) ; } } | Parses the specified attribute of this parsers schedule expression and stores the result in parsedExpr . This method sets the ivAttr ivString and ivPos member variables that are accessed by other parsing methods . Only ivPos should be modified by those other methods . |
163,145 | private void skipWhitespace ( ) { while ( ivPos < ivString . length ( ) && Character . isWhitespace ( ivString . charAt ( ivPos ) ) ) { ivPos ++ ; } } | Skip any whitespace at the current position in the parse string . |
163,146 | private int scanToken ( ) { int begin = ivPos ; if ( ivPos < ivString . length ( ) ) { if ( ivString . charAt ( ivPos ) == '-' ) { ivPos ++ ; } while ( ivPos < ivString . length ( ) && isTokenChar ( ivString . charAt ( ivPos ) ) ) { ivPos ++ ; } } return begin ; } | Skip the minimum number of characters necessary to form a single unit of information within a value . Whitespace before the value is not skipped . |
163,147 | private int findNamedValue ( int begin , String [ ] namedValues , int min ) { int length = ivPos - begin ; for ( int i = 0 ; i < namedValues . length ; i ++ ) { String namedValue = namedValues [ i ] ; if ( length == namedValue . length ( ) && ivString . regionMatches ( true , begin , namedValue , 0 , length ) ) { return min + i ; } } return - 1 ; } | Case - insensitively search the specified list of named values for a substring of the parse string . The substring of the parse string is the range [ begin ivPos ) . |
163,148 | public static byte [ ] generateSalt ( String saltString ) { byte [ ] output = null ; if ( saltString == null || saltString . length ( ) < 1 ) { output = new byte [ SEED_LENGTH ] ; SecureRandom rand = new SecureRandom ( ) ; rand . setSeed ( rand . generateSeed ( SEED_LENGTH ) ) ; rand . nextBytes ( output ) ; } else { try { output = saltString . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { output = saltString . getBytes ( ) ; } } return output ; } | generate salt value by using given string . salt was generated as following format String format of current time + given string + hostname |
163,149 | public static byte [ ] digest ( char [ ] plainBytes , byte [ ] salt , String algorithm , int iteration , int length ) throws InvalidPasswordCipherException { if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "algorithm : " + algorithm + " iteration : " + iteration ) ; logger . fine ( "input length: " + plainBytes . length ) ; logger . fine ( "salt length: " + salt . length ) ; logger . fine ( "output length: " + length ) ; } byte [ ] oBytes = null ; if ( plainBytes != null && plainBytes . length > 0 && algorithm != null && algorithm . length ( ) > 0 && iteration > 0 ) { long begin = 0 ; if ( logger . isLoggable ( Level . FINE ) ) { begin = System . nanoTime ( ) ; } try { SecretKeyFactory skf = SecretKeyFactory . getInstance ( algorithm ) ; PBEKeySpec ks = new PBEKeySpec ( plainBytes , salt , iteration , length ) ; SecretKey s = skf . generateSecret ( ks ) ; oBytes = s . getEncoded ( ) ; } catch ( Exception e ) { throw ( InvalidPasswordCipherException ) new InvalidPasswordCipherException ( e . getMessage ( ) ) . initCause ( e ) ; } if ( logger . isLoggable ( Level . FINE ) ) { long elapsed = System . nanoTime ( ) - begin ; logger . fine ( "Elapsed time : " + elapsed + " ns " + ( elapsed / 1000000 ) + " ms" ) ; } } if ( ( logger . isLoggable ( Level . FINE ) ) && oBytes != null ) { logger . fine ( "digest length: " + oBytes . length ) ; logger . fine ( hexDump ( oBytes ) ) ; } return oBytes ; } | perform message digest and then append a salt at the end . |
163,150 | public DERObject toASN1Object ( ) { ASN1EncodableVector v = new ASN1EncodableVector ( ) ; v . add ( digestedObjectType ) ; if ( otherObjectTypeID != null ) { v . add ( otherObjectTypeID ) ; } v . add ( digestAlgorithm ) ; v . add ( objectDigest ) ; return new DERSequence ( v ) ; } | Produce an object suitable for an ASN1OutputStream . |
163,151 | private boolean findInList ( Entry oEntry ) { return findInList ( oEntry . getHashcodes ( ) , oEntry . getLengths ( ) , firstCell , oEntry . getCurrentSize ( ) - 1 ) ; } | Determine if an address represented by an Entry object is in the address tree |
163,152 | private boolean putInList ( Entry entry ) { FilterCellFastStr currentCell = firstCell ; FilterCellFastStr nextCell = null ; int [ ] hashcodes = entry . getHashcodes ( ) ; int [ ] lengths = entry . getLengths ( ) ; int lastIndex = entry . getCurrentSize ( ) - 1 ; for ( int i = lastIndex ; i >= 0 ; i -- ) { if ( ( hashcodes [ i ] == 0 ) && ( lengths [ i ] == 0 ) ) { currentCell . addNewCell ( hashcodes [ i ] , lengths [ i ] ) ; return true ; } nextCell = currentCell . findNextCell ( hashcodes [ i ] ) ; if ( nextCell != null ) { if ( nextCell . getHashLength ( ) != lengths [ i ] ) { return false ; } } if ( nextCell == null ) { for ( int j = i ; j >= 0 ; j -- ) { currentCell = currentCell . addNewCell ( hashcodes [ j ] , lengths [ j ] ) ; if ( ( hashcodes [ j ] == 0 ) && ( lengths [ j ] == 0 ) ) { return true ; } } return true ; } currentCell = nextCell ; } return true ; } | Add and new address to the address tree where the new address is represented by an Entry object . |
163,153 | private Entry convertToEntries ( String newAddress ) { byte [ ] ba = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "convertToEntries" ) ; } try { ba = newAddress . getBytes ( "ISO-8859-1" ) ; } catch ( UnsupportedEncodingException x ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "ISO-8859-1 encoding not supported. Exception: " + x ) ; } ba = newAddress . getBytes ( ) ; } int baLength = ba . length ; int hashValue = 0 ; int hashLength = 0 ; int e31 = 1 ; Entry oEntry = new Entry ( ) ; for ( int i = 0 ; i < baLength ; i ++ ) { if ( ba [ i ] == WILDCARD_VALUE ) { boolean valid = true ; if ( i != 0 ) { valid = false ; } if ( baLength >= 2 ) { if ( ba [ 1 ] != PERIOD_VALUE ) { valid = false ; } } if ( valid ) { oEntry . addEntry ( 0 , 0 ) ; i = 1 ; continue ; } } if ( ba [ i ] != PERIOD_VALUE ) { hashValue += e31 * ba [ i ] ; e31 = e31 * 31 ; hashLength ++ ; } if ( ( ba [ i ] == PERIOD_VALUE ) || ( i == baLength - 1 ) ) { if ( hashLength > 0 ) { oEntry . addEntry ( hashValue , hashLength ) ; } hashLength = 0 ; e31 = 1 ; hashValue = 0 ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "convertToEntries" ) ; } return oEntry ; } | Convert a single URL address to an Entry object . The entry object will contain the hashcode array and length array of the substrings of this address |
163,154 | public static void hash ( byte [ ] data , byte [ ] output ) { int len = output . length ; if ( len == 0 ) return ; int [ ] code = calculate ( data ) ; for ( int outIndex = 0 , codeIndex = 0 , shift = 24 ; outIndex < len && codeIndex < 5 ; ++ outIndex , shift -= 8 ) { output [ outIndex ] = ( byte ) ( code [ codeIndex ] >>> shift ) ; if ( shift == 0 ) { shift = 32 ; ++ codeIndex ; } } } | Calculates the SHA - 1 hash code of the input data and writes up to 20 bytes of it in the output byte array parameter . |
163,155 | public UIViewRoot createView ( FacesContext context , String viewId ) { checkNull ( context , "context" ) ; try { viewId = calculateViewId ( context , viewId ) ; Application application = context . getApplication ( ) ; UIViewRoot newViewRoot = ( UIViewRoot ) application . createComponent ( context , UIViewRoot . COMPONENT_TYPE , null ) ; UIViewRoot oldViewRoot = context . getViewRoot ( ) ; if ( oldViewRoot == null ) { ViewHandler handler = application . getViewHandler ( ) ; newViewRoot . setLocale ( handler . calculateLocale ( context ) ) ; newViewRoot . setRenderKitId ( handler . calculateRenderKitId ( context ) ) ; } else { newViewRoot . setLocale ( oldViewRoot . getLocale ( ) ) ; newViewRoot . setRenderKitId ( oldViewRoot . getRenderKitId ( ) ) ; } newViewRoot . setViewId ( viewId ) ; return newViewRoot ; } catch ( InvalidViewIdException e ) { sendSourceNotFound ( context , e . getMessage ( ) ) ; return null ; } } | Process the specification required algorithm that is generic to all PDL . |
163,156 | private Object getDestinationName ( String destinationType , Object destination ) throws Exception { String methodName ; if ( "javax.jms.Queue" . equals ( destinationType ) ) methodName = "getQueueName" ; else if ( "javax.jms.Topic" . equals ( destinationType ) ) methodName = "getTopicName" ; else throw new InvalidPropertyException ( "destinationType: " + destinationType ) ; try { return destination . getClass ( ) . getMethod ( methodName ) . invoke ( destination ) ; } catch ( NoSuchMethodException x ) { throw new InvalidPropertyException ( Tr . formatMessage ( tc , "J2CA8505.destination.type.mismatch" , destination , destinationType ) , x ) ; } } | Returns the name of the queue or topic . |
163,157 | JCAContextProvider getJCAContextProvider ( Class < ? > workContextClass ) { JCAContextProvider provider = null ; for ( Class < ? > cl = workContextClass ; provider == null && cl != null ; cl = cl . getSuperclass ( ) ) provider = contextProviders . getService ( cl . getName ( ) ) ; return provider ; } | Returns the JCAContextProvider for the specified work context class . |
163,158 | String getJCAContextProviderName ( Class < ? > workContextClass ) { ServiceReference < JCAContextProvider > ref = null ; for ( Class < ? > cl = workContextClass ; ref == null && cl != null ; cl = cl . getSuperclass ( ) ) ref = contextProviders . getReference ( cl . getName ( ) ) ; String name = ref == null ? null : ( String ) ref . getProperty ( JCAContextProvider . CONTEXT_NAME ) ; if ( name == null && ref != null ) name = ( String ) ref . getProperty ( "component.name" ) ; return name ; } | Returns the component name of the JCAContextProvider for the specified work context class . |
163,159 | public Class < ? > loadClass ( final String className ) throws ClassNotFoundException , UnableToAdaptException , MalformedURLException { ClassLoader raClassLoader = resourceAdapterSvc . getClassLoader ( ) ; if ( raClassLoader != null ) { return Utils . priv . loadClass ( raClassLoader , className ) ; } else { try { if ( System . getSecurityManager ( ) == null ) { for ( Bundle bundle : componentContext . getBundleContext ( ) . getBundles ( ) ) { if ( resourceAdapterID . equals ( "wasJms" ) && ( "com.ibm.ws.messaging.jms.1.1" . equals ( bundle . getSymbolicName ( ) ) || "com.ibm.ws.messaging.jms.2.0" . equals ( bundle . getSymbolicName ( ) ) ) ) return bundle . loadClass ( className ) ; else if ( resourceAdapterID . equals ( "wmqJms" ) && "com.ibm.ws.messaging.jms.wmq" . equals ( bundle . getSymbolicName ( ) ) ) return bundle . loadClass ( className ) ; } throw new ClassNotFoundException ( className ) ; } else { try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < Class < ? > > ( ) { public Class < ? > run ( ) throws ClassNotFoundException { for ( Bundle bundle : componentContext . getBundleContext ( ) . getBundles ( ) ) { if ( resourceAdapterID . equals ( "wasJms" ) && ( "com.ibm.ws.messaging.jms.1.1" . equals ( bundle . getSymbolicName ( ) ) || "com.ibm.ws.messaging.jms.2.0" . equals ( bundle . getSymbolicName ( ) ) ) ) return bundle . loadClass ( className ) ; else if ( resourceAdapterID . equals ( "wmqJms" ) && "com.ibm.ws.messaging.jms.wmq" . equals ( bundle . getSymbolicName ( ) ) ) return bundle . loadClass ( className ) ; } throw new ClassNotFoundException ( className ) ; } } ) ; } catch ( PrivilegedActionException e ) { throw ( ClassNotFoundException ) e . getCause ( ) ; } } } catch ( ClassNotFoundException cnf ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Could not find adapter file and bundle does not have the class either. Possible cause is incorrectly specified file path." , cnf ) ; } throw cnf ; } } } | Load a resource adapter class . |
163,160 | protected void setContextProvider ( ServiceReference < JCAContextProvider > ref ) { contextProviders . putReference ( ( String ) ref . getProperty ( JCAContextProvider . TYPE ) , ref ) ; } | Declarative Services method for setting a JCAContextProvider service reference |
163,161 | private void stopResourceAdapter ( ) { if ( resourceAdapter != null ) try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "stop" , resourceAdapter ) ; ArrayList < ThreadContext > threadContext = startTask ( raThreadContextDescriptor ) ; try { beginContext ( raMetaData ) ; try { ClassLoader previousClassLoader = jcasu . beginContextClassLoader ( raClassLoader ) ; try { resourceAdapter . stop ( ) ; } finally { if ( raClassLoader != null ) { jcasu . endContextClassLoader ( raClassLoader , previousClassLoader ) ; classLoadingSvc . destroyThreadContextClassLoader ( raClassLoader ) ; } } } finally { endContext ( raMetaData ) ; } } finally { stopTask ( raThreadContextDescriptor , threadContext ) ; } for ( Timer timer = timers . poll ( ) ; timer != null ; timer = timers . poll ( ) ) { timer . cancel ( ) ; timer . purge ( ) ; } workManager . stop ( ) ; } catch ( Throwable x ) { } finally { BundleContext bundleContext = FrameworkUtil . getBundle ( getClass ( ) ) . getBundleContext ( ) ; if ( bundleContext != null ) { bundleContext . ungetService ( contextSvcRef ) ; } } } | Stop the resource adapter if it has started . |
163,162 | @ SuppressWarnings ( "unchecked" ) private ThreadContextDescriptor captureRaThreadContext ( WSContextService contextSvc ) { Map < String , String > execProps = new HashMap < String , String > ( ) ; execProps . put ( WSContextService . DEFAULT_CONTEXT , WSContextService . ALL_CONTEXT_TYPES ) ; execProps . put ( WSContextService . REQUIRE_AVAILABLE_APP , "false" ) ; return contextSvc . captureThreadContext ( execProps ) ; } | Capture current thread context of the context service . |
163,163 | private ArrayList < ThreadContext > startTask ( ThreadContextDescriptor raThreadContextDescriptor ) { return raThreadContextDescriptor == null ? null : raThreadContextDescriptor . taskStarting ( ) ; } | Start task if there is a resource adapter context descriptor . |
163,164 | private void stopTask ( ThreadContextDescriptor raThreadContextDescriptor , ArrayList < ThreadContext > threadContext ) { if ( raThreadContextDescriptor != null ) raThreadContextDescriptor . taskStopping ( threadContext ) ; } | Stop the resource adapter context descriptor task if one was started . |
163,165 | protected void unsetContextProvider ( ServiceReference < JCAContextProvider > ref ) { contextProviders . removeReference ( ( String ) ref . getProperty ( JCAContextProvider . TYPE ) , ref ) ; } | Declarative Services method for unsetting a JCAContextProvider service reference |
163,166 | private WebAuthenticator getAuthenticatorForFailOver ( String authType , WebRequest webRequest ) { WebAuthenticator authenticator = null ; if ( LoginConfiguration . FORM . equals ( authType ) ) { authenticator = createFormLoginAuthenticator ( webRequest ) ; } else if ( LoginConfiguration . BASIC . equals ( authType ) ) { authenticator = getBasicAuthAuthenticator ( ) ; } return authenticator ; } | Get the appropriate Authenticator based on the authType |
163,167 | private boolean appHasWebXMLFormLogin ( WebRequest webRequest ) { return webRequest . getFormLoginConfiguration ( ) != null && webRequest . getFormLoginConfiguration ( ) . getLoginPage ( ) != null && webRequest . getFormLoginConfiguration ( ) . getErrorPage ( ) != null ; } | Determines if the application has a FORM login configuration in its web . xml |
163,168 | private boolean globalWebAppSecurityConfigHasFormLogin ( ) { WebAppSecurityConfig globalConfig = WebAppSecurityCollaboratorImpl . getGlobalWebAppSecurityConfig ( ) ; return globalConfig != null && globalConfig . getLoginFormURL ( ) != null ; } | Determine if the global WebAppSecurityConfig has a form login page . |
163,169 | public WebAuthenticator getWebAuthenticator ( WebRequest webRequest ) { String authMech = webAppSecurityConfig . getOverrideHttpAuthMethod ( ) ; if ( authMech != null && authMech . equals ( "CLIENT_CERT" ) ) { return createCertificateLoginAuthenticator ( ) ; } SecurityMetadata securityMetadata = webRequest . getSecurityMetadata ( ) ; LoginConfiguration loginConfig = securityMetadata . getLoginConfiguration ( ) ; if ( loginConfig != null ) { String authenticationMethod = loginConfig . getAuthenticationMethod ( ) ; if ( LoginConfiguration . FORM . equalsIgnoreCase ( authenticationMethod ) ) { return createFormLoginAuthenticator ( webRequest ) ; } else if ( LoginConfiguration . CLIENT_CERT . equalsIgnoreCase ( authenticationMethod ) ) { return createCertificateLoginAuthenticator ( ) ; } } return getBasicAuthAuthenticator ( ) ; } | Determine the correct WebAuthenticator to use based on the authentication method . If there authentication method is not specified in the web . xml file then we will use BasicAuth as default . |
163,170 | public BasicAuthAuthenticator getBasicAuthAuthenticator ( ) { try { return createBasicAuthenticator ( ) ; } catch ( RegistryException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "RegistryException while trying to create BasicAuthAuthenticator" , e ) ; } } return null ; } | Create an instance of BasicAuthAuthenticator . |
163,171 | public boolean handleAttribute ( DDParser parser , String nsURI , String localName , int index ) throws ParseException { boolean result = false ; if ( nsURI != null ) { return result ; } if ( CONTEXT_ROOT_ATTRIBUTE_NAME . equals ( localName ) ) { this . contextRoot = parser . parseStringAttributeValue ( index ) ; result = true ; } return result ; } | parse the context - root attribute defined in the element . |
163,172 | public boolean isPersistent ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isPersistent: " + this ) ; checkTimerAccess ( ) ; checkTimerExists ( ALLOW_CACHED_TIMER_IS_PERSISTENT ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isPersistent: true" ) ; return true ; } | Query whether this timer has persistent semantics . |
163,173 | public Entry getNext ( ) { checkEntryParent ( ) ; Entry entry = null ; if ( ! isLast ( ) ) { entry = next ; } return entry ; } | Unsynchronized . Get the next entry in the list . |
163,174 | Entry insertAfter ( Entry newEntry ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "insertAfter" , new Object [ ] { newEntry } ) ; checkEntryParent ( ) ; if ( newEntry . parentList == null ) { Entry nextEntry = getNext ( ) ; newEntry . previous = this ; newEntry . next = nextEntry ; newEntry . parentList = parentList ; if ( nextEntry != null ) { nextEntry . previous = newEntry ; } next = newEntry ; if ( isLast ( ) ) { parentList . last = newEntry ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "insertAfter" , newEntry ) ; return newEntry ; } SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.Entry" , "1:154:1.3" } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.utils.linkedlist.Entry.insertAfter" , "1:160:1.3" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.Entry" , "1:167:1.3" } ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "insertAfter" , e ) ; throw e ; } | Unsynchronized . Insert a new entry in after this one . |
163,175 | Entry remove ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remove" ) ; checkEntryParent ( ) ; Entry removedEntry = null ; Entry prevEntry = getPrevious ( ) ; if ( prevEntry != null ) { prevEntry . next = next ; } Entry nextEntry = getNext ( ) ; if ( nextEntry != null ) { nextEntry . previous = prevEntry ; } if ( isFirst ( ) ) { parentList . first = nextEntry ; } if ( isLast ( ) ) { parentList . last = prevEntry ; } next = null ; previous = null ; parentList = null ; removedEntry = this ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remove" , removedEntry ) ; return removedEntry ; } | Unsynchronized . Removes this entry from the list . |
163,176 | void checkEntryParent ( ) { if ( parentList == null ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.Entry" , "1:239:1.3" } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.utils.linkedlist.Entry.checkEntryParent" , "1:246:1.3" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.Entry" , "1:253:1.3" } ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkEntryParent" , e ) ; throw e ; } } | Unsynchronized . Check that the parent list is not null and therefore the entry is still valid . Otherwise throw a runtime exception |
163,177 | public Object put ( Object key , Object value ) { return localMap . put ( key , value ) ; } | 2 . As with the put may need methods that use the common map for any of these other methods below but assume not for now |
163,178 | static Converter getValueTypeConverter ( FacesContext facesContext , UISelectMany component ) { Converter converter = null ; Object valueTypeAttr = component . getAttributes ( ) . get ( VALUE_TYPE_KEY ) ; if ( valueTypeAttr != null ) { Class < ? > valueType = getClassFromAttribute ( facesContext , valueTypeAttr ) ; if ( valueType == null ) { throw new FacesException ( "The attribute " + VALUE_TYPE_KEY + " of component " + component . getClientId ( facesContext ) + " does not evaluate to a " + "String, a Class object or a ValueExpression pointing " + "to a String or a Class object." ) ; } converter = facesContext . getApplication ( ) . createConverter ( valueType ) ; if ( converter == null ) { facesContext . getExternalContext ( ) . log ( "Found attribute valueType on component " + _ComponentUtils . getPathToComponent ( component ) + ", but could not get a by-type converter for type " + valueType . getName ( ) ) ; } } return converter ; } | Uses the valueType attribute of the given UISelectMany component to get a by - type converter . |
163,179 | private final void checkTopicNotNull ( String topic ) throws InvalidTopicSyntaxException { if ( topic == null ) throw new InvalidTopicSyntaxException ( NLS . format ( "INVALID_TOPIC_ERROR_CWSIH0005" , new Object [ ] { topic } ) ) ; } | null topic check |
163,180 | private CookieData matchAndParse ( byte [ ] data , HeaderKeys hdr ) { int pos = this . bytePosition ; int start = - 1 ; int stop = - 1 ; for ( ; pos < data . length ; pos ++ ) { byte b = data [ pos ] ; if ( '=' == b ) { break ; } if ( ';' == b || ',' == b ) { if ( - 1 == start ) { continue ; } pos -- ; break ; } if ( ' ' != b && '\t' != b ) { if ( - 1 == start ) { start = pos ; } stop = pos ; } } this . bytePosition = pos + 1 ; if ( - 1 == start ) { return null ; } if ( - 1 == stop ) { stop = pos ; } else if ( data . length == stop ) { stop -- ; } boolean foundDollar = ( '$' == data [ start ] ) ; if ( foundDollar ) { start ++ ; } else if ( '"' == data [ start ] && '"' == data [ stop ] ) { start ++ ; stop -- ; } int len = stop - start + 1 ; if ( 0 >= len ) { return null ; } CookieData token = CookieData . match ( data , start , len ) ; if ( null != token && null != hdr ) { if ( ! token . validForHeader ( hdr , foundDollar ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Token not valid for header, " + hdr + " " + token ) ; } token = null ; } } if ( null == token ) { this . name = new byte [ len ] ; System . arraycopy ( data , start , this . name , 0 , len ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "name: " + GenericUtils . getEnglishString ( this . name ) ) ; } } return token ; } | This method matches the cookie attribute header with the pre - established Cookie header types . If a match is established the appropriate Cookie header data type is returned . |
163,181 | private void parseValue ( byte [ ] data , CookieData token ) { int start = - 1 ; int stop = - 1 ; int pos = this . bytePosition ; int num_quotes = 0 ; for ( ; pos < data . length ; pos ++ ) { byte b = data [ pos ] ; if ( ';' == b ) { break ; } if ( '"' == b ) { num_quotes ++ ; } if ( ',' == b ) { if ( CookieData . cookiePort . equals ( token ) ) { if ( 2 <= num_quotes ) { break ; } } else if ( ! CookieData . cookieExpires . equals ( token ) ) { break ; } } if ( ' ' != b && '\t' != b ) { if ( - 1 == start ) { start = pos ; } stop = pos ; } } this . bytePosition = pos + 1 ; if ( - 1 == start ) { this . value = new byte [ 0 ] ; return ; } if ( - 1 == stop ) { this . value = new byte [ 0 ] ; return ; } if ( '"' == data [ start ] && '"' == data [ stop ] ) { start ++ ; stop -- ; } int len = stop - start + 1 ; if ( 0 <= len ) { this . value = new byte [ len ] ; if ( 0 < len ) { System . arraycopy ( data , start , this . value , 0 , len ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "value: " + GenericUtils . nullOutPasswords ( this . value , ( byte ) '&' ) ) ; } } } } | This method parses the cookie attribute value . |
163,182 | protected static JwtContext parseJwtWithoutValidation ( String jwtString ) throws Exception { JwtConsumer firstPassJwtConsumer = new JwtConsumerBuilder ( ) . setSkipAllValidators ( ) . setDisableRequireSignature ( ) . setSkipSignatureVerification ( ) . build ( ) ; JwtContext jwtContext = firstPassJwtConsumer . process ( jwtString ) ; return jwtContext ; } | Just parse without validation for now |
163,183 | public static boolean isValidJmxPropertyValue ( String s ) { if ( ( s . indexOf ( ":" ) >= 0 ) || ( s . indexOf ( "*" ) >= 0 ) || ( s . indexOf ( '"' ) >= 0 ) || ( s . indexOf ( "?" ) >= 0 ) || ( s . indexOf ( "," ) >= 0 ) || ( s . indexOf ( "=" ) >= 0 ) ) { return false ; } else return true ; } | Does the specified string contain characters valid in a JMX key property? |
163,184 | public static < R > MethodResult < R > success ( R result ) { return new MethodResult < > ( result , null , false ) ; } | Create a MethodResult for a method which returned a value |
163,185 | public static < R > MethodResult < R > failure ( Throwable failure ) { return new MethodResult < > ( null , failure , false ) ; } | Create a MethodResult for a method which threw an exception |
163,186 | public static < R > MethodResult < R > internalFailure ( Throwable failure ) { return new MethodResult < R > ( null , failure , true ) ; } | Create a MethodResult for an internal exception which occurred while trying to run a method |
163,187 | private final void clearUnreferencedEntries ( ) { for ( WeakEntry entry = ( WeakEntry ) queue . poll ( ) ; entry != null ; entry = ( WeakEntry ) queue . poll ( ) ) { WeakEntry removedEntry = ( WeakEntry ) super . remove ( entry . key ) ; if ( removedEntry != entry ) { super . put ( entry . key , removedEntry ) ; } } } | Remove the unreferenced Entries from the map . |
163,188 | protected void attachBifurcatedConsumer ( BifurcatedConsumerSessionImpl consumer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "attachBifurcatedConsumer" , consumer ) ; if ( _bifurcatedConsumers == null ) { synchronized ( this ) { if ( _bifurcatedConsumers == null ) _bifurcatedConsumers = new LinkedList < BifurcatedConsumerSessionImpl > ( ) ; } } synchronized ( _bifurcatedConsumers ) { _bifurcatedConsumers . add ( consumer ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachBifurcatedConsumer" ) ; } | Adds the bifurcated consumer to the list of associated consumers . |
163,189 | protected void removeBifurcatedConsumer ( BifurcatedConsumerSessionImpl consumer ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeBifurcatedConsumer" , consumer ) ; synchronized ( _bifurcatedConsumers ) { _bifurcatedConsumers . remove ( consumer ) ; } _localConsumerPoint . cleanupBifurcatedConsumer ( consumer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeBifurcatedConsumer" ) ; } | Removes the bifurcated consumer to the list of associated consumers . |
163,190 | void _close ( ) throws SIResourceException , SIConnectionLostException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "_close" ) ; try { _localConsumerPoint . close ( ) ; } catch ( SINotPossibleInCurrentConfigurationException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "_close" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "_close" ) ; } | Performs any operations required to close this consumer session but it does not modify any references which the connection might have . |
163,191 | void checkNotClosed ( ) throws SISessionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkNotClosed" ) ; try { synchronized ( _localConsumerPoint ) { _localConsumerPoint . checkNotClosed ( ) ; } } catch ( SISessionUnavailableException e ) { SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" , e ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" ) ; } | Check that this consumer session is not closed . |
163,192 | protected SICoreConnection getConnectionInternal ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConsumerSession . tc . isEntryEnabled ( ) ) { SibTr . entry ( CoreSPIConsumerSession . tc , "getConnectionInternal" , this ) ; SibTr . exit ( CoreSPIConsumerSession . tc , "getConnectionInternal" , _connection ) ; } return _connection ; } | Internal getter method which bypasses the not closed check . |
163,193 | public long getIdInternal ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getIdInternal" ) ; SibTr . exit ( tc , "getIdInternal" , new Long ( _consumerId ) ) ; } return _consumerId ; } | Gets the id for the consumer without any checking . |
163,194 | void setId ( long id ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setId" , new Long ( id ) ) ; _consumerId = id ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setId" ) ; } | Sets the id for this consumer . |
163,195 | private static void createFactoryInstance ( ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( cclass , "createFactoryInstance" ) ; try { Class cls = Class . forName ( MATCHING_CLASS_NAME ) ; instance = ( Matching ) cls . newInstance ( ) ; } catch ( Exception e ) { FFDC . processException ( cclass , "com.ibm.ws.sib.matchspace.Matching.createFactoryInstance" , e , "1:94:1.18" ) ; createException = e ; } if ( tc . isEntryEnabled ( ) ) tc . exit ( cclass , "createFactoryInstance" ) ; } | Create the Matching instance . |
163,196 | public static Matching getInstance ( ) throws Exception { if ( tc . isEntryEnabled ( ) ) tc . entry ( cclass , "getInstance" ) ; if ( instance == null ) throw createException ; if ( tc . isEntryEnabled ( ) ) tc . exit ( cclass , "getInstance" , "instance=" + instance ) ; return instance ; } | Obtain a reference to the singleton Matching instance |
163,197 | final boolean abort ( boolean removeFromQueue , Throwable cause ) { if ( removeFromQueue && executor . queue . remove ( this ) ) executor . maxQueueSizeConstraint . release ( ) ; if ( nsAcceptEnd == nsAcceptBegin - 1 ) nsRunEnd = nsQueueEnd = nsAcceptEnd = System . nanoTime ( ) ; boolean aborted = result . compareAndSet ( state , cause ) ; if ( aborted ) try { state . releaseShared ( ABORTED ) ; if ( nsQueueEnd == nsAcceptBegin - 2 ) nsRunEnd = nsQueueEnd = System . nanoTime ( ) ; if ( callback != null ) callback . onEnd ( task , this , null , true , 0 , cause ) ; } finally { if ( latch != null ) latch . countDown ( ) ; if ( cancellableStage != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "completion stage to complete exceptionally: " + cancellableStage ) ; cancellableStage . completeExceptionally ( cause ) ; } } else { while ( state . get ( ) < RUNNING ) Thread . yield ( ) ; } return aborted ; } | Invoked to abort a task . |
163,198 | final void accept ( boolean runOnSubmitter ) { long time ; nsAcceptEnd = time = System . nanoTime ( ) ; if ( runOnSubmitter ) nsQueueEnd = time ; state . setSubmitted ( ) ; } | Invoked to indicate the task was successfully submitted . |
163,199 | public static String resolve ( WebSphereConfig14 config , String raw ) { String resolved = raw ; StringCharacterIterator itr = new StringCharacterIterator ( resolved ) ; int startCount = 0 ; int startIndex = - 1 ; char c = itr . first ( ) ; while ( c != CharacterIterator . DONE ) { if ( c == Config14Constants . EVAL_START_TOKEN . charAt ( 0 ) ) { c = itr . next ( ) ; if ( c == Config14Constants . EVAL_START_TOKEN . charAt ( 1 ) ) { startCount ++ ; if ( startIndex == - 1 ) { startIndex = itr . getIndex ( ) - 1 ; } } else { itr . previous ( ) ; } } else if ( c == Config14Constants . EVAL_END_TOKEN . charAt ( 0 ) ) { if ( startCount > 0 ) { startCount -- ; if ( startCount == 0 ) { int endIndex = itr . getIndex ( ) ; String propertyName = resolved . substring ( startIndex + 2 , endIndex ) ; String resolvedPropertyName = resolve ( config , propertyName ) ; String resolvedValue = ( String ) config . getValue ( resolvedPropertyName , String . class , false , null , true ) ; String prefix = resolved . substring ( 0 , startIndex ) ; String suffix = resolved . substring ( endIndex + 1 ) ; resolved = prefix + resolvedValue + suffix ; int index = prefix . length ( ) + resolvedValue . length ( ) - 1 ; itr . setText ( resolved ) ; itr . setIndex ( index ) ; startIndex = - 1 ; } } } c = itr . next ( ) ; if ( ( c == CharacterIterator . DONE ) && ( startIndex > - 1 ) && ( startIndex < raw . length ( ) ) ) { itr . setIndex ( startIndex + 2 ) ; startIndex = - 1 ; startCount = 0 ; c = itr . current ( ) ; } } return resolved ; } | This method takes a raw value which may contain nested properties and resolves those properties into their actual values . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.