idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
37,100
protected Subject createBasicAuthSubject ( AuthenticationData authenticationData , Subject subject ) throws WSLoginFailedException , CredentialException { Subject basicAuthSubject = subject != null ? subject : new Subject ( ) ; String loginRealm = ( String ) authenticationData . get ( AuthenticationData . REALM ) ; String username = ( String ) authenticationData . get ( AuthenticationData . USERNAME ) ; String password = getPassword ( ( char [ ] ) authenticationData . get ( AuthenticationData . PASSWORD ) ) ; if ( username == null || username . isEmpty ( ) || password == null || password . isEmpty ( ) ) { throw new WSLoginFailedException ( TraceNLS . getFormattedMessage ( this . getClass ( ) , TraceConstants . MESSAGE_BUNDLE , "JAAS_LOGIN_MISSING_CREDENTIALS" , new Object [ ] { } , "CWWKS1171E: The login on the client application failed because the user name or password is null. Ensure the CallbackHandler implementation is gathering the necessary credentials." ) ) ; } CredentialsService credentialsService = credentialsServiceRef . getServiceWithException ( ) ; credentialsService . setBasicAuthCredential ( basicAuthSubject , loginRealm , username , password ) ; Principal principal = new WSPrincipal ( username , null , WSPrincipal . AUTH_METHOD_BASIC ) ; basicAuthSubject . getPrincipals ( ) . add ( principal ) ; return basicAuthSubject ; }
Create the basic auth subject using the given authentication data
37,101
static RLSSuspendTokenManager getInstance ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getInstance" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getInstance" , _instance ) ; return _instance ; }
Returns the single instance of the RLSSuspendTokenManager
37,102
RLSSuspendToken registerSuspend ( int timeout ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerSuspend" , new Integer ( timeout ) ) ; RLSSuspendToken token = Configuration . getRecoveryLogComponent ( ) . createRLSSuspendToken ( null ) ; Alarm alarm = null ; if ( timeout > 0 ) { alarm = Configuration . getAlarmManager ( ) . scheduleAlarm ( timeout * 1000L , this , token ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Alarm has been created for this suspend call" , alarm ) ; } synchronized ( _tokenMap ) { _tokenMap . put ( token , alarm ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerSuspend" , token ) ; return token ; }
Registers that a suspend call has been made on the RecoveryLogService and generates a unique RLSSuspendToken which must be passed in to registerResume to cancel this suspend operation
37,103
void registerResume ( RLSSuspendToken token ) throws RLSInvalidSuspendTokenException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerResume" , token ) ; if ( token != null && _tokenMap . containsKey ( token ) ) { synchronized ( _tokenMap ) { Alarm alarm = ( Alarm ) _tokenMap . remove ( token ) ; if ( alarm != null ) { alarm . cancel ( ) ; } } } else { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Throw RLSInvalidSuspendTokenException - suspend token is not recognised" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerResume" , "RLSInvalidSuspendTokenException" ) ; throw new RLSInvalidSuspendTokenException ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerResume" ) ; }
Cancels the suspend request that returned the matching RLSSuspendToken . The suspend call s alarm if there is one will also be cancelled
37,104
boolean isResumable ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isResumable" ) ; boolean isResumable = true ; synchronized ( _tokenMap ) { if ( ! _tokenMap . isEmpty ( ) ) { isResumable = false ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isResumable" , new Boolean ( isResumable ) ) ; return isResumable ; }
Returns true if there are no tokens in the map indicating that no active suspends exist .
37,105
public static String formatUniqueName ( String uniqueName ) throws InvalidUniqueNameException { String validName = getValidUniqueName ( uniqueName ) ; if ( validName == null ) { if ( tc . isErrorEnabled ( ) ) { Tr . error ( tc , WIMMessageKey . INVALID_UNIQUE_NAME_SYNTAX , WIMMessageHelper . generateMsgParms ( uniqueName ) ) ; } throw new InvalidUniqueNameException ( WIMMessageKey . INVALID_UNIQUE_NAME_SYNTAX , Tr . formatMessage ( tc , WIMMessageKey . INVALID_UNIQUE_NAME_SYNTAX , WIMMessageHelper . generateMsgParms ( uniqueName ) ) ) ; } else { return validName ; } }
Formats the specified entity unique name and also check it using the LDAP DN syntax rule . The formatting including remove
37,106
public static String constructUniqueName ( String [ ] RDNs , Entity entity , String parentDN , boolean throwExc ) throws WIMException { boolean found = false ; String uniqueName = null ; String missingPropName = null ; for ( int i = 0 ; i < RDNs . length ; i ++ ) { String [ ] localRDNs = getRDNs ( RDNs [ i ] ) ; int size = localRDNs . length ; String [ ] RDNValues = new String [ size ] ; boolean findValue = true ; for ( int j = 0 ; j < size && findValue ; j ++ ) { String thisRDN = localRDNs [ j ] ; String thisRDNValue = String . valueOf ( entity . get ( thisRDN ) ) ; if ( thisRDNValue == null || "null" . equalsIgnoreCase ( thisRDNValue ) ) { findValue = false ; missingPropName = thisRDN ; } else if ( thisRDNValue . trim ( ) . length ( ) == 0 ) { String qualifiedEntityType = entity . getTypeName ( ) ; throw new InvalidPropertyValueException ( WIMMessageKey . CAN_NOT_CONSTRUCT_UNIQUE_NAME , Tr . formatMessage ( tc , WIMMessageKey . CAN_NOT_CONSTRUCT_UNIQUE_NAME , WIMMessageHelper . generateMsgParms ( thisRDN , qualifiedEntityType ) ) ) ; } else { RDNValues [ j ] = thisRDNValue ; } } if ( findValue ) { if ( ! found ) { uniqueName = constructUniqueName ( localRDNs , RDNValues , parentDN ) ; found = true ; } else if ( throwExc ) { String qualifiedEntityType = entity . getTypeName ( ) ; throw new InvalidUniqueNameException ( WIMMessageKey . CAN_NOT_CONSTRUCT_UNIQUE_NAME , Tr . formatMessage ( tc , WIMMessageKey . CAN_NOT_CONSTRUCT_UNIQUE_NAME , WIMMessageHelper . generateMsgParms ( RDNs [ i ] , qualifiedEntityType ) ) ) ; } } } if ( missingPropName != null && ! found && throwExc ) { throw new MissingMandatoryPropertyException ( WIMMessageKey . MISSING_MANDATORY_PROPERTY , Tr . formatMessage ( tc , WIMMessageKey . MISSING_MANDATORY_PROPERTY , WIMMessageHelper . generateMsgParms ( missingPropName ) ) ) ; } return uniqueName ; }
Returns the unique name based on the input value .
37,107
private static String escapeAttributeValue ( String value ) { final String escapees = ",=+<>#;\"\\" ; char [ ] chars = value . toCharArray ( ) ; StringBuffer buf = new StringBuffer ( 2 * value . length ( ) ) ; int lead ; for ( lead = 0 ; lead < chars . length ; lead ++ ) { if ( ! isWhitespace ( chars [ lead ] ) ) { break ; } } int trail ; for ( trail = chars . length - 1 ; trail >= 0 ; trail -- ) { if ( ! isWhitespace ( chars [ trail ] ) ) { break ; } } for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( ( i < lead ) || ( i > trail ) || ( escapees . indexOf ( c ) >= 0 ) ) { buf . append ( '\\' ) ; } buf . append ( c ) ; } return new String ( buf ) ; }
Given the value of an attribute returns a string suitable for inclusion in a DN .
37,108
public static String unescapeSpaces ( String in ) { char [ ] chars = in . toCharArray ( ) ; int end = chars . length ; StringBuffer out = new StringBuffer ( in . length ( ) ) ; for ( int i = 0 ; i < end ; i ++ ) { boolean isSlashSpace = ( chars [ i ] == '\\' ) && ( i + 1 < end ) && ( chars [ i + 1 ] == ' ' ) ; if ( isSlashSpace ) { boolean isStart = ( i > 0 ) && ( chars [ i - 1 ] == '=' ) ; boolean isEnd = ( i + 2 >= end ) || ( ( i + 2 < end ) && ( chars [ i + 2 ] == ',' ) ) ; if ( ! isStart && ! isEnd ) { ++ i ; } } out . append ( chars [ i ] ) ; } return new String ( out ) ; }
Replace any unnecessary escaped spaces from the input DN .
37,109
public static String getChildText ( Element elem , String childTagName ) { NodeList nodeList = elem . getElementsByTagName ( childTagName ) ; int len = nodeList . getLength ( ) ; if ( len == 0 ) { return null ; } return getElementText ( ( Element ) nodeList . item ( len - 1 ) ) ; }
Return content of child element with given tag name . If more than one children with this name are present the content of the last element is returned .
37,110
public static List getChildTextList ( Element elem , String childTagName ) { NodeList nodeList = elem . getElementsByTagName ( childTagName ) ; int len = nodeList . getLength ( ) ; if ( len == 0 ) { return Collections . EMPTY_LIST ; } List list = new ArrayList ( len ) ; for ( int i = 0 ; i < len ; i ++ ) { list . add ( getElementText ( ( Element ) nodeList . item ( i ) ) ) ; } return list ; }
Return list of content Strings of all child elements with given tag name .
37,111
public void sendNackMessage ( SIBUuid8 upstream , SIBUuid12 destUuid , SIBUuid8 busUuid , long startTick , long endTick , int priority , Reliability reliability , SIBUuid12 stream ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendNackMessage" , new Object [ ] { new Long ( startTick ) , new Long ( endTick ) } ) ; ControlNack nackMsg = createControlNackMessage ( priority , reliability , stream ) ; nackMsg . setStartTick ( startTick ) ; nackMsg . setEndTick ( endTick ) ; if ( upstream == null ) { upstream = _originStreamMap . get ( stream ) ; } _mpio . sendToMe ( upstream , priority + 2 , nackMsg ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendNackMessage " ) ; }
Called by one of our input stream data structures when we don t have any info for a tick and need to nack upstream .
37,112
private void processAckExpected ( ControlAckExpected ackExpMsg ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processAckExpected" , ackExpMsg ) ; SIBUuid12 streamID = ackExpMsg . getGuaranteedStreamUUID ( ) ; int priority = ackExpMsg . getPriority ( ) . intValue ( ) ; Reliability reliability = ackExpMsg . getReliability ( ) ; if ( _internalInputStreamManager . hasStream ( streamID , priority , reliability ) ) { _internalInputStreamManager . processAckExpected ( ackExpMsg ) ; } else { _targetStreamManager . handleAckExpectedMessage ( ackExpMsg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processAckExpected" ) ; }
Process an AckExpected message .
37,113
private long processNackWithReturnValue ( ControlNack nackMsg ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processNackWithReturnValue" , nackMsg ) ; long returnValue = - 1 ; SIBUuid12 stream = nackMsg . getGuaranteedStreamUUID ( ) ; if ( _sourceStreamManager . hasStream ( stream ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Ignoring processNack on sourceStream at PubSubInputHandler" ) ; returnValue = _sourceStreamManager . getStreamSet ( ) . getStream ( nackMsg . getPriority ( ) , nackMsg . getReliability ( ) ) . getCompletedPrefix ( ) ; } else { _internalInputStreamManager . processNack ( nackMsg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processNackWithReturnValue" , new Long ( returnValue ) ) ; return returnValue ; }
Process a nack from a PubSubOutputHandler .
37,114
private void remotePut ( MessageItem msg , SIBUuid8 sourceMEUuid ) throws SIResourceException , SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remotePut" , new Object [ ] { msg , sourceMEUuid } ) ; SIBUuid12 stream = msg . getMessage ( ) . getGuaranteedStreamUUID ( ) ; if ( ! _originStreamMap . containsKey ( stream ) ) _originStreamMap . put ( stream , sourceMEUuid ) ; MessageProcessorSearchResults searchResults = matchMessage ( msg ) ; String topic = msg . getMessage ( ) . getDiscriminator ( ) ; HashMap allPubSubOutputHandlers = _destination . getAllPubSubOutputHandlers ( ) ; List matchingPubsubOutputHandlers = searchResults . getPubSubOutputHandlers ( topic ) ; if ( allPubSubOutputHandlers != null && allPubSubOutputHandlers . size ( ) > 0 ) { remoteToRemotePut ( msg , allPubSubOutputHandlers , matchingPubsubOutputHandlers ) ; } _destination . unlockPubsubOutputHandlers ( ) ; Set consumerDispatchers = searchResults . getConsumerDispatchers ( topic ) ; if ( consumerDispatchers != null && consumerDispatchers . size ( ) > 0 ) { msg . setSearchResults ( searchResults ) ; remoteToLocalPut ( msg ) ; } else { remoteToLocalPutSilence ( msg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remotePut" ) ; }
The remote put method is driven when the producer is remote to this PubSub Input handler .
37,115
protected void remoteToLocalPutSilence ( MessageItem msgItem ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remoteToLocalPutSilence" , new Object [ ] { msgItem } ) ; _targetStreamManager . handleSilence ( msgItem ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remoteToLocalPutSilence" ) ; }
This is a put message that has oringinated from another ME When there are no matching local consumers we need to write Silence into the stream instead
37,116
private MessageProcessorSearchResults matchMessage ( MessageItem msg ) throws SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "matchMessage" , new Object [ ] { msg } ) ; JsMessage jsMsg = msg . getMessage ( ) ; TopicAuthorization topicAuth = _messageProcessor . getDiscriminatorAccessChecker ( ) ; MessageProcessorSearchResults searchResults = new MessageProcessorSearchResults ( topicAuth ) ; int redelCount = msg . guessRedeliveredCount ( ) ; if ( redelCount > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Set deliverycount into message: " + redelCount ) ; jsMsg . setDeliveryCount ( redelCount ) ; } _matchspace . retrieveMatchingOutputHandlers ( _destination , jsMsg . getDiscriminator ( ) , ( MatchSpaceKey ) jsMsg , searchResults ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "matchMessage" , new Object [ ] { searchResults } ) ; return searchResults ; }
Returns a list of matching OutputHandlers for a particular message . Note that this method takes a MessageProcessorSearchResults object from a pool . This object must be returned by the caller when it is finished with .
37,117
private boolean restoreFanOut ( MessageItemReference ref , boolean commitInsert ) throws SIDiscriminatorSyntaxException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "restoreFanOut" , new Object [ ] { ref , new Boolean ( commitInsert ) } ) ; boolean keepReference = true ; MessageItem msg = null ; try { msg = ( MessageItem ) ref . getReferredItem ( ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PubSubInputHandler.restoreFanOut" , "1:2102:1.329.1.1" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "restoreFanOut" , e ) ; throw new SIResourceException ( e ) ; } MessageProcessorSearchResults searchResults = matchMessage ( msg ) ; String topic = msg . getMessage ( ) . getDiscriminator ( ) ; List matchingPubsubOutputHandlers = searchResults . getPubSubOutputHandlers ( topic ) ; if ( matchingPubsubOutputHandlers != null && matchingPubsubOutputHandlers . size ( ) > 0 ) { HashMap allPubSubOutputHandlers = _destination . getAllPubSubOutputHandlers ( ) ; try { Iterator itr = allPubSubOutputHandlers . values ( ) . iterator ( ) ; while ( itr . hasNext ( ) ) { PubSubOutputHandler handler = ( PubSubOutputHandler ) itr . next ( ) ; if ( handler . okToForward ( msg ) ) { if ( matchingPubsubOutputHandlers . contains ( handler ) ) { handler . putInsert ( msg , commitInsert ) ; } else { handler . putSilence ( msg ) ; } } } } finally { _destination . unlockPubsubOutputHandlers ( ) ; } } else { keepReference = false ; } if ( keepReference && ! commitInsert ) { ref . setSearchResults ( searchResults ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "restoreFanOut" ) ; return keepReference ; }
Restore fan out of the given message to subscribers .
37,118
private MessageItemReference addProxyReference ( MessageItem msg , MessageProcessorSearchResults matchingPubsubOutputHandlers , TransactionCommon tran ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addProxyReference" , new Object [ ] { msg , tran } ) ; MessageItemReference ref = new MessageItemReference ( msg ) ; msg . addPersistentRef ( ) ; ref . setSearchResults ( matchingPubsubOutputHandlers ) ; try { ref . registerMessageEventListener ( MessageEvents . POST_COMMIT_ADD , this ) ; ref . registerMessageEventListener ( MessageEvents . POST_ROLLBACK_ADD , this ) ; Transaction msTran = _messageProcessor . resolveAndEnlistMsgStoreTransaction ( tran ) ; _proxyReferenceStream . add ( ref , msTran ) ; } catch ( OutOfCacheSpace e ) { SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addProxyReference" , "SIResourceException" ) ; throw new SIResourceException ( e ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PubSubInputHandler.addProxyReference" , "1:2315:1.329.1.1" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PubSubInputHandler" , "1:2322:1.329.1.1" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addProxyReference" , e ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PubSubInputHandler" , "1:2332:1.329.1.1" , e } , null ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addProxyReference" ) ; return ref ; }
Add a msg reference to the proxy subscription reference stream .
37,119
public void setPropertiesInMessage ( JsMessage jsMsg , SIBUuid12 destinationUuid , SIBUuid12 producerConnectionUuid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setPropertiesInMessage" , new Object [ ] { jsMsg , destinationUuid , producerConnectionUuid } ) ; SIMPUtils . setGuaranteedDeliveryProperties ( jsMsg , _messageProcessor . getMessagingEngineUuid ( ) , null , null , null , destinationUuid , ProtocolType . PUBSUBINPUT , GDConfig . PROTOCOL_VERSION ) ; if ( jsMsg . getConnectionUuid ( ) == null ) { jsMsg . setConnectionUuid ( producerConnectionUuid ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setPropertiesInMessage" ) ; }
Sets properties in the message that are common to both links and non - links .
37,120
public void validate ( ) { String target = getTargetName ( ) ; if ( value ( ) < 1 ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "bulkhead.parameter.invalid.value.CWMFT5016E" , "value " , value ( ) , target ) ) ; } if ( waitingTaskQueue ( ) < 1 ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "bulkhead.parameter.invalid.value.CWMFT5016E" , "waitingTaskQueue" , waitingTaskQueue ( ) , target ) ) ; } }
Validate Bulkhead configure and make sure the value and waitingTaskQueue must be greater than or equal to 1 .
37,121
public void updateCacheSizes ( long max , long current ) { final String methodName = "updateCacheSizes()" ; if ( tc . isDebugEnabled ( ) && null != _maxInMemoryCacheEntryCount && null != _inMemoryCacheEntryCount ) { if ( max != _maxInMemoryCacheEntryCount . getCount ( ) && _inMemoryCacheEntryCount . getCount ( ) != current ) Tr . debug ( tc , methodName + " cacheName=" + _sCacheName + " max=" + max + " current=" + current + " enable=" + this . _enable , this ) ; } if ( _enable ) { if ( _maxInMemoryCacheEntryCount != null ) _maxInMemoryCacheEntryCount . setCount ( max ) ; if ( _inMemoryCacheEntryCount != null ) _inMemoryCacheEntryCount . setCount ( current ) ; } }
Updates statistics using two supplied arguments - maxInMemoryCacheSize and currentInMemoryCacheSize .
37,122
public void onCacheHit ( String template , int locality ) { final String methodName = "onCacheHit()" ; CacheStatsModule csm = null ; if ( ( csm = getCSM ( template ) ) == null ) { return ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + " cacheName=" + _sCacheName + " template=" + template + " locality=" + locality + " enable=" + csm . _enable + " parentEnable=" + _enable + " " + this ) ; switch ( locality ) { case REMOTE : if ( csm . _enable ) { if ( csm . _remoteHitCount != null ) { csm . _remoteHitCount . increment ( ) ; } if ( csm . _inMemoryAndDiskCacheEntryCount != null ) { csm . _inMemoryAndDiskCacheEntryCount . increment ( ) ; } if ( csm . _remoteCreationCount != null ) { csm . _remoteCreationCount . increment ( ) ; } } break ; case MEMORY : if ( csm . _enable && csm . _hitsInMemoryCount != null ) csm . _hitsInMemoryCount . increment ( ) ; break ; case DISK : if ( _csmDisk != null && _csmDisk . _enable && _csmDisk . _hitsOnDisk != null ) { _csmDisk . _hitsOnDisk . increment ( ) ; } if ( csm . _enable && csm . _hitsOnDiskCount != null ) csm . _hitsOnDiskCount . increment ( ) ; break ; default : if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + " Error - Unrecognized locality " + locality + " cacheName=" + _sCacheName ) ; break ; } return ; }
Updates statistics for the cache hit case .
37,123
public void onCacheMiss ( String template , int locality ) { final String methodName = "onCacheMiss()" ; CacheStatsModule csm = null ; if ( ( csm = getCSM ( template ) ) == null ) { return ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + " cacheName=" + _sCacheName + " template=" + template + " locality=" + locality + " enable=" + csm . _enable + " " + this ) ; if ( csm . _enable && csm . _missCount != null ) csm . _missCount . increment ( ) ; return ; }
Updates statistics for the cache miss case .
37,124
public void onEntryCreation ( String template , int source ) { final String methodName = "onEntryCreation()" ; CacheStatsModule csm = null ; if ( ( csm = getCSM ( template ) ) == null ) { return ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + " cacheName=" + _sCacheName + " template=" + template + " source=" + source + " enable=" + csm . _enable + " " + this ) ; if ( csm . _enable ) { if ( source == REMOTE ) { if ( csm . _remoteCreationCount != null ) csm . _remoteCreationCount . increment ( ) ; } if ( csm . _inMemoryAndDiskCacheEntryCount != null ) csm . _inMemoryAndDiskCacheEntryCount . increment ( ) ; } return ; }
Updates statistics for the cache entry creation case .
37,125
private static void applyElement ( Annotated member , Schema property ) { final XmlElementWrapper wrapper = member . getAnnotation ( XmlElementWrapper . class ) ; if ( wrapper != null ) { final XML xml = getXml ( property ) ; xml . setWrapped ( true ) ; if ( ! "##default" . equals ( wrapper . name ( ) ) && ! wrapper . name ( ) . isEmpty ( ) && ! wrapper . name ( ) . equals ( ( ( SchemaImpl ) property ) . getName ( ) ) ) { xml . setName ( wrapper . name ( ) ) ; } } else { final XmlElement element = member . getAnnotation ( XmlElement . class ) ; if ( element != null ) { setName ( element . namespace ( ) , element . name ( ) , property ) ; } } }
Puts definitions for XML element .
37,126
private static void applyAttribute ( Annotated member , Schema property ) { final XmlAttribute attribute = member . getAnnotation ( XmlAttribute . class ) ; if ( attribute != null ) { final XML xml = getXml ( property ) ; xml . setAttribute ( true ) ; setName ( attribute . namespace ( ) , attribute . name ( ) , property ) ; } }
Puts definitions for XML attribute .
37,127
private static boolean setName ( String ns , String name , Schema property ) { boolean apply = false ; final String cleanName = StringUtils . trimToNull ( name ) ; final String useName ; if ( ! isEmpty ( cleanName ) && ! cleanName . equals ( ( ( SchemaImpl ) property ) . getName ( ) ) ) { useName = cleanName ; apply = true ; } else { useName = null ; } final String cleanNS = StringUtils . trimToNull ( ns ) ; final String useNS ; if ( ! isEmpty ( cleanNS ) ) { useNS = cleanNS ; apply = true ; } else { useNS = null ; } if ( apply ) { getXml ( property ) . name ( useName ) . namespace ( useNS ) ; } return apply ; }
Puts name space and name for XML node or attribute .
37,128
private static boolean isAttributeAllowed ( Schema property ) { if ( property . getType ( ) == SchemaType . ARRAY || property . getType ( ) == SchemaType . OBJECT ) { return false ; } if ( ! StringUtils . isBlank ( property . getRef ( ) ) ) { return false ; } return true ; }
Checks whether the passed property can be represented as node attribute .
37,129
public static Attribute getInstance ( Object o ) { if ( o == null || o instanceof Attribute ) { return ( Attribute ) o ; } if ( o instanceof ASN1Sequence ) { return new Attribute ( ( ASN1Sequence ) o ) ; } throw new IllegalArgumentException ( "unknown object in factory" ) ; }
return an Attribute object from the given object .
37,130
synchronized void unregister ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "unregister" , this ) ; } if ( registration != null ) { registration . unregister ( ) ; registration = null ; } }
Remove the service registration Package private .
37,131
public void printStackTrace ( PrintWriter p ) { if ( wrapped == null ) { p . println ( "none" ) ; } else { StackTraceElement [ ] stackElements = getStackTraceEliminatingDuplicateFrames ( ) ; p . println ( wrapped ) ; for ( int i = 0 ; i < stackElements . length ; i ++ ) { StackTraceElement stackTraceElement = stackElements [ i ] ; final String toString = printStackTraceElement ( stackTraceElement ) ; p . println ( "\t" + toString ) ; } TruncatableThrowable cause = getCause ( ) ; if ( cause != null ) { if ( cause . isIntermediateCausesStripped ( ) ) { p . print ( "Caused by (repeated) ... : " ) ; } else { p . print ( CAUSED_BY ) ; } cause . printStackTrace ( p ) ; } } }
This method will print a trimmed stack trace to stderr .
37,132
public StackTraceElement [ ] getStackTraceEliminatingDuplicateFrames ( ) { if ( parentFrames == null ) { return getStackTrace ( ) ; } if ( noduplicatesStackTrace == null ) { List < StackTraceElement > list = new ArrayList < StackTraceElement > ( ) ; StackTraceElement [ ] stackElements = getStackTrace ( ) ; int numberToInclude = countNonDuplicatedFrames ( parentFrames , stackElements ) ; for ( int i = 0 ; i < numberToInclude ; i ++ ) { list . add ( stackElements [ i ] ) ; } boolean duplicateFramesRemoved = numberToInclude < stackElements . length ; if ( duplicateFramesRemoved ) { list . add ( new StackTraceElement ( "... " + ( stackElements . length - numberToInclude ) + " more" , DUPLICATE_FRAMES_EYECATCHER , null , 0 ) ) ; } noduplicatesStackTrace = list . toArray ( new StackTraceElement [ 0 ] ) ; } return noduplicatesStackTrace . clone ( ) ; }
Useful for exceptions which are the causes of other exceptions . Gets the stack frames but not only does it eliminate internal classes it eliminates frames which are redundant with the parent exception . In the case where the exception is not a cause it returns a normal exception . If duplicate frames are stripped it will add an
37,133
public void record ( CircuitBreakerStateImpl . CircuitBreakerResult result ) { boolean isFailure = ( result == FAILURE ) ; if ( resultCount < size ) { resultCount ++ ; } else { boolean oldestResultIsFailure = results . get ( nextResultIndex ) ; if ( oldestResultIsFailure ) { failures -- ; } } results . set ( nextResultIndex , isFailure ) ; if ( isFailure ) { failures ++ ; } nextResultIndex ++ ; if ( nextResultIndex >= size ) { nextResultIndex = 0 ; } }
Record a result in the rolling window
37,134
protected MetadataViewKey deriveViewKey ( FacesContext facesContext , UIViewRoot root ) { MetadataViewKey viewKey ; if ( ! facesContext . getResourceLibraryContracts ( ) . isEmpty ( ) ) { String [ ] contracts = new String [ facesContext . getResourceLibraryContracts ( ) . size ( ) ] ; contracts = facesContext . getResourceLibraryContracts ( ) . toArray ( contracts ) ; viewKey = new MetadataViewKeyImpl ( root . getViewId ( ) , root . getRenderKitId ( ) , root . getLocale ( ) , contracts ) ; } else { viewKey = new MetadataViewKeyImpl ( root . getViewId ( ) , root . getRenderKitId ( ) , root . getLocale ( ) ) ; } return viewKey ; }
Generates an unique key according to the metadata information stored in the passed UIViewRoot instance that can affect the way how the view is generated . By default the view params are the viewId the locale the renderKit and the contracts associated to the view .
37,135
public void modified ( List < String > newSources ) { if ( collectorMgr == null || isInit == false ) { this . sourcesList = newSources ; return ; } try { ArrayList < String > oldSources = new ArrayList < String > ( sourcesList ) ; ArrayList < String > sourcesToRemove = new ArrayList < String > ( oldSources ) ; sourcesToRemove . removeAll ( newSources ) ; collectorMgr . unsubscribe ( this , convertToSourceIDList ( sourcesToRemove ) ) ; ArrayList < String > sourcesToAdd = new ArrayList < String > ( newSources ) ; sourcesToAdd . removeAll ( oldSources ) ; collectorMgr . subscribe ( this , convertToSourceIDList ( sourcesToAdd ) ) ; sourcesList = newSources ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
Without osgi this modified method is called explicility from the update method in JsonTrService
37,136
public void writingState ( ) { if ( ! this . writtenState ) { this . writtenState = true ; this . writtenStateWithoutWrapper = false ; this . fast = new FastWriter ( this . initialSize ) ; this . out = this . fast ; } }
Mark that state is about to be written . Contrary to what you d expect we cannot and should not assume that this location is really going to have state ; it is perfectly legit to have a ResponseWriter that filters out content and ignores an attempt to write out state at this point . So we have to check after the fact to see if there really are state markers .
37,137
@ Reference ( name = "extensionProvider" , service = ExtensionProvider . class , policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE ) protected void registerExtensionProvider ( ExtensionProvider provider ) { LibertyApplicationBusFactory . getInstance ( ) . registerExtensionProvider ( provider ) ; }
Register a new extension provier
37,138
private String dumpMap ( Map < String , String [ ] > m ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( " --- request parameters: ---\n" ) ; Iterator < String > it = m . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String key = it . next ( ) ; String [ ] values = m . get ( key ) ; sb . append ( key + ": " ) ; for ( String s : values ) { sb . append ( "[" + s + "] " ) ; } sb . append ( "\n" ) ; } return sb . toString ( ) ; }
dump parameter map for trace .
37,139
private void forwardMessage ( AbstractMessage aMessage , SIBUuid8 targetMEUuid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "forwardMessage" , new Object [ ] { aMessage , targetMEUuid } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && UserTrace . tc_mt . isDebugEnabled ( ) && ! aMessage . isControlMessage ( ) ) { JsMessage jsMsg = ( JsMessage ) aMessage ; JsDestinationAddress routingDestination = jsMsg . getRoutingDestination ( ) ; if ( routingDestination != null ) { String destId = routingDestination . getDestinationName ( ) ; boolean temporary = false ; if ( destId . startsWith ( SIMPConstants . TEMPORARY_PUBSUB_DESTINATION_PREFIX ) ) temporary = true ; UserTrace . forwardJSMessage ( jsMsg , targetMEUuid , destId , temporary ) ; } else { DestinationHandler dest = _destinationManager . getDestinationInternal ( aMessage . getGuaranteedTargetDestinationDefinitionUUID ( ) , false ) ; if ( dest != null ) UserTrace . forwardJSMessage ( jsMsg , targetMEUuid , dest . getName ( ) , dest . isTemporary ( ) ) ; else UserTrace . forwardJSMessage ( jsMsg , targetMEUuid , jsMsg . getGuaranteedTargetDestinationDefinitionUUID ( ) . toString ( ) , false ) ; } } _mpio . sendToMe ( targetMEUuid , aMessage . getPriority ( ) . intValue ( ) , aMessage ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "forwardMessage" ) ; }
Forwards a message onto a foreign bus
37,140
private boolean attachAndLockMsg ( SIMPMessage msgItem , boolean isOnItemStream ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "attachAndLockMsg" , new Object [ ] { msgItem , Boolean . valueOf ( isOnItemStream ) , this } ) ; if ( _msgAttached ) { String text = "Message already attached [" ; if ( _attachedMessage != null ) text = text + _attachedMessage . getMessage ( ) . getMessageHandle ( ) ; text = text + "," + msgItem . getMessage ( ) . getMessageHandle ( ) + "]" ; SIErrorException e = new SIErrorException ( text ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.attachAndLockMsg" , "1:1057:1.22.5.1" , this ) ; } if ( isOnItemStream ) { if ( _consumerSession . getForwardScanning ( ) ) { _msgLocked = false ; _msgAttached = true ; _msgOnItemStream = true ; _attachedMessage = null ; } else { LockingCursor cursor = _consumerKey . getGetCursor ( msgItem ) ; try { _msgLocked = msgItem . lockItemIfAvailable ( cursor . getLockID ( ) ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.attachAndLockMsg" , "1:1094:1.22.5.1" , this ) ; SibTr . exception ( tc , e ) ; _msgLocked = false ; _msgAttached = true ; _msgOnItemStream = true ; _attachedMessage = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachAndLockMsg" , e ) ; throw new SIResourceException ( e ) ; } if ( _msgLocked ) { _msgAttached = true ; _msgOnItemStream = true ; _attachedMessage = msgItem ; } else { _msgAttached = true ; _msgOnItemStream = true ; _attachedMessage = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Missed the message!" ) ; } } } else { _msgLocked = false ; _msgAttached = true ; _msgOnItemStream = false ; _attachedMessage = msgItem ; } if ( _msgAttached && ( _keyGroup != null ) ) _keyGroup . attachMessage ( _consumerKey ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachAndLockMsg" , Boolean . valueOf ( _attachedMessage != null ) ) ; return ( _attachedMessage != null ) ; }
Attach and lock a message to this LCP
37,141
SIMPMessage getAttachedMessage ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getAttachedMessage" , this ) ; SIMPMessage msg = null ; if ( _msgAttached ) { if ( _msgOnItemStream && ! _msgLocked ) { msg = getEligibleMsgLocked ( null ) ; } else msg = _attachedMessage ; _msgAttached = false ; _msgLocked = false ; _attachedMessage = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getAttachedMessage" , msg ) ; return msg ; }
If a message has been attached to this LCP detach it and return it
37,142
private boolean checkReceiveAllowed ( ) throws SISessionUnavailableException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkReceiveAllowed" ) ; boolean allowed = _destinationAttachedTo . isReceiveAllowed ( ) ; if ( ! allowed ) { _stoppedForReceiveAllowed = true ; if ( ! _stopped ) { internalStop ( ) ; } } else { _stoppedForReceiveAllowed = false ; if ( ( _stopped ) && ( ! _stoppedByRequest ) ) { internalStart ( false ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkReceiveAllowed" , Boolean . valueOf ( allowed ) ) ; return allowed ; }
Checks the destination allows receive
37,143
private void checkReceiveState ( ) throws SIIncorrectCallException , SISessionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkReceiveState" ) ; checkNotClosed ( ) ; if ( _asynchConsumerRegistered ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkReceiveState" , "asynchConsumerRegistered == true " ) ; throw new SIIncorrectCallException ( nls . getFormattedMessage ( "RECEIVE_USAGE_ERROR_CWSIP0171" , new Object [ ] { _consumerDispatcher . getDestination ( ) . getName ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } else if ( _waiting ) { SIIncorrectCallException e = new SIIncorrectCallException ( nls . getFormattedMessage ( "RECEIVE_USAGE_ERROR_CWSIP0178" , new Object [ ] { _consumerDispatcher . getDestination ( ) . getName ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkReceiveState" , "receive already in progress" ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkReceiveState" ) ; }
Checks the state for the synchronous consumer
37,144
private SIMPMessage getEligibleMsgLocked ( TransactionCommon tranImpl ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getEligibleMsgLocked" , new Object [ ] { this , tranImpl } ) ; SIMPMessage msg = null ; boolean msgAccepted = prepareAddActiveMessage ( ) ; if ( ! msgAccepted ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "The consumer (or its set) is currently maxed out" ) ; } else { try { msg = retrieveMsgLocked ( ) ; if ( msg != null && _consumerDispatcher . getConsumerDispatcherState ( ) . isNoLocal ( ) ) { LinkedList < SIMPMessage > markedForDeletion = new LinkedList < SIMPMessage > ( ) ; int msgCount = 0 ; while ( msg != null && _connectionUuid . equals ( msg . getProducerConnectionUuid ( ) ) ) { markedForDeletion . add ( msg ) ; msgCount ++ ; if ( msgCount >= NO_LOCAL_BATCH_SIZE ) { removeUnwantedMsgs ( markedForDeletion , null ) ; markedForDeletion . clear ( ) ; msgCount = 0 ; } msg = retrieveMsgLocked ( ) ; } if ( ! markedForDeletion . isEmpty ( ) ) { TransactionCommon tran = null ; if ( tranImpl != null && msg != null ) tran = tranImpl ; removeUnwantedMsgs ( markedForDeletion , tran ) ; } } } finally { if ( msg != null ) commitAddActiveMessage ( ) ; else rollbackAddActiveMessage ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getEligibleMsgLocked" , msg ) ; return msg ; }
Retrieves the next eligible message for delivery to this consumer . Performs a check for noLocal and takes this into account when retrieving the next eligible message . If any messages are not eligible for delivery they are deleted from the itemstream before the first eligble one is returned .
37,145
protected void waitingNotify ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "waitingNotify" ) ; this . lock ( ) ; try { if ( _waiting ) _waiter . signal ( ) ; } finally { this . unlock ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "waitingNotify" ) ; }
Wakeup our thread if we re waiting on a receive . This method is normally called as part of remoteDurable when we need to resubmit a get because a previous get caused a noLocal discard .
37,146
private SIMPMessage retrieveMsgLocked ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "retrieveMsgLocked" , new Object [ ] { this } ) ; SIMPMessage msg = null ; try { msg = _consumerKey . getMessageLocked ( ) ; if ( msg != null ) msg . eventLocked ( ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.retrieveMsgLocked" , "1:2101:1.22.5.1" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint" , "1:2108:1.22.5.1" , SIMPUtils . getStackTrace ( e ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "retrieveMsgLocked" , e ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint" , "1:2119:1.22.5.1" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "retrieveMsgLocked" , msg ) ; return msg ; }
Attempt to retrieve a message from the CD s itemStream in a locked state .
37,147
private void checkParams ( int maxActiveMessages , long messageLockExpiry , int maxBatchSize ) throws SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkParams" , new Object [ ] { Integer . valueOf ( maxActiveMessages ) , Long . valueOf ( messageLockExpiry ) , Integer . valueOf ( maxBatchSize ) } ) ; if ( maxActiveMessages < 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkParams" , "SIIncorrectCallException maxActiveMessages < 0" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "REG_ASYNCH_CONSUMER_ERROR_CWSIR0141" , new Object [ ] { Integer . valueOf ( maxActiveMessages ) } , null ) ) ; } if ( messageLockExpiry < 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkParams" , "SIIncorrectCallException messageLockExpiry < 0" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "REG_ASYNCH_CONSUMER_ERROR_CWSIR0142" , new Object [ ] { Long . valueOf ( messageLockExpiry ) } , null ) ) ; } if ( maxBatchSize <= 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkParams" , "SIIncorrectCallException maxBatchSize <= 0" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "REG_ASYNCH_CONSUMER_ERROR_CWSIR0143" , new Object [ ] { Integer . valueOf ( maxBatchSize ) } , null ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkParams" ) ; }
Checks that the maxBatchSize is > 0 Checks that messasgeLockExpiry > = 0 Checks that maxActiveMessages > = 0
37,148
boolean processAttachedMsgs ( ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processAttachedMsgs" , this ) ; SIMPMessage msg = null ; this . lock ( ) ; try { msg = getAttachedMessage ( ) ; } finally { this . unlock ( ) ; } if ( _keyGroup != null ) { ConsumableKey attachedKey = _keyGroup . getAttachedMember ( ) ; if ( ( attachedKey != null ) && ( attachedKey != _consumerKey ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processAttachedMsgs" ) ; return ( ( JSLocalConsumerPoint ) attachedKey . getConsumerPoint ( ) ) . processAttachedMsgs ( ) ; } } if ( msg != null ) { if ( ! _msgOnItemStream && ! _bifurcatable ) { if ( ! msg . isItemReference ( ) && msg . getReportCOD ( ) != null ) { ( ( MessageItem ) msg ) . beforeCompletion ( _autoCommitTransaction ) ; } if ( _singleLockedMessageEnum != null ) _singleLockedMessageEnum . newMessage ( msg ) ; else _singleLockedMessageEnum = new SingleLockedMessageEnumerationImpl ( this , msg ) ; _asynchConsumer . processMsgs ( _singleLockedMessageEnum , _consumerSession ) ; removeActiveMessages ( 1 ) ; _singleLockedMessageEnum . clearMessage ( ) ; } else { boolean isRecoverable = true ; if ( ( _unrecoverableOptions != Reliability . NONE ) && ( msg . getReliability ( ) . compareTo ( _unrecoverableOptions ) <= 0 ) ) isRecoverable = false ; registerForEvents ( msg ) ; _allLockedMessages . addNewMessage ( msg , _msgOnItemStream , isRecoverable ) ; _asynchConsumer . processMsgs ( _allLockedMessages , _consumerSession ) ; _allLockedMessages . resetCallbackCursor ( ) ; } if ( _externalConsumerLock != null ) _interruptConsumer = _externalConsumerLock . isLockYieldRequested ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processAttachedMsgs" , Boolean . TRUE ) ; return true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processAttachedMsgs" , Boolean . FALSE ) ; return false ; }
Try to asynchronously deliver any attached messages
37,149
void runAsynchConsumer ( boolean isolatedRun ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "runAsynchConsumer" , new Object [ ] { this , Boolean . valueOf ( isolatedRun ) } ) ; JSLocalConsumerPoint nextConsumer = this ; boolean firstTimeRound = true ; do { if ( _interruptConsumer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "External yield requested" ) ; Thread . yield ( ) ; if ( ! _stopped ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Yield appears to have been ignored" ) ; } } synchronized ( _asynchConsumerBusyLock ) { if ( ! _runningAsynchConsumer || ( ! firstTimeRound && _runningAsynchConsumer ) ) { if ( ( _stopped && ! ( isolatedRun ) ) || ( ! _stopped && isolatedRun ) || _closed || ! _asynchConsumerRegistered ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "We've been interferred with: " + _stopped + ", " + _closed + ", " + _asynchConsumerRegistered ) ; nextConsumer = null ; _runningAsynchConsumer = false ; } else { if ( firstTimeRound ) { firstTimeRound = false ; boolean msgDelivered = processAttachedMsgs ( ) ; if ( ! ( msgDelivered && isolatedRun ) ) { nextConsumer = processQueuedMsgs ( isolatedRun ) ; } } if ( ! isolatedRun && ( nextConsumer != null ) ) { nextConsumer = nextConsumer . processQueuedMsgs ( isolatedRun ) ; } if ( nextConsumer != null ) _runningAsynchConsumer = true ; else _runningAsynchConsumer = false ; } if ( ! _runningAsynchConsumer && _runAsynchConsumerInterupted ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "We've been told to stop, wake up whoever asked us" ) ; _runAsynchConsumerInterupted = false ; _asynchConsumerBusyLock . notifyAll ( ) ; } } else nextConsumer = null ; } } while ( nextConsumer != null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "runAsynchConsumer" ) ; }
Go and look for both attached messages and messages on the QP . If any are found then deliver them via the asynch callback
37,150
public void close ( ) throws SIResourceException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "close" , this ) ; _interruptConsumer = true ; synchronized ( _asynchConsumerBusyLock ) { if ( _closed || _closing ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "close" , "Already Closed" ) ; return ; } _lockRequested = true ; if ( _keyGroup != null ) _keyGroup . lock ( ) ; try { this . lock ( ) ; try { _lockRequested = false ; _consumerKey . stop ( ) ; unsetReady ( ) ; _closing = true ; } finally { this . unlock ( ) ; } } finally { if ( _keyGroup != null ) _keyGroup . unlock ( ) ; } if ( _asynchConsumerRegistered ) { if ( ! _asynchConsumer . isAsynchConsumerRunning ( ) ) { try { processAttachedMsgs ( ) ; } catch ( SISessionDroppedException e ) { } } if ( _keyGroup != null ) { _consumerKey . leaveKeyGroup ( ) ; _keyGroup = null ; } } this . lock ( ) ; try { synchronized ( _allLockedMessages ) { try { _allLockedMessages . unlockAll ( ) ; } catch ( SIMPMessageNotLockedException e ) { } catch ( SISessionDroppedException e ) { } _closed = true ; } if ( _waiting ) { _waiter . signal ( ) ; } } finally { this . unlock ( ) ; } _interruptConsumer = false ; if ( _runningAsynchConsumer && ! _asynchConsumer . isAsynchConsumerRunning ( ) ) { _runAsynchConsumerInterupted = true ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Waiting for runAsynchConsumer to complete" ) ; _asynchConsumerBusyLock . wait ( ) ; } catch ( InterruptedException e ) { } } } unlockAllHiddenMessages ( ) ; _consumerKey . detach ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "close" ) ; }
Closes the LocalConsumerPoint .
37,151
public boolean isClosed ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isClosed" , this ) ; SibTr . exit ( tc , "isClosed" , Boolean . valueOf ( _closed ) ) ; } return _closed ; }
Returns true if this LCP is closed .
37,152
public void start ( boolean deliverImmediately ) throws SISessionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "start" , new Object [ ] { Boolean . valueOf ( deliverImmediately ) , this } ) ; _stoppedByRequest = false ; internalStart ( deliverImmediately ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "start" ) ; }
Start this LCP . If there are any synchronous receives waiting wake them up If there is a AsynchConsumerCallback registered look on the QP for messages for asynch delivery . If deliverImmediately is set this Thread is used to deliver any initial messages rather than starting up a new Thread .
37,153
public void checkForMessages ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkForMessages" , this ) ; try { _messageProcessor . startNewThread ( new AsynchThread ( this , false ) ) ; } catch ( InterruptedException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.checkForMessages" , "1:3881:1.22.5.1" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkForMessages" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkForMessages" ) ; }
Spin off a thread that checks for any stored messages . This is called by a consumerKeyGroup to try to kick a group back into life after a stopped member detaches and makes the group ready again .
37,154
public void unlockAll ( ) throws SISessionUnavailableException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockAll" , this ) ; synchronized ( _asynchConsumerBusyLock ) { this . lock ( ) ; try { checkNotClosed ( ) ; try { _allLockedMessages . unlockAll ( ) ; } catch ( SIMPMessageNotLockedException e ) { } } finally { this . unlock ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAll" ) ; }
Unlock all messages which have been locked to this LCP but not consumed
37,155
private void setBaseRecoverability ( Reliability unrecoverableReliability ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setBaseRecoverability" , new Object [ ] { this , unrecoverableReliability } ) ; setUnrecoverability ( unrecoverableReliability ) ; _baseUnrecoverableOptions = _unrecoverableOptions ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setBaseRecoverability" ) ; }
Set the consumerSession s recoverability
37,156
private void resetBaseUnrecoverability ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resetBaseUnrecoverability" , this ) ; _unrecoverableOptions = _baseUnrecoverableOptions ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resetBaseUnrecoverability" ) ; }
Restore the original unrecoverability of the session
37,157
private void setReady ( ) throws SINotPossibleInCurrentConfigurationException { Reliability unrecoverable = Reliability . ASSURED_PERSISTENT ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setReady" , this ) ; if ( _transacted ) unrecoverable = _unrecoverableOptions ; _ready = true ; if ( _keyGroup != null ) _keyGroup . groupReady ( ) ; _consumerKey . ready ( unrecoverable ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setReady" ) ; }
Change the Ready state to true
37,158
protected void unsetReady ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unsetReady" , this ) ; _ready = false ; if ( _keyGroup != null ) _keyGroup . groupNotReady ( ) ; if ( _consumerKey != null ) { _consumerKey . notReady ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unsetReady" ) ; }
Change the Ready state to false
37,159
protected TransactionCommon getAutoCommitTransaction ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getAutoCommitTransaction" , this ) ; } TransactionCommon tran = _messageProcessor . getTXManager ( ) . createAutoCommitTransaction ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "getAutoCommitTransaction" , tran ) ; } return tran ; }
An autocommit transaction is not threadsafe therefore any users must either prevent concurrent use or use separate transactions . All references in JSLocalConsumerPoint to _autoCommitTransaction are threadsafe so the cached transaction is ok . However callers to this method are not so a new transaction is returned each time .
37,160
public int getMaxActiveMessages ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getMaxActiveMessages" ) ; SibTr . exit ( tc , "getMaxActiveMessages" , Integer . valueOf ( _maxActiveMessages ) ) ; } return _maxActiveMessages ; }
Gets the max active message count Currently only used by the unit tests to be sure that the max active count has been updated
37,161
public void setMaxActiveMessages ( int maxActiveMessages ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setMaxActiveMessages" , Integer . valueOf ( maxActiveMessages ) ) ; synchronized ( _asynchConsumerBusyLock ) { this . lock ( ) ; try { synchronized ( _maxActiveMessageLock ) { if ( maxActiveMessages > _maxActiveMessages && maxActiveMessages < _currentActiveMessages ) { if ( _consumerSuspended ) { if ( _runningAsynchConsumer ) { _consumerSuspended = false ; _suspendFlags &= ~ DispatchableConsumerPoint . SUSPEND_FLAG_ACTIVE_MSGS ; } else { resumeConsumer ( DispatchableConsumerPoint . SUSPEND_FLAG_ACTIVE_MSGS ) ; } } } else if ( maxActiveMessages <= _currentActiveMessages && ! _consumerSuspended ) { _consumerSuspended = true ; _suspendFlags |= DispatchableConsumerPoint . SUSPEND_FLAG_ACTIVE_MSGS ; } _maxActiveMessages = maxActiveMessages ; } } finally { this . unlock ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setMaxActiveMessages" ) ; }
Update the max active messages field
37,162
public boolean contextInfoRequired ( String eventType , long requestNumber ) { boolean needContextInfo = false ; List < ProbeExtension > probeExtnList = RequestProbeService . getProbeExtensions ( ) ; for ( int i = 0 ; i < probeExtnList . size ( ) ; i ++ ) { ProbeExtension probeExtension = probeExtnList . get ( i ) ; if ( requestNumber % probeExtension . getRequestSampleRate ( ) == 0 ) { if ( probeExtension . getContextInfoRequirement ( ) == ContextInfoRequirement . ALL_EVENTS ) { needContextInfo = true ; break ; } else if ( probeExtension . getContextInfoRequirement ( ) == ContextInfoRequirement . EVENTS_MATCHING_SPECIFIED_EVENT_TYPES && ( probeExtension . invokeForEventTypes ( ) == null || probeExtension . invokeForEventTypes ( ) . contains ( eventType ) ) ) { needContextInfo = true ; break ; } } } return needContextInfo ; }
This method will check if context information is required or not by processing through each active ProbeExtensions available in PE List
37,163
public static RequestProbeTransformDescriptor getObjForInstrumentation ( String key ) { RequestProbeTransformDescriptor requestProbeTransformDescriptor = RequestProbeBCIManagerImpl . getRequestProbeTransformDescriptors ( ) . get ( key ) ; return requestProbeTransformDescriptor ; }
getObjForInstrumentation Returns TransformDescriptor with input parameters className methodName and methodDescription
37,164
boolean addHandle ( SIMessageHandle handle , Map ctxInfo , final boolean canBeDeleted ) { final String methodName = "addHandle" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { handle , ctxInfo , canBeDeleted } ) ; } boolean addedToThisToken = false ; if ( _messageHandles . isEmpty ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "No existing message handles - using current message as template <ctxInfo=" + ctxInfo + "> <canBeDeleted=" + canBeDeleted + "> <handle= " + handle + ">" ) ; } _messageHandles . add ( handle ) ; _contextInfo = ctxInfo ; _deleteMessagesWhenRead = canBeDeleted ; _contextInfoContainsDefaultEntries = ( _contextInfo . size ( ) == 2 ) ; addedToThisToken = true ; } else { if ( matches ( ctxInfo , canBeDeleted ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "Message matched token for supplied handle - adding handle to the token <handle=" + handle + ">" ) ; } _messageHandles . add ( handle ) ; addedToThisToken = true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , addedToThisToken ) ; } return addedToThisToken ; }
Attemts to add the supplied message handle to the token . This is only done if the context information matches and both messages are BENP or both are not BENP .
37,165
boolean matches ( Map ctxInfo , boolean canBeDeleted ) { final String methodName = "matches" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { ctxInfo , canBeDeleted } ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "Attempting to match againgst token <context=" + _contextInfo + "> <isBENP=" + _deleteMessagesWhenRead ) ; } boolean doesMatch = false ; if ( canBeDeleted == _deleteMessagesWhenRead && _contextInfoContainsDefaultEntries && ( ctxInfo . size ( ) == _contextInfo . size ( ) ) ) { } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , doesMatch ) ; } return doesMatch ; }
This method checks to see if the supplied information from a message handle matches the information that this token is using .
37,166
private void updateBufferManager ( Map < String , Object > properties ) { if ( properties . isEmpty ( ) ) { return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Ignoring runtime changes to WSBB config; " + properties ) ; } }
This is used to provide the runtime configuration changes to an existing pool manager which is a small subset of the possible creation properties .
37,167
private synchronized static void initConfigs ( ) { for ( int i = 0 ; i < moduleIDs . length ; i ++ ) { getConfigFromXMLFile ( getXmlFileName ( modulePrefix + moduleIDs [ i ] ) , true , false ) ; } }
Init moduleConfigs with array moduleIDs - use modulePrefix because they are all websphere default PMI modules
37,168
public static PmiModuleConfig getConfig ( String moduleID ) { if ( moduleID == null ) return null ; PmiModuleConfig config = ( PmiModuleConfig ) moduleConfigs . get ( moduleID ) ; if ( config == null ) { int hasDot = moduleID . indexOf ( '.' ) ; if ( hasDot == - 1 ) { String preDefinedMod = DEFAULT_MODULE_PREFIX + moduleID ; config = getConfigFromXMLFile ( getXmlFileName ( preDefinedMod ) , true , false ) ; } } if ( config == null ) { config = getConfigFromXMLFile ( getXmlFileName ( moduleID ) , true , true ) ; } return config ; }
return PmiModuleConfig for a given moduleID
37,169
public static PmiModuleConfig findConfig ( PmiModuleConfig [ ] configs , String moduleID ) { if ( moduleID == null ) return null ; for ( int i = 0 ; i < configs . length ; i ++ ) { if ( configs [ i ] . getUID ( ) . equals ( moduleID ) ) return configs [ i ] ; } return null ; }
return the config for the moduleID
37,170
public synchronized static PmiModuleConfig getConfigFromXMLFile ( String xmlFilePath , boolean bFromCache , boolean bValidate ) { PmiModuleConfig config = null ; String modUID = getModuleUID ( xmlFilePath ) ; config = ( PmiModuleConfig ) moduleConfigs . get ( modUID ) ; if ( bFromCache ) { if ( config != null ) { return config ; } } else { if ( config != null ) { return config . copy ( ) ; } } if ( bEnableStatsTemplateLookup ) { int lookupCount = lookupList . size ( ) ; for ( int i = 0 ; i < lookupCount ; i ++ ) { config = ( ( StatsTemplateLookup ) lookupList . get ( i ) ) . getTemplate ( modUID ) ; if ( config != null ) break ; else { if ( modUID . startsWith ( DEFAULT_MODULE_PREFIX ) ) { config = ( ( StatsTemplateLookup ) lookupList . get ( i ) ) . getTemplate ( modUID . substring ( 26 ) ) ; if ( config != null ) break ; } } } if ( config != null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "StatsTemplateLookup available for: " + xmlFilePath ) ; config . setMbeanType ( "" ) ; moduleConfigs . put ( config . getUID ( ) , config ) ; if ( ! bFromCache ) return config . copy ( ) ; else return config ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "StatsTemplateLookup NOT available for: " + xmlFilePath ) ; } } final String _xmlFile = xmlFilePath ; final boolean _bDTDValidation = bValidate ; parseException = null ; try { config = ( PmiModuleConfig ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws Exception { return parser . parse ( _xmlFile , _bDTDValidation ) ; } } ) ; } catch ( PrivilegedActionException e ) { parseException = e . getException ( ) ; } if ( config != null ) { if ( bFromCache ) { config . setMbeanType ( "" ) ; moduleConfigs . put ( config . getUID ( ) , config ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Read PMI config for stats type: " + config . getUID ( ) ) ; return config ; } else return config . copy ( ) ; } else { return config ; } }
will parsed one more time
37,171
public static String getDataName ( String moduleName , int dataId ) { PmiModuleConfig config = PerfModules . getConfig ( moduleName ) ; if ( config == null ) return null ; PmiDataInfo info = config . getDataInfo ( dataId ) ; if ( info == null ) return null ; else return info . getName ( ) ; }
Convert data id to data name
37,172
public static int getDataId ( String moduleName , String dataName ) { PmiModuleConfig config = PerfModules . getConfig ( moduleName ) ; if ( dataName . indexOf ( '.' ) < 0 ) dataName = moduleName + "." + dataName ; if ( config != null ) return config . getDataId ( dataName ) ; else return - 1 ; }
Convert data name to dataId
37,173
public ConsumerDispatcherState getConsumerDispatcherState ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConsumerDispatcherState" ) ; SibTr . exit ( tc , "getConsumerDispatcherState" , _subState ) ; } return _subState ; }
Returns the subState .
37,174
private void deleteDurableSubscription ( boolean callProxyCode ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteDurableSubscription" , new Object [ ] { new Boolean ( callProxyCode ) } ) ; HashMap durableSubsTable = _destinationManager . getDurableSubscriptionsTable ( ) ; synchronized ( durableSubsTable ) { ConsumerDispatcher consumerDispatcher = ( ConsumerDispatcher ) durableSubsTable . get ( _subState . getSubscriberID ( ) ) ; if ( consumerDispatcher != null ) { if ( consumerDispatcher . dispatcherStateEquals ( _subState ) ) { durableSubsTable . remove ( _subState . getSubscriberID ( ) ) ; try { consumerDispatcher . deleteConsumerDispatcher ( callProxyCode ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.itemstreams.DurableSubscriptionItemStream.deleteDurableSubscription" , "1:626:1.95" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteDurableSubscription" , e ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteDurableSubscription" ) ; }
Deletes the durable subscription from the list of durable subscriptions and calls through to the consumer dispatcher to remove the subscription from the MatchSpace .
37,175
public static TraceComponent register ( Class < ? > aClass , String group ) { return register ( aClass , group , null ) ; }
Register the provided class with the trace service and assign it to the provided group name .
37,176
public static final void dump ( TraceComponent tc , String msg , Object obj ) { if ( obj != null && obj instanceof Object [ ] ) { com . ibm . websphere . ras . Tr . dump ( tc , msg , ( Object [ ] ) obj ) ; } else { com . ibm . websphere . ras . Tr . dump ( tc , msg , obj ) ; } }
Print the provided message if the input trace component allows dump level messages .
37,177
public static final void entry ( TraceComponent tc , String methodName , Object obj ) { if ( obj != null && obj instanceof Object [ ] ) { com . ibm . websphere . ras . Tr . entry ( tc , methodName , ( Object [ ] ) obj ) ; } else { com . ibm . websphere . ras . Tr . entry ( tc , methodName , obj ) ; } }
Print the provided message if the input trace component allows entry level messages .
37,178
public static final void error ( TraceComponent tc , String msg ) { com . ibm . websphere . ras . Tr . error ( tc , msg ) ; }
Print the provided message if the input trace component allows error level messages .
37,179
public static final void exit ( TraceComponent tc , String methodName , Object obj ) { com . ibm . websphere . ras . Tr . exit ( tc , methodName , obj ) ; }
Print the provided message if the input trace component allows exit level messages .
37,180
public String getID ( ) { byte [ ] genBytes = new byte [ this . outputSize ] ; synchronized ( this . generator ) { this . generator . nextBytes ( genBytes ) ; } String id = convertSessionIdBytesToSessionId ( genBytes , this . idLength ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getID: " + id ) ; } return id ; }
Request the next random ID field from the generator .
37,181
public MatchResponse merge ( MatchResponse matchResponse ) { if ( matchResponse == null || matchResponse == this ) { return this ; } else { boolean mergedSSLRequired = mergeSSLRequired ( matchResponse . isSSLRequired ( ) ) ; boolean mergedAccessPrecluded = mergeAccessPrecluded ( matchResponse . isAccessPrecluded ( ) ) ; List < String > mergedRoles = mergeRoles ( matchResponse . getRoles ( ) , mergedAccessPrecluded ) ; return new MatchResponse ( mergedRoles , mergedSSLRequired , mergedAccessPrecluded ) ; } }
Merges the roles sslRequired and accessPrecluded fields according to the Servlet 2 . 3 and 3 . 0 specifications .
37,182
protected boolean mergeSSLRequired ( boolean otherSSLRequired ) { boolean mergedSSLRequired = false ; if ( collectionMatch . isExactMatch ( ) ) { mergedSSLRequired = sslRequired && otherSSLRequired ; } else if ( collectionMatch . isPathMatch ( ) || collectionMatch . isExtensionMatch ( ) ) { mergedSSLRequired = sslRequired || otherSSLRequired ; } return mergedSSLRequired ; }
Merges the sslRequired fields .
37,183
private void _publishManagedBeanDestroyerListener ( FacesContext facesContext ) { ExternalContext externalContext = facesContext . getExternalContext ( ) ; Map < String , Object > applicationMap = externalContext . getApplicationMap ( ) ; applicationMap . put ( ManagedBeanDestroyerListener . APPLICATION_MAP_KEY , _detroyerListener ) ; }
Publishes the ManagedBeanDestroyerListener instance in the application map . This allows the FacesConfigurator to access the instance and to set the correct ManagedBeanDestroyer instance on it .
37,184
public void setFacesInitializer ( FacesInitializer facesInitializer ) { if ( _facesInitializer != null && _facesInitializer != facesInitializer && _servletContext != null ) { _facesInitializer . destroyFaces ( _servletContext ) ; } _facesInitializer = facesInitializer ; if ( _servletContext != null ) { facesInitializer . initFaces ( _servletContext ) ; } }
configure the faces initializer
37,185
private void dispatchInitializationEvent ( ServletContextEvent event , int operation ) { if ( operation == FACES_INIT_PHASE_PREINIT ) { if ( ! loadFacesInitPluginsJDK6 ( ) ) { loadFacesInitPluginsJDK5 ( ) ; } } List < StartupListener > pluginEntries = ( List < StartupListener > ) _servletContext . getAttribute ( FACES_INIT_PLUGINS ) ; if ( pluginEntries == null ) { return ; } for ( StartupListener initializer : pluginEntries ) { log . info ( "Processing plugin" ) ; switch ( operation ) { case FACES_INIT_PHASE_PREINIT : initializer . preInit ( event ) ; break ; case FACES_INIT_PHASE_POSTINIT : initializer . postInit ( event ) ; break ; case FACES_INIT_PHASE_PREDESTROY : initializer . preDestroy ( event ) ; break ; default : initializer . postDestroy ( event ) ; break ; } } log . info ( "Processing MyFaces plugins done" ) ; }
the central initialisation event dispatcher which calls our listeners
37,186
public void unsetAsynchConsumer ( boolean stoppable ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException , SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "unsetAsynchConsumer" ) ; if ( sessionId == 0 ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "SESSION_ID_HAS_NOT_BEEN_SET_SICO1043" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".unsetAsyncConsumer" , CommsConstants . CONVERSATIONHELPERIMPL_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; throw e ; } CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( connectionObjectId ) ; request . putShort ( sessionId ) ; CommsByteBuffer reply = null ; try { reply = jfapExchange ( request , ( stoppable ? JFapChannelConstants . SEG_DEREGISTER_STOPPABLE_ASYNC_CONSUMER : JFapChannelConstants . SEG_DEREGISTER_ASYNC_CONSUMER ) , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; } catch ( SIConnectionLostException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Connection was lost" , e ) ; throw new SIConnectionDroppedException ( e . getMessage ( ) , e ) ; } try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_DEREGISTER_ASYNC_CONSUMER_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIIncorrectCallException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "unsetAsynchConsumer" ) ; }
Sends a request to unset the asynchronous consumer .
37,187
public void setAsynchConsumer ( AsynchConsumerCallback consumer , int maxActiveMessages , long messageLockExpiry , int maxBatchSize , OrderingContext orderContext , int maxSequentialFailures , long hiddenMessageDelay , boolean stoppable ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException , SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setAsynchConsumer" , new Object [ ] { consumer , maxActiveMessages , messageLockExpiry , maxBatchSize , orderContext , maxSequentialFailures , hiddenMessageDelay , stoppable } ) ; if ( sessionId == 0 ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "SESSION_ID_HAS_NOT_BEEN_SET_SICO1043" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".setAsyncConsumer" , CommsConstants . CONVERSATIONHELPERIMPL_02 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Session Id was 0" , e ) ; throw e ; } CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( connectionObjectId ) ; request . putShort ( sessionId ) ; if ( orderContext != null ) { request . putShort ( ( ( OrderingContextProxy ) orderContext ) . getId ( ) ) ; } else { request . putShort ( CommsConstants . NO_ORDER_CONTEXT ) ; } request . putShort ( proxyQueueId ) ; request . putInt ( maxActiveMessages ) ; request . putLong ( messageLockExpiry ) ; request . putInt ( maxBatchSize ) ; int JFapSegmentId = JFapChannelConstants . SEG_REGISTER_ASYNC_CONSUMER ; if ( stoppable ) { request . putInt ( maxSequentialFailures ) ; request . putLong ( hiddenMessageDelay ) ; JFapSegmentId = JFapChannelConstants . SEG_REGISTER_STOPPABLE_ASYNC_CONSUMER ; } CommsByteBuffer reply = null ; try { reply = jfapExchange ( request , JFapSegmentId , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; } catch ( SIConnectionLostException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Connection was lost" , e ) ; throw new SIConnectionDroppedException ( e . getMessage ( ) , e ) ; } try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_REGISTER_ASYNC_CONSUMER_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIIncorrectCallException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setAsynchConsumer" ) ; }
Sends a request to set the asynchronous consumer .
37,188
public void exchangeStop ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "exchangeStop" ) ; if ( sessionId == 0 ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "SESSION_ID_HAS_NOT_BEEN_SET_SICO1043" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".exchangeStop" , CommsConstants . CONVERSATIONHELPERIMPL_04 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; throw e ; } CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( connectionObjectId ) ; request . putShort ( sessionId ) ; final CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_STOP_SESS , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_STOP_SESS_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "exchangeStop" ) ; }
Sends a request to stop the session .
37,189
public void deleteMessages ( SIMessageHandle [ ] msgHandles , SITransaction tran , int priority ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIIncorrectCallException , SIMessageNotLockedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deleteMessages" , new Object [ ] { msgHandles , tran , priority } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) ) { CommsLightTrace . traceMessageIds ( tc , "DeleteMsgTrace" , msgHandles ) ; } if ( sessionId == 0 ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "SESSION_ID_HAS_NOT_BEEN_SET_SICO1043" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".deleteMessages" , CommsConstants . CONVERSATIONHELPERIMPL_08 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; throw e ; } if ( msgHandles == null ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "NULL_MESSAGE_IDS_PASSED_IN_SICO1044" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".deleteMessages" , CommsConstants . CONVERSATIONHELPERIMPL_09 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; throw e ; } CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( connectionObjectId ) ; request . putShort ( sessionId ) ; request . putSITransaction ( tran ) ; request . putSIMessageHandles ( msgHandles ) ; if ( tran == null ) { final CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_DELETE_SET , priority , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_DELETE_SET_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SILimitExceededException ( reply , err ) ; checkFor_SIIncorrectCallException ( reply , err ) ; checkFor_SIMessageNotLockedException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } } finally { if ( reply != null ) reply . release ( ) ; } } else { jfapSend ( request , JFapChannelConstants . SEG_DELETE_SET_NOREPLY , priority , true , ThrottlingPolicy . BLOCK_THREAD ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deleteMessages" ) ; }
Deletes a set of messages based on their IDs in the scope of a specific transaction .
37,190
public void setSessionId ( short sessionId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setSessionId" , "" + sessionId ) ; if ( this . sessionId == 0 && sessionId != 0 ) { this . sessionId = sessionId ; } else { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "SESSION_ID_HAS_ALREADY_BEEN_SET_SICO1045" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".setSessionId" , CommsConstants . CONVERSATIONHELPERIMPL_11 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setSessionId" ) ; }
This method will set the ID of the session that we will flow to the server to identify us .
37,191
public void get ( Object rootVal , MatchSpaceKey msg , EvalCache cache , Object contextValue , SearchResults result ) throws MatchingException , BadMessageFormatMatchingException { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "get" , new Object [ ] { rootVal , msg , cache , result } ) ; if ( result instanceof CacheingSearchResults ) ( ( CacheingSearchResults ) result ) . setMatcher ( vacantChild ) ; vacantChild . get ( null , msg , cache , contextValue , result ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "get" ) ; }
get delegates and also caches and reports whether there are any tests below this point in the tree .
37,192
public ContentMatcher remove ( Conjunction selector , MatchTarget object , InternTable subExpr , OrdinalPosition parentId ) throws MatchingException { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "remove" , "selector: " + selector + ", object: " + object ) ; vacantChild = vacantChild . remove ( selector , object , subExpr , ordinalPosition ) ; ContentMatcher result = this ; if ( vacantChild == null ) result = null ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "remove" , "result: " + result ) ; return result ; }
Remove just delegates
37,193
public int shrink ( ) { byte [ ] old = buf ; if ( pos == 0 ) { return 0 ; } int n = old . length - pos ; int m ; int p ; int s ; int l ; if ( n < origsize ) { buf = new byte [ origsize ] ; p = pos ; s = origsize - n ; l = old . length - p ; m = old . length - origsize ; pos = s ; } else { buf = new byte [ n ] ; p = pos ; s = 0 ; l = n ; m = old . length - l ; pos = 0 ; } System . arraycopy ( old , p , buf , s , l ) ; return m ; }
Shrink the buffer . This will reclaim currently unused space in the buffer reducing memory but potentially increasing the cost of resizing the buffer
37,194
public boolean isRRSTransactional ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , hexId ( ) + ":isRRSTransactional()=" + true ) ; } return true ; }
Indicate whether this TranWrapper is RRS transactional
37,195
protected Compiler createCompiler ( FacesContext context ) { Compiler compiler = new SAXCompiler ( ) ; compiler . setDevelopmentProjectStage ( context . isProjectStage ( ProjectStage . Development ) ) ; loadLibraries ( context , compiler ) ; loadDecorators ( context , compiler ) ; loadOptions ( context , compiler ) ; return compiler ; }
Creates the Facelet page compiler .
37,196
protected FaceletFactory createFaceletFactory ( FacesContext context , Compiler compiler ) { ExternalContext eContext = context . getExternalContext ( ) ; long refreshPeriod ; if ( context . isProjectStage ( ProjectStage . Production ) ) { refreshPeriod = WebConfigParamUtils . getLongInitParameter ( eContext , PARAMS_REFRESH_PERIOD , DEFAULT_REFRESH_PERIOD_PRODUCTION ) ; } else { refreshPeriod = WebConfigParamUtils . getLongInitParameter ( eContext , PARAMS_REFRESH_PERIOD , DEFAULT_REFRESH_PERIOD ) ; } ResourceResolver resolver = new DefaultResourceResolver ( ) ; ArrayList < String > classNames = new ArrayList < String > ( ) ; String faceletsResourceResolverClassName = WebConfigParamUtils . getStringInitParameter ( eContext , PARAMS_RESOURCE_RESOLVER , null ) ; List < String > resourceResolversFromAnnotations = RuntimeConfig . getCurrentInstance ( context . getExternalContext ( ) ) . getResourceResolvers ( ) ; if ( faceletsResourceResolverClassName != null ) { classNames . add ( faceletsResourceResolverClassName ) ; } if ( ! resourceResolversFromAnnotations . isEmpty ( ) ) { classNames . addAll ( resourceResolversFromAnnotations ) ; } if ( ! classNames . isEmpty ( ) ) { resolver = ClassUtils . buildApplicationObject ( ResourceResolver . class , classNames , resolver ) ; } _resourceResolver = resolver ; return new DefaultFaceletFactory ( compiler , resolver , refreshPeriod ) ; }
Creates a FaceletFactory instance using the specified compiler .
37,197
protected String getResponseContentType ( FacesContext context , String orig ) { String contentType = orig ; Map < Object , Object > m = context . getAttributes ( ) ; if ( m . containsKey ( "facelets.ContentType" ) ) { contentType = ( String ) m . get ( "facelets.ContentType" ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Facelet specified alternate contentType '" + contentType + "'" ) ; } } if ( contentType == null ) { contentType = "text/html" ; log . finest ( "ResponseWriter created had a null ContentType, defaulting to text/html" ) ; } return contentType ; }
Generate the content type
37,198
protected String getResponseEncoding ( FacesContext context , String orig ) { String encoding = orig ; Map < Object , Object > m = context . getAttributes ( ) ; Map < String , Object > sm = context . getExternalContext ( ) . getSessionMap ( ) ; if ( m . containsKey ( PARAM_ENCODING ) ) { encoding = ( String ) m . get ( PARAM_ENCODING ) ; if ( encoding != null && log . isLoggable ( Level . FINEST ) ) { log . finest ( "Facelet specified alternate encoding '" + encoding + "'" ) ; } sm . put ( CHARACTER_ENCODING_KEY , encoding ) ; } if ( encoding == null ) { encoding = context . getExternalContext ( ) . getRequestCharacterEncoding ( ) ; } if ( encoding == null ) { encoding = ( String ) sm . get ( CHARACTER_ENCODING_KEY ) ; if ( encoding != null && log . isLoggable ( Level . FINEST ) ) { log . finest ( "Session specified alternate encoding '" + encoding + "'" ) ; } } if ( encoding == null ) { encoding = DEFAULT_CHARACTER_ENCODING ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "ResponseWriter created had a null CharacterEncoding, defaulting to " + encoding ) ; } } return encoding ; }
Generate the encoding
37,199
protected void initialize ( FacesContext context ) { log . finest ( "Initializing" ) ; Compiler compiler = createCompiler ( context ) ; _faceletFactory = createFaceletFactory ( context , compiler ) ; ExternalContext eContext = context . getExternalContext ( ) ; _initializeBuffer ( eContext ) ; _initializeMode ( eContext ) ; _initializeContractMappings ( eContext ) ; MyfacesConfig mfConfig = MyfacesConfig . getCurrentInstance ( eContext ) ; if ( mfConfig . getComponentUniqueIdsCacheSize ( ) > 0 ) { String [ ] componentIdsCached = SectionUniqueIdCounter . generateUniqueIdCache ( "_" , mfConfig . getComponentUniqueIdsCacheSize ( ) ) ; eContext . getApplicationMap ( ) . put ( CACHED_COMPONENT_IDS , componentIdsCached ) ; } _viewPoolProcessor = ViewPoolProcessor . getInstance ( context ) ; log . finest ( "Initialization Successful" ) ; }
Initialize the ViewHandler during its first request .