idx
int64 0
165k
| question
stringlengths 73
4.15k
| target
stringlengths 5
918
| len_question
int64 21
890
| len_target
int64 3
255
|
|---|---|---|---|---|
160,500
|
private void setReady ( ) throws SINotPossibleInCurrentConfigurationException { // If we're not transacted no messages are recoverable Reliability unrecoverable = Reliability . ASSURED_PERSISTENT ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setReady" , this ) ; // If the consumer is transacted inform the CD what // recoverability is required. if ( _transacted ) unrecoverable = _unrecoverableOptions ; //set the ready state _ready = true ; if ( _keyGroup != null ) _keyGroup . groupReady ( ) ; //and inform the consumerDispatcher that we are ready _consumerKey . ready ( unrecoverable ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setReady" ) ; }
|
Change the Ready state to true
| 204
| 6
|
160,501
|
protected void unsetReady ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unsetReady" , this ) ; //set the ready state _ready = false ; if ( _keyGroup != null ) _keyGroup . groupNotReady ( ) ; // if consumerKey is null then it can't be already in ready state! if ( _consumerKey != null ) { //tell the consumerDispatcher that we are no longer ready _consumerKey . notReady ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unsetReady" ) ; }
|
Change the Ready state to false
| 159
| 6
|
160,502
|
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 .
| 125
| 64
|
160,503
|
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
| 87
| 25
|
160,504
|
@ Override 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 the new value is > previous value and // check if consumer is suspended and resume consumer. // But only do this if the message count is less than the curent active count if ( maxActiveMessages > _maxActiveMessages && maxActiveMessages < _currentActiveMessages ) { // If the consumer was suspended - reenable it if ( _consumerSuspended ) { // If this is part of an asynch callback we don't need to try and kick // off a new thread as the nextLocked will return us another message on // exit of the consumeMessages() method. if ( _runningAsynchConsumer ) { _consumerSuspended = false ; _suspendFlags &= ~ DispatchableConsumerPoint . SUSPEND_FLAG_ACTIVE_MSGS ; } // Otherwise perform a full resume else { resumeConsumer ( DispatchableConsumerPoint . SUSPEND_FLAG_ACTIVE_MSGS ) ; } } } else if ( maxActiveMessages <= _currentActiveMessages && ! _consumerSuspended ) { // If the maxActiveMessages has been set to something lower than the current active message // count, then suspend the consumer until the messages have been processed _consumerSuspended = true ; _suspendFlags |= DispatchableConsumerPoint . SUSPEND_FLAG_ACTIVE_MSGS ; } _maxActiveMessages = maxActiveMessages ; } // active message lock } // this lock finally { this . unlock ( ) ; } } // async lock if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setMaxActiveMessages" ) ; }
|
Update the max active messages field
| 457
| 6
|
160,505
|
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
| 224
| 23
|
160,506
|
public static RequestProbeTransformDescriptor getObjForInstrumentation ( String key ) { RequestProbeTransformDescriptor requestProbeTransformDescriptor = RequestProbeBCIManagerImpl . getRequestProbeTransformDescriptors ( ) . get ( key ) ; return requestProbeTransformDescriptor ; }
|
getObjForInstrumentation Returns TransformDescriptor with input parameters className methodName and methodDescription
| 70
| 21
|
160,507
|
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 ; // Work out once whether this map is default size so we can optimize // the matches method later on. _contextInfoContainsDefaultEntries = ( _contextInfo . size ( ) == 2 //&& //lohith liberty change // _contextInfo.containsKey(WlmClassifierConstants.CONTEXT_MAP_KEY) && /* _contextInfo.containsKey(ExitPointConstants.TYPE_NAME)*/ ) ; 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 .
| 465
| 35
|
160,508
|
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 ; // For the message to match the token the following must be true: // // * They must have the same BENP flag // * Both context maps must be of the same length // * They must be of size two. // * The values must be for the WLM Classifier and the MDB Type. // * The WLM classifiers must be equal in both maps. // // If all of these are true then we can batch and matches returns true. // // The value of the MDB type can be ignored as it is guaranteed to be the // same for any one MDB. // // If we have more than two items in the map then it contains other context // information - this other information may effect whether or not the messages // can be batched so we do not batch them. if ( canBeDeleted == _deleteMessagesWhenRead && _contextInfoContainsDefaultEntries && ( ctxInfo . size ( ) == _contextInfo . size ( ) ) // && // ctxInfo.containsKey(WlmClassifierConstants.CONTEXT_MAP_KEY) && /*ctxInfo.containsKey(ExitPointConstants.TYPE_NAME)*/ ) { //lohith liberty change /* Object WLMClassifier1 = _contextInfo.get(WlmClassifierConstants.CONTEXT_MAP_KEY); Object WLMClassifier2 = ctxInfo.get(WlmClassifierConstants.CONTEXT_MAP_KEY);*/ // doesMatch = (WLMClassifier1 != null) && (WLMClassifier1.equals (WLMClassifier2)); } 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 .
| 546
| 22
|
160,509
|
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 ) ; } // TODO: should be able to flip leak detection on or off }
|
This is used to provide the runtime configuration changes to an existing pool manager which is a small subset of the possible creation properties .
| 89
| 25
|
160,510
|
private synchronized static void initConfigs ( ) { for ( int i = 0 ; i < moduleIDs . length ; i ++ ) { // add module configs one by one //addModuleInfo(moduleIDs[i] + modulePrefix); // don't do validation since in pre-defined module getConfigFromXMLFile ( getXmlFileName ( modulePrefix + moduleIDs [ i ] ) , true , false ) ; } }
|
Init moduleConfigs with array moduleIDs - use modulePrefix because they are all websphere default PMI modules
| 93
| 24
|
160,511
|
public static PmiModuleConfig getConfig ( String moduleID ) { if ( moduleID == null ) return null ; PmiModuleConfig config = ( PmiModuleConfig ) moduleConfigs . get ( moduleID ) ; if ( config == null ) { // beanModule and com.ibm.websphere.pmi.xml.beanModule will work // if moduleID doesn't have a '.' then use pre-defined modulePrefix int hasDot = moduleID . indexOf ( ' ' ) ; if ( hasDot == - 1 ) { // not found in moduleConfigs; try as a pre-defined module // prepend com.ibm.websphere.pmi.xml. to moduleID String preDefinedMod = DEFAULT_MODULE_PREFIX + moduleID ; config = getConfigFromXMLFile ( getXmlFileName ( preDefinedMod ) , true , false ) ; } } if ( config == null ) { // input moduleID has '.' in it. use as it is // do validation since its NOT pre-defined module config = getConfigFromXMLFile ( getXmlFileName ( moduleID ) , true , true ) ; } return config ; }
|
return PmiModuleConfig for a given moduleID
| 260
| 10
|
160,512
|
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 ) ) // VELA //configs[i].getShortName().equals(moduleID)) return configs [ i ] ; } return null ; }
|
return the config for the moduleID
| 102
| 7
|
160,513
|
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
| 78
| 7
|
160,514
|
public static int getDataId ( String moduleName , String dataName ) { PmiModuleConfig config = PerfModules . getConfig ( moduleName ) ; // attach module name to it - this has to be consistent with the PMI xml config files // under com/ibm/websphere/pmi/xxModule.xml if ( dataName . indexOf ( ' ' ) < 0 ) dataName = moduleName + "." + dataName ; if ( config != null ) return config . getDataId ( dataName ) ; else return - 1 ; }
|
Convert data name to dataId
| 120
| 7
|
160,515
|
public ConsumerDispatcherState getConsumerDispatcherState ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConsumerDispatcherState" ) ; SibTr . exit ( tc , "getConsumerDispatcherState" , _subState ) ; } return _subState ; }
|
Returns the subState .
| 84
| 5
|
160,516
|
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 ) { // Get the consumerDispatcher from the durable subscriptions table ConsumerDispatcher consumerDispatcher = ( ConsumerDispatcher ) durableSubsTable . get ( _subState . getSubscriberID ( ) ) ; //If entire topicspace has been deleted, the subscription will have already //been removed. if ( consumerDispatcher != null ) { // Check if the subscription from the durable subscriptions table is this // subscription. Its possible that the topicspace this subscription was on // was deleted and a new subscription with the same id has been added into // the table if ( consumerDispatcher . dispatcherStateEquals ( _subState ) ) { // Remove consumerDispatcher from durable subscriptions table durableSubsTable . remove ( _subState . getSubscriberID ( ) ) ; // Delete consumerDispatcher ( implicit remove from matchspace) try { // Don't need to send the proxy delete event message // just need to reset the memory to the stat 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 ) ; // Could not delete consumer dispatcher 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 .
| 479
| 27
|
160,517
|
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 .
| 29
| 17
|
160,518
|
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 .
| 87
| 14
|
160,519
|
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 .
| 90
| 14
|
160,520
|
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 .
| 36
| 14
|
160,521
|
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 .
| 43
| 14
|
160,522
|
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 .
| 103
| 10
|
160,523
|
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 .
| 119
| 26
|
160,524
|
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 .
| 87
| 8
|
160,525
|
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 .
| 79
| 42
|
160,526
|
public void setFacesInitializer ( FacesInitializer facesInitializer ) // TODO who uses this method? { if ( _facesInitializer != null && _facesInitializer != facesInitializer && _servletContext != null ) { _facesInitializer . destroyFaces ( _servletContext ) ; } _facesInitializer = facesInitializer ; if ( _servletContext != null ) { facesInitializer . initFaces ( _servletContext ) ; } }
|
configure the faces initializer
| 101
| 6
|
160,527
|
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 ; } //now we process the plugins for ( StartupListener initializer : pluginEntries ) { log . info ( "Processing plugin" ) ; //for now the initializers have to be stateless to //so that we do not have to enforce that the initializer //must be serializable 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
| 284
| 10
|
160,528
|
public void unsetAsynchConsumer ( boolean stoppable ) //SIB0115d.comms throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException , SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "unsetAsynchConsumer" ) ; if ( sessionId == 0 ) { // If the session Id = 0, then no one called setSessionId(). As such we are unable to flow // to the server as we do not know which session to instruct the server to use. 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 ( ) ; // Connection object id request . putShort ( connectionObjectId ) ; // Consumer session id request . putShort ( sessionId ) ; // Pass on call to server CommsByteBuffer reply = null ; try { reply = jfapExchange ( request , ( stoppable ? JFapChannelConstants . SEG_DEREGISTER_STOPPABLE_ASYNC_CONSUMER : JFapChannelConstants . SEG_DEREGISTER_ASYNC_CONSUMER ) , //SIB0115d.comms JFapChannelConstants . PRIORITY_MEDIUM , true ) ; } catch ( SIConnectionLostException e ) { // No FFDC Code needed // Converting this to a connection dropped as that is all we can throw if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Connection was lost" , e ) ; throw new SIConnectionDroppedException ( e . getMessage ( ) , e ) ; } // Confirm appropriate data returned 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 .
| 748
| 11
|
160,529
|
public void exchangeStop ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "exchangeStop" ) ; if ( sessionId == 0 ) { // If the session Id = 0, then no one called setSessionId(). As such we are unable to flow // to the server as we do not know which session to instruct the server to use. 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 ( ) ; // Connection object id request . putShort ( connectionObjectId ) ; // Consumer session id request . putShort ( sessionId ) ; // Pass on call to server final CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_STOP_SESS , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; // Confirm appropriate data returned 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 .
| 595
| 9
|
160,530
|
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 { // If the session Id is being set twice this is badness. The conversation helper is // associated one to one to a proxy queue, that in turn is associated one to one with a // consumer session. They aren't re-used, so calling this twice indicates some bug. 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 .
| 307
| 20
|
160,531
|
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 .
| 146
| 19
|
160,532
|
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
| 144
| 3
|
160,533
|
public int shrink ( ) { byte [ ] old = buf ; if ( pos == 0 ) { return 0 ; // nothing to do } 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
| 154
| 27
|
160,534
|
@ Override public boolean isRRSTransactional ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , hexId ( ) + ":isRRSTransactional()=" + true ) ; } return true ; }
|
Indicate whether this TranWrapper is RRS transactional
| 66
| 13
|
160,535
|
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 .
| 75
| 8
|
160,536
|
protected FaceletFactory createFaceletFactory ( FacesContext context , Compiler compiler ) { ExternalContext eContext = context . getExternalContext ( ) ; // refresh period 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 ) ; } // resource resolver 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 .
| 375
| 12
|
160,537
|
protected String getResponseContentType ( FacesContext context , String orig ) { String contentType = orig ; // see if we need to override the contentType 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 + "'" ) ; } } // safety check if ( contentType == null ) { contentType = "text/html" ; log . finest ( "ResponseWriter created had a null ContentType, defaulting to text/html" ) ; } return contentType ; }
|
Generate the content type
| 170
| 5
|
160,538
|
protected String getResponseEncoding ( FacesContext context , String orig ) { String encoding = orig ; // see if we need to override the encoding Map < Object , Object > m = context . getAttributes ( ) ; Map < String , Object > sm = context . getExternalContext ( ) . getSessionMap ( ) ; // 1. check the request attribute 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 ) ; } // 2. get it from request if ( encoding == null ) { encoding = context . getExternalContext ( ) . getRequestCharacterEncoding ( ) ; } // 3. get it from the session if ( encoding == null ) { encoding = ( String ) sm . get ( CHARACTER_ENCODING_KEY ) ; if ( encoding != null && log . isLoggable ( Level . FINEST ) ) { log . finest ( "Session specified alternate encoding '" + encoding + "'" ) ; } } // 4. default it 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
| 342
| 4
|
160,539
|
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 ) ; // Create a component ids cache and store it on application map to // reduce the overhead associated with create such ids over and over. 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 .
| 250
| 10
|
160,540
|
private Facelet _getFacelet ( FacesContext context , String viewId ) throws IOException { // grab our FaceletFactory and create a Facelet FaceletFactory . setInstance ( _faceletFactory ) ; try { return _faceletFactory . getFacelet ( context , viewId ) ; } finally { FaceletFactory . setInstance ( null ) ; } }
|
Gets the Facelet representing the specified view identifier .
| 77
| 11
|
160,541
|
@ Override protected void retrieveBundleContext ( ) { BundleContext bc = TxBundleTools . getBundleContext ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "retrieveBundleContext from TxBundleTools, bc " + bc ) ; if ( bc == null ) { bc = EmbeddableTxBundleTools . getBundleContext ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "retrieveBundleContext from EmbeddableTxBundleTools, bc " + bc ) ; } _bc = bc ; }
|
This method retrieves bundle context from the the ws . tx . embeddable bundle so that if that bundle has started before the tx . jta bundle then we are still able to access the Service Registry .
| 132
| 43
|
160,542
|
public synchronized void setRequestBufferSize ( int size ) { if ( size <= 0 ) { throw new IllegalArgumentException ( "request buffer size must be greater than zero" ) ; } if ( this . requestBuffer . size ( ) != 0 ) { throw new IllegalStateException ( "cannot resize non-empty ThreadPool request buffer" ) ; } this . requestBuffer = new BoundedBuffer ( size ) ; requestBufferInitialCapacity_ = size ; requestBufferExpansionLimit_ = requestBufferInitialCapacity_ * 10 ; }
|
Sets the size of the request buffer . If work has been dispatched on this thread pool the behavior of this method and all subsequent calls to this pool are undefined .
| 113
| 33
|
160,543
|
@ Deprecated protected void addThread ( Runnable command ) { Worker worker ; if ( _isDecoratedZOS ) // 331761A worker = new DecoratedZOSWorker ( command , threadid ++ ) ; // 331761A else // 331761A worker = new Worker ( command , threadid ++ ) ; // LIDB1855-58 // D527355.3 - If the current thread is an application thread, then the // creation of a new thread will copy the application class loader as the // context class loader. If the new thread is long-lived in this pool, the // application class loader will be leaked. if ( contextClassLoader != null && THREAD_CONTEXT_ACCESSOR . getContextClassLoader ( worker ) != contextClassLoader ) { THREAD_CONTEXT_ACCESSOR . setContextClassLoader ( worker , contextClassLoader ) ; } Thread . interrupted ( ) ; // PK27301 threads_ . put ( worker , worker ) ; ++ poolSize_ ; ++ activeThreads ; // PK77809 Tell the buffer that we have created a new thread waiting for // work if ( command == null ) { requestBuffer . incrementWaitingThreads ( ) ; } // must fire before it is started fireThreadCreated ( poolSize_ ) ; try { worker . start ( ) ; } catch ( OutOfMemoryError error ) { // 394200 - If an OutOfMemoryError is thrown because too many threads // have already been created, undo everything we've done. // Alex Ffdc.log(error, this, ThreadPool.class.getName(), "626"); // // D477704.2 threads_ . remove ( worker ) ; -- poolSize_ ; -- activeThreads ; fireThreadDestroyed ( poolSize_ ) ; throw error ; } }
|
Create and start a thread to handle a new command . Call only when holding lock .
| 387
| 17
|
160,544
|
@ Deprecated public int createThreads ( int numberOfThreads ) { int ncreated = 0 ; for ( int i = 0 ; i < numberOfThreads ; ++ i ) { synchronized ( this ) { if ( poolSize_ < maximumPoolSize_ ) { addThread ( null ) ; ++ ncreated ; } else break ; } } return ncreated ; }
|
Create and start up to numberOfThreads threads in the pool . Return the number created . This may be less than the number requested if creating more would exceed maximum pool size bound .
| 78
| 37
|
160,545
|
@ Deprecated protected synchronized void workerDone ( Worker w , boolean taskDied ) { threads_ . remove ( w ) ; if ( taskDied ) { -- activeThreads ; -- poolSize_ ; } if ( poolSize_ == 0 && shutdown_ ) { maximumPoolSize_ = minimumPoolSize_ = 0 ; // disable new threads notifyAll ( ) ; // notify awaitTerminationAfterShutdown } fireThreadDestroyed ( poolSize_ ) ; }
|
Cleanup method called upon termination of worker thread .
| 97
| 10
|
160,546
|
@ Deprecated protected Runnable getTask ( boolean oldThread ) throws InterruptedException { // PK77809 long waitTime ; Runnable r = null ; boolean firstTime = true ; while ( true ) { synchronized ( this ) { // System.out.println("1 " + activeThreads + " : " + poolSize_); if ( firstTime ) { -- activeThreads ; // PK77809 Let the buffer know we have a waiting thread if ( oldThread ) { requestBuffer . incrementWaitingThreads ( ) ; } } if ( poolSize_ > maximumPoolSize_ ) { // Cause to die if too many threads if ( ! growasneeded || ! firstTime ) { // System.out.println("2 die"); -- poolSize_ ; // PK77809 Let the buffer know we have a waiting thread requestBuffer . decrementWaitingThreads ( ) ; return null ; } } // infinite timeout if we are below the minimum size waitTime = ( shutdown_ ) ? 0 : ( poolSize_ <= minimumPoolSize_ ) ? - 1 : keepAliveTime_ ; } // PK27301 start try { r = ( waitTime >= 0 ) ? ( Runnable ) ( requestBuffer . poll ( waitTime ) ) : ( Runnable ) ( requestBuffer . take ( ) ) ; } catch ( InterruptedException e ) { ++ activeThreads ; // PK77809 Let the buffer know we have a waiting thread synchronized ( this ) { requestBuffer . decrementWaitingThreads ( ) ; } ; throw e ; } // PK27301 end synchronized ( this ) { // System.out.println("3 r=" + r); if ( r == null ) { r = ( Runnable ) requestBuffer . poll ( 0 ) ; } if ( r != null ) { ++ activeThreads ; break ; } else if ( poolSize_ > minimumPoolSize_ ) { // discount the current thread // System.out.println("4 die"); poolSize_ -- ; // PK77809 Signal the buffer we have removed a thread requestBuffer . decrementWaitingThreads ( ) ; break ; } // System.out.println("going again"); } firstTime = false ; } return r ; }
|
Get a task from the handoff queue or null if shutting down .
| 471
| 14
|
160,547
|
public void setDecoratedZOS ( ) { // 331761A if ( xMemSetupThread == null ) { try { final Class xMemCRBridgeClass = Class . forName ( "com.ibm.ws390.xmem.XMemCRBridgeImpl" ) ; xMemSetupThread = xMemCRBridgeClass . getMethod ( "setupThreadStub" , new Class [ ] { java . lang . Object . class } ) ; } catch ( Throwable t ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Unexpected exception caught accessing XMemCRBridgeImpl.setupThreadStub" , t ) ; // Alex Ffdc.log(t, this, "com.ibm.ws.util.ThreadPool.setDecoratedZOS", // "893"); // D477704.2 } } if ( xMemSetupThread != null ) { _isDecoratedZOS = true ; } }
|
sets this thread pool to create threads which are decorated via setupThreadStub
| 208
| 15
|
160,548
|
public void executeOnDaemon ( Runnable command ) { int id = 0 ; final Runnable commandToRun = command ; synchronized ( this ) { this . daemonId ++ ; id = this . daemonId ; } final String runId = name + " : DMN" + id ; // d185137.2 Thread t = ( Thread ) AccessController . doPrivileged ( new PrivilegedAction ( ) { // d185137.2 public Object run ( ) { // return new Thread(commandToRun); // d185137.2 Thread temp = new Thread ( commandToRun , runId ) ; // d185137.2 temp . setDaemon ( true ) ; return temp ; } } ) ; t . start ( ) ; }
|
Dispatch work on a daemon thread . This thread is not accounted for in the pool . There are no corresponding ThreadPoolListener events . There is no MonitorPlugin support .
| 158
| 33
|
160,549
|
public void execute ( Runnable command , int blockingMode ) throws InterruptedException , ThreadPoolQueueIsFullException , IllegalStateException { // D186668 execute ( command , blockingMode , 0 ) ; }
|
Arrange for the given command to be executed by a thread in this pool . The call s behavior when the pool and its internal request queue are at full capacity is determined by the blockingMode .
| 45
| 39
|
160,550
|
public Runnable execute ( Runnable command , long timeoutInMillis ) throws InterruptedException , IllegalStateException { try { return execute ( command , WAIT_WHEN_QUEUE_IS_FULL , timeoutInMillis ) ; } catch ( ThreadPoolQueueIsFullException e ) { // we should not get here. // Alex Ffdc.log(e, this, ThreadPool.class.getName(), "855"); // D477704.2 return null ; } }
|
Arrange for the given command to be executed by a thread in this pool . If the pools internal request buffer is full the call will block for at most timeoutInMillis milliseconds .
| 107
| 37
|
160,551
|
public void setMonitorPlugin ( MonitorPlugin plugin ) throws TooManyListenersException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "setMonitorPlugin" , plugin ) ; } if ( this . monitorPlugin != null && ! this . monitorPlugin . equals ( plugin ) ) { throw new TooManyListenersException ( "INTERNAL ERROR: ThreadPool.MonitorPlugin already set." ) ; } this . monitorPlugin = plugin ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "setMonitorPlugin" , plugin ) ; } }
|
Registers a MonitorPlugin with this thread pool . Only one plugin is supported in the current implementation .
| 147
| 20
|
160,552
|
public void checkAllThreads ( ) { // if nothing is plugged in, exit early if ( this . monitorPlugin == null ) { return ; } long currentTime = 0 ; // lazily initialize current time try { for ( Iterator i = this . threads_ . values ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Worker thread = ( Worker ) i . next ( ) ; synchronized ( thread ) { // d204471 if ( thread . getStartTime ( ) > 0 ) { if ( currentTime == 0 ) { currentTime = System . currentTimeMillis ( ) ; } if ( ! thread . isHung && this . monitorPlugin . checkThread ( thread , thread . threadNumber , currentTime - thread . getStartTime ( ) ) ) { // PK25446 thread . isHung = true ; } } } } this . lastThreadCheckDidntComplete = false ; // D222794 } catch ( ConcurrentModificationException e ) { // begin D222794 // NOTE: we can pretty much ignore this exception ... if // we occasionally fail on the check, we'll be OK. So // we simply keep track with a flag. If two consecutive // checks fail, then we'll log to FFDC if ( this . lastThreadCheckDidntComplete ) { // Alex Ffdc.log(e, this, this.getClass().getName(), "1181", this); // // D477704.2 } this . lastThreadCheckDidntComplete = true ; } // end D222794 }
|
Checks all active threads in this thread pool to determine if they are hung . The definition of hung is provided by the MonitorPlugin .
| 327
| 27
|
160,553
|
public FilterCellSlowStr findNextCell ( String nextValue ) { if ( nextCell == null ) { return null ; } return nextCell . get ( nextValue ) ; }
|
Find the next cell for a given string which may come after this cell in the address tree .
| 37
| 19
|
160,554
|
protected boolean invokeGeneratePluginCfgMBean ( ParseLoginAddress loginAddress , String clusterName , String targetPath , String option ) { boolean success = false ; try { success = connection . generatePluginConfig ( loginAddress , clusterName , targetPath , option ) ; if ( success ) success = copyFileToTargetPath ( loginAddress , clusterName , targetPath ) ; if ( success ) { if ( option . equalsIgnoreCase ( "server" ) ) { commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.complete.server" ) ) ; } else commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.complete.collective" ) ) ; } else if ( option . equalsIgnoreCase ( "server" ) ) { commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.fail.server" ) ) ; } else commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.fail.collective" ) ) ; } catch ( RuntimeMBeanException e ) { commandConsole . printlnErrorMessage ( getMessage ( "common.connectionError" , e . getMessage ( ) ) ) ; } catch ( UnknownHostException e ) { // java.net.UnknownHostException: bad host commandConsole . printlnErrorMessage ( getMessage ( "common.hostError" , loginAddress . getHost ( ) ) ) ; } catch ( ConnectException e ) { // java.net.ConnectException: bad port commandConsole . printlnErrorMessage ( getMessage ( "common.portError" , loginAddress . getPort ( ) ) ) ; } catch ( IOException e ) { // java.io.IOException: bad creds or some other IO error commandConsole . printlnErrorMessage ( getMessage ( "common.connectionError" , e . getMessage ( ) ) ) ; } catch ( Exception e ) { String msg = e . getMessage ( ) ; if ( msg != null ) { //int idx = e.getMessage().indexOf(MBEAN_NOT_PRESENT_MSG_ID); //if (idx > -1) { commandConsole . printlnInfoMessage ( getMessage ( "generateWebServerPluginTask.notEnabled" ) ) ; //} } commandConsole . printlnErrorMessage ( getMessage ( "common.connectionError" , e . getMessage ( ) ) ) ; } finally { try { connection . closeConnector ( ) ; } catch ( IOException e ) { // java.io.IOException: some other IO error commandConsole . printlnErrorMessage ( getMessage ( "common.connectionError" , e . getMessage ( ) ) ) ; } } return success ; }
|
Invokes MBean for generatePluginConfig to generate plugin configuration file
| 580
| 14
|
160,555
|
public static TraceFactory getTraceFactory ( NLS nls ) { return ( TraceFactory ) Utils . getImpl ( "com.ibm.ws.objectManager.utils.TraceFactoryImpl" , new Class [ ] { NLS . class } , new Object [ ] { nls } ) ; }
|
Create a platform specific TraceFactory instance .
| 67
| 8
|
160,556
|
public void setActiveTrace ( String activeNames , int traceLevel ) throws java . io . IOException { TraceFactory . activeNames = activeNames ; TraceFactory . traceLevel = traceLevel ; ; }
|
Specify what to trace and start tracing it .
| 43
| 10
|
160,557
|
protected void setSICoreConnection ( SICoreConnection connection ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setSICoreConnection" , connection ) ; //Retrieve Client Conversation State if necessary validateConversationState ( ) ; cConState . setSICoreConnection ( connection ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setSICoreConnection" ) ; }
|
Sets the SICoreConnection reference on the server
| 127
| 11
|
160,558
|
public Serializable copy ( Serializable obj ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "copy : " + Util . identity ( obj ) ) ; // ----------------------------------------------------------------------- // Optimize copyObject by special casing null, immutable objects, // and primitive arrays. All of these can be handled much more // efficiently than performing a 'deep' copy. d154342.7 // ----------------------------------------------------------------------- if ( obj == null ) { return obj ; } Class < ? > objType = obj . getClass ( ) ; // if the object is a primitive wrapper class, then return it. if ( ( objType == String . class ) || ( objType == Integer . class ) || ( objType == Long . class ) || ( objType == Boolean . class ) || ( objType == Byte . class ) || ( objType == Character . class ) || ( objType == Float . class ) || ( objType == Double . class ) || ( objType == Short . class ) ) { // Yes, so do nothing... return obj ; } Class < ? > componentType = objType . getComponentType ( ) ; // If this is an array of primitives take a clone instead of deep copy if ( componentType != null && componentType . isPrimitive ( ) ) { if ( componentType == boolean . class ) return ( ( boolean [ ] ) obj ) . clone ( ) ; if ( componentType == byte . class ) return ( ( byte [ ] ) obj ) . clone ( ) ; if ( componentType == char . class ) return ( ( char [ ] ) obj ) . clone ( ) ; if ( componentType == short . class ) return ( ( short [ ] ) obj ) . clone ( ) ; if ( componentType == int . class ) return ( ( int [ ] ) obj ) . clone ( ) ; if ( componentType == long . class ) return ( ( long [ ] ) obj ) . clone ( ) ; if ( componentType == float . class ) return ( ( float [ ] ) obj ) . clone ( ) ; if ( componentType == double . class ) return ( ( double [ ] ) obj ) . clone ( ) ; } // End d154342.7 if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "copy : making a deep copy" ) ; return copySerializable ( obj ) ; }
|
Make a copy of an object by writing it out to stream and reading it back again . This will make a deep copy of the object .
| 525
| 28
|
160,559
|
public ScheduleExpression copy ( ScheduleExpression schedule ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "copy ScheduleExpression: " + Util . identity ( schedule ) ) ; // 'schedule' could be a subclass of ScheduleExpression, so only // use the base class constructor if not a subclass. F743-21028.3 if ( schedule . getClass ( ) == ScheduleExpression . class ) { return copyBase ( schedule ) ; // 632906 } return ( ScheduleExpression ) copySerializable ( schedule ) ; }
|
Make a copy of a ScheduleExpression object .
| 133
| 10
|
160,560
|
public static ScheduleExpression copyBase ( ScheduleExpression schedule ) // d632906 { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "copy copyBase: " + Util . identity ( schedule ) ) ; // 'schedule' could be a subclass of ScheduleExpression. // Use only the base class constructor. return new ScheduleExpression ( ) . start ( schedule . getStart ( ) == null ? null : new Date ( schedule . getStart ( ) . getTime ( ) ) ) . end ( schedule . getEnd ( ) == null ? null : new Date ( schedule . getEnd ( ) . getTime ( ) ) ) . timezone ( schedule . getTimezone ( ) ) . second ( schedule . getSecond ( ) ) . minute ( schedule . getMinute ( ) ) . hour ( schedule . getHour ( ) ) . dayOfMonth ( schedule . getDayOfMonth ( ) ) . dayOfWeek ( schedule . getDayOfWeek ( ) ) . month ( schedule . getMonth ( ) ) . year ( schedule . getYear ( ) ) ; }
|
Make a copy of a javax . ejb . ScheduleExpression portion of the object .
| 244
| 21
|
160,561
|
BigInteger setMultiChoiceCount ( ) { if ( fields != null ) for ( int i = 0 ; i < fields . length ; i ++ ) multiChoiceCount = multiChoiceCount . multiply ( fields [ i ] . setMultiChoiceCount ( ) ) ; return multiChoiceCount ; }
|
Set the multiChoiceCount for this tuple
| 60
| 8
|
160,562
|
public JSVariant [ ] getDominatedVariants ( ) { if ( dominated == null ) { List dom = new ArrayList ( ) ; getDominatedVariants ( dom ) ; dominated = ( JSVariant [ ] ) dom . toArray ( new JSVariant [ 0 ] ) ; } return dominated ; }
|
Identify any variants that are descendents of this tuple either directly or via other tuples . Used in MessageMap construction .
| 67
| 25
|
160,563
|
public static ChainStartMode getKey ( int ordinal ) { if ( ordinal >= 0 && ordinal < _values . length ) { return _values [ ordinal ] ; } return null ; }
|
Get the chain start mode definition for this ordinal .
| 42
| 11
|
160,564
|
public static InjectionTarget getInjectionTarget ( ComponentNameSpaceConfiguration compNSConfig , ClientInjection injection ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getInjectionTarget: " + injection ) ; // Create a temporary InjectionBinding in order to resolve the target. ClientInjectionBinding binding = new ClientInjectionBinding ( compNSConfig , injection ) ; Class < ? > injectionType = binding . loadClass ( injection . getInjectionTypeName ( ) ) ; String targetName = injection . getTargetName ( ) ; String targetClassName = injection . getTargetClassName ( ) ; // Add a single injection target and then retrieve it. binding . addInjectionTarget ( injectionType , targetName , targetClassName ) ; InjectionTarget target = InjectionProcessorContextImpl . getInjectionTargets ( binding ) . get ( 0 ) ; binding . metadataProcessingComplete ( ) ; // d681767 if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getInjectionTarget: " + target ) ; return target ; }
|
Acquires an InjectionTarget for the specified ClientInjection .
| 269
| 14
|
160,565
|
protected ArrayList filterXidsByType ( Xid [ ] xidArray ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "filterXidsByType" , xidArray ) ; final ArrayList < XidImpl > xidList = new ArrayList < XidImpl > ( ) ; if ( xidArray != null ) { /*----------------------------------------------------------*/ /* Iterate over the list of returned xids, and insert them */ /* into a new list containing all the xids that have been */ /* recovered thus far. We don't have to worry about */ /* duplicates because every resource is guaranteed to have a */ /* unique bqual + gtrid combination. */ /*----------------------------------------------------------*/ for ( int y = 0 ; y < xidArray . length ; y ++ ) { // PQ56777 - Oracle can return entries with null in them. // normally(?) it will be the last in the list. It // appears to happen if an indoubt transaction on the // database completes during our call to recover. if ( xidArray [ y ] == null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "RM has returned null inDoubt Xid entry - " + y ) ; continue ; } /*------------------------------------------------------*/ /* We only want to add this Xid to our list if it is */ /* one that we generated. */ /*------------------------------------------------------*/ if ( XidImpl . isOurFormatId ( xidArray [ y ] . getFormatId ( ) ) ) { /*--------------------------------------------------*/ /* It is possible that the Xid we get back from the */ /* RM is actually an instance of our XidImpl. In */ /* the case that it's not, we have to re-construct */ /* the XidImpl so that we can extract the xid bytes. */ /*--------------------------------------------------*/ XidImpl ourXid = null ; if ( xidArray [ y ] instanceof XidImpl ) { ourXid = ( XidImpl ) xidArray [ y ] ; } else { ourXid = new XidImpl ( xidArray [ y ] ) ; // Check the bqual is one of ours... // as V5.1 also uses the same formatId but with // different length encoding if ( ourXid . getBranchQualifier ( ) . length != XidImpl . BQUAL_JTA_BQUAL_LENGTH ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Xid is wrong length - " + y ) ; continue ; } } xidList . add ( ourXid ) ; } /* if isOurFormatId() */ } /* for each Xid */ } /* if xidArray != null */ if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "filterXidsByType" , xidList ) ; return xidList ; }
|
Removes all non - WAS Xids from an array of Xids and puts them in an ArrayList structure .
| 621
| 23
|
160,566
|
protected ArrayList filterXidsByCruuidAndEpoch ( ArrayList xidList , byte [ ] cruuid , int epoch ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "filterXidsByCruuidAndEpoch" , new Object [ ] { xidList , cruuid , epoch } ) ; for ( int x = xidList . size ( ) - 1 ; x >= 0 ; x -- ) { final XidImpl ourXid = ( XidImpl ) xidList . get ( x ) ; final byte [ ] xidCruuid = ourXid . getCruuid ( ) ; final int xidEpoch = ourXid . getEpoch ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Trace other Cruuid: " + xidCruuid + ", or: " + Util . toHexString ( xidCruuid ) ) ; Tr . debug ( tc , "Trace my Cruuid: " + cruuid + ", or: " + Util . toHexString ( cruuid ) ) ; } if ( ( ! java . util . Arrays . equals ( cruuid , xidCruuid ) ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "filterXidsByCruuidAndEpoch: cruuid is different: " + ourXid . getCruuid ( ) ) ; xidList . remove ( x ) ; } else if ( xidEpoch >= epoch ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "filterXidsByCruuidAndEpoch: xid epoch is " + xidEpoch ) ; xidList . remove ( x ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "filterXidsByCruuidAndEpoch" , xidList ) ; return xidList ; }
|
Removes all Xids from an ArrayList that don t have our cruuid in their bqual . Assumes that all Xids are XidImpls .
| 421
| 33
|
160,567
|
protected boolean canWeForgetXid ( XidImpl ourXid , Xid [ ] knownXids ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "canWeForgetXid" , new Object [ ] { ourXid , knownXids } ) ; if ( tc . isDebugEnabled ( ) ) { // We are only called if knownXids != null for ( int i = 0 ; i < knownXids . length ; i ++ ) { Tr . debug ( tc , "tx xid[" + i + "] " + knownXids [ i ] ) ; } } boolean forgetMe = true ; /*----------------------------------------------------------------*/ /* Yank the parts of the JTA xid. The branch qualifier will be */ /* the full JTA branch qualifier, and will need to be shortened */ /* to the same length of the transaction bqual so that the array */ /* compare has a chance to complete successfully. */ /*----------------------------------------------------------------*/ final int jtaFormatId = ourXid . getFormatId ( ) ; final byte [ ] jtaGtrid = ourXid . getGlobalTransactionId ( ) ; final byte [ ] fullJtaBqual = ourXid . getBranchQualifier ( ) ; byte [ ] jtaBqual = null ; /*----------------------------------------------------------------*/ /* We have to separate the transaction gtrid and bqual for the */ /* array compares. These are places to store these items. */ /*----------------------------------------------------------------*/ int txnFormatId ; byte [ ] txnGtrid ; byte [ ] txnBqual ; /*----------------------------------------------------------------*/ /* Iterate over all the known XIDs (if there are none, we won't */ /* iterate over anything). */ /*----------------------------------------------------------------*/ int x = 0 ; while ( ( x < knownXids . length ) && ( forgetMe == true ) ) { /*------------------------------------------------------------*/ /* If this is the first XID, shorten the JTA bqual to the */ /* length of the transaction bqual. We are assuming here */ /* that all the transaction bquals are the same length. If */ /* they arent, for some reason, we will need to revisit this. */ /*------------------------------------------------------------*/ if ( x == 0 ) { final int bqualLength = ( knownXids [ x ] . getBranchQualifier ( ) ) . length ; jtaBqual = new byte [ bqualLength ] ; System . arraycopy ( fullJtaBqual , 0 , jtaBqual , 0 , bqualLength ) ; } /*------------------------------------------------------------*/ /* Separate the transaction XID into comparable units. */ /*------------------------------------------------------------*/ txnFormatId = knownXids [ x ] . getFormatId ( ) ; txnGtrid = knownXids [ x ] . getGlobalTransactionId ( ) ; txnBqual = knownXids [ x ] . getBranchQualifier ( ) ; /*------------------------------------------------------------*/ /* Compare the individual parts of the XID for equality. If */ /* they are equal, set a boolean value and we can stop */ /* checking. */ /*------------------------------------------------------------*/ if ( ( jtaFormatId == txnFormatId ) && ( java . util . Arrays . equals ( jtaGtrid , txnGtrid ) ) && ( java . util . Arrays . equals ( jtaBqual , txnBqual ) ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Xid has been matched to a transaction:" , ourXid ) ; } auditTransactionXid ( ourXid , knownXids [ x ] , getXAResourceInfo ( ) ) ; forgetMe = false ; } x ++ ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "canWeForgetXid" , forgetMe ) ; return forgetMe ; }
|
Iterates over the list of known Xids retrieved from transaction service and tries to match the given javax . transaction . xa . Xid with one of them .
| 814
| 35
|
160,568
|
private static void propogateSecureSession ( HttpServletRequest request , Message message ) { final String cipherSuite = ( String ) request . getAttribute ( SSL_CIPHER_SUITE_ATTRIBUTE ) ; if ( cipherSuite != null ) { final java . security . cert . Certificate [ ] certs = ( java . security . cert . Certificate [ ] ) request . getAttribute ( SSL_PEER_CERT_CHAIN_ATTRIBUTE ) ; message . put ( TLSSessionInfo . class , new TLSSessionInfo ( cipherSuite , null , certs ) ) ; } }
|
Propogate in the message a TLSSessionInfo instance representative of the TLS - specific information in the HTTP request .
| 132
| 24
|
160,569
|
private void cacheInput ( Message outMessage ) { if ( outMessage . getExchange ( ) == null ) { return ; } Message inMessage = outMessage . getExchange ( ) . getInMessage ( ) ; if ( inMessage == null ) { return ; } Object o = inMessage . get ( "cxf.io.cacheinput" ) ; DelegatingInputStream in = inMessage . getContent ( DelegatingInputStream . class ) ; if ( PropertyUtils . isTrue ( o ) ) { Collection < Attachment > atts = inMessage . getAttachments ( ) ; if ( atts != null ) { for ( Attachment a : atts ) { if ( a . getDataHandler ( ) . getDataSource ( ) instanceof AttachmentDataSource ) { try { ( ( AttachmentDataSource ) a . getDataHandler ( ) . getDataSource ( ) ) . cache ( inMessage ) ; } catch ( IOException e ) { throw new Fault ( e ) ; } } } } if ( in != null ) { in . cacheInput ( ) ; } } else if ( in != null ) { //We don't need to cache it, but we may need to consume it in order for the client // to be able to receive a response. (could be blocked sending) //However, also don't want to consume indefinitely. We'll limit to 16M. try { IOUtils . consume ( in , 16 * 1024 * 1024 ) ; } catch ( Exception ioe ) { //ignore } } }
|
On first write we need to make sure any attachments and such that are still on the incoming stream are read in . Otherwise we can get into a deadlock where the client is still trying to send the request but the server is trying to send the response . Neither side is reading and both blocked on full buffers . Not a good situation .
| 327
| 67
|
160,570
|
public static void processException ( Object source , Class sourceClass , String methodName , Throwable throwable , String probe , Object [ ] objects ) { if ( TraceComponent . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( cclass , "processException" , new Object [ ] { source , sourceClass , methodName , throwable , probe , objects } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && trace . isEventEnabled ( ) ) trace . event ( cclass , "processException" , throwable ) ; print ( source , sourceClass , methodName , throwable , probe , objects ) ; com . ibm . ws . ffdc . FFDCFilter . processException ( throwable , sourceClass . getName ( ) + ":" + methodName , probe , source , objects ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( cclass , "processException" ) ; }
|
Process an exception for a non static class .
| 219
| 9
|
160,571
|
static void print ( Object object , java . io . PrintWriter printWriter ) { if ( object instanceof Printable ) { ( ( Printable ) object ) . print ( printWriter ) ; } else { printWriter . print ( object ) ; } // if (object instanceof Printable). }
|
Dump an Object to a java . io . PrintWriter .
| 62
| 13
|
160,572
|
byte [ ] getServiceData ( ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getServiceData" , this ) ; // Check that the file is actually open if ( _activeFile == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getServiceData" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } final byte [ ] serviceData = _activeFile . getServiceData ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getServiceData" , RLSUtils . toHexString ( serviceData , RLSUtils . MAX_DISPLAY_BYTES ) ) ; return serviceData ; }
|
Package access method to return the current service data .
| 167
| 10
|
160,573
|
LogFileHeader logFileHeader ( ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logFileHeader" , this ) ; // Check that the file is actually open if ( _activeFile == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logFileHeader" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } final LogFileHeader logFileHeader = _activeFile . logFileHeader ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logFileHeader" , logFileHeader ) ; return logFileHeader ; }
|
Returns the LogFileHeader for the currently active log file .
| 145
| 12
|
160,574
|
ArrayList < ReadableLogRecord > recoveredRecords ( ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "recoveredRecords" , _recoveredRecords ) ; return _recoveredRecords ; }
|
Returns an array of ReadableLogRecords retrieved when the recovery log was opened .
| 52
| 17
|
160,575
|
void setServiceData ( byte [ ] serviceData ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setServiceData" , new java . lang . Object [ ] { RLSUtils . toHexString ( serviceData , RLSUtils . MAX_DISPLAY_BYTES ) , this } ) ; // Check that the files are available if ( ( _file1 == null ) || ( _file2 == null ) ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setServiceData" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } // Cache the service data buffer reference. This class logically 'owns' the buffer. _serviceData = serviceData ; // Pass the reference to the underlying log file objects. _file1 . setServiceData ( serviceData ) ; _file2 . setServiceData ( serviceData ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setServiceData" ) ; }
|
Package access method to replace the existing service data with the new service data .
| 228
| 15
|
160,576
|
protected void writeLogRecord ( LogRecord logRecord ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "writeLogRecord" , logRecord ) ; _activeFile . writeLogRecord ( logRecord ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeLogRecord" ) ; }
|
Do any necessary under the covers work to write the LogRecord .
| 74
| 13
|
160,577
|
public static Map < String , String > processArchiveManifest ( final JarFile jarFile ) throws Throwable { Map < String , String > manifestAttrs = null ; if ( jarFile != null ) { try { manifestAttrs = AccessController . doPrivileged ( new PrivilegedExceptionAction < Map < String , String > > ( ) { @ Override public Map < String , String > run ( ) throws ZipException , IOException { InputStream is = null ; Map < String , String > attrs = null ; try { // Read the manifest and access the manifest headers. is = jarFile . getInputStream ( jarFile . getEntry ( JarFile . MANIFEST_NAME ) ) ; attrs = ManifestProcessor . readManifestIntoMap ( ManifestProcessor . parseManifest ( is ) ) ; } finally { if ( is != null ) { InstallUtils . close ( is ) ; } } return attrs ; } } ) ; } catch ( PrivilegedActionException e ) { throw e . getCause ( ) ; } } return manifestAttrs ; }
|
Gets the archive file Manifest attributes as a String Map from a jar file .
| 229
| 16
|
160,578
|
public static Map < String , String > processArchiveManifest ( final File file ) throws Throwable { Map < String , String > manifestAttrs = null ; if ( file != null && file . isFile ( ) && ArchiveFileType . JAR . isType ( file . getPath ( ) ) ) { JarFile jarFile = null ; try { jarFile = new JarFile ( file ) ; manifestAttrs = processArchiveManifest ( jarFile ) ; } finally { if ( jarFile != null ) { InstallUtils . close ( jarFile ) ; } } } return manifestAttrs ; }
|
Gets the archive file Manifest attributes as a String Map from a file .
| 129
| 15
|
160,579
|
public static String getLicenseAgreement ( final JarFile jar , final Map < String , String > manifestAttrs ) { String licenseAgreement = null ; if ( manifestAttrs . isEmpty ( ) ) { return licenseAgreement ; } String licenseAgreementPrefix = manifestAttrs . get ( ArchiveUtils . LICENSE_AGREEMENT ) ; LicenseProvider licenseProvider = ( licenseAgreementPrefix != null ) ? ZipLicenseProvider . createInstance ( jar , licenseAgreementPrefix ) : null ; if ( licenseProvider != null ) licenseAgreement = new InstallLicenseImpl ( "" , LicenseType . UNSPECIFIED , licenseProvider ) . getAgreement ( ) ; return licenseAgreement ; }
|
Gets the license agreement for the jar file .
| 149
| 10
|
160,580
|
public void deactivate ( ComponentContext context ) { if ( contextRef . get ( ) == null ) { // Components are only deactivated if they activate successfully, // and component instances are discarded after being deactivated. // This is either DS or programmer error. throw new IllegalStateException ( "not activated" ) ; } this . contextRef . set ( null ) ; }
|
Deactivates the map . Will trigger a release of all held services .
| 77
| 15
|
160,581
|
public void init ( HttpInboundServiceContext sc ) { // for requests, we don't care about the validation setHeaderValidation ( false ) ; setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; }
|
Initialize this incoming HTTP request message .
| 63
| 8
|
160,582
|
public void init ( HttpOutboundServiceContext sc ) { // for requests, we don't care about the validation setHeaderValidation ( false ) ; setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; setVersion ( getServiceContext ( ) . getHttpConfig ( ) . getOutgoingVersion ( ) ) ; }
|
Initialize this outgoing HTTP request message .
| 86
| 8
|
160,583
|
public void init ( HttpInboundServiceContext sc , BNFHeaders hdrs ) { // for requests, we don't care about the validation setHeaderValidation ( false ) ; setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; if ( null != hdrs ) { hdrs . duplicate ( this ) ; } }
|
Initialize this incoming HTTP request message with specific headers ie . ones stored in a cache perhaps .
| 90
| 19
|
160,584
|
public void init ( HttpOutboundServiceContext sc , BNFHeaders hdrs ) { // for requests, we don't care about the validation setHeaderValidation ( false ) ; setOwner ( sc ) ; setBinaryParseState ( HttpInternalConstants . PARSING_BINARY_VERSION ) ; if ( null != hdrs ) { hdrs . duplicate ( this ) ; } setVersion ( getServiceContext ( ) . getHttpConfig ( ) . getOutgoingVersion ( ) ) ; }
|
Initialize this outgoing HTTP request message with specific headers ie . ones stored in a cache perhaps .
| 113
| 19
|
160,585
|
@ Override public WsByteBuffer [ ] encodePseudoHeaders ( ) { WsByteBuffer [ ] firstLine = new WsByteBuffer [ 1 ] ; firstLine [ 0 ] = allocateBuffer ( getOutgoingBufferSize ( ) ) ; LiteralIndexType indexType = LiteralIndexType . NOINDEXING ; //For the time being, there will be no indexing on the responses to guarantee //the write context is concurrent to the remote endpoint's read context. Remote //intermediaries could index if they so desire, so setting NoIndexing (as //opposed to NeverIndexing). //TODO: investigate how streams and priority can work together with indexing on //responses. //LiteralIndexType indexType = isPushPromise ? LiteralIndexType.NOINDEXING : LiteralIndexType.INDEX; //Corresponding dynamic table H2HeaderTable table = this . getH2HeaderTable ( ) ; //Current encoded pseudo-header byte [ ] encodedHeader = null ; try { //Encode the Method encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . METHOD , this . myMethod . toString ( ) , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; //Encode Scheme encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . SCHEME , this . myScheme . toString ( ) , indexType ) ; this . myScheme . toString ( ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; //Encode Authority if ( this . sUrlHost != null ) { // TODO: should the iUrlPort be added here? encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . AUTHORITY , this . sUrlHost , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; } //Encode Path encodedHeader = H2Headers . encodeHeader ( table , HpackConstants . PATH , this . myURIString , indexType ) ; firstLine = putBytes ( encodedHeader , firstLine ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . error ( tc , e . getMessage ( ) ) ; } return null ; } // don't flip the last buffer as headers get tacked on the end if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { String url = GenericUtils . nullOutPasswords ( getMarshalledSecondToken ( ) , ( byte ) ' ' ) ; Tr . event ( tc , "Encoding first line: " + getMethod ( ) + " " + url + " " + getVersion ( ) ) ; } return firstLine ; }
|
of the first line .
| 610
| 5
|
160,586
|
@ Override public void setMethod ( String method ) throws UnsupportedMethodException { MethodValues val = MethodValues . match ( method , 0 , method . length ( ) ) ; if ( null == val ) { throw new UnsupportedMethodException ( "Illegal method " + method ) ; } setMethod ( val ) ; }
|
Set the method of this request to the given String if it is valid .
| 68
| 15
|
160,587
|
@ Override public void setMethod ( MethodValues method ) { this . myMethod = method ; super . setFirstLineChanged ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "setMethod(v): " + ( null != method ? method . getName ( ) : null ) ) ; } }
|
Set the request method to the given value .
| 83
| 9
|
160,588
|
@ Override final public String getRequestURI ( ) { if ( null == this . myURIString ) { this . myURIString = GenericUtils . getEnglishString ( this . myURIBytes ) ; } return this . myURIString ; }
|
Query the value of the request URI .
| 53
| 8
|
160,589
|
private String getTargetHost ( ) { String host = getVirtualHost ( ) ; if ( null == host ) { host = ( isIncoming ( ) ) ? getServiceContext ( ) . getLocalAddr ( ) . getCanonicalHostName ( ) : getServiceContext ( ) . getRemoteAddr ( ) . getCanonicalHostName ( ) ; } return host ; }
|
Find the target host of the request . This checks the VirtualHost data but falls back on the socket layer target if need be .
| 83
| 26
|
160,590
|
private int getTargetPort ( ) { int port = getVirtualPort ( ) ; if ( NOTSET == port ) { port = ( isIncoming ( ) ) ? getServiceContext ( ) . getLocalPort ( ) : getServiceContext ( ) . getRemotePort ( ) ; } return port ; }
|
Find the target port of the request . This checks the VirtualPort data and falls back on the socket port information if need be .
| 64
| 26
|
160,591
|
@ Override public int getVirtualPort ( ) { if ( HeaderStorage . NOTSET != this . iUrlPort ) { // use the port from the parsed URL return this . iUrlPort ; } if ( NOT_PRESENT <= this . iHdrPort ) { // already searched the header value and either found it or not, // either way, return what we saved return this . iHdrPort ; } // need to extract the value from the header byte [ ] host = getHeader ( HttpHeaderKeys . HDR_HOST ) . asBytes ( ) ; if ( null == host || host . length == 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: No/empty host header" ) ; } return - 1 ; } // default to not_present now this . iHdrPort = NOT_PRESENT ; int start = - 1 ; if ( LEFT_BRACKET == host [ 0 ] ) { // IPV6 IP address start = GenericUtils . byteIndexOf ( host , RIGHT_BRACKET , 0 ) ; if ( - 1 == start ) { // invalid IP if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: Invalid IPV6 ip in host header" ) ; } return - 1 ; } start ++ ; // skip past the bracket } else { // everything but an IPV6 IP start = GenericUtils . byteIndexOf ( host , BNFHeaders . COLON , 0 ) ; } if ( - 1 == start || host . length <= start || BNFHeaders . COLON != host [ start ] ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: No port in host header" ) ; } return - 1 ; } start ++ ; // skip past the colon int length = host . length - start ; if ( 0 >= length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: No port after colon" ) ; } return - 1 ; } try { // PK14634 - cache the parsed port this . iHdrPort = GenericUtils . asIntValue ( host , start , length ) ; } catch ( NumberFormatException nfe ) { // no FFDC required if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: Invalid port value: " + HttpChannelUtils . getEnglishString ( host , start , length ) ) ; } return - 1 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getVirtualPort: returning " + this . iHdrPort ) ; } return this . iHdrPort ; }
|
Query the target port of this request . It will first check for a port in the URL string and if not found it will check the Host header . This will return - 1 if it is not found in either spot .
| 660
| 44
|
160,592
|
private void parseURI ( byte [ ] data , int start ) { // at this point, we're parsing /URI [?querystring] if ( start >= data . length ) { // PK22096 - default to "/" if not found, should have caught empty // string inputs previously (http://host:port is valid) this . myURIBytes = SLASH ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Defaulting to slash since no URI data found" ) ; } return ; } int uri_end = data . length ; for ( int i = start ; i < data . length ; i ++ ) { // look for the query string marker if ( ' ' == data [ i ] ) { uri_end = i ; break ; } } // save off the URI if ( start == uri_end ) { // no uri found throw new IllegalArgumentException ( "Missing URI: " + GenericUtils . getEnglishString ( data ) ) ; } if ( 0 == start && uri_end == data . length ) { this . myURIBytes = data ; } else { this . myURIBytes = new byte [ uri_end - start ] ; System . arraycopy ( data , start , this . myURIBytes , 0 , this . myURIBytes . length ) ; uri_end ++ ; // jump past the '?' if ( uri_end < data . length ) { // save off the query string data byte [ ] query = new byte [ data . length - uri_end ] ; System . arraycopy ( data , uri_end , query , 0 , query . length ) ; setQueryString ( query ) ; } } }
|
Parse the URI information out of the input data along with any query information found afterwards . If format errors are found then an exception is thrown .
| 363
| 29
|
160,593
|
private void parseScheme ( byte [ ] data ) { // we know the first character is correct, find the colon for ( int i = 1 ; i < data . length ; i ++ ) { if ( ' ' == data [ i ] ) { SchemeValues val = SchemeValues . match ( data , 0 , i ) ; if ( null == val ) { throw new IllegalArgumentException ( "Invalid scheme inside URL: " + GenericUtils . getEnglishString ( data ) ) ; } setScheme ( val ) ; // scheme should be followed by "://" if ( ( i + 2 ) >= data . length || ( ' ' != data [ i + 1 ] || ' ' != data [ i + 2 ] ) ) { throw new IllegalArgumentException ( "Invalid net_path: " + GenericUtils . getEnglishString ( data ) ) ; } parseAuthority ( data , i + 3 ) ; return ; } } // no colon found throw new IllegalArgumentException ( "Invalid scheme in URL: " + GenericUtils . getEnglishString ( data ) ) ; }
|
Parse the scheme marker out of the input data and then start the parse for the next section . If any errors are encountered then an exception is thrown .
| 229
| 31
|
160,594
|
@ Override public void setRequestURI ( byte [ ] uri ) { if ( null == uri || 0 == uri . length ) { throw new IllegalArgumentException ( "setRequestURI: null input" ) ; } super . setFirstLineChanged ( ) ; if ( ' ' == uri [ 0 ] ) { // URI of "*" can only be one character long to be valid if ( 1 != uri . length && ' ' != uri [ 1 ] ) { String value = GenericUtils . getEnglishString ( uri ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setRequestURI: invalid uri [" + value + "]" ) ; } throw new IllegalArgumentException ( "Invalid uri: " + value ) ; } } else if ( ' ' != uri [ 0 ] ) { String value = GenericUtils . getEnglishString ( uri ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setRequestURI: invalid uri [" + value + "]" ) ; } throw new IllegalArgumentException ( "Invalid uri: " + value ) ; } initScheme ( ) ; this . myURIString = null ; this . sUrlHost = null ; this . iUrlPort = HeaderStorage . NOTSET ; this . myQueryBytes = null ; this . queryParams = null ; parseURI ( uri , 0 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setRequestURI: set URI to " + getRequestURI ( ) ) ; } }
|
Allow the user to set the URI in the HttpRequest to the given byte array prior to sending the request .
| 380
| 23
|
160,595
|
public void initScheme ( ) { // set the scheme based on whether the socket is secure or not if ( null == getServiceContext ( ) || null == getServiceContext ( ) . getTSC ( ) ) { // discrimination path, not ready for this yet return ; } if ( getServiceContext ( ) . isSecure ( ) ) { this . myScheme = SchemeValues . HTTPS ; } else { this . myScheme = SchemeValues . HTTP ; } }
|
Initialize the scheme information based on the socket being secure or not .
| 99
| 14
|
160,596
|
@ Override public String getScheme ( ) { // if it hasn't been set yet, then check whether the SC is secure // or not and set the value accordingly if ( null == this . myScheme ) { initScheme ( ) ; } if ( null == this . myScheme ) { // if the request has been already destroyed then it will be still null return null ; } return this . myScheme . getName ( ) ; }
|
Query the value of the scheme .
| 95
| 7
|
160,597
|
@ Override public void setScheme ( SchemeValues scheme ) { this . myScheme = scheme ; super . setFirstLineChanged ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setScheme(v): " + ( null != scheme ? scheme . getName ( ) : null ) ) ; } }
|
Set the value of the scheme in the Request by using the int identifiers .
| 86
| 15
|
160,598
|
private void deserializeMethod ( ObjectInput stream ) throws IOException , ClassNotFoundException { MethodValues method = null ; if ( SERIALIZATION_V2 == getDeserializationVersion ( ) ) { method = MethodValues . find ( readByteArray ( stream ) ) ; } else { method = MethodValues . find ( ( String ) stream . readObject ( ) ) ; } if ( null == method ) { throw new IOException ( "Missing method" ) ; } setMethod ( method ) ; }
|
Deserialize the method information from the input stream .
| 108
| 11
|
160,599
|
private void deserializeScheme ( ObjectInput stream ) throws IOException , ClassNotFoundException { SchemeValues scheme = null ; if ( SERIALIZATION_V2 == getDeserializationVersion ( ) ) { byte [ ] value = readByteArray ( stream ) ; if ( null == value ) { throw new IOException ( "Missing scheme" ) ; } scheme = SchemeValues . find ( value ) ; } else { String value = ( String ) stream . readObject ( ) ; scheme = SchemeValues . find ( value ) ; } setScheme ( scheme ) ; }
|
Deserialize the scheme information from the input stream .
| 122
| 11
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.