idx
int64 0
41.2k
| question
stringlengths 83
4.15k
| target
stringlengths 5
715
|
|---|---|---|
40,400
|
protected synchronized void unjoin ( SIXAResource resource ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "unjoin" , resource ) ; resourcesJoinedToThisResource . remove ( resource ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "unjoin" ) ; }
|
Called when another instance is un - joining from us .
|
40,401
|
protected void updatedSslSupport ( SSLSupport service , Map < String , Object > props ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "updatedSslSupport" , props ) ; } sslSupport = service ; String id = ( String ) props . get ( SSL_CFG_REF ) ; if ( ! defaultId . equals ( id ) ) { for ( SSLChannelOptions options : sslOptions . values ( ) ) { options . updateRefId ( id ) ; options . updateRegistration ( bContext , sslConfigs ) ; } defaultId = id ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "updatedSslSupport" , "defaultConfigId=" + defaultId ) ; } }
|
This is called if the service is updated .
|
40,402
|
public static JSSEProvider getJSSEProvider ( ) { SSLChannelProvider p = instance . get ( ) ; if ( p != null ) return p . sslSupport . getJSSEProvider ( ) ; throw new IllegalStateException ( "Requested service is null: no active component instance" ) ; }
|
Access the JSSE provider factory service .
|
40,403
|
public static JSSEHelper getJSSEHelper ( ) { SSLChannelProvider p = instance . get ( ) ; if ( p != null ) return p . sslSupport . getJSSEHelper ( ) ; throw new IllegalStateException ( "Requested service is null: no active component instance" ) ; }
|
Access the JSSEHelper service .
|
40,404
|
public static DateFormat getBasicDateFormatter ( ) { return customizeDateFormat ( DateFormat . getDateTimeInstance ( DateFormat . SHORT , DateFormat . MEDIUM ) , false ) ; }
|
Return a DateFormat object that can be used to format timestamps in the System . out System . err and TraceOutput logs . It will use the default date format .
|
40,405
|
public static DateFormat customizeDateFormat ( DateFormat formatter , boolean isoDateFormat ) { String pattern ; int patternLength ; int endOfSecsIndex ; if ( ! ! ! isoDateFormat ) { if ( formatter instanceof SimpleDateFormat ) { SimpleDateFormat sdFormatter = ( SimpleDateFormat ) formatter ; pattern = sdFormatter . toPattern ( ) ; patternLength = pattern . length ( ) ; endOfSecsIndex = pattern . lastIndexOf ( 's' ) + 1 ; String newPattern = pattern . substring ( 0 , endOfSecsIndex ) + ":SSS z" ; if ( endOfSecsIndex < patternLength ) newPattern += pattern . substring ( endOfSecsIndex , patternLength ) ; newPattern = newPattern . replace ( 'h' , 'H' ) ; newPattern = newPattern . replace ( 'K' , 'H' ) ; newPattern = newPattern . replace ( 'k' , 'H' ) ; newPattern = newPattern . replace ( 'a' , ' ' ) ; newPattern = newPattern . trim ( ) ; sdFormatter . applyPattern ( newPattern ) ; formatter = sdFormatter ; } else { formatter = new SimpleDateFormat ( "yy.MM.dd HH:mm:ss:SSS z" ) ; } } else { formatter = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) ; } if ( sysTimeZone != null ) { formatter . setTimeZone ( sysTimeZone ) ; } return formatter ; }
|
Modifies an existing DateFormat object so that it can be used to format timestamps in the System . out System . err and TraceOutput logs using either default date and time format or ISO - 8601 date and time format
|
40,406
|
private void setAndValidateProperties ( String cfgAuthentication , String cfgAuthorization , String cfgUserRegistry ) { if ( ( cfgAuthentication == null ) || cfgAuthentication . isEmpty ( ) ) { throwIllegalArgumentExceptionMissingAttribute ( CFG_KEY_AUTHENTICATION_REF ) ; } this . cfgAuthenticationRef = cfgAuthentication ; if ( ( cfgAuthorization == null ) || cfgAuthorization . isEmpty ( ) ) { throwIllegalArgumentExceptionMissingAttribute ( CFG_KEY_AUTHORIZATION_REF ) ; } this . cfgAuthorizationRef = cfgAuthorization ; if ( ( cfgUserRegistry == null ) || cfgUserRegistry . isEmpty ( ) ) { throwIllegalArgumentExceptionMissingAttribute ( CFG_KEY_USERREGISTRY_REF ) ; } this . cfgUserRegistryRef = cfgUserRegistry ; }
|
Sets and validates the configuration properties . If any of the configuration properties are not set an IllegalArgumentException is thrown .
|
40,407
|
@ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . OPTIONAL ) protected synchronized void setServerStarted ( ServerStarted serverStarted ) { isServerStarted = true ; startManagementEJB ( ) ; }
|
Declarative services method that is invoked once the ServerStarted service is available . Only after this method is invoked is the Management EJB system module started .
|
40,408
|
public HashMap < String , Object > saveContextData ( ) { HashMap < String , Object > contextData = new HashMap < String , Object > ( ) ; ComponentMetaDataAccessorImpl cmdai = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) ; ComponentMetaData cmd = cmdai . getComponentMetaData ( ) ; if ( cmd != null ) { contextData . put ( ComponentMetaData , cmd ) ; } Iterator < ITransferContextService > TransferIterator = com . ibm . ws . webcontainer . osgi . WebContainer . getITransferContextServices ( ) ; if ( TransferIterator != null ) { while ( TransferIterator . hasNext ( ) ) { ITransferContextService tcs = TransferIterator . next ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling storeState on: " + tcs ) ; } tcs . storeState ( contextData ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No implmenting services found" ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Saving the context data : " + contextData ) ; } return contextData ; }
|
Save off the context data for the current thread
|
40,409
|
public Subject finalizeSubject ( Subject subject , ConnectionRequestInfo reqInfo , CMConfigData cmConfigData ) throws ResourceException { final boolean isTracingEnabled = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTracingEnabled && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "finalizeSubject" ) ; } if ( isTracingEnabled && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "finalizeSubject" ) ; } return subject ; }
|
The finalizeSubject method is used to set what the final Subject will be for processing .
|
40,410
|
public Entry remove ( Entry removePointer ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remove" , new Object [ ] { removePointer } ) ; Entry removedEntry = null ; if ( contains ( removePointer ) ) { removedEntry = removePointer . remove ( ) ; } else { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.LinkedList" , "1:291:1.3" } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.utils.linkedlist.LinkedList.remove" , "1:297:1.3" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.utils.linkedlist.LinkedList" , "1:304:1.3" } ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remove" , e ) ; throw e ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remove" , removedEntry ) ; return removedEntry ; }
|
Synchronized . Remove an Entry from the list .
|
40,411
|
public Entry getFirst ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getFirst" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getFirst" , first ) ; return first ; }
|
Synchronized . Get the first entry in the list .
|
40,412
|
public Entry getLast ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getLast" ) ; SibTr . exit ( tc , "getLast" , last ) ; } return last ; }
|
Synchronized . Get the last entry in the list .
|
40,413
|
private void addMemberToList ( JSConsumerKey key , boolean specificList ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addMemberToList" , new Object [ ] { key , Boolean . valueOf ( specificList ) } ) ; if ( specificList ) { if ( specificKeyMembers == null ) { specificKeyMembers = new ArrayList < LocalQPConsumerKey > ( ) ; } specificKeyMembers . add ( ( LocalQPConsumerKey ) key ) ; } else { if ( generalKeyMembers == null ) { generalKeyMembers = new ArrayList < LocalQPConsumerKey > ( ) ; } generalKeyMembers . add ( ( LocalQPConsumerKey ) key ) ; generalMemberIndex = 0 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addMemberToList" ) ; }
|
Add the member to the correct list
|
40,414
|
public void removeMember ( JSConsumerKey key ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeMember" , key ) ; LocalQPConsumerKey anyKey = null ; synchronized ( consumerDispatcher . getDestination ( ) . getReadyConsumerPointLock ( ) ) { if ( singleMember != null ) { if ( ! ( key . isSpecific ( ) ) ) generalMemberCount -- ; if ( singleMember == key ) singleMember = null ; else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeMember" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.LocalQPConsumerKeyGroup" , "1:453:1.6.1.14" } , null ) ) ; } } else { if ( key . isSpecific ( ) ) specificKeyMembers . remove ( key ) ; else { generalKeyMembers . remove ( key ) ; generalMemberCount -- ; generalMemberIndex = 0 ; } } memberCount -- ; if ( memberCount == 0 ) { consumerDispatcher . removeKeyGroup ( this ) ; if ( classifyingMessages ) { consumerSet . takeClassificationReadLock ( ) ; int numFilters = consumerKeyFilter . length ; for ( int i = 0 ; i < numFilters ; i ++ ) consumerKeyFilter [ i ] . detach ( ) ; consumerSet . freeClassificationReadLock ( ) ; } else { consumerKeyFilter [ 0 ] . detach ( ) ; } } else if ( memberCount == startedCount ) { if ( generalMemberCount > 0 ) anyKey = generalKeyMembers . get ( 0 ) ; else anyKey = specificKeyMembers . get ( 0 ) ; } } if ( anyKey != null ) anyKey . getConsumerPoint ( ) . checkForMessages ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeMember" ) ; }
|
Remove a member from the group
|
40,415
|
public LocalQPConsumerKey resolvedKey ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resolvedKey" ) ; LocalQPConsumerKey key = null ; if ( generalMemberCount > 0 ) { if ( singleMember != null ) key = singleMember ; else { key = generalKeyMembers . get ( generalMemberIndex ) ; if ( ++ generalMemberIndex == generalMemberCount ) generalMemberIndex = 0 ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resolvedKey" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.LocalQPConsumerKeyGroup" , "1:688:1.6.1.14" } , null ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resolvedKey" , key ) ; return key ; }
|
Return one of the groups non - specific members
|
40,416
|
public void setConsumerActive ( boolean active ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setConsumerActive" , active ) ; if ( active ) { consumerThreadID = Thread . currentThread ( ) . getId ( ) ; } else { consumerThreadID = 0 ; } consumerThreadActive = active ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setConsumerActive" , consumerThreadID ) ; }
|
We only want to remember the result of a filter match if it is called as a result of a consumer asking for a message . The consumer indicates that it is asking for a message by calling this method with active set to true . After the consumer has got it s message it should call again with active false .
|
40,417
|
public boolean filterMatches ( AbstractItem item ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "filterMatches" , item ) ; boolean match = false ; LocalQPConsumerKey matchingMember = null ; if ( generalMemberCount > 0 ) { matchingMember = null ; match = true ; } else { if ( singleMember != null ) { if ( singleMember . filterMatches ( item ) ) { match = true ; matchingMember = singleMember ; } } else { LocalQPConsumerKey keyMember ; int index ; int size = specificKeyMembers . size ( ) ; for ( index = 0 ; ( index < size ) && ! match ; index ++ ) { keyMember = specificKeyMembers . get ( index ) ; if ( keyMember . filterMatches ( item ) ) { match = true ; matchingMember = keyMember ; } } } } boolean onConsumerThread = consumerThreadActive && ( Thread . currentThread ( ) . getId ( ) == consumerThreadID ) ; if ( onConsumerThread ) { currentMatch = match ; currentMatchingMember = matchingMember ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , new Object [ ] { Boolean . valueOf ( match ) , matchingMember } ) ; return match ; }
|
All members of a keyGroup share the same getCursor on the itemStream which uses this method to filter the items . This allows us to see if an item matches ANY of the members of the group .
|
40,418
|
public ConsumableKey getMatchingMember ( ConsumableKey preferedKey ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMatchingMember" ) ; ConsumableKey key = null ; if ( currentMatch ) { if ( currentMatchingMember == null ) { if ( ! preferedKey . isSpecific ( ) ) key = preferedKey ; else if ( generalMemberCount > 0 ) key = resolvedKey ( ) ; } else key = currentMatchingMember ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMatchingMember" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.LocalQPConsumerKeyGroup" , "1:982:1.6.1.14" } , null ) ) ; } if ( key == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMatchingMember" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.LocalQPConsumerKeyGroup" , "1:995:1.6.1.14" } , null ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMatchingMember" , key ) ; return key ; }
|
Returns the member which last matched a message
|
40,419
|
public void attachMessage ( ConsumableKey consumerKey ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "attachMessage" , msgAttachedMember ) ; SibTr . exit ( tc , "attachMessage" , consumerKey ) ; } if ( msgAttachedMember == null ) msgAttachedMember = consumerKey ; else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachMessage" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.LocalQPConsumerKeyGroup" , "1:1027:1.6.1.14" } , null ) ) ; } }
|
Record the fact that one of the members has a message attached
|
40,420
|
public boolean hasNonSpecificConsumers ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "hasNonSpecificConsumers" ) ; boolean value ; if ( generalMemberCount > 0 ) value = true ; else value = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "hasNonSpecificConsumers" , Boolean . valueOf ( value ) ) ; return value ; }
|
Only called when consumer is ready and when already holding the ConsumerDispatchers readyConsumerPointLock
|
40,421
|
public Object createResource ( ResourceInfo info ) throws Exception { ComponentMetaData cData = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) . getComponentMetaData ( ) ; if ( cData != null ) applications . add ( cData . getJ2EEName ( ) . getApplication ( ) ) ; return cloudantSvc . createResource ( ( String ) props . get ( "databaseName" ) , ( Boolean ) props . get ( "create" ) , info == null ? ResourceInfo . AUTH_APPLICATION : info . getAuth ( ) , info == null ? null : info . getLoginPropertyList ( ) ) ; }
|
Invoked when a cloudant Database is injected or looked up .
|
40,422
|
public Object getCloudantClient ( ResourceInfo info ) throws Exception { return cloudantSvc . getCloudantClient ( info == null ? ResourceInfo . AUTH_APPLICATION : info . getAuth ( ) , info == null ? null : info . getLoginPropertyList ( ) ) ; }
|
Returns the underlying cloudantClient object for this database and the provided resource config
|
40,423
|
private URL getRelativePath ( FacesContext facesContext , String path ) throws IOException { URL url = ( URL ) _relativePaths . get ( path ) ; if ( url == null ) { url = _factory . resolveURL ( facesContext , _src , path ) ; if ( url != null ) { ViewResource viewResource = ( ViewResource ) facesContext . getAttributes ( ) . get ( FaceletFactory . LAST_RESOURCE_RESOLVED ) ; if ( viewResource != null ) { } else { _relativePaths . put ( path , url ) ; } } } return url ; }
|
Delegates resolution to DefaultFaceletFactory reference . Also caches URLs for relative paths .
|
40,424
|
private void include ( AbstractFaceletContext ctx , UIComponent parent ) throws IOException , FacesException , FaceletException , ELException { ctx . pushPageContext ( new PageContextImpl ( ) ) ; try { this . refresh ( parent ) ; DefaultFaceletContext ctxWrapper = new DefaultFaceletContext ( ( DefaultFaceletContext ) ctx , this , false ) ; ctx . getFacesContext ( ) . getAttributes ( ) . put ( FaceletContext . FACELET_CONTEXT_KEY , ctxWrapper ) ; _root . apply ( ctxWrapper , parent ) ; ctx . getFacesContext ( ) . getAttributes ( ) . put ( FaceletContext . FACELET_CONTEXT_KEY , ctx ) ; this . markApplied ( parent ) ; } finally { ctx . popPageContext ( ) ; } }
|
Given the passed FaceletContext apply our child FaceletHandlers to the passed parent
|
40,425
|
public void include ( AbstractFaceletContext ctx , UIComponent parent , URL url ) throws IOException , FacesException , FaceletException , ELException { DefaultFacelet f = ( DefaultFacelet ) _factory . getFacelet ( ctx , url ) ; f . include ( ctx , parent ) ; }
|
Grabs a DefaultFacelet from referenced DefaultFaceletFacotry
|
40,426
|
public synchronized void process ( ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "process: " + this ) ; if ( isAlreadyProcessed ) { if ( ivProcessFailure != null ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "rethrowing " + ivProcessFailure ) ; throw new InjectionException ( ivProcessFailure . getMessage ( ) , ivProcessFailure ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "No-opping the .process() method because this ReferenceContext " + "instance has already been processed." ) ; return ; } if ( ivProviders . isEmpty ( ) ) { throw new IllegalStateException ( "Unable to perform reference processing. " + "The list of input components was empty." ) ; } boolean complete = false ; try { processImpl ( ) ; complete = true ; } catch ( InjectionException ex ) { ivProcessFailure = ex ; complete = true ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "process: " + ex ) ; throw ex ; } finally { if ( complete ) { isAlreadyProcessed = true ; ivProviders . clear ( ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "process" ) ; }
|
F743 - 17630CodRv
|
40,427
|
private void createPersistenceMaps ( ComponentNameSpaceConfiguration masterCompNSConfig , List < ComponentNameSpaceConfiguration > compNSConfigs ) { Map < Class < ? > , Collection < String > > classesToComponents = new HashMap < Class < ? > , Collection < String > > ( ) ; Map < String , Collection < String > > persistenceRefsToComponents = new HashMap < String , Collection < String > > ( ) ; for ( ComponentNameSpaceConfiguration compNSConfig : compNSConfigs ) { ComponentMetaData cmd = compNSConfig . getComponentMetaData ( ) ; if ( cmd != null ) { String name = cmd . getJ2EEName ( ) . getComponent ( ) ; if ( ! compNSConfig . isMetaDataComplete ( ) ) { List < Class < ? > > classesToScan = compNSConfig . getInjectionClasses ( ) ; if ( classesToScan != null ) { for ( Class < ? > klass : classesToScan ) { for ( Class < ? > superClass = klass ; superClass != null && superClass != Object . class ; superClass = superClass . getSuperclass ( ) ) { addComponentToPersistenceMap ( classesToComponents , superClass , name ) ; } } } } List < ? extends PersistenceContextRef > pcRefs = compNSConfig . getPersistenceContextRefs ( ) ; if ( pcRefs != null ) { for ( PersistenceContextRef ref : pcRefs ) { addComponentToPersistenceMap ( persistenceRefsToComponents , ref . getName ( ) , name ) ; } } List < ? extends PersistenceUnitRef > puRefs = compNSConfig . getPersistenceUnitRefs ( ) ; if ( puRefs != null ) { for ( PersistenceUnitRef ref : puRefs ) { addComponentToPersistenceMap ( persistenceRefsToComponents , ref . getName ( ) , name ) ; } } } } masterCompNSConfig . setPersistenceMaps ( classesToComponents , persistenceRefsToComponents ) ; }
|
F743 - 30682
|
40,428
|
private String dumpJavaColonCompEnvMap ( ) { StringBuffer buffer = new StringBuffer ( "" ) ; buffer . append ( "EJBContext.lookup data structure contents:\n" ) ; buffer . append ( " Contains **" + ivJavaColonCompEnvMap . size ( ) + "** bindings.\n" ) ; if ( ! ivJavaColonCompEnvMap . isEmpty ( ) ) { Set < Map . Entry < String , InjectionBinding < ? > > > entries = ivJavaColonCompEnvMap . entrySet ( ) ; Iterator < Map . Entry < String , InjectionBinding < ? > > > entryIterator = entries . iterator ( ) ; int count = 0 ; while ( entryIterator . hasNext ( ) ) { Map . Entry < String , InjectionBinding < ? > > oneEntry = entryIterator . next ( ) ; buffer . append ( " Entry " + count + "\n" ) ; buffer . append ( " Key: **" + oneEntry . getKey ( ) + "**\n" ) ; buffer . append ( " Value: **" + oneEntry . getValue ( ) + "**\n" ) ; buffer . append ( "\n" ) ; count ++ ; } } return buffer . toString ( ) ; }
|
Provides nice looking trace output for the EJBContext . lookup data structure .
|
40,429
|
public boolean isProcessDynamicNeeded ( List < Class < ? > > injectionClasses ) { for ( Class < ? > klass : injectionClasses ) { if ( ! ivProcessedInjectionClasses . contains ( klass ) ) { return true ; } } return false ; }
|
Returns true if dynamic processing is needed for any of the classes .
|
40,430
|
public static List < ProvisioningFeatureDefinition > getKernelFeatures ( BundleContext ctx , WsLocationAdmin locationService ) { List < ProvisioningFeatureDefinition > result = kernelDefs ; if ( result == null ) { result = kernelDefs = getKernelFeatures ( ctx , locationService , false ) ; } return result ; }
|
Get the kernel feature definitions in use by the runtime .
|
40,431
|
public String download ( ) { try { HttpURLConnection conn = getConnection ( ) ; return readConnection ( conn ) ; } catch ( Exception e ) { Assert . fail ( e . getMessage ( ) ) ; } return null ; }
|
Downloads contents of URL and converts them to a string
|
40,432
|
public OpenAPI downloadModel ( ) throws Exception { String download = download ( ) ; if ( download != null ) { try { SwaggerParseResult parseResult = new OpenAPIParser ( ) . readContents ( download , null , null , null ) ; if ( parseResult != null ) { return parseResult . getOpenAPI ( ) ; } } catch ( Exception e ) { Assert . fail ( e . getMessage ( ) ) ; } return null ; } return null ; }
|
Downloads contents of URL and converts them to an OpenAPI model
|
40,433
|
public static OpenAPIConnection openAPIDocsConnection ( LibertyServer server , boolean secure ) { return new OpenAPIConnection ( server , OPEN_API_DOCS ) . secure ( secure ) ; }
|
creates default connection for OpenAPI docs endpoint
|
40,434
|
public static OpenAPIConnection openAPIUIConnection ( LibertyServer server , boolean secure ) { return new OpenAPIConnection ( server , OPEN_API_UI ) . secure ( secure ) ; }
|
creates default connection for OpenAPI UI endpoint
|
40,435
|
public void processDrsInbound ( long localClock ) { if ( drsClock <= 0 ) { return ; } long clockDifference = localClock - drsClock ; if ( expirationTime > 0 ) expirationTime += clockDifference ; if ( timeStamp > 0 ) timeStamp += clockDifference ; drsClock = - 1 ; }
|
Handle needed processing after receiving a CE from a remote mahine via DRS .
|
40,436
|
public synchronized Object getValue ( ) { if ( id != null ) { if ( serializedValue != null ) { long oldSize = - 1 ; if ( cacheEntryPool != null ) { if ( cacheEntryPool . cache . isCacheSizeInMBEnabled ( ) ) { oldSize = getObjectSize ( ) ; } } try { value = SerializationUtility . deserialize ( serializedValue , cacheName ) ; } catch ( Exception ex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.CacheEntry.getValue" , "200" , this ) ; } if ( value != null ) { serializedValue = null ; if ( cacheEntryPool != null ) { if ( cacheEntryPool . cache . isCacheSizeInMBEnabled ( ) ) { long newSize = getObjectSize ( ) ; if ( oldSize != - 1 && newSize != - 1 ) { cacheEntryPool . cache . increaseCacheSizeInBytes ( newSize - oldSize , "GET_VALUE" ) ; } else { cacheEntryPool . cache . disableCacheSizeInMB ( ) ; } } } } } } return value ; }
|
Get s the entry s value
|
40,437
|
protected void setValue ( Object value ) { this . value = value ; serializedValue = null ; timeStamp = System . currentTimeMillis ( ) ; this . valueHashcode = 0 ; }
|
Set s the entry s value
|
40,438
|
public void reset ( ) { if ( refCount . get ( ) > 0 && isRefCountingEnabled ( ) ) { Tr . warning ( tc , "reset called on " + id + " with a refCount of " + refCount ) ; Thread . dumpStack ( ) ; } cacheName = null ; drsClock = - 1 ; timeStamp = - 1 ; serializedId = null ; id = null ; if ( useByteBuffer && this . value != null ) { if ( this . value instanceof DistributedNioMapObject ) { ( ( DistributedNioMapObject ) this . value ) . release ( ) ; } } serializedValue = null ; value = null ; clock = CacheConfig . DEFAULT_PRIORITY ; refCount . set ( 0 ) ; priority = CacheConfig . DEFAULT_PRIORITY ; timeLimit = - 1 ; inactivity = - 1 ; expirationTime = - 1 ; validatorExpirationTime = - 1 ; removeWhenUnpinned = false ; _templates = EMPTY_STRING_ARRAY ; _dataIds = EMPTY_OBJECT_ARRAY ; _serializedDataIds = null ; pendingRemoval = false ; sharingPolicy = EntryInfo . NOT_SHARED ; persistToDisk = true ; isOverflowEntry = false ; lruEvicted = false ; lruHead = null ; useByteBuffer = false ; aliasList = EMPTY_OBJECT_ARRAY ; serializedAliasList = null ; userMetaData = null ; serializedUserMetaData = null ; loadedFromDisk = false ; cacheType = CACHE_TYPE_DEFAULT ; skipValueSerialized = false ; skipMemoryAndWriteToDisk = false ; skipMemoryAndWriteToDiskErrorCode = HTODDynacache . NO_EXCEPTION ; valueHashcode = 0 ; externalCacheGroupId = null ; }
|
This brings this CacheEntry back to the same state it had when it was first created . It does not change its lruArray index . It is called by the Cache when one of the preallocated CacheEntry instances is about to be reused for another logical entry .
|
40,439
|
public void copy ( CacheEntry cacheEntry ) { if ( cacheEntry == this ) return ; if ( useByteBuffer && this . value != null ) { if ( this . value instanceof DistributedNioMapObject ) { ( ( DistributedNioMapObject ) this . value ) . release ( ) ; } } this . value = cacheEntry . value ; this . valueHashcode = cacheEntry . valueHashcode ; this . serializedValue = cacheEntry . serializedValue ; this . serializedId = cacheEntry . serializedId ; timeStamp = cacheEntry . timeStamp ; expirationTime = cacheEntry . expirationTime ; validatorExpirationTime = cacheEntry . validatorExpirationTime ; timeLimit = cacheEntry . timeLimit ; inactivity = cacheEntry . inactivity ; drsClock = cacheEntry . drsClock ; id = cacheEntry . id ; priority = cacheEntry . priority ; if ( priority < 0 ) priority = 0 ; if ( priority > CacheConfig . MAX_PRIORITY ) priority = CacheConfig . MAX_PRIORITY ; _templates = cacheEntry . _templates ; _dataIds = cacheEntry . _dataIds ; _serializedDataIds = cacheEntry . _serializedDataIds ; sharingPolicy = cacheEntry . sharingPolicy ; persistToDisk = cacheEntry . persistToDisk ; refCount = new AtomicInteger ( cacheEntry . refCount . get ( ) ) ; aliasList = cacheEntry . aliasList ; serializedAliasList = cacheEntry . serializedAliasList ; useByteBuffer = cacheEntry . useByteBuffer ; userMetaData = cacheEntry . userMetaData ; serializedUserMetaData = cacheEntry . serializedUserMetaData ; loadedFromDisk = cacheEntry . loadedFromDisk ; cacheType = cacheEntry . cacheType ; skipValueSerialized = cacheEntry . skipValueSerialized ; skipMemoryAndWriteToDisk = cacheEntry . skipMemoryAndWriteToDisk ; skipMemoryAndWriteToDiskErrorCode = cacheEntry . skipMemoryAndWriteToDiskErrorCode ; vbcSource = cacheEntry . vbcSource ; externalCacheGroupId = cacheEntry . externalCacheGroupId ; }
|
This method copies the state of another CacheEntry into this CacheEntry . It is called by the Cache when a CacheEntry is imported from another JVM .
|
40,440
|
public Object getUserMetaData ( ) { if ( serializedUserMetaData != null ) { try { userMetaData = SerializationUtility . deserialize ( serializedUserMetaData , cacheName ) ; } catch ( Exception ex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.CacheEntry.getUserMetaData" , "600" , this ) ; } serializedUserMetaData = null ; } return userMetaData ; }
|
Get s the userMetaData
|
40,441
|
public long getCacheValueSize ( ) { long valuesize = - 1 ; if ( this . value != null ) { Object localValue = this . value ; valuesize = ObjectSizer . getSize ( localValue ) ; } else { if ( this . serializedValue != null ) { byte [ ] localSerializedValue = this . serializedValue ; valuesize = ObjectSizer . getSize ( localSerializedValue ) ; } } return valuesize ; }
|
Computes the best - effort size of the cache entry s value . Returns - 1 if value could not be computed .
|
40,442
|
public HttpSession generateNewId ( WebApp webapp ) { HttpSession existingSession = ( HttpSession ) webappToSessionMap . get ( webapp ) ; if ( existingSession != null ) { if ( ! webapp . getSessionContext ( ) . isValid ( existingSession , request , false ) ) { existingSession = null ; } } else { existingSession = webapp . getSessionContext ( ) . getIHttpSession ( request , ( HttpServletResponse ) request . getResponse ( ) , false ) ; } if ( existingSession == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isErrorEnabled ( ) ) { Tr . error ( tc , "changeSessionId.no.session.associated.with.request" , new Object [ ] { request . getRequestURI ( ) } ) ; } throw new IllegalStateException ( Tr . formatMessage ( tc , "changeSessionId.no.session.associated.with.request" , request . getRequestURI ( ) ) ) ; } HttpSession session = ( ( HttpSessionContext31Impl ) webapp . getSessionContext ( ) ) . generateNewId ( request , ( HttpServletResponse ) request . getResponse ( ) , existingSession ) ; return session ; }
|
Added for support of HttpSessionIdListeners
|
40,443
|
public RecoverableUnitSection lookupSection ( int identity ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "lookupSection" , new java . lang . Object [ ] { this , new Integer ( identity ) } ) ; SQLRecoverableUnitSectionImpl recoverableUnitSection = ( SQLRecoverableUnitSectionImpl ) _recoverableUnitSections . get ( new Integer ( identity ) ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "lookupSection" , recoverableUnitSection ) ; return recoverableUnitSection ; }
|
Returns the recoverable unit section previously created with the supplied identity . If no such recoverable unit section exists this method returns null .
|
40,444
|
protected synchronized void invoke ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "invoke" ) ; try { listener . errorOccurred ( exception , segmentType , requestNumber , priority , conversation ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.sib.jfapchannel.impl.rldispatcher.ConversationReceiveListenerErrorOccurredInvocation" , JFapChannelConstants . CRLERROROCCURREDINVOKE_INVOKE_01 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "exception thrown by conversation receive listener" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , t ) ; connection . invalidate ( true , t , "exception thrown in errorOccurred method - " + t . getMessage ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "invoke" ) ; }
|
Invokes the error occurred callback of a receive listener . The information required for this invocation is encapsulated in this class . If code in the callback throws an exception then the connection is invalidated .
|
40,445
|
protected synchronized void reset ( Connection connection , ConversationReceiveListener listener , SIConnectionLostException exception , int segmentType , int requestNumber , int priority , Conversation conversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reset" , new Object [ ] { connection , listener , exception , "" + segmentType , "" + requestNumber , "" + priority , conversation } ) ; this . connection = connection ; this . listener = listener ; this . exception = exception ; this . segmentType = segmentType ; this . requestNumber = requestNumber ; this . priority = priority ; this . conversation = conversation ; setDispatchable ( null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "reset" ) ; }
|
Resets the state of this object . Used for pooling .
|
40,446
|
private void _idAdded ( String clientId ) { _ids . add ( _getIdFromClientId ( clientId ) ) ; _unvisitedClientIds . add ( clientId ) ; _addSubtreeClientId ( clientId ) ; }
|
an new id has been added .
|
40,447
|
private String _getVisitId ( UIComponent component ) { String id = component . getId ( ) ; if ( ( id != null ) && ! _ids . contains ( id ) ) { return null ; } String clientId = component . getClientId ( getFacesContext ( ) ) ; assert ( clientId != null ) ; return _clientIds . contains ( clientId ) ? clientId : null ; }
|
If so returns its client id . If not returns null .
|
40,448
|
private String _getIdFromClientId ( String clientId ) { final char separator = getFacesContext ( ) . getNamingContainerSeparatorChar ( ) ; int lastIndex = clientId . lastIndexOf ( separator ) ; String id = null ; if ( lastIndex < 0 ) { id = clientId ; } else if ( lastIndex < ( clientId . length ( ) - 1 ) ) { id = clientId . substring ( lastIndex + 1 ) ; } return id ; }
|
out the trailing id segmetn .
|
40,449
|
private void _addSubtreeClientId ( String clientId ) { final char separator = getFacesContext ( ) . getNamingContainerSeparatorChar ( ) ; int length = clientId . length ( ) ; for ( int i = 0 ; i < length ; i ++ ) { if ( clientId . charAt ( i ) == separator ) { String namingContainerClientId = clientId . substring ( 0 , i ) ; Collection < String > c = _subtreeClientIds . get ( namingContainerClientId ) ; if ( c == null ) { c = new ArrayList < String > ( ) ; _subtreeClientIds . put ( namingContainerClientId , c ) ; } c . add ( clientId ) ; } } }
|
subtree client ids
|
40,450
|
private void _removeSubtreeClientId ( String clientId ) { for ( String key : _subtreeClientIds . keySet ( ) ) { if ( clientId . startsWith ( key ) ) { Collection < String > ids = _subtreeClientIds . get ( key ) ; ids . remove ( clientId ) ; } } }
|
entries from our subtree collections
|
40,451
|
public ORB createServerORB ( Map < String , Object > config , Map < String , Object > extraConfig , List < IIOPEndpoint > endpoints , Collection < SubsystemFactory > subsystemFactories ) throws ConfigException { ORB orb = createORB ( translateToTargetArgs ( config , subsystemFactories ) , translateToTargetProps ( config , extraConfig , endpoints , subsystemFactories ) ) ; return orb ; }
|
Create an ORB for a CORBABean server context .
|
40,452
|
public ORB createClientORB ( Map < String , Object > clientProps , Collection < SubsystemFactory > subsystemFactories ) throws ConfigException { return createORB ( translateToClientArgs ( clientProps , subsystemFactories ) , translateToClientProps ( clientProps , subsystemFactories ) ) ; }
|
Create an ORB for a CSSBean client context .
|
40,453
|
private ORB createORB ( String [ ] args , Properties props ) { return ORB . init ( args , props ) ; }
|
Create an ORB instance using the configured argument and property bundles .
|
40,454
|
private String [ ] translateToTargetArgs ( Map < String , Object > props , Collection < SubsystemFactory > subsystemFactories ) throws ConfigException { ArrayList < String > list = new ArrayList < String > ( ) ; for ( SubsystemFactory sf : subsystemFactories ) { sf . addTargetORBInitArgs ( props , list ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Configargs: " + list ) ; } return list . toArray ( new String [ list . size ( ) ] ) ; }
|
Translate a CORBABean configuration into an array of arguments used to configure the ORB instance .
|
40,455
|
private String [ ] translateToClientArgs ( Map < String , Object > clientProps , Collection < SubsystemFactory > subsystemFactories ) throws ConfigException { ArrayList < String > list = new ArrayList < String > ( ) ; for ( SubsystemFactory sf : subsystemFactories ) { sf . addClientORBInitArgs ( clientProps , list ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Configargs: " + list ) ; } return list . toArray ( new String [ list . size ( ) ] ) ; }
|
Translate client configuration into the argument bundle needed to instantiate the client ORB instance .
|
40,456
|
private Properties translateToClientProps ( Map < String , Object > clientProps , Collection < SubsystemFactory > subsystemFactories ) throws ConfigException { Properties result = createYokoORBProperties ( ) ; for ( SubsystemFactory sf : subsystemFactories ) { addInitializerPropertyForSubsystem ( result , sf , false ) ; sf . addClientORBInitProperties ( result , clientProps ) ; } return result ; }
|
Translate client configuration into the property bundle necessary to configure the client ORB instance .
|
40,457
|
public static String getName ( ) { String secname = null ; WSCredential credential = getCallerWSCredential ( ) ; try { if ( credential != null && ! credential . isUnauthenticated ( ) ) { String realmSecname = credential . getRealmSecurityName ( ) ; if ( realmSecname != null && ! realmSecname . isEmpty ( ) ) { secname = realmSecname . substring ( realmSecname . lastIndexOf ( REALM_SEPARATOR ) + 1 ) ; } } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Internal error: " + e ) ; } return secname ; }
|
Return the security name of the current subject on the thread
|
40,458
|
public static String getUser ( ) { String accessid = null ; WSCredential credential = getCallerWSCredential ( ) ; try { if ( credential != null && ! credential . isUnauthenticated ( ) ) accessid = credential . getAccessId ( ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Internal error: " + e ) ; } return accessid ; }
|
Return the accessid of the current subject on the thread
|
40,459
|
private Boolean compareListValues ( Object firstVal , Object secondVal , boolean lessThan , boolean permissive , boolean overallTrue ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "compareListValues" , new Object [ ] { firstVal , secondVal , new Boolean ( lessThan ) , new Boolean ( permissive ) , new Boolean ( overallTrue ) } ) ; Boolean finalReturn = null ; Boolean compReturn = compare ( firstVal , secondVal , lessThan , permissive ) ; if ( compReturn != null ) { if ( overallTrue ) { if ( compReturn . equals ( Boolean . TRUE ) ) { finalReturn = Boolean . TRUE ; } } else { if ( compReturn . equals ( Boolean . FALSE ) ) { finalReturn = Boolean . TRUE ; } } } if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "compareListValues" , finalReturn ) ; return finalReturn ; }
|
Evaluate a comparison between 2 values at least one of which will be from a list . If we can determine that there is a matching pair then we return TRUE .
|
40,460
|
private URL setURL ( URL url ) throws RepositoryIllegalArgumentException { int port = url . getPort ( ) ; if ( port == - 1 ) { throw new RepositoryIllegalArgumentException ( "Bad proxy URL" , new IllegalArgumentException ( "Proxy URL does not contain a port" ) ) ; } String host = url . getHost ( ) ; if ( host . equals ( "" ) ) { throw new RepositoryIllegalArgumentException ( "Bad proxy URL" , new IllegalArgumentException ( "Proxy URL does not contain a host" ) ) ; } return url ; }
|
Rather than setting the port directly verify that the proxy URL did contain a port and throw an exception if it did not . This avoids problems later .
|
40,461
|
protected void setMBean ( ServiceReference < ? > ref ) { Object jmxObjectName = ref . getProperty ( "jmx.objectname" ) ; if ( jmxObjectName instanceof String ) { try { ObjectName name = new ObjectName ( ( String ) jmxObjectName ) ; setServiceReferenceInternal ( ref , name ) ; } catch ( MalformedObjectNameException e ) { } } else { } }
|
Sets the reference to a dynamic MBean .
|
40,462
|
public void printStackToDebug ( ) { Throwable t = new Throwable ( ) ; StackTraceElement [ ] ste = t . getStackTrace ( ) ; int start = ( ste . length > 6 ) ? 6 : ste . length ; for ( int i = start ; i >= 1 ; i -- ) { Tr . debug ( tc , "Calling Stack Element[" + i + "]: " + ste [ i ] ) ; } }
|
Debug method to print part of the current stack .
|
40,463
|
public void setPoolManagerRef ( WsByteBufferPoolManagerImpl oManagerRef ) { this . oWsByteBufferPoolManager = oManagerRef ; this . trusted = oManagerRef . isTrustedUsers ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setPoolManagerRef: trusted=" + this . trusted ) ; } }
|
Set the PoolManager reference .
|
40,464
|
public void setDirectShadowBuffer ( ByteBuffer buffer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "setDirectShadowBuffer" ) ; } if ( ! this . trusted ) checkValidity ( ) ; this . oWsBBDirect = buffer ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "setDirectShadowBuffer" ) ; } }
|
Set the direct bytebuffer that backs an indirect heap buffer to the input buffer .
|
40,465
|
public void setParmsToDirectBuffer ( ) { if ( oByteBuffer . isDirect ( ) ) { this . oWsBBDirect = this . oByteBuffer ; return ; } if ( oWsBBDirect == null ) { this . oWsBBDirect = ByteBuffer . allocateDirect ( oByteBuffer . capacity ( ) ) ; } this . oWsBBDirect . limit ( oByteBuffer . limit ( ) ) ; this . oWsBBDirect . position ( oByteBuffer . position ( ) ) ; }
|
Copy the buffer parameters from the indirect to the backing direct buffer if necessary .
|
40,466
|
private void taskHostStatus ( RESTRequest request , RESTResponse response ) { String taskID = RESTHelper . getRequiredParam ( request , APIConstants . PARAM_TASK_ID ) ; String host = RESTHelper . getRequiredParam ( request , APIConstants . PARAM_HOST ) ; String taskHostStatusJson = getMultipleRoutingHelper ( ) . getHostDetails ( taskID , host ) ; OutputHelper . writeJsonOutput ( response , taskHostStatusJson ) ; }
|
Returns a JSON array of CommandResult serialization representing the steps taken in that host
|
40,467
|
protected void prepareExpansion ( ) throws IOException { WsResource expansionResource = deployedAppServices . getLocationAdmin ( ) . resolveResource ( AppManagerConstants . EXPANDED_APPS_DIR ) ; expansionResource . create ( ) ; }
|
Application expansion ...
|
40,468
|
public DeployedAppInfo createDeployedAppInfo ( ApplicationInformation < DeployedAppInfo > appInfo ) throws UnableToAdaptException { String appPid = appInfo . getPid ( ) ; String appName = appInfo . getName ( ) ; String appPath = appInfo . getLocation ( ) ; File appFile = new File ( appPath ) ; Tr . debug ( _tc , "Create deployed application:" + " PID [ " + appPid + " ]" + " Name [ " + appName + " ]" + " Location [ " + appPath + " ]" ) ; Container appContainer = appInfo . getContainer ( ) ; Container originalAppContainer = null ; if ( applicationManager . getExpandApps ( ) && isArchive ( appFile , appPath ) ) { try { prepareExpansion ( ) ; WsResource expandedResource = resolveExpansion ( appName ) ; File expandedFile = expandedResource . asFile ( ) ; expand ( appName , appFile , expandedResource , expandedFile ) ; originalAppContainer = appContainer ; appContainer = deployedAppServices . setupContainer ( appPid , expandedFile ) ; } catch ( IOException e ) { Tr . error ( _tc , "warning.could.not.expand.application" , appName , e . getMessage ( ) ) ; } } Application applicationDD ; try { applicationDD = appContainer . adapt ( Application . class ) ; } catch ( UnableToAdaptException e ) { Tr . error ( _tc , "error.application.parse.descriptor" , appName , "META-INF/application.xml" , e ) ; throw e ; } InterpretedContainer jeeContainer ; if ( appContainer instanceof InterpretedContainer ) { jeeContainer = ( InterpretedContainer ) appContainer ; } else { jeeContainer = appContainer . adapt ( InterpretedContainer . class ) ; } if ( applicationDD == null ) { jeeContainer . setStructureHelper ( EARStructureHelper . getUnknownRootInstance ( ) ) ; } else { List < String > modulePaths = new ArrayList < String > ( ) ; for ( Module module : applicationDD . getModules ( ) ) { modulePaths . add ( module . getModulePath ( ) ) ; } jeeContainer . setStructureHelper ( EARStructureHelper . create ( modulePaths ) ) ; } appInfo . setContainer ( jeeContainer ) ; EARDeployedAppInfo deployedApp = new EARDeployedAppInfo ( appInfo , applicationDD , this , deployedAppServices , originalAppContainer ) ; appInfo . setHandlerInfo ( deployedApp ) ; return deployedApp ; }
|
Create deployment information for a java enterprise application .
|
40,469
|
protected String createCssContentString ( ) { StringBuilder css = new StringBuilder ( ) ; css . append ( "<style>" ) ; css . append ( "body {" ) ; css . append ( "background-color: #152935;" ) ; css . append ( "font-family: serif;" ) ; css . append ( "margin: 0;" ) ; css . append ( "}\n" ) ; css . append ( "#top, #bottom {" ) ; css . append ( "padding: 20px;" ) ; css . append ( "}\n" ) ; css . append ( "" ) ; css . append ( "#top-middle, #bottom-middle {" ) ; css . append ( "background-color: #001428;" ) ; css . append ( "padding: 10px;" ) ; css . append ( "}\n" ) ; css . append ( "" ) ; css . append ( ".container {" ) ; css . append ( "background-color: white;" ) ; css . append ( "padding: 20px 50px;" ) ; css . append ( "}\n" ) ; css . append ( ".error {" ) ; css . append ( "color: red;" ) ; css . append ( "font-weight: bold;" ) ; css . append ( "}\n" ) ; css . append ( "</style>" ) ; return css . toString ( ) ; }
|
Creates the CSS content string to be used to format page .
|
40,470
|
public void complete ( VirtualConnection vc , TCPReadRequestContext req ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "complete() called: vc=" + vc ) ; } HttpOutboundServiceContextImpl mySC = ( HttpOutboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPOSC ) ; VirtualConnection readVC = null ; try { do { if ( mySC . parseMessage ( ) ) { mySC . handleParsedMessage ( ) ; return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reading for more data" ) ; } mySC . setupReadBuffers ( mySC . getHttpConfig ( ) . getIncomingHdrBufferSize ( ) , false ) ; readVC = req . read ( 1 , this , false , mySC . getReadTimeout ( ) ) ; } while ( null != readVC ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , getClass ( ) . getName ( ) + ".complete" , "112" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught exception: " + e . getMessage ( ) ) ; } mySC . setPersistent ( false ) ; mySC . getAppWriteCallback ( ) . error ( vc , e ) ; } }
|
Called by the channel below us when a read has completed .
|
40,471
|
protected void reConnect ( VirtualConnection inVC , IOException ioe ) { if ( getLink ( ) . isReconnectAllowed ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Attempting reconnect: " + getLink ( ) . getVirtualConnection ( ) ) ; } getTSC ( ) . getReadInterface ( ) . setBuffer ( null ) ; getLink ( ) . reConnectAsync ( ioe ) ; } else { callErrorCallback ( inVC , ioe ) ; } }
|
If an error occurs during an attempted write of an outgoing request message this method will either reconnect for another try or pass the error up the channel chain .
|
40,472
|
void callErrorCallback ( VirtualConnection inVC , IOException ioe ) { setPersistent ( false ) ; if ( this . bEarlyReads && null != getAppReadCallback ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Early read failure calling error() on appside" ) ; } getAppReadCallback ( ) . error ( inVC , ioe ) ; } else if ( null != getAppWriteCallback ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling write.error() on appside" ) ; } getAppWriteCallback ( ) . error ( inVC , ioe ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No appside, closing connection" ) ; } getLink ( ) . getDeviceLink ( ) . close ( inVC , ioe ) ; } }
|
Call the error callback of the app above .
|
40,473
|
private boolean resetWriteBuffers ( ) { int stop = getPendingStop ( ) ; WsByteBuffer [ ] list = getPendingBuffers ( ) ; if ( null == this . positionList || null == list ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Error in resetBuffers: posList: " + this . positionList + " list: " + list ) ; } getTSC ( ) . getWriteInterface ( ) . setBuffer ( null ) ; return false ; } for ( int i = 0 ; i < stop ; i ++ ) { list [ i ] . position ( this . positionList [ i ] ) ; } getTSC ( ) . getWriteInterface ( ) . setBuffers ( list ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reset positions on (" + stop + ") write buffers" ) ; } return true ; }
|
Reset the position on all of the existing write buffers back so we can resend them all as we don t know what actually made it out before the error occurred .
|
40,474
|
protected void nowReconnectedAsync ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reconnected async for " + this ) ; } if ( ! resetWriteBuffers ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Resetting buffers (async) failed" ) ; } IOException ioe = new IOException ( "Failed reconnect" ) ; if ( null != getAppWriteCallback ( ) ) { getAppWriteCallback ( ) . error ( getVC ( ) , ioe ) ; } else { getLink ( ) . getDeviceLink ( ) . close ( getVC ( ) , ioe ) ; } return ; } setPersistent ( true ) ; updatePersistence ( getRequestImpl ( ) ) ; resetRead ( ) ; VirtualConnection rc = getTSC ( ) . getWriteInterface ( ) . write ( TCPWriteRequestContext . WRITE_ALL_DATA , HttpOSCWriteCallback . getRef ( ) , isForceAsync ( ) , getWriteTimeout ( ) ) ; if ( null != rc ) { if ( ! isMessageSent ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling callback.complete of app channel." ) ; } getAppWriteCallback ( ) . complete ( getLink ( ) . getVirtualConnection ( ) ) ; } else { if ( isReadAheadEnabled ( ) ) { this . bReadAheadEnabled = false ; } setupJITRead ( getHttpConfig ( ) . getIncomingHdrBufferSize ( ) ) ; getTSC ( ) . getReadInterface ( ) . read ( 1 , HttpOSCReadCallback . getRef ( ) , true , getReadTimeout ( ) ) ; } } }
|
Once we know we are reconnected to the target server reset the TCP buffers and start the async resend .
|
40,475
|
protected void nowReconnectedSync ( IOException originalExcep ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reconnected sync for " + this ) ; } if ( ! resetWriteBuffers ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Resetting buffers (sync) failed" ) ; } throw originalExcep ; } setPersistent ( true ) ; updatePersistence ( getRequestImpl ( ) ) ; if ( isReadAheadEnabled ( ) ) { this . bReadAheadEnabled = false ; } try { getTSC ( ) . getWriteInterface ( ) . write ( TCPWriteRequestContext . WRITE_ALL_DATA , getWriteTimeout ( ) ) ; } catch ( IOException ioe ) { setPersistent ( false ) ; throw ioe ; } }
|
Once we ve reconnected to the target server attempt to redo the sync write of the buffers . If another error happens simply pass that back up the stack .
|
40,476
|
private VirtualConnection startEarlyRead ( InterChannelCallback cb , boolean forceQueue ) { getLink ( ) . disallowRewrites ( ) ; setAppReadCallback ( cb ) ; if ( headersParsed ( ) && ! getResponseImpl ( ) . isTemporaryStatusCode ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "earlyRead: Final response already received." ) ; } if ( forceQueue ) { cb . complete ( getVC ( ) ) ; return null ; } return getVC ( ) ; } if ( headersParsed ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "earlyRead: Message exists, isOwner: " + isResponseOwner ( ) ) ; } resetMsgParsedState ( ) ; if ( ! isResponseOwner ( ) ) { setMyResponse ( null ) ; getResponseImpl ( ) ; } else { getResponseImpl ( ) . clear ( ) ; } } VirtualConnection vc = parseResponseMessageAsync ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "earlyRead: return vc=" + vc ) ; } if ( null != vc && forceQueue ) { cb . complete ( getVC ( ) ) ; return null ; } return vc ; }
|
Common utility method to start the response read now regardless of the request message state .
|
40,477
|
public void setRequest ( HttpRequestMessage msg ) throws IllegalRequestObjectException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "setRequest: " + msg ) ; } if ( null == msg ) { throw new IllegalRequestObjectException ( "Illegal null message" ) ; } HttpRequestMessageImpl temp = null ; try { temp = ( HttpRequestMessageImpl ) msg ; } catch ( ClassCastException cce ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Non msg impl passed to setRequest" ) ; } throw new IllegalRequestObjectException ( "Invalid message provided" ) ; } if ( null != getMyRequest ( ) && isRequestOwner ( ) ) { if ( ! getMyRequest ( ) . equals ( temp ) ) { getMyRequest ( ) . destroy ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Caller overlaying same message" ) ; } } } setMyRequest ( temp ) ; VersionValues version = temp . getVersionValue ( ) ; getMyRequest ( ) . init ( this ) ; getMyRequest ( ) . setVersion ( version ) ; updatePersistence ( getMyRequest ( ) ) ; getResponseImpl ( ) . setHeaderChangeLimit ( getMyRequest ( ) . getHeaderChangeLimit ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "setRequest" ) ; } }
|
Set the request message in this service context .
|
40,478
|
public void sendRequestHeaders ( ) throws IOException , MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "sendRequestHeaders(sync)" ) ; } if ( headersSent ( ) ) { throw new MessageSentException ( "Headers already sent" ) ; } setPartialBody ( true ) ; getLink ( ) . setAllowReconnect ( true ) ; try { sendHeaders ( getRequestImpl ( ) ) ; } catch ( IOException e ) { reConnect ( e ) ; } if ( shouldReadResponseImmediately ( ) ) { startResponseReadSync ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "sendRequestHeaders(sync)" ) ; } }
|
Send the headers for the outgoing request synchronously .
|
40,479
|
public VirtualConnection sendRequestHeaders ( InterChannelCallback callback , boolean bForce ) throws MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "sendRequestHeaders(async)" ) ; } if ( headersSent ( ) ) { throw new MessageSentException ( "Headers already sent" ) ; } setPartialBody ( true ) ; getLink ( ) . setAllowReconnect ( true ) ; setForceAsync ( bForce ) ; setAppWriteCallback ( callback ) ; VirtualConnection vc = sendHeaders ( getRequestImpl ( ) , HttpOSCWriteCallback . getRef ( ) ) ; if ( null != vc && shouldReadResponseImmediately ( ) ) { vc = startResponseRead ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "sendRequestHeaders(async): " + vc ) ; } return vc ; }
|
Send the headers for the outgoing request asynchronously .
|
40,480
|
public void sendRequestBody ( WsByteBuffer [ ] body ) throws IOException , MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "sendRequestBody(sync)" ) ; } if ( isMessageSent ( ) ) { throw new MessageSentException ( "Message already sent" ) ; } if ( ! headersSent ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Setting partial body true" ) ; } setPartialBody ( true ) ; } getLink ( ) . setAllowReconnect ( true ) ; try { sendOutgoing ( body , getRequestImpl ( ) ) ; } catch ( IOException e ) { reConnect ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "sendRequestBody(sync)" ) ; } }
|
Send the given body buffers for the outgoing request synchronously . If chunked encoding is set then each call to this method will be considered a chunk and encoded as such . If the message is Content - Length defined then the buffers will simply be sent out with no modifications .
|
40,481
|
public VirtualConnection sendRequestBody ( WsByteBuffer [ ] body , InterChannelCallback callback , boolean bForce ) throws MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "sendRequestBody(async)" ) ; } if ( isMessageSent ( ) ) { throw new MessageSentException ( "Message already sent" ) ; } if ( ! headersSent ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Setting partial body true" ) ; } setPartialBody ( true ) ; } getLink ( ) . setAllowReconnect ( true ) ; setForceAsync ( bForce ) ; setAppWriteCallback ( callback ) ; VirtualConnection vc = sendOutgoing ( body , getRequestImpl ( ) , HttpOSCWriteCallback . getRef ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "sendRequestBody(async): " + vc ) ; } return vc ; }
|
Send the given body buffers for the outgoing request asynchronously . If chunked encoding is set then each call to this method will be considered a chunk and encoded as such . If the message is Content - Length defined then the buffers will simply be sent out with no modifications .
|
40,482
|
public void finishRequestMessage ( WsByteBuffer [ ] body ) throws IOException , MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "finishRequestMessage(sync)" ) ; } if ( isMessageSent ( ) ) { throw new MessageSentException ( "Message already sent" ) ; } if ( ! headersSent ( ) ) { if ( ! getRequestImpl ( ) . isChunkedEncodingSet ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Setting partial body false" ) ; } setPartialBody ( false ) ; } } if ( getHttpConfig ( ) . runningOnZOS ( ) ) { getVC ( ) . getStateMap ( ) . put ( HttpConstants . FINAL_WRITE_MARK , "true" ) ; } getLink ( ) . setAllowReconnect ( true ) ; try { sendFullOutgoing ( body , getRequestImpl ( ) ) ; } catch ( IOException e ) { reConnect ( e ) ; } if ( this . bEarlyReads ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "finishRequestMessage(sync): early read is active" ) ; } return ; } if ( headersParsed ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Response headers already parsed" ) ; } if ( this . bTempResponsesUsed || ! getResponseImpl ( ) . isTemporaryStatusCode ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "finishRequestMessage(sync): already parsed" ) ; } return ; } resetRead ( ) ; readSyncResponse ( ) ; } else { startResponseReadSync ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "finishRequestMessage(sync)" ) ; } }
|
Send the given body buffers for the outgoing request synchronously . If chunked encoding is set then these buffers will be considered a chunk and encoded as such . If the message is Content - Length defined then the buffers will simply be sent out with no modifications . This marks the end of the outgoing message . This method will return when the response has been received and parsed .
|
40,483
|
public VirtualConnection finishRequestMessage ( WsByteBuffer [ ] body , InterChannelCallback callback , boolean bForce ) throws MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "finishRequestMessage(async)" ) ; } if ( isMessageSent ( ) ) { throw new MessageSentException ( "Message already sent" ) ; } if ( ! headersSent ( ) ) { if ( ! getRequestImpl ( ) . isChunkedEncodingSet ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Setting partial body false" ) ; } setPartialBody ( false ) ; } } if ( getHttpConfig ( ) . runningOnZOS ( ) ) { getVC ( ) . getStateMap ( ) . put ( HttpConstants . FINAL_WRITE_MARK , "true" ) ; } setForceAsync ( bForce ) ; getLink ( ) . setAllowReconnect ( true ) ; setAppWriteCallback ( callback ) ; VirtualConnection vc = sendFullOutgoing ( body , getRequestImpl ( ) , HttpOSCWriteCallback . getRef ( ) ) ; if ( null != vc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Request write completed immediately." ) ; } if ( this . bEarlyReads ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "finishRequestMessage(async): early read is active" ) ; } return getVC ( ) ; } if ( headersParsed ( ) ) { if ( this . bTempResponsesUsed || ! getResponseImpl ( ) . isTemporaryStatusCode ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "finishRequestMessage(async): already parsed" ) ; } return getVC ( ) ; } resetRead ( ) ; readAsyncResponse ( ) ; vc = null ; } else { vc = startResponseRead ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "finishRequestMessage(async): " + vc ) ; } return vc ; }
|
Send the given body buffers for the outgoing request asynchronously . If chunked encoding is set then these buffers will be considered a chunk and encoded as such . If the message is Content - Length defined then the buffers will simply be sent out with no modifications . This marks the end of the outgoing message . The callback will be called when the response has been received and parsed .
|
40,484
|
private HttpInvalidMessageException checkRequestValidity ( ) { if ( shouldReadResponseImmediately ( ) ) { return null ; } long len = getRequest ( ) . getContentLength ( ) ; long num = getNumBytesWritten ( ) ; if ( HeaderStorage . NOTSET != len && num != len ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Request had content-length of " + len + " but sent " + num ) ; } setPersistent ( false ) ; return new HttpInvalidMessageException ( "Request length " + len + " but sent " + num ) ; } return null ; }
|
Once we ve fully written the request message do any final checks to verify it s correctness . If something was incorrect then an exception will be handed to the caller and that should be passed along to the application channel above .
|
40,485
|
VirtualConnection parseResponseMessageAsync ( ) { VirtualConnection readVC = null ; try { do { if ( parseMessage ( ) ) { return getVC ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reading for more data to parse" ) ; } setupReadBuffers ( getHttpConfig ( ) . getIncomingHdrBufferSize ( ) , false ) ; readVC = getTSC ( ) . getReadInterface ( ) . read ( 1 , HttpOSCReadCallback . getRef ( ) , false , getReadTimeout ( ) ) ; } while ( null != readVC ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception while parsing response: " + e ) ; } setPersistent ( false ) ; if ( this . bEarlyReads || this . bTempResponsesUsed ) { getAppReadCallback ( ) . error ( getVC ( ) , e ) ; } else { getAppWriteCallback ( ) . error ( getVC ( ) , e ) ; } return null ; } return null ; }
|
Method to clean the service context and read another response message asynchronously . This will return a non - null virtual connection object if the new response message is fully parsed with no async reads needed . Otherwise it will return null and a callback will be used later .
|
40,486
|
private void parseResponseMessageSync ( ) throws IOException { if ( isReadDataAvailable ( ) ) { try { if ( parseMessage ( ) ) { this . numResponsesReceived ++ ; return ; } } catch ( IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "IOException while parsing response: " + ioe ) ; } throw ioe ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception while parsing response: " + e ) ; } throw new IOException ( e . getMessage ( ) , e ) ; } } while ( true ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reading for data to parse" ) ; } try { setupReadBuffers ( getHttpConfig ( ) . getIncomingHdrBufferSize ( ) , false ) ; getTSC ( ) . getReadInterface ( ) . read ( 1 , getReadTimeout ( ) ) ; } catch ( IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception while reading response: " + ioe ) ; } reConnect ( ioe ) ; } try { if ( parseMessage ( ) ) { this . numResponsesReceived ++ ; return ; } } catch ( IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "IOException while parsing response: " + ioe ) ; } throw ioe ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception while parsing response: " + e ) ; } throw new IOException ( e . getMessage ( ) , e ) ; } } }
|
Method to read for a response message synchronously . This will return when the message headers are completely parsed or throw an exception if an error occurs . This method does not contain any logic on what to do with the response it just wraps the reading and parsing stage .
|
40,487
|
private boolean checkBodyValidity ( ) throws IOException { if ( isImmediateReadEnabled ( ) || this . bEarlyReads ) { if ( ! headersParsed ( ) ) { IOException ioe = new IOException ( "Request headers not sent yet" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Attempt to read response prior to sendRequest" ) ; } throw ioe ; } } else if ( ! isMessageSent ( ) ) { IOException ioe = new IOException ( "Request not finished yet" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Attempt to read response prior to finishRequest" ) ; } throw ioe ; } return isIncomingBodyValid ( ) ; }
|
Utility method to check whether the upcoming read for the response body is either valid at this point or even necessary .
|
40,488
|
protected void wakeupReadAhead ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Received synchronous read-ahead wake-up call." ) ; } synchronized ( this . readAheadSyncer ) { this . readAheadSyncer . notify ( ) ; } }
|
Method used by the read - ahead callback thread to notify this service context that the read has completed .
|
40,489
|
private void prepareForCaller ( IdentifierType id , String qualifiedEntityType , String uid , String uName , boolean isIgnoreRepositoryErrors , Set < String > failureRepositoryIds ) throws WIMException { String METHODNAME = "prepareForCaller" ; if ( id != null ) { String externalId = id . getExternalId ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " prepare identifier for caller, set [uniqueId=" + externalId + "]" ) ; } if ( externalId != null ) { id . setUniqueId ( externalId ) ; } id . setExternalId ( null ) ; } }
|
prepare the identifier DataObject for caller .
|
40,490
|
private Entity innerRetrieveEntityFromRepository ( Root root , Entity retEntDO , String uniqueId , boolean isAllowOperationIfReposDown , Set < String > failureRepositoryIds ) throws WIMException { String METHODNAME = "retrieveEntityFromRepository" ; List < String > reposIds = getRepositoryManager ( ) . getRepoIds ( ) ; for ( int i = 0 ; ( i < reposIds . size ( ) && retEntDO == null ) ; i ++ ) { String reposId = reposIds . get ( i ) ; try { Root retRoot = getRepositoryManager ( ) . getRepository ( reposId ) . get ( root ) ; if ( retRoot != null ) { List < Entity > entList = retRoot . getEntities ( ) ; if ( entList . size ( ) >= 1 ) { retEntDO = entList . get ( 0 ) ; } } } catch ( EntityNotFoundException e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " EntityNotFoundException[reposId=" + reposId + "] - " + uniqueId ) ; } } catch ( WIMSystemException wse ) { String message = wse . getMessage ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " WSE message = " + message ) ; } if ( message != null && message . contains ( "CWIML4520E" ) && message . contains ( "javax.naming.InvalidNameException" ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " WIMSystemException [reposId=" + reposId + "] - " + message ) ; } } else throw wse ; } catch ( Exception e ) { if ( ! isAllowOperationIfReposDown ) { if ( e instanceof WIMException ) { throw ( WIMException ) e ; } throw new WIMException ( e ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , METHODNAME + " IGNORE: exception [" + e . getMessage ( ) + "] when retrieve entity from repository [" + reposId + "]" ) ; failureRepositoryIds . add ( reposId ) ; } } } return retEntDO ; }
|
Method created so we can ffdc the inner EntityNotFoundException
|
40,491
|
private String getRealmNameOrFirstBest ( Root root ) { String value = null ; value = getRealmName ( root ) ; if ( value == null ) { try { value = getRealmName ( ) ; } catch ( Exception e ) { } } return value ; }
|
First try to get the default or primary realm defined . If not found then use the realm name from one of the registries . Added for populating audit records .
|
40,492
|
@ FFDCIgnore ( { EntityNotFoundException . class , Exception . class } ) private String getUniqueNameByUniqueId ( String uniqueId , boolean isAllowOperationIfReposDown , Set < String > failureRepositoryIds ) throws WIMException { final String METHODNAME = "getUniqueNameByUniqueId" ; String uniqueName = null ; boolean found = false ; int i = 0 ; Root temp = new Root ( ) ; Entity entity = new Entity ( ) ; IdentifierType id = new IdentifierType ( ) ; id . setExternalId ( uniqueId ) ; entity . setIdentifier ( id ) ; temp . getEntities ( ) . add ( entity ) ; List < String > repositoryIds = repositoryManager . getRepoIds ( ) ; while ( i < repositoryIds . size ( ) && ! found ) { try { Root returnedRoot = repositoryManager . getRepository ( repositoryIds . get ( i ) ) . get ( temp ) ; if ( returnedRoot != null ) { List < Entity > pes = returnedRoot . getEntities ( ) ; if ( pes != null ) { Entity ent = pes . get ( 0 ) ; if ( ent != null ) { IdentifierType entityId = ent . getIdentifier ( ) ; if ( entityId != null ) { uniqueName = entityId . getUniqueName ( ) ; found = true ; } } } } } catch ( EntityNotFoundException e ) { i ++ ; } catch ( Exception e ) { if ( ! isAllowOperationIfReposDown ) { if ( e instanceof WIMException ) { throw ( WIMException ) e ; } throw new WIMException ( e ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , METHODNAME + " IGNORE: exception [" + e . getMessage ( ) + "] on repository [" + repositoryIds . get ( i ) + "]" ) ; failureRepositoryIds . add ( repositoryIds . get ( i ) ) ; i ++ ; } } } return uniqueName ; }
|
Get the uniqueName based on the specified uniqueId
|
40,493
|
void initResolve ( ) { featureNamesToResolve = new HashSet < > ( ) ; samplesToInstall = new ArrayList < > ( ) ; resolvedFeatures = new HashMap < > ( ) ; requestedFeatureNames = new HashSet < > ( ) ; featuresMissing = new ArrayList < > ( ) ; resourcesWrongProduct = new ArrayList < > ( ) ; requirementsFoundForOtherProducts = new HashSet < > ( ) ; missingTopLevelRequirements = new ArrayList < > ( ) ; missingRequirements = new ArrayList < > ( ) ; resolverRepository . clearPreferredVersions ( ) ; }
|
Initialize all the fields used for a resolution
|
40,494
|
List < List < RepositoryResource > > createInstallLists ( ) { List < List < RepositoryResource > > installLists = new ArrayList < > ( ) ; for ( SampleResource sample : samplesToInstall ) { installLists . add ( createInstallList ( sample ) ) ; } for ( String featureName : requestedFeatureNames ) { List < RepositoryResource > installList = createInstallList ( featureName ) ; if ( ! installList . isEmpty ( ) ) { installLists . add ( installList ) ; } } for ( ProvisioningFeatureDefinition feature : resolvedFeatures . values ( ) ) { if ( feature . isAutoFeature ( ) && ! requestedFeatureNames . contains ( feature . getSymbolicName ( ) ) && feature instanceof KernelResolverEsa ) { installLists . add ( createInstallList ( feature . getSymbolicName ( ) ) ) ; } } return installLists ; }
|
Create the install lists for the resources which we were asked to resolve
|
40,495
|
public final synchronized long nextId ( Object obj ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "nextId" , obj ) ; long id = _idCount ++ ; while ( _idMap . get ( id ) != null ) { id = _idCount ++ ; } _idMap . put ( id , obj ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "nextId" , new Long ( id ) ) ; return id ; }
|
Returns the next available id starting from 1 and associates it with the given object . This method should be used during the creation of a new recoverable object .
|
40,496
|
public final synchronized void removeId ( long id ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "removeId" , new Long ( id ) ) ; _idMap . remove ( id ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "removeId" ) ; }
|
Remove the given id from the map . This method should be called at the end of a recoverable object s lifetime .
|
40,497
|
public final synchronized boolean reserveId ( long id , Object obj ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "reserveId" , new Object [ ] { new Long ( id ) , obj } ) ; boolean reserved = false ; if ( _idMap . get ( id ) == null ) { _idMap . put ( id , obj ) ; reserved = true ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "reserveId" , new Boolean ( reserved ) ) ; return reserved ; }
|
Reserve the given id and associate it with the given object . This method should be used during recovery when there is a requirement to create a new object with a specific id rather than the one that is next available .
|
40,498
|
public final synchronized Object [ ] getAllObjects ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getAllObjects" ) ; Object [ ] values = _idMap . values ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getAllObjects" , values ) ; return values ; }
|
Return an array of all the objects currently held in the table .
|
40,499
|
public synchronized Object getCacheKey ( EvictionTableEntry evt ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { Object key = null ; if ( filemgr == null ) { throw new HashtableOnDiskException ( "No Filemanager" ) ; } HashtableEntry e = findEntry ( evt , RETRIEVE_KEY ) ; if ( e != null ) key = e . getKey ( ) ; return key ; }
|
This method is used by garbage collector to get the cache key for the corresponding EvictionTableEntry
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.