idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
163,700
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 ) { // Our...
Add the member to the correct list
252
7
163,701
public void removeMember ( JSConsumerKey key ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeMember" , key ) ; LocalQPConsumerKey anyKey = null ; // We lock the CD so other members are not added/removed while // we do this synchronized ( consumerDispatcher . ge...
Remove a member from the group
614
6
163,702
public LocalQPConsumerKey resolvedKey ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resolvedKey" ) ; LocalQPConsumerKey key = null ; if ( generalMemberCount > 0 ) { // If we only have one this is easy if ( singleMember != null ) key = singleMember ; // Otherwise,...
Return one of the groups non - specific members
324
9
163,703
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 ...
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 .
126
62
163,704
public boolean filterMatches ( AbstractItem item ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "filterMatches" , item ) ; boolean match = false ; LocalQPConsumerKey matchingMember = null ; // Hopefully we have a general consumer so we don't need to parse the message...
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 .
446
42
163,705
public ConsumableKey getMatchingMember ( ConsumableKey preferedKey ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMatchingMember" ) ; ConsumableKey key = null ; // The last move of the getCursor found a match if ( currentMatch ) { // There was a general waiter so...
Returns the member which last matched a message
499
8
163,706
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 ; e...
Record the fact that one of the members has a message attached
222
12
163,707
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 . isEntryEnable...
Only called when consumer is ready and when already holding the ConsumerDispatchers readyConsumerPointLock
118
19
163,708
@ Override public Object createResource ( ResourceInfo info ) throws Exception { ComponentMetaData cData = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) . getComponentMetaData ( ) ; if ( cData != null ) applications . add ( cData . getJ2EEName ( ) . getApplication ( ) ) ; return cloudantSvc . createR...
Invoked when a cloudant Database is injected or looked up .
144
13
163,709
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
62
15
163,710
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 ...
Delegates resolution to DefaultFaceletFactory reference . Also caches URLs for relative paths .
164
17
163,711
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 ) c...
Given the passed FaceletContext apply our child FaceletHandlers to the passed parent
189
17
163,712
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
70
14
163,713
@ Override public synchronized void process ( ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "process: " + this ) ; // ------------------------------------------------------------------- // Determine if it'...
F743 - 17630CodRv
436
9
163,714
private void createPersistenceMaps ( ComponentNameSpaceConfiguration masterCompNSConfig , List < ComponentNameSpaceConfiguration > compNSConfigs ) { Map < Class < ? > , Collection < String > > classesToComponents = new HashMap < Class < ? > , Collection < String > > ( ) ; Map < String , Collection < String > > persiste...
F743 - 30682
445
6
163,715
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 < ...
Provides nice looking trace output for the EJBContext . lookup data structure .
282
18
163,716
@ Override 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 .
63
13
163,717
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 .
72
11
163,718
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
51
11
163,719
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 ) { As...
Downloads contents of URL and converts them to an OpenAPI model
102
13
163,720
public static OpenAPIConnection openAPIDocsConnection ( LibertyServer server , boolean secure ) { return new OpenAPIConnection ( server , OPEN_API_DOCS ) . secure ( secure ) ; }
creates default connection for OpenAPI docs endpoint
48
9
163,721
public static OpenAPIConnection openAPIUIConnection ( LibertyServer server , boolean secure ) { return new OpenAPIConnection ( server , OPEN_API_UI ) . secure ( secure ) ; }
creates default connection for OpenAPI UI endpoint
48
9
163,722
public void processDrsInbound ( long localClock ) { // Is dsrClock timestamp from the remote machine missing // or was the CE's timestampls already altered? if ( drsClock <= 0 ) { return ; } // Adjust timestamps for this machines clock. long clockDifference = localClock - drsClock ; if ( expirationTime > 0 ) expiration...
Handle needed processing after receiving a CE from a remote mahine via DRS .
122
16
163,723
@ Override 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...
Get s the entry s value
263
6
163,724
protected void setValue ( Object value ) { this . value = value ; serializedValue = null ; timeStamp = System . currentTimeMillis ( ) ; this . valueHashcode = 0 ; }
Set s the entry s value
43
6
163,725
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 !=...
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 .
403
54
163,726
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 ....
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 .
498
31
163,727
@ Override 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" , ...
Get s the userMetaData
118
6
163,728
@ Override 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 . ge...
Computes the best - effort size of the cache entry s value . Returns - 1 if value could not be computed .
119
24
163,729
public HttpSession generateNewId ( WebApp webapp ) { HttpSession existingSession = ( HttpSession ) webappToSessionMap . get ( webapp ) ; if ( existingSession != null ) { if ( ! webapp . getSessionContext ( ) . isValid ( existingSession , request , false ) ) { existingSession = null ; } } else { // Looks like the sessio...
Added for support of HttpSessionIdListeners
302
10
163,730
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 (...
Returns the recoverable unit section previously created with the supplied identity . If no such recoverable unit section exists this method returns null .
127
26
163,731
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 ...
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 .
291
39
163,732
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...
Resets the state of this object . Used for pooling .
192
13
163,733
private void _idAdded ( String clientId ) { // An id to visit has been added, update our other // collections to reflect this. // Update the ids collection _ids . add ( _getIdFromClientId ( clientId ) ) ; // Update the unvisited ids collection _unvisitedClientIds . add ( clientId ) ; // Update the subtree ids collectio...
an new id has been added .
95
7
163,734
private String _getVisitId ( UIComponent component ) { // We first check to see whether the component's id // is in our id collection. We do this before checking // for the full client id because getting the full client id // is more expensive than just getting the local id. String id = component . getId ( ) ; if ( ( i...
If so returns its client id . If not returns null .
173
12
163,735
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 = clien...
out the trailing id segmetn .
123
9
163,736
private void _addSubtreeClientId ( String clientId ) { // Loop over the client id and find the substring corresponding to // each ancestor NamingContainer client id. For each ancestor // NamingContainer, add an entry into the map for the full client // id. final char separator = getFacesContext ( ) . getNamingContainer...
subtree client ids
280
5
163,737
private void _removeSubtreeClientId ( String clientId ) { // Loop through each entry in the map and check to see whether // the client id to remove should be contained in the corresponding // collection - ie. whether the key (the NamingContainer client id) // is present at the start of the client id to remove. for ( St...
entries from our subtree collections
158
7
163,738
@ Override 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 ) , translateToTargetPr...
Create an ORB for a CORBABean server context .
96
13
163,739
@ Override 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 .
71
12
163,740
private ORB createORB ( String [ ] args , Properties props ) { return ORB . init ( args , props ) ; }
Create an ORB instance using the configured argument and property bundles .
28
13
163,741
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 ( Trace...
Translate a CORBABean configuration into an array of arguments used to configure the ORB instance .
132
21
163,742
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 ) ; ...
Translate client configuration into the argument bundle needed to instantiate the client ORB instance .
136
18
163,743
private Properties translateToClientProps ( Map < String , Object > clientProps , Collection < SubsystemFactory > subsystemFactories ) throws ConfigException { Properties result = createYokoORBProperties ( ) ; for ( SubsystemFactory sf : subsystemFactories ) { addInitializerPropertyForSubsystem ( result , sf , false ) ...
Translate client configuration into the property bundle necessary to configure the client ORB instance .
97
17
163,744
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 =...
Return the security name of the current subject on the thread
163
11
163,745
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 . isDebugEnabl...
Return the accessid of the current subject on the thread
108
11
163,746
private Boolean compareListValues ( // was BooleanValue Object firstVal , Object secondVal , boolean lessThan , boolean permissive , boolean overallTrue ) // If true we are searching for at least one TRUE result, else at least one FALSE. { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( ccla...
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 .
276
34
163,747
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 ...
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 .
129
29
163,748
protected void setMBean ( ServiceReference < ? > ref ) { // Use "jmx.objectname" for determining the ObjectName to be consistent with Apache Aries. Object jmxObjectName = ref . getProperty ( "jmx.objectname" ) ; if ( jmxObjectName instanceof String ) { try { // Construct an ObjectName from the "jmx.objectname" property...
Sets the reference to a dynamic MBean .
232
11
163,749
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 .
94
10
163,750
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 .
91
6
163,751
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 . isEntryEn...
Set the direct bytebuffer that backs an indirect heap buffer to the input buffer .
109
16
163,752
public void setParmsToDirectBuffer ( ) { if ( oByteBuffer . isDirect ( ) ) { this . oWsBBDirect = this . oByteBuffer ; return ; } if ( oWsBBDirect == null ) { this . oWsBBDirect = ByteBuffer . allocateDirect ( oByteBuffer . capacity ( ) ) ; } // set the position and limit this . oWsBBDirect . limit ( oByteBuffer . limi...
Copy the buffer parameters from the indirect to the backing direct buffer if necessary .
115
15
163,753
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 ( ) . getHos...
Returns a JSON array of CommandResult serialization representing the steps taken in that host
116
16
163,754
protected void prepareExpansion ( ) throws IOException { WsResource expansionResource = deployedAppServices . getLocationAdmin ( ) . resolveResource ( AppManagerConstants . EXPANDED_APPS_DIR ) ; expansionResource . create ( ) ; }
Application expansion ...
53
3
163,755
@ Override 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 ( _...
Create deployment information for a java enterprise application .
686
9
163,756
protected String createCssContentString ( ) { StringBuilder css = new StringBuilder ( ) ; css . append ( "<style>" ) ; // body css . append ( "body {" ) ; css . append ( "background-color: #152935;" ) ; css . append ( "font-family: serif;" ) ; css . append ( "margin: 0;" ) ; css . append ( "}\n" ) ; // #top, #bottom cs...
Creates the CSS content string to be used to format page .
349
13
163,757
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...
Called by the channel below us when a read has completed .
394
13
163,758
protected void reConnect ( VirtualConnection inVC , IOException ioe ) { if ( getLink ( ) . isReconnectAllowed ( ) ) { // start the reconnect if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Attempting reconnect: " + getLink ( ) . getVirtualConnection ( ) ) ; } // 359362 - ...
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 .
143
30
163,759
void callErrorCallback ( VirtualConnection inVC , IOException ioe ) { // otherwise pass the error along to the channel above us, or close // the connection if nobody is above setPersistent ( false ) ; if ( this . bEarlyReads && null != getAppReadCallback ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isD...
Call the error callback of the app above .
265
9
163,760
private boolean resetWriteBuffers ( ) { int stop = getPendingStop ( ) ; WsByteBuffer [ ] list = getPendingBuffers ( ) ; // verify we can actually attempt the re-write if ( null == this . positionList || null == list ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Erro...
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 .
243
34
163,761
protected void nowReconnectedAsync ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reconnected async for " + this ) ; } // reset the data buffers first if ( ! resetWriteBuffers ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr ....
Once we know we are reconnected to the target server reset the TCP buffers and start the async resend .
588
22
163,762
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 (...
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 .
324
32
163,763
private VirtualConnection startEarlyRead ( InterChannelCallback cb , boolean forceQueue ) { // disallow rewrites once we start mixing the request and temp responses getLink ( ) . disallowRewrites ( ) ; setAppReadCallback ( cb ) ; // check for an existing final response if ( headersParsed ( ) && ! getResponseImpl ( ) . ...
Common utility method to start the response read now regardless of the request message state .
444
16
163,764
@ Override public void setRequest ( HttpRequestMessage msg ) throws IllegalRequestObjectException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "setRequest: " + msg ) ; } // null message isn't allowed if ( null == msg ) { throw new IllegalRequestObjectException ( "Ille...
Set the request message in this service context .
423
9
163,765
@ Override 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 ...
Send the headers for the outgoing request synchronously .
207
10
163,766
@ Override public VirtualConnection sendRequestHeaders ( InterChannelCallback callback , boolean bForce ) throws MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "sendRequestHeaders(async)" ) ; } if ( headersSent ( ) ) { throw new MessageSentException...
Send the headers for the outgoing request asynchronously .
271
11
163,767
@ Override 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" ) ;...
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 .
242
54
163,768
@ Override 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 ...
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 .
300
55
163,769
@ Override 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...
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 . Thi...
629
73
163,770
@ Override public VirtualConnection finishRequestMessage ( WsByteBuffer [ ] body , InterChannelCallback callback , boolean bForce ) throws MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "finishRequestMessage(async)" ) ; } if ( isMessageSent ( ) ) { ...
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 . Th...
724
75
163,771
private HttpInvalidMessageException checkRequestValidity ( ) { if ( shouldReadResponseImmediately ( ) ) { // ignore body validation as this might happen after sending only // the headers if 100-continue, Upgrade, immediate-read, etc. return null ; } long len = getRequest ( ) . getContentLength ( ) ; long num = getNumBy...
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 .
210
43
163,772
VirtualConnection parseResponseMessageAsync ( ) { VirtualConnection readVC = null ; try { do { if ( parseMessage ( ) ) { // finished parsing the message return getVC ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reading for more data to parse" ) ; } // configure...
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 .
304
52
163,773
private void parseResponseMessageSync ( ) throws IOException { // if read buffers are available, then attempt a parse otherwise go // into the "read data then parse" loop if ( isReadDataAvailable ( ) ) { try { // if data is already available, don't modify the buffer if ( parseMessage ( ) ) { this . numResponsesReceived...
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 .
537
52
163,774
private boolean checkBodyValidity ( ) throws IOException { // LI4335 - allow response body reading if early reads are in place if ( isImmediateReadEnabled ( ) || this . bEarlyReads ) { if ( ! headersParsed ( ) ) { // this means they are requesting body buffers prior to sending // the minimum request headers IOException...
Utility method to check whether the upcoming read for the response body is either valid at this point or even necessary .
254
23
163,775
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 .
79
20
163,776
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 . ...
prepare the identifier DataObject for caller .
152
9
163,777
private Entity innerRetrieveEntityFromRepository ( Root root , Entity retEntDO , String uniqueId , boolean isAllowOperationIfReposDown , Set < String > failureRepositoryIds ) throws WIMException { String METHODNAME = "retrieveEntityFromRepository" ; List < String > reposIds = getRepositoryManager ( ) . getRepoIds ( ) ;...
Method created so we can ffdc the inner EntityNotFoundException
529
14
163,778
private String getRealmNameOrFirstBest ( Root root ) { String value = null ; value = getRealmName ( root ) ; if ( value == null ) { try { value = getRealmName ( ) ; } catch ( Exception e ) { // leave realm at null } } 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 .
65
33
163,779
@ 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 f...
Get the uniqueName based on the specified uniqueId
458
10
163,780
void initResolve ( ) { featureNamesToResolve = new HashSet <> ( ) ; samplesToInstall = new ArrayList <> ( ) ; resolvedFeatures = new HashMap <> ( ) ; requestedFeatureNames = new HashSet <> ( ) ; featuresMissing = new ArrayList <> ( ) ; resourcesWrongProduct = new ArrayList <> ( ) ; requirementsFoundForOtherProducts = n...
Initialize all the fields used for a resolution
131
9
163,781
List < List < RepositoryResource > > createInstallLists ( ) { List < List < RepositoryResource >> installLists = new ArrayList <> ( ) ; // Create install list for each sample for ( SampleResource sample : samplesToInstall ) { installLists . add ( createInstallList ( sample ) ) ; } // Create install list for each reques...
Create the install lists for the resources which we were asked to resolve
256
13
163,782
public final synchronized long nextId ( Object obj ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "nextId" , obj ) ; long id = _idCount ++ ; // Keep incrementing the id until we // find one that hasn't been reserved. while ( _idMap . get ( id ) != null ) { id = _idCount ++ ; } // Add the new id to the map associa...
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 .
142
31
163,783
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 .
71
24
163,784
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 ; // The id can only be reserved if it // isn't already in the map if ( _idMap . get ( id ) == null ) { _idMap . put...
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 .
135
43
163,785
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 .
80
13
163,786
public synchronized Object getCacheKey ( EvictionTableEntry evt ) //3821 NK begin throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { Object key = null ; if ( filemgr == null ) { throw new HashtableOnDiskException ( "No Filemanager" ) ; } HashtableEntry e = fin...
This method is used by garbage collector to get the cache key for the corresponding EvictionTableEntry
129
19
163,787
public synchronized boolean remove ( Object key ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { if ( filemgr == null ) { throw new HashtableOnDiskException ( "No Filemanager" ) ; } if ( key == null ) return false ; // no null keys allowed HashtableEntry e...
Removes the mapping for this key and deletes the object from disk .
134
15
163,788
public synchronized boolean updateExpirationInHeader ( Object key , long expirationTime , long validatorExpirationTime ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { if ( filemgr == null ) { throw new HashtableOnDiskException ( "No Filemanager" ) ; } if ...
This method is used to update expiration times in disk entry header
290
12
163,789
int walkHash ( HashtableAction action , int retrieveMode , int index , int length ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { iterationLock . p ( ) ; int tindex = - 1 ; int tableSize = header . tablesize ( ) ; //System.out.println("*** table size= " +...
Generic routine to walk the hash table and pass each entry to the action interface .
531
16
163,790
public void listfiles ( Writer o ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { ListAction act = new ListAction ( o ) ; walkHash ( act , RETRIEVE_KEY , 0 , - 1 ) ; }
Dump all keys to stdout .
61
8
163,791
private void countAndVerifyObjects ( ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { println ( "countAndVerifyObjects(): Hashtable " + filename + " was not closed properly. Validating " ) ; header . set_num_objects ( 0 ) ; HashtableAction act = new Hashta...
This walks the hash table and sets the internal count of objects . Note that it also sort of works as a verifier of the content - if we throw an exception we can be sure the file is corrupted .
206
42
163,792
private void countObjects ( ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { println ( "countObjects(): Hashtable " + filename + " was not closed properly. Validating " ) ; iterationLock . p ( ) ; int count = 0 ; try { for ( int i = 0 ; i < header . tables...
This walks the hash table and sets the internal count of objects . It is streamlined to only get a count and not examine any objects .
238
27
163,793
private void rehash ( ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { int size = ( header . tablesize ( ) * 2 ) + 1 ; if ( this . tempTableSize > size ) { doRehash ( this . tempTableSize ) ; this . tempTableSize = 0 ; } else { doRehash ( size ) ; } }
Internal method to do default rehash of doubling
87
9
163,794
private void doRehash ( int new_table_size ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { // // Acquire the lock to prevent iteration while doubling // iterationLock . p ( ) ; // // Step 0: // This should be our only exposure = for a short time we // wil...
Double the size of the hash table -
261
8
163,795
void setRehashFlag ( long location ) throws IOException , EOFException { rehashInProgress = location ; filemgr . seek ( rehashOffset ) ; filemgr . writeLong ( location ) ; }
Set the rehash indicator . If set during startup we must initiate recovery and complete the rehash .
46
20
163,796
public synchronized boolean contains ( int id ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "contains" , "" + id ) ; mutableKey . setValue ( id ) ; boolean returnValue = idToConvTable . containsKey ( mutableKey ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "contains" , "" + returnValue ...
Test to determine if a particular conversation ID is present in the table .
103
14
163,797
public synchronized ConversationImpl get ( int id ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "get" , "" + id ) ; mutableKey . setValue ( id ) ; ConversationImpl retValue = idToConvTable . get ( mutableKey ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "get" , retValue ) ; return retVa...
Retrieve a conversation from the table by ID
100
9
163,798
public synchronized boolean remove ( int id ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "remove" , "" + id ) ; final boolean result = contains ( id ) ; if ( result ) { mutableKey . setValue ( id ) ; idToConvTable . remove ( mutableKey ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "r...
Remove a conversation from the table by ID
109
8
163,799
public synchronized Iterator iterator ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "iterator" ) ; Iterator returnValue = idToConvTable . values ( ) . iterator ( ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "iterator" , returnValue ) ; return returnValue ; }
Returns an iterator which iterates over the tables contents . The values returned by this iterator are objects of type Conversation .
85
23