idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
38,600
private void transferOrReleasePermit ( ) { maxConcurrencyConstraint . release ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "expedites/maxConcurrency available" , expeditesAvailable , maxConcurrencyConstraint . availablePermits ( ) ) ; if ( ! queue . isEmpty ( ) && withheldConcurrency . get ( ) > 0 && maxConcurrencyConstraint . tryAcquire ( ) ) { decrementWithheldConcurrency ( ) ; if ( acquireExpedite ( ) > 0 ) expediteGlobal ( new GlobalPoolTask ( ) ) ; else enqueueGlobal ( new GlobalPoolTask ( ) ) ; } }
Releases a permit against maxConcurrency or transfers it to a worker task that runs on the global thread pool .
38,601
public void closeConnection ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "closeConnection" ) ; try { if ( _XAResourceFactory != null && _XARes != null ) { ( ( XAResourceFactory ) _XAResourceFactory ) . destroyXAResource ( _XARes ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.Transaction.JTA.XARminst.closeConnection" , "250" , this ) ; Tr . audit ( tc , "WTRN0038_ERR_DESTROYING_XARESOURCE" , t ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "closeConnection" ) ; }
Close the XAConnection with the XAResource .
38,602
protected VirtualConnection readInternal ( long numBytes , TCPReadCompletedCallback readCallback , boolean forceQueue , int timeout ) { if ( timeout == IMMED_TIMEOUT ) { immediateTimeout ( ) ; return null ; } if ( timeout == ABORT_TIMEOUT ) { abort ( ) ; immediateTimeout ( ) ; return null ; } setIOAmount ( numBytes ) ; setLastIOAmt ( 0 ) ; setIODoneAmount ( 0 ) ; setReadCompletedCallback ( readCallback ) ; setForceQueue ( forceQueue ) ; setTimeoutTime ( timeout ) ; return processAsyncReadRequest ( ) ; }
internal async read entry point
38,603
public boolean isFileServingEnabled ( ) { disallowAllFileServingProp = WCCustomProperties . DISALLOW_ALL_FILE_SERVING ; if ( disallowAllFileServingProp != null && ! this . getApplicationName ( ) . equalsIgnoreCase ( "isclite" ) ) { try { if ( Boolean . valueOf ( disallowAllFileServingProp ) . booleanValue ( ) ) { this . fileServingEnabled = Boolean . FALSE ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "isFileServing" , "PK54499: disallowAllFileServingProp set to " + disallowAllFileServingProp + " for application: " + this . getApplicationName ( ) ) ; } } catch ( Exception x ) { logger . logp ( Level . SEVERE , CLASS_NAME , "isFileServing" , "Illegal value set for property com.ibm.ws.webcontainer.disallowallfileserving" ) ; } } if ( this . fileServingEnabled != null ) return this . fileServingEnabled . booleanValue ( ) ; return WCCustomProperties . FILE_SERVING_ENABLED ; }
Returns the fileServingEnabled .
38,604
public Map < String , String > getJspAttributes ( ) { if ( null == this . jspAttributes ) { this . jspAttributes = new HashMap < String , String > ( ) ; } return this . jspAttributes ; }
Returns the jspAttributes .
38,605
public IServletConfig getServletInfo ( String string ) { if ( string == null || string . isEmpty ( ) ) { Tr . debug ( tc , "getServletInfo" , "servlet name is null/empty. Use internal servlet name " + NULLSERVLETNAME ) ; string = NULLSERVLETNAME ; } return ( IServletConfig ) this . servletInfo . get ( string ) ; }
Method getServletInfo .
38,606
public boolean isServeServletsByClassnameEnabled ( ) { disallowServeServletsByClassnameProp = WCCustomProperties . DISALLOW_SERVE_SERVLETS_BY_CLASSNAME_PROP ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "isServeServletsByClassnameEnabled" , "disallowServeServletsByClassnameProp = " + disallowServeServletsByClassnameProp ) ; } if ( disallowServeServletsByClassnameProp != null ) { try { if ( Boolean . valueOf ( disallowServeServletsByClassnameProp ) . booleanValue ( ) ) { this . serveServletsByClassnameEnabled = Boolean . FALSE ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "isServeServletsByClassnameEnabled" , "PK52059: disallowServeServletsByClassnameProp set to " + disallowServeServletsByClassnameProp + " for application: " + this . getApplicationName ( ) ) ; } } catch ( Exception x ) { logger . logp ( Level . SEVERE , CLASS_NAME , "isServeServletsByClassnameEnabled" , "Illegal value set for property com.ibm.ws.webcontainer.disallowserveservletsbyclassname" ) ; } } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "isServeServletsByClassnameEnabled" , "value = " + ( this . serveServletsByClassnameEnabled != null ? this . serveServletsByClassnameEnabled . booleanValue ( ) : WCCustomProperties . SERVE_SERVLETS_BY_CLASSNAME_ENABLED ) ) ; } if ( this . serveServletsByClassnameEnabled != null ) return this . serveServletsByClassnameEnabled . booleanValue ( ) ; return WCCustomProperties . SERVE_SERVLETS_BY_CLASSNAME_ENABLED ; }
Returns the serveServletsByClassname .
38,607
public void setMimeFilters ( HashMap mimeFilters ) { if ( mimeFilters != null && mimeFilters . size ( ) > 0 ) { this . isMimeFilteringEnabled = true ; } this . mimeFilters = mimeFilters ; }
Sets the mimeFilters .
38,608
public String getApplicationName ( ) { if ( this . applicationName != null ) return this . applicationName ; else if ( webApp != null ) return this . webApp . getApplicationName ( ) ; else return null ; }
Return the applicationName .
38,609
public void setDisableStaticMappingCache ( ) { if ( this . contextParams != null ) { String value = ( String ) this . contextParams . get ( "com.ibm.ws.webcontainer.DISABLE_STATIC_MAPPING_CACHE" ) ; if ( value != null ) { if ( value . equalsIgnoreCase ( "true" ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setDisableStaticMappingCache" , "cxtParam disable static mapping cache for application -> " + applicationName ) ; this . setDisableStaticMappingCache ( true ) ; } return ; } } if ( WCCustomProperties . DISABLE_STATIC_MAPPING_CACHE != null ) { String disableStaticMappingCacheApp = WCCustomProperties . DISABLE_STATIC_MAPPING_CACHE ; if ( disableStaticMappingCacheApp . equals ( "*" ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setDisableStaticMappingCache" , "disable static mapping cache for all apps." ) ; this . setDisableStaticMappingCache ( true ) ; return ; } else { String [ ] parsedStr = disableStaticMappingCacheApp . split ( "," ) ; for ( String toCheckStr : parsedStr ) { toCheckStr = toCheckStr . trim ( ) ; if ( applicationName != null && applicationName . equalsIgnoreCase ( toCheckStr ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setDisableStaticMappingCache" , "disable static mapping cache for application -> " + applicationName ) ; this . setDisableStaticMappingCache ( true ) ; return ; } } } } }
PM84305 - start
38,610
public final void insertNullElementsAt ( int index , int count ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "insertNullElementsAt" , new Object [ ] { new Integer ( index ) , new Integer ( count ) } ) ; for ( int i = index ; i < index + count ; i ++ ) add ( i , null ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "insertNullElementsAt" ) ; }
Inserts count null values at index moving up all the components at index and greater .
38,611
protected void validatePattern ( ) { if ( pattern . length ( ) == 0 ) { throw new IllegalArgumentException ( Tr . formatMessage ( tc , "OPENTRACING_FILTER_PATTERN_BLANK" ) ) ; } if ( ! regex ) { try { URI . create ( pattern ) ; } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException ( Tr . formatMessage ( tc , "OPENTRACING_FILTER_PATTERN_INVALID" , pattern ) , e ) ; } } }
Throw exceptions if the pattern is invalid .
38,612
protected final String prepareUri ( final URI uri ) { if ( compareRelative ) { final String path = uri . getRawPath ( ) ; final String query = uri . getRawQuery ( ) ; final String fragment = uri . getRawFragment ( ) ; if ( query != null && fragment != null ) { return path + "?" + query + "#" + fragment ; } else if ( query != null ) { return path + "?" + query ; } else if ( fragment != null ) { return path + "#" + fragment ; } else { return path ; } } else { return uri . toString ( ) ; } }
Prepare the URI for matching .
38,613
public String readText ( String prompt ) { if ( ! isInputStreamAvailable ( ) ) { return null ; } try { return console . readLine ( prompt ) ; } catch ( IOError e ) { stderr . println ( "Exception while reading stdin: " + e . getMessage ( ) ) ; e . printStackTrace ( stderr ) ; } return null ; }
Reads text from the input String prompting with the given String .
38,614
public synchronized int add ( E object ) { if ( object == null ) throw new NullPointerException ( "FastList add called with null" ) ; if ( ( count + 1 ) >= maxCount ) resize ( capacity * 2 ) ; int initialAddIndex = addIndex ; while ( listElements [ addIndex ] != null ) { addIndex ++ ; if ( addIndex == capacity ) addIndex = 0 ; if ( addIndex == initialAddIndex ) { throw new RuntimeException ( "FastList out of space" ) ; } } count ++ ; listElements [ addIndex ] = object ; return addIndex ; }
Adds specified object to the list and increments size
38,615
public synchronized List < E > getAll ( ) { ArrayList < E > list = new ArrayList < E > ( ) ; for ( E element : listElements ) { if ( element != null ) { list . add ( element ) ; } } return list ; }
Provides a shallow copy of the list
38,616
public Object [ ] addAll ( CacheMap c ) { LinkedList < Object > discards = new LinkedList < Object > ( ) ; Object discard ; for ( int bucketIndex = c . next [ c . BEFORE_LRU ] ; bucketIndex != c . AFTER_MRU ; bucketIndex = c . next [ bucketIndex ] ) for ( int i = 0 ; i < c . bucketSizes [ bucketIndex ] ; i ++ ) if ( ( discard = add ( c . keys [ bucketIndex ] [ i ] , c . values [ bucketIndex ] [ i ] ) ) != null ) discards . add ( discard ) ; return discards . toArray ( ) ; }
Inserts into this CacheMap all entries from the specified CacheMap returning a list of any values that do not fit .
38,617
private Object discardFromBucket ( int bucketIndex , int entryIndex ) { numDiscards ++ ; bucketSizes [ bucketIndex ] -- ; numEntries -- ; return values [ bucketIndex ] [ entryIndex ] ; }
Discard an entry from the specified bucket . The actual entry is not nulled out because it will later be overwritten .
38,618
int addRef ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addRef" ) ; int ret = NOP ; if ( _refCount ++ == 0 ) ret = SUBSCRIBE ; checkRefCount ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addRef" , String . valueOf ( ret ) + ":" + String . valueOf ( _refCount ) ) ; return ret ; }
Adds a reference to the subscription .
38,619
int removeRef ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeRef" ) ; int ret = NOP ; if ( -- _refCount == 0 ) ret = UNSUBSCRIBE ; checkRefCount ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeRef" , String . valueOf ( ret ) + ":" + String . valueOf ( _refCount ) ) ; return ret ; }
Removes a reference to the subscription .
38,620
final String getTopic ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getTopic" ) ; SibTr . exit ( tc , "getTopic" , _topic ) ; } return _topic ; }
Returns the value of the topic .
38,621
final SIBUuid12 getTopicSpaceUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getTopicSpaceUuid" ) ; SibTr . exit ( tc , "getTopicSpaceUuid" , _topicSpaceUuid ) ; } return _topicSpaceUuid ; }
Returns the value of the topic space uuid .
38,622
final String getTopicSpaceName ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getTopicSpaceName" ) ; SibTr . exit ( tc , "getTopicSpaceName" , _topicSpaceName ) ; } return _topicSpaceName ; }
Returns the value of the topic space name .
38,623
final String getMESubUserId ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getMESubUserId" ) ; SibTr . exit ( tc , "getMESubUserId" , _meSubUserId ) ; } return _meSubUserId ; }
Returns the value of the userid associated with the subscription .
38,624
final boolean isForeignSecuredProxy ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isForeignSecuredProxy" ) ; SibTr . exit ( tc , "isForeignSecuredProxy" , new Boolean ( _foreignSecuredProxy ) ) ; } return _foreignSecuredProxy ; }
Returns true if this proxy sub was from a foreign bus in a secured env .
38,625
void mark ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "mark" ) ; SibTr . exit ( tc , "mark" ) ; } _marked = true ; }
Marks this object .
38,626
void unmark ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "unmark" ) ; SibTr . exit ( tc , "unmark" ) ; } _marked = false ; }
Unmarks this object .
38,627
boolean isMarked ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isMarked" ) ; SibTr . exit ( tc , "isMarked" , new Boolean ( _marked ) ) ; } return _marked ; }
Is Marked indicates if this object is still marked . If it is then it can be removed .
38,628
protected void registerForPostCommit ( MultiMEProxyHandler proxyHandler , DestinationHandler destination , PubSubOutputHandler handler , Neighbour neighbour ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerForPostCommit" , new Object [ ] { proxyHandler , destination , handler , neighbour } ) ; _proxyHandler = proxyHandler ; _destination = destination ; _handler = handler ; _neighbour = neighbour ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerForPostCommit" ) ; }
Sets the information in the subscription so that when a commit is called it can resolve the correct objects to add items to the MatchSpace .
38,629
protected void registerForPostCommit ( Neighbour neighbour , Neighbours neighbours ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerForPostCommit" , new Object [ ] { neighbour , neighbours } ) ; _proxyHandler = null ; _destination = null ; _handler = null ; _neighbour = neighbour ; _neighbours = neighbours ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerForPostCommit" ) ; }
Used only for rollback - if the transaction is rolled back and there is a neighbour set then rmeove the proxy reference .
38,630
public void eventPostRollbackAdd ( Transaction transaction ) throws SevereMessageStoreException { super . eventPostRollbackAdd ( transaction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "eventPostRollbackAdd" , transaction ) ; if ( _handler != null ) { _handler . removeTopic ( _topic ) ; if ( _handler . getTopics ( ) == null || _handler . getTopics ( ) . length == 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Deleting PubSubOutputHandler " + _handler ) ; _destination . deletePubSubOutputHandler ( _neighbour . getUUID ( ) ) ; } } else if ( _neighbours != null ) _neighbours . removeTopicSpaceReference ( _neighbour . getUUID ( ) , this , _topicSpaceUuid , _topic ) ; _neighbour . removeSubscription ( _topicSpaceUuid , _topic ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "eventPostRollbackAdd" ) ; }
When the add rollback is made need to remove the topic . Or the topicSpace reference needs to be removed .
38,631
public void eventPostCommitUpdate ( Transaction transaction ) throws SevereMessageStoreException { super . eventPostCommitAdd ( transaction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "eventPostCommitUpdate" , transaction ) ; if ( _proxyHandler != null ) { _destination . getSubscriptionIndex ( ) . remove ( _controllableProxySubscription ) ; _proxyHandler . getMessageProcessor ( ) . getMessageProcessorMatching ( ) . removePubSubOutputHandlerMatchTarget ( _controllableProxySubscription ) ; } try { if ( _proxyHandler != null ) { _controllableProxySubscription = _proxyHandler . getMessageProcessor ( ) . getMessageProcessorMatching ( ) . addPubSubOutputHandlerMatchTarget ( _handler , _topicSpaceUuid , _topic , _foreignSecuredProxy , _meSubUserId ) ; } } catch ( SIException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.proxyhandler.MESubscription.eventPostCommitUpdate" , "1:738:1.55" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.MESubscription" , "1:745:1.55" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "eventPostCommitUpdate" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.MESubscription" , "1:755:1.55" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "eventPostCommitUpdate" ) ; }
Updates the ControllableProxySubscription .
38,632
public void setMatchspaceSub ( ControllableProxySubscription sub ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setMatchspaceSub" , sub ) ; _controllableProxySubscription = sub ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setMatchspaceSub" ) ; }
This sets the field in the MESubscription for the object that was stored in the Matchspace
38,633
public ControllableProxySubscription getMatchspaceSub ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getMatchspaceSub" ) ; SibTr . exit ( tc , "getMatchspaceSub" , _controllableProxySubscription ) ; } return _controllableProxySubscription ; }
Gets the object that was stored in the Matchspace
38,634
public final AbstractItem findById ( long itemId ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findById" , Long . valueOf ( itemId ) ) ; AbstractItem item = null ; ReferenceCollection ic = ( ( ReferenceCollection ) _getMembership ( ) ) ; if ( null == ic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findById" ) ; throw new NotInMessageStore ( ) ; } item = ic . findById ( itemId ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findById" , item ) ; return item ; }
Reply the item in the receiver with a matching ID . The item returned stream is neither removed from the message store nor locked for exclusive use of the caller .
38,635
public final ItemReference findOldestReference ( ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findOldestReference" ) ; ReferenceCollection ic = ( ( ReferenceCollection ) _getMembership ( ) ) ; if ( null == ic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findOldestReference" ) ; throw new NotInMessageStore ( ) ; } ItemReference item = null ; if ( ic != null ) { item = ( ItemReference ) ic . findOldestItem ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findOldestReference" , item ) ; return item ; }
Find the reference that has been known to the stream for longest . The reference returned may be in any of the states defined in the state model . The caller should not assume that the reference can be used for any particular purpose .
38,636
private void publishEvent ( WSJobExecution jobEx , String topicToPublish , String correlationId ) { if ( eventsPublisher != null ) { eventsPublisher . publishJobExecutionEvent ( jobEx , topicToPublish , correlationId ) ; } }
Helper method to publish event
38,637
private void publishEvent ( WSJobInstance jobInst , String topicToPublish , String correlationId ) { if ( eventsPublisher != null ) { eventsPublisher . publishJobInstanceEvent ( jobInst , topicToPublish , correlationId ) ; } }
Helper method to publish event with correlationId
38,638
private long restartInternal ( long oldExecutionId , Properties restartParameters ) throws JobExecutionAlreadyCompleteException , NoSuchJobExecutionException , JobExecutionNotMostRecentException , JobRestartException , JobSecurityException { if ( authService != null ) { authService . authorizedJobRestartByExecution ( oldExecutionId ) ; } if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "JobOperator restart, with old executionId = " + oldExecutionId + "\n" + traceJobParameters ( restartParameters ) ) ; } BatchStatusValidator . validateStatusAtExecutionRestart ( oldExecutionId , restartParameters ) ; long instanceId = getPersistenceManagerService ( ) . getJobInstanceIdFromExecutionId ( oldExecutionId ) ; getPersistenceManagerService ( ) . updateJobInstanceOnRestart ( instanceId , new Date ( ) ) ; WSJobExecution jobExecution = getPersistenceManagerService ( ) . createJobExecution ( instanceId , restartParameters , new Date ( ) ) ; long newExecutionId = getBatchKernelService ( ) . restartJob ( jobExecution . getExecutionId ( ) , restartParameters ) . getKey ( ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "Restarted job with new executionId: " + newExecutionId + ", and old executionID: " + oldExecutionId ) ; } return newExecutionId ; }
Restart the given execution using the given jobparams .
38,639
private void getMessageDigestMD5 ( ) throws AttributeNotFoundException { if ( MBeans . messageDigestMD5 == null ) { try { MBeans . messageDigestMD5 = MessageDigestUtility . createMessageDigest ( "MD5" ) ; } catch ( NoSuchAlgorithmException e ) { Tr . error ( tc , "DYNA1044E" , new Object [ ] { e . getMessage ( ) } ) ; throw new AttributeNotFoundException ( "Message digest for MD5 is not available. " + e . getMessage ( ) ) ; } } }
create messageDigest for MD5 algoritm if it is not created .
38,640
public Map < String , ExtendedAttributeDefinition > getAttributeMap ( ) { Map < String , ExtendedAttributeDefinition > map = null ; AttributeDefinition [ ] attrDefs = getAttributeDefinitions ( ObjectClassDefinition . ALL ) ; if ( attrDefs != null ) { map = new HashMap < String , ExtendedAttributeDefinition > ( ) ; for ( AttributeDefinition attrDef : attrDefs ) { map . put ( attrDef . getID ( ) , new ExtendedAttributeDefinitionImpl ( attrDef ) ) ; } } else { map = Collections . emptyMap ( ) ; } return map ; }
ONLY USED BY SCHEMA WRITER
38,641
private static String getAliasName ( String alias , String bundleLocation ) { String newAlias = alias ; if ( alias != null && ! alias . isEmpty ( ) ) { try { if ( bundleLocation != null && ! bundleLocation . isEmpty ( ) ) { if ( bundleLocation . startsWith ( XMLConfigConstants . BUNDLE_LOC_KERNEL_TAG ) ) { } else if ( bundleLocation . startsWith ( XMLConfigConstants . BUNDLE_LOC_FEATURE_TAG ) ) { int index = bundleLocation . indexOf ( XMLConfigConstants . BUNDLE_LOC_PROD_EXT_TAG ) ; if ( index != - 1 ) { index += XMLConfigConstants . BUNDLE_LOC_PROD_EXT_TAG . length ( ) ; int endIndex = bundleLocation . indexOf ( ":" , index ) ; String productName = bundleLocation . substring ( index , endIndex ) ; newAlias = productName + "_" + alias ; } } else if ( bundleLocation . startsWith ( XMLConfigConstants . BUNDLE_LOC_CONNECTOR_TAG ) ) { } else { newAlias = null ; } } } catch ( Throwable t ) { } } return newAlias ; }
Prefixes the alias with the product extension name if there is a product extension associated to this OCD .
38,642
private static byte [ ] getBytes ( InputStream stream , int knownSize ) throws IOException { try { if ( knownSize == - 1 ) { ByteArrayOutputStream byteOut = new ByteArrayOutputStream ( ) ; try { byte [ ] bytes = new byte [ 1024 ] ; int read ; while ( 0 <= ( read = stream . read ( bytes ) ) ) byteOut . write ( bytes , 0 , read ) ; return byteOut . toByteArray ( ) ; } finally { Util . tryToClose ( byteOut ) ; } } else { byte [ ] bytes = new byte [ knownSize ] ; int read ; int offset = 0 ; while ( knownSize > 0 && ( read = stream . read ( bytes , offset , knownSize ) ) > 0 ) { offset += read ; knownSize -= read ; } return bytes ; } } finally { Util . tryToClose ( stream ) ; } }
Util method to totally read an input stream into a byte array . Used for class definition .
38,643
static URL getSharedClassCacheURL ( URL resourceURL , String resourceName ) { URL sharedClassCacheURL ; if ( resourceURL == null ) { sharedClassCacheURL = null ; } else { String protocol = resourceURL . getProtocol ( ) ; if ( "jar" . equals ( protocol ) ) { sharedClassCacheURL = resourceURL ; } else if ( "wsjar" . equals ( protocol ) ) { try { sharedClassCacheURL = new URL ( resourceURL . toExternalForm ( ) . substring ( 2 ) ) ; } catch ( MalformedURLException e ) { sharedClassCacheURL = null ; } } else if ( ! "file" . equals ( protocol ) ) { sharedClassCacheURL = null ; } else { String externalForm = resourceURL . toExternalForm ( ) ; if ( externalForm . endsWith ( resourceName ) ) { try { sharedClassCacheURL = new URL ( externalForm . substring ( 0 , externalForm . length ( ) - resourceName . length ( ) ) ) ; } catch ( MalformedURLException e ) { sharedClassCacheURL = null ; } } else { sharedClassCacheURL = null ; } } } return sharedClassCacheURL ; }
Computes the shared class cache URL from the resource URL .
38,644
public Package definePackage ( String name , Manifest manifest , URL sealBase ) throws IllegalArgumentException { Attributes mA = manifest . getMainAttributes ( ) ; String specTitle = mA . getValue ( Name . SPECIFICATION_TITLE ) ; String specVersion = mA . getValue ( Name . SPECIFICATION_VERSION ) ; String specVendor = mA . getValue ( Name . SPECIFICATION_VENDOR ) ; String implTitle = mA . getValue ( Name . IMPLEMENTATION_TITLE ) ; String implVersion = mA . getValue ( Name . IMPLEMENTATION_VERSION ) ; String implVendor = mA . getValue ( Name . IMPLEMENTATION_VENDOR ) ; String sealedString = mA . getValue ( Name . SEALED ) ; Boolean sealed = ( sealedString == null ? Boolean . FALSE : sealedString . equalsIgnoreCase ( "true" ) ) ; String unixName = name . replaceAll ( "\\." , "/" ) + "/" ; mA = manifest . getAttributes ( unixName ) ; if ( mA != null ) { String s = mA . getValue ( Name . SPECIFICATION_TITLE ) ; if ( s != null ) specTitle = s ; s = mA . getValue ( Name . SPECIFICATION_VERSION ) ; if ( s != null ) specVersion = s ; s = mA . getValue ( Name . SPECIFICATION_VENDOR ) ; if ( s != null ) specVendor = s ; s = mA . getValue ( Name . IMPLEMENTATION_TITLE ) ; if ( s != null ) implTitle = s ; s = mA . getValue ( Name . IMPLEMENTATION_VERSION ) ; if ( s != null ) implVersion = s ; s = mA . getValue ( Name . IMPLEMENTATION_VENDOR ) ; if ( s != null ) implVendor = s ; s = mA . getValue ( Name . SEALED ) ; if ( s != null ) sealed = s . equalsIgnoreCase ( "true" ) ; } if ( ! sealed ) sealBase = null ; return definePackage ( name , specTitle , specVersion , specVendor , implTitle , implVersion , implVendor , sealBase ) ; }
to set vars passed up to ClassLoader . definePackage .
38,645
protected void addToClassPath ( Iterable < ArtifactContainer > artifacts ) { for ( ArtifactContainer art : artifacts ) { smartClassPath . addArtifactContainer ( art ) ; } }
Add all the artifact containers to the class path
38,646
@ FFDCIgnore ( NullPointerException . class ) protected void addLibraryFile ( File f ) { if ( ! ! ! f . exists ( ) ) { if ( tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "cls.library.archive" , f , new FileNotFoundException ( f . getName ( ) ) ) ; } return ; } if ( ! f . isDirectory ( ) && ! isArchive ( f ) ) return ; BundleContext bc = FrameworkUtil . getBundle ( ContainerClassLoader . class ) . getBundleContext ( ) ; ServiceReference < ArtifactContainerFactory > acfsr = bc . getServiceReference ( ArtifactContainerFactory . class ) ; if ( acfsr != null ) { ArtifactContainerFactory acf = bc . getService ( acfsr ) ; if ( acf != null ) { try { ArtifactContainer ac = acf . getContainer ( bc . getBundle ( ) . getDataFile ( "" ) , f ) ; smartClassPath . addArtifactContainer ( ac ) ; } catch ( NullPointerException e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception while adding files to classpath" , e ) ; } if ( tc . isInfoEnabled ( ) ) { Tr . info ( tc , "cls.library.file.forbidden" , f ) ; } } } } }
Method to allow adding shared libraries to this classloader currently using File .
38,647
@ FFDCIgnore ( PrivilegedActionException . class ) private boolean isArchive ( File f ) { final File target = f ; try { AccessController . doPrivileged ( new PrivilegedExceptionAction < Void > ( ) { public Void run ( ) throws IOException { new ZipFile ( target ) . close ( ) ; return null ; } } ) ; } catch ( PrivilegedActionException e ) { Exception innerException = e . getException ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The following file can not be added to the classpath " + f + " due to error " , innerException ) ; } return false ; } return true ; }
Check that a file is an archive
38,648
public static ComponentMetaData getComponentMetaData ( JavaColonNamespace namespace , String name ) throws NamingException { ComponentMetaData cmd = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) . getComponentMetaData ( ) ; if ( cmd == null ) { String fullName = name . isEmpty ( ) ? namespace . toString ( ) : namespace + "/" + name ; String msg = Tr . formatMessage ( tc , "JNDI_NON_JEE_THREAD_CWWKN0100E" , fullName ) ; NamingException nex = new NamingException ( msg ) ; throw nex ; } return cmd ; }
Helper method to get the component metadata from the thread context .
38,649
@ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE ) protected Map < String , Object > setConfiguration ( ServiceReference < SecurityConfiguration > ref ) { String id = ( String ) ref . getProperty ( KEY_ID ) ; if ( id != null ) { configs . putReference ( id , ref ) ; } else { Tr . error ( tc , "SECURITY_SERVICE_REQUIRED_SERVICE_WITHOUT_ID" , "securityConfiguration" ) ; } return getServiceProperties ( ) ; }
Method will be called for each SecurityConfiguration that is registered in the OSGi service registry . We maintain an internal map of these for easy access .
38,650
protected Map < String , Object > unsetConfiguration ( ServiceReference < SecurityConfiguration > ref ) { configs . removeReference ( ( String ) ref . getProperty ( KEY_ID ) , ref ) ; return getServiceProperties ( ) ; }
Method will be called for each SecurityConfiguration that is unregistered in the OSGi service registry . We must remove this instance from our internal map .
38,651
@ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE ) protected Map < String , Object > setAuthentication ( ServiceReference < AuthenticationService > ref ) { if ( hasPropertiesFromFile ( ref ) ) { String id = ( String ) ref . getProperty ( KEY_ID ) ; if ( id != null ) { authentication . putReference ( id , ref ) ; } else { Tr . error ( tc , "SECURITY_SERVICE_REQUIRED_SERVICE_WITHOUT_ID" , KEY_AUTHENTICATION ) ; } } else { authentication . putReference ( String . valueOf ( ref . getProperty ( KEY_SERVICE_ID ) ) , ref ) ; } authnService . set ( null ) ; return getServiceProperties ( ) ; }
Method will be called for each AuthenticationService that is registered in the OSGi service registry . We maintain an internal map of these for easy access .
38,652
protected Map < String , Object > unsetAuthentication ( ServiceReference < AuthenticationService > ref ) { authentication . removeReference ( ( String ) ref . getProperty ( KEY_ID ) , ref ) ; authentication . removeReference ( String . valueOf ( ref . getProperty ( KEY_SERVICE_ID ) ) , ref ) ; authnService . set ( null ) ; return getServiceProperties ( ) ; }
Method will be called for each AuthenticationService that is unregistered in the OSGi service registry . We must remove this instance from our internal map .
38,653
@ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE ) protected Map < String , Object > setAuthorization ( ServiceReference < AuthorizationService > ref ) { if ( hasPropertiesFromFile ( ref ) ) { String id = ( String ) ref . getProperty ( KEY_ID ) ; if ( id != null ) { authorization . putReference ( id , ref ) ; } else { Tr . error ( tc , "SECURITY_SERVICE_REQUIRED_SERVICE_WITHOUT_ID" , KEY_AUTHORIZATION ) ; } } else { authorization . putReference ( String . valueOf ( ref . getProperty ( KEY_SERVICE_ID ) ) , ref ) ; } authzService . set ( null ) ; return getServiceProperties ( ) ; }
Method will be called for each AuthorizationService that is registered in the OSGi service registry . We maintain an internal map of these for easy access .
38,654
protected Map < String , Object > unsetAuthorization ( ServiceReference < AuthorizationService > ref ) { authorization . removeReference ( ( String ) ref . getProperty ( KEY_ID ) , ref ) ; authorization . removeReference ( String . valueOf ( ref . getProperty ( KEY_SERVICE_ID ) ) , ref ) ; authzService . set ( null ) ; return getServiceProperties ( ) ; }
Method will be called for each AuthorizationService that is unregistered in the OSGi service registry . We must remove this instance from our internal map .
38,655
@ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE , target = "(config.displayId=*)" ) protected Map < String , Object > setUserRegistry ( ServiceReference < UserRegistryService > ref ) { adjustUserRegistryServiceRef ( ref ) ; userRegistryService . set ( null ) ; return getServiceProperties ( ) ; }
Method will be called for each UserRegistryService that is registered in the OSGi service registry . We maintain an internal map of these for easy access .
38,656
protected Map < String , Object > unsetUserRegistry ( ServiceReference < UserRegistryService > ref ) { userRegistry . removeReference ( ( String ) ref . getProperty ( KEY_ID ) , ref ) ; userRegistry . removeReference ( String . valueOf ( ref . getProperty ( KEY_SERVICE_ID ) ) , ref ) ; userRegistryService . set ( null ) ; return getServiceProperties ( ) ; }
Method will be called for each UserRegistryService that is unregistered in the OSGi service registry . We must remove this instance from our internal map .
38,657
private SecurityConfiguration getEffectiveSecurityConfiguration ( ) { SecurityConfiguration effectiveConfig = configs . getService ( cfgSystemDomain ) ; if ( effectiveConfig == null ) { Tr . error ( tc , "SECURITY_SERVICE_ERROR_BAD_DOMAIN" , cfgSystemDomain , CFG_KEY_SYSTEM_DOMAIN ) ; throw new IllegalArgumentException ( Tr . formatMessage ( tc , "SECURITY_SERVICE_ERROR_BAD_DOMAIN" , cfgSystemDomain , CFG_KEY_SYSTEM_DOMAIN ) ) ; } return effectiveConfig ; }
Eventually this will be execution context aware and pick the right domain . Till then we re only accessing the system domain configuration .
38,658
private < V > V autoDetectService ( String serviceName , ConcurrentServiceReferenceMap < String , V > map ) { Iterator < V > services = map . getServices ( ) ; if ( services . hasNext ( ) == false ) { Tr . error ( tc , "SECURITY_SERVICE_NO_SERVICE_AVAILABLE" , serviceName ) ; throw new IllegalStateException ( Tr . formatMessage ( tc , "SECURITY_SERVICE_NO_SERVICE_AVAILABLE" , serviceName ) ) ; } V service = services . next ( ) ; if ( services . hasNext ( ) ) { Tr . error ( tc , "SECURITY_SERVICE_MULTIPLE_SERVICE_AVAILABLE" , serviceName ) ; throw new IllegalStateException ( Tr . formatMessage ( tc , "SECURITY_SERVICE_MULTIPLE_SERVICE_AVAILABLE" , serviceName ) ) ; } return service ; }
When the configuration element is not defined use some auto - detect logic to try and return the single Service of a specified field . If there is no service or multiple services that is considered an error case which auto - detect can not resolve .
38,659
private AuthenticationService getAuthenticationService ( String id ) { AuthenticationService service = authentication . getService ( id ) ; if ( service == null ) { throwIllegalArgumentExceptionInvalidAttributeValue ( SecurityConfiguration . CFG_KEY_AUTHENTICATION_REF , id ) ; } return service ; }
Retrieve the AuthenticationService for the specified id .
38,660
private AuthorizationService getAuthorizationService ( String id ) { AuthorizationService service = authorization . getService ( id ) ; if ( service == null ) { throwIllegalArgumentExceptionInvalidAttributeValue ( SecurityConfiguration . CFG_KEY_AUTHORIZATION_REF , id ) ; } return service ; }
Retrieve the AuthorizationService for the specified id .
38,661
private UserRegistryService getUserRegistryService ( String id ) { UserRegistryService service = userRegistry . getService ( id ) ; if ( service == null ) { throwIllegalArgumentExceptionInvalidAttributeValue ( SecurityConfiguration . CFG_KEY_USERREGISTRY_REF , id ) ; } return service ; }
Retrieve the UserRegistryService for the specified id .
38,662
protected final String getFacetName ( FaceletContext ctx , UIComponent parent ) { return ( String ) parent . getAttributes ( ) . get ( "facelets.FACET_NAME" ) ; }
Return the Facet name we are scoped in otherwise null
38,663
public void completeTxTimeout ( ) throws TransactionRolledbackException { final boolean traceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( traceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "completeTxTimeout" ) ; if ( tx != null && tx . isTimedOut ( ) ) { if ( traceOn && tc . isEventEnabled ( ) ) Tr . event ( tc , "Transaction has timed out. The transaction will be rolled back now" ) ; Tr . info ( tc , "WTRN0041_TXN_ROLLED_BACK" , tx . getTranName ( ) ) ; ( ( EmbeddableTransactionImpl ) tx ) . rollbackResources ( ) ; final TransactionRolledbackException rbe = new TransactionRolledbackException ( "Transaction is ended due to timeout" ) ; FFDCFilter . processException ( rbe , "com.ibm.tx.jta.embeddable.impl.EmbeddableTranManagerImpl.completeTxTimeout" , "100" , this ) ; if ( traceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "completeTxTimeout" , rbe ) ; throw rbe ; } if ( traceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "completeTxTimeout" ) ; }
Complete processing of passive transaction timeout .
38,664
public void addConsumer ( DispatchableConsumerPoint lcp ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addConsumer" , lcp ) ; synchronized ( consumerList ) { consumerList . add ( lcp ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addConsumer" ) ; }
Add a new consumer to this set .
38,665
public void removeConsumer ( DispatchableConsumerPoint lcp ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeConsumer" , lcp ) ; synchronized ( consumerList ) { consumerList . remove ( lcp ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeConsumer" ) ; }
Remove a consumer from the set .
38,666
public int getGetCursorIndex ( SIMPMessage msg ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getGetCursorIndex" ) ; int classPos = 0 ; synchronized ( classifications ) { if ( classifications . getNumberOfClasses ( ) > 0 ) { String keyClassification = msg . getMessageControlClassification ( true ) ; if ( keyClassification != null && classifications . getWeight ( keyClassification ) > 0 ) classPos = classifications . getPosition ( keyClassification ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getGetCursorIndex" , classPos ) ; return classPos ; }
Determine the index of the getCursor to use based on the classification of a message .
38,667
public synchronized int chooseGetCursorIndex ( int previous ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "chooseGetCursorIndex" , new Object [ ] { Integer . valueOf ( previous ) } ) ; int classPos = 0 ; if ( classifications . getNumberOfClasses ( ) > 0 ) { if ( previous == - 1 ) { weightMap = classifications . getWeightings ( ) ; } else { weightMap . remove ( Integer . valueOf ( previous ) ) ; } if ( ! weightMap . isEmpty ( ) ) { classPos = classifications . findClassIndex ( weightMap ) ; } else if ( unitTestOperation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "chooseGetCursorIndex" , "SIErrorException" ) ; throw new SIErrorException ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "chooseGetCursorIndex" , classPos ) ; return classPos ; }
Determine the index of the getCursor to use based on the classifications defined for the ConsumerSet that this consumer belongs to .
38,668
public JSConsumerClassifications getClassifications ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getClassifications" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getClassifications" , classifications ) ; return classifications ; }
Returns a reference to the Classifications object that wraps the classifications specified by XD .
38,669
public boolean prepareAddActiveMessage ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "prepareAddActiveMessage" ) ; boolean messageAccepted = false ; boolean limitReached = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "maxActiveMessagePrepareReadLock.lock(): " + maxActiveMessagePrepareLock ) ; maxActiveMessagePrepareReadLock . lock ( ) ; synchronized ( maxActiveMessageLock ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Active Messages: current: " + currentActiveMessages + ", prepared: " + preparedActiveMessages + ", maximum: " + maxActiveMessages + " (suspended: " + consumerSetSuspended + ")" ) ; if ( ! consumerSetSuspended ) { if ( ( currentActiveMessages + preparedActiveMessages ) == ( maxActiveMessages - 1 ) ) { limitReached = true ; } else { preparedActiveMessages ++ ; messageAccepted = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Prepare added" ) ; } } if ( ! messageAccepted ) { maxActiveMessagePrepareReadLock . unlock ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "maxActiveMessagePrepareReadLock.unlock(): " + maxActiveMessagePrepareLock ) ; } } if ( limitReached ) { boolean releaseWriteLock = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "maxActiveMessagePrepareWriteLock.lock(): " + maxActiveMessagePrepareLock ) ; maxActiveMessagePrepareWriteLock . lock ( ) ; synchronized ( maxActiveMessageLock ) { if ( ! consumerSetSuspended ) { messageAccepted = true ; preparedActiveMessages ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Prepare added" ) ; if ( ( currentActiveMessages + preparedActiveMessages ) == maxActiveMessages ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Write lock held until commit/rollback" ) ; releaseWriteLock = false ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "maxActiveMessagePrepareReadLock.lock(): " + maxActiveMessagePrepareLock ) ; maxActiveMessagePrepareReadLock . lock ( ) ; } } if ( releaseWriteLock ) { maxActiveMessagePrepareWriteLock . unlock ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "maxActiveMessagePrepareWriteLock.unlock(): " + maxActiveMessagePrepareLock ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "prepareAddActiveMessage" , Boolean . valueOf ( messageAccepted ) ) ; return messageAccepted ; }
Because there may be multiple members or the ConsumerSet if we re managing the active mesage count we must reserve a space for any message that a consumer may lock rather than lock it first then realise that the ConsumerSet has reached its maximum active message limit and have to unlock it .
38,670
public void takeClassificationReadLock ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "takeClassificationReadLock" ) ; classificationReadLock . lock ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "takeClassificationReadLock" ) ; }
Take a classification readlock
38,671
public void freeClassificationReadLock ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "freeClassificationReadLock" ) ; classificationReadLock . unlock ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "freeClassificationReadLock" ) ; }
Free a classification readlock
38,672
public void registerSynchronization ( Synchronization s ) throws CPIException { try { ivContainer . uowCtrl . enlistWithSession ( s ) ; } catch ( CSIException e ) { throw new CPIException ( e . toString ( ) ) ; } }
Register the synchronization object with this activity session
38,673
private EJBKey [ ] getEJBKeys ( BeanO [ ] beans ) { EJBKey result [ ] = null ; if ( beans != null ) { result = new EJBKey [ beans . length ] ; for ( int i = 0 ; i < beans . length ; ++ i ) { result [ i ] = beans [ i ] . getId ( ) ; } } return result ; }
Get snapshot of all EJBKeys associated with the beans involved in current activity session
38,674
private BeanO [ ] getBeanOs ( ) { BeanO result [ ] ; result = new BeanO [ ivBeanOs . size ( ) ] ; Iterator < BeanO > iter = ivBeanOs . values ( ) . iterator ( ) ; int i = 0 ; while ( iter . hasNext ( ) ) { result [ i ++ ] = iter . next ( ) ; } return result ; }
Get snapshot of all beans involved in current activity session
38,675
public void scanClasses ( ClassSource_Streamer streamer , Set < String > i_seedClassNamesSet , ScanPolicy scanPolicy ) { throw new UnsupportedOperationException ( ) ; }
scan policy and external regions are never scanned iteratively .
38,676
public List < com . ibm . wsspi . security . wim . model . PartyRole > getPartyRoles ( ) { if ( partyRoles == null ) { partyRoles = new ArrayList < com . ibm . wsspi . security . wim . model . PartyRole > ( ) ; } return this . partyRoles ; }
Gets the value of the partyRoles property .
38,677
public JSchema getExpectedSchema ( Map context ) { if ( expectedSchema != null ) return expectedSchema ; if ( expectedType == null ) return null ; expectedSchema = ( JSchema ) context . get ( expectedType ) ; if ( expectedSchema != null ) return expectedSchema ; expectedSchema = new JSchema ( expectedType , context ) ; return expectedSchema ; }
Retrieve the subschema corresponding to the expected type ( will be null iff expected type is null . Constructs the subschema if it doesn t already exist . The context argument guards against duplicate construction of schemas in the event that the definition is recursive .
38,678
public void taskStarting ( ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; prevInvocationSubject = subjectManager . getInvocationSubject ( ) ; prevCallerSubject = subjectManager . getCallerSubject ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "taskStarting" , "previous caller/invocation subjects" , prevCallerSubject , prevInvocationSubject ) ; subjectManager . setInvocationSubject ( invocationSubject ) ; subjectManager . setCallerSubject ( callerSubject ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "taskStarting" , new Object [ ] { "new caller/invocation subjects" , callerSubject , invocationSubject } ) ; }
Push the subjects associated with this security context onto the thread .
38,679
public void taskStopping ( ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "taskStopping" , "restore caller/invocation subjects" , prevCallerSubject , prevInvocationSubject ) ; subjectManager . setCallerSubject ( prevCallerSubject ) ; subjectManager . setInvocationSubject ( prevInvocationSubject ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "taskStopping" ) ; }
Restore the subjects that were previously on the thread prior to applying this security context .
38,680
private void readState ( GetField fields ) throws IOException { callerPrincipal = ( WSPrincipal ) fields . get ( CALLER_PRINCIPAL , null ) ; subjectsAreEqual = fields . get ( SUBJECTS_ARE_EQUAL , false ) ; if ( ! subjectsAreEqual ) { invocationPrincipal = ( WSPrincipal ) fields . get ( INVOCATION_PRINCIPAL , null ) ; } else { invocationPrincipal = callerPrincipal ; } jaasLoginContextEntry = ( String ) fields . get ( JAAS_LOGIN_CONTEXT , null ) ; callerSubjectCacheKey = ( String ) fields . get ( CALLER_SUBJECT_CACHE_KEY , null ) ; invocationSubjectCacheKey = ( String ) fields . get ( INVOCATION_SUBJECT_CACHE_KEY , null ) ; }
Read the security context
38,681
@ FFDCIgnore ( AuthenticationException . class ) protected Subject recreateFullSubject ( WSPrincipal wsPrincipal , SecurityService securityService , AtomicServiceReference < UnauthenticatedSubjectService > unauthenticatedSubjectServiceRef , String customCacheKey ) { Subject subject = null ; if ( wsPrincipal != null ) { String userName = wsPrincipal . getName ( ) ; AuthenticateUserHelper authHelper = new AuthenticateUserHelper ( ) ; if ( jaasLoginContextEntry == null ) { jaasLoginContextEntry = DESERIALIZE_LOGINCONTEXT_DEFAULT ; } try { subject = authHelper . authenticateUser ( securityService . getAuthenticationService ( ) , userName , jaasLoginContextEntry , customCacheKey ) ; } catch ( AuthenticationException e ) { Tr . error ( tc , "SEC_CONTEXT_DESERIALIZE_AUTHN_ERROR" , new Object [ ] { e . getLocalizedMessage ( ) } ) ; } } if ( subject == null ) { subject = unauthenticatedSubjectServiceRef . getService ( ) . getUnauthenticatedSubject ( ) ; } return subject ; }
Perform a login to recreate the full subject given a WSPrincipal
38,682
protected WSPrincipal getWSPrincipal ( Subject subject ) throws IOException { WSPrincipal wsPrincipal = null ; Set < WSPrincipal > principals = ( subject != null ) ? subject . getPrincipals ( WSPrincipal . class ) : null ; if ( principals != null && ! principals . isEmpty ( ) ) { if ( principals . size ( ) > 1 ) { String principalNames = null ; for ( WSPrincipal principal : principals ) { if ( principalNames == null ) principalNames = principal . getName ( ) ; else principalNames = principalNames + ", " + principal . getName ( ) ; } throw new IOException ( Tr . formatMessage ( tc , "SEC_CONTEXT_DESERIALIZE_TOO_MANY_PRINCIPALS" , principalNames ) ) ; } else { wsPrincipal = principals . iterator ( ) . next ( ) ; } } return wsPrincipal ; }
Get the WSPrincipal from the subject
38,683
private void serializeSubjectCacheKey ( PutField fields ) throws Exception { if ( callerSubject != null ) { Hashtable < String , ? > hashtable = subjectHelper . getHashtableFromSubject ( callerSubject , new String [ ] { AttributeNameConstants . WSCREDENTIAL_CACHE_KEY } ) ; if ( hashtable != null ) { callerSubjectCacheKey = ( String ) hashtable . get ( AttributeNameConstants . WSCREDENTIAL_CACHE_KEY ) ; } } if ( callerSubjectCacheKey != null ) fields . put ( CALLER_SUBJECT_CACHE_KEY , callerSubjectCacheKey ) ; if ( ! subjectsAreEqual ) { if ( invocationSubject != null ) { Hashtable < String , ? > hashtable = subjectHelper . getHashtableFromSubject ( invocationSubject , new String [ ] { AttributeNameConstants . WSCREDENTIAL_CACHE_KEY } ) ; if ( hashtable != null ) { invocationSubjectCacheKey = ( String ) hashtable . get ( AttributeNameConstants . WSCREDENTIAL_CACHE_KEY ) ; } } } if ( invocationSubjectCacheKey != null ) fields . put ( INVOCATION_SUBJECT_CACHE_KEY , invocationSubjectCacheKey ) ; }
Serialize the cache lookup keys for the caller and invocation subjects
38,684
public void clear ( ) throws IOException { if ( writer != null ) { throw new IOException ( ) ; } else { nextChar = 0 ; if ( limitBuffer && ( strBuffer . length ( ) > this . bodyContentBuffSize ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "BodyContentImpl" , "clear buffer, create new one with buffer size [" + this . bodyContentBuffSize + "]" ) ; } strBuffer = new StringBuffer ( this . bodyContentBuffSize ) ; } else if ( strBuffer != null ) { strBuffer . setLength ( 0 ) ; } } }
Clear the contents of the buffer . If the buffer has been already been flushed then the clear operation shall throw an IOException to signal the fact that some data has already been irrevocably written to the client response stream .
38,685
public void writeOut ( Writer out ) throws IOException { if ( writer == null ) { out . write ( strBuffer . toString ( ) ) ; } }
Write the contents of this BodyJspWriter into a Writer . Subclasses are likely to do interesting things with the implementation so some things are extra efficient .
38,686
void setWriter ( Writer writer ) { if ( closed ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setWriter" , "resetting closed to false for this=[" + this + "]" ) ; } closed = false ; strBuffer = new StringBuffer ( this . bodyContentBuffSize ) ; } this . writer = writer ; if ( writer != null ) { if ( bufferSize != 0 ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setWriter" , "BodyContentImpl setWriter A. bufferSize=[" + bufferSize + "] this=[" + this + "]" ) ; } bufferSizeSave = bufferSize ; bufferSize = 0 ; } } else { bufferSize = bufferSizeSave ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setWriter" , "BodyContentImpl setWriter B. bufferSize=[" + bufferSize + "] this=[" + this + "]" ) ; } clearBody ( ) ; } }
Sets the writer to which all output is written .
38,687
public final Map < String , String > getExecutionProperties ( ) { TreeMap < String , String > copy = null ; if ( internalPropNames != null ) { copy = new TreeMap < String , String > ( threadContextDescriptor . getExecutionProperties ( ) ) ; for ( String name : internalPropNames ) copy . remove ( name ) ; } return copy ; }
Returns a copy of execution properties .
38,688
public TimerWorkItem createTimeoutRequest ( long timeoutTime , TimerCallback _callback , IAbstractAsyncFuture _future ) { TimerWorkItem wi = new TimerWorkItem ( timeoutTime , _callback , _future , _future . getReuseCount ( ) ) ; _future . setTimeoutWorkItem ( wi ) ; if ( ( this . queueToUse == 1 ) || ( numQueues == 1 ) ) { synchronized ( this . requestQueue1 ) { this . requestQueue1 . add ( wi ) ; } } else { synchronized ( this . requestQueue2 ) { this . requestQueue2 . add ( wi ) ; } } return wi ; }
Creates a work item and puts it on the work queue for requesting a timeout to be started .
38,689
public void timeSlotPruning ( long curTime ) { TimeSlot slotEntry = this . firstSlot ; TimeSlot nextSlot = null ; int endIndex = 0 ; int i ; while ( slotEntry != null ) { nextSlot = slotEntry . nextEntry ; if ( curTime - slotEntry . mostRecentlyAccessedTime > TIMESLOT_PRUNING_THRESHOLD ) { endIndex = slotEntry . lastEntryIndex ; for ( i = endIndex ; i >= 0 ; i -- ) { if ( slotEntry . entries [ i ] . state == TimerWorkItem . ENTRY_ACTIVE ) { break ; } } if ( i < 0 ) { removeSlot ( slotEntry ) ; } } slotEntry = nextSlot ; } }
Remove slots which have no active requests and no new requests have been added in a set amount of time .
38,690
public void insertWorkItem ( TimerWorkItem work , long curTime ) { long insertTime = work . timeoutTime ; TimeSlot nextSlot = this . firstSlot ; while ( nextSlot != null ) { if ( ( insertTime == nextSlot . timeoutTime ) && ( nextSlot . lastEntryIndex != TimeSlot . TIMESLOT_LAST_ENTRY ) ) { nextSlot . addEntry ( work , curTime ) ; break ; } else if ( insertTime < nextSlot . timeoutTime ) { nextSlot = insertSlot ( insertTime , nextSlot ) ; nextSlot . addEntry ( work , curTime ) ; break ; } else { nextSlot = nextSlot . nextEntry ; } } if ( nextSlot == null ) { nextSlot = insertSlotAtEnd ( insertTime ) ; nextSlot . addEntry ( work , curTime ) ; } }
Put a work item into an existing time slot or create a new time slot and put the work item into that time slot .
38,691
public TimeSlot insertSlot ( long newSlotTimeout , TimeSlot slot ) { TimeSlot retSlot = new TimeSlot ( newSlotTimeout ) ; retSlot . nextEntry = slot ; retSlot . prevEntry = slot . prevEntry ; if ( retSlot . prevEntry != null ) { retSlot . prevEntry . nextEntry = retSlot ; } else { this . firstSlot = retSlot ; } slot . prevEntry = retSlot ; return retSlot ; }
Create a new time slot with a given timeout time and add this new time slot in front of an existing time slot in the list .
38,692
public TimeSlot insertSlotAtEnd ( long newSlotTimeout ) { TimeSlot retSlot = new TimeSlot ( newSlotTimeout ) ; if ( this . lastSlot == null ) { this . lastSlot = retSlot ; this . firstSlot = retSlot ; } else { retSlot . prevEntry = this . lastSlot ; this . lastSlot . nextEntry = retSlot ; this . lastSlot = retSlot ; } return retSlot ; }
Create a new time slot with a given timeout time and add this new time slot at the end of the time slot list .
38,693
public void removeSlot ( TimeSlot oldSlot ) { if ( oldSlot . nextEntry != null ) { oldSlot . nextEntry . prevEntry = oldSlot . prevEntry ; } else { this . lastSlot = oldSlot . prevEntry ; } if ( oldSlot . prevEntry != null ) { oldSlot . prevEntry . nextEntry = oldSlot . nextEntry ; } else { this . firstSlot = oldSlot . nextEntry ; } }
Remove a time slot from the list .
38,694
public void checkForTimeouts ( long checkTime ) { TimeSlot nextSlot = this . firstSlot ; TimerWorkItem entry = null ; TimeSlot oldSlot = null ; while ( nextSlot != null && checkTime >= nextSlot . timeoutTime ) { int endIndex = nextSlot . lastEntryIndex ; for ( int i = 0 ; i <= endIndex ; i ++ ) { entry = nextSlot . entries [ i ] ; if ( entry . state == TimerWorkItem . ENTRY_ACTIVE ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found a timeout, calling timerTriggered" ) ; } entry . state = TimerWorkItem . ENTRY_CANCELLED ; entry . callback . timerTriggered ( entry ) ; } } oldSlot = nextSlot ; removeSlot ( oldSlot ) ; nextSlot = nextSlot . nextEntry ; } }
Check for timeouts in the time slot list .
38,695
public static List < String > getMatchingFileNames ( String root , String filterExpr , boolean fullPath ) { List < File > fileList = getMatchingFiles ( root , filterExpr ) ; List < String > list = new ArrayList < String > ( fileList . size ( ) ) ; for ( File f : fileList ) { if ( fullPath ) list . add ( f . getAbsolutePath ( ) ) ; else list . add ( f . getName ( ) ) ; } return list ; }
Get a list of file names from the given path that match the provided filter ; not recursive .
38,696
public PartnerLogData getEntry ( int index ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getEntry" , index ) ; _pltReadLock . lock ( ) ; try { final PartnerLogData entry = _partnerLogTable . get ( index - 1 ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEntry" , entry ) ; return entry ; } catch ( IndexOutOfBoundsException ioobe ) { FFDCFilter . processException ( ioobe , "com.ibm.ws.Transaction.JTA.PartnerLogTable.getEntry" , "122" , this ) ; } finally { _pltReadLock . unlock ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEntry" , null ) ; return null ; }
Return the entry in the recovery table at the given index or null if the index is out of the table s bounds
38,697
public void addEntry ( PartnerLogData logData ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "addEntry" , logData ) ; _pltWriteLock . lock ( ) ; try { addPartnerEntry ( logData ) ; } finally { _pltWriteLock . unlock ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "addEntry" ) ; }
Add an entry at the end of the recovery table .
38,698
public PartnerLogData findEntry ( RecoveryWrapper rw ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "findEntry" , rw ) ; PartnerLogData entry ; _pltWriteLock . lock ( ) ; try { for ( PartnerLogData pld : _partnerLogTable ) { final RecoveryWrapper nextWrapper = pld . getLogData ( ) ; if ( rw . isSameAs ( nextWrapper ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Found entry in table" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "findEntry" , pld . getIndex ( ) ) ; return pld ; } } entry = rw . container ( _failureScopeController ) ; addPartnerEntry ( entry ) ; } finally { _pltWriteLock . unlock ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "findEntry" , entry ) ; return entry ; }
This method searches the partner log table for an entry with matching wrapper . If an entry does not exist one is created and added to the table . It should only be accessing the runtime table .
38,699
public void clearUnused ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "clearUnused" ) ; final RecoveryLog partnerLog = _failureScopeController . getPartnerLog ( ) ; _pltWriteLock . lock ( ) ; try { boolean cleared = false ; for ( PartnerLogData pld : _partnerLogTable ) { cleared |= pld . clearIfNotInUse ( ) ; } try { if ( cleared ) { ( ( DistributedRecoveryLog ) partnerLog ) . keypoint ( ) ; } } catch ( Exception exc ) { } } finally { _pltWriteLock . unlock ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "clearUnused" ) ; }
Scans through the partners listed in this table and instructs each of them to clear themselves from the recovery log if they are not associated with current transactions . Entries remain in the table an can be re - logged during if they are used again .