idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
164,100
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 . getForm...
Synchronized . Remove an Entry from the list .
164,101
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 .
164,102
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 .
164,103
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 ) { specif...
Add the member to the correct list
164,104
public void removeMember ( JSConsumerKey key ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeMember" , key ) ; LocalQPConsumerKey anyKey = null ; synchronized ( consumerDispatcher . getDestination ( ) . getReadyConsumerPointLock ( ) ) { if ( singleMember != nul...
Remove a member from the group
164,105
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 ( generalMem...
Return one of the groups non - specific members
164,106
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 .
164,107
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...
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 .
164,108
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...
Returns the member which last matched a message
164,109
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
164,110
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
164,111
public Object createResource ( ResourceInfo info ) throws Exception { ComponentMetaData cData = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) . getComponentMetaData ( ) ; if ( cData != null ) applications . add ( cData . getJ2EEName ( ) . getApplication ( ) ) ; return cloudantSvc . createResource ( (...
Invoked when a cloudant Database is injected or looked up .
164,112
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
164,113
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,114
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
164,115
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
164,116
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 (...
F743 - 17630CodRv
164,117
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
164,118
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 .
164,119
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 .
164,120
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 .
164,121
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
164,122
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
164,123
public static OpenAPIConnection openAPIDocsConnection ( LibertyServer server , boolean secure ) { return new OpenAPIConnection ( server , OPEN_API_DOCS ) . secure ( secure ) ; }
creates default connection for OpenAPI docs endpoint
164,124
public static OpenAPIConnection openAPIUIConnection ( LibertyServer server , boolean secure ) { return new OpenAPIConnection ( server , OPEN_API_UI ) . secure ( secure ) ; }
creates default connection for OpenAPI UI endpoint
164,125
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 .
164,126
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 , cacheNam...
Get s the entry s value
164,127
protected void setValue ( Object value ) { this . value = value ; serializedValue = null ; timeStamp = System . currentTimeMillis ( ) ; this . valueHashcode = 0 ; }
Set s the entry s value
164,128
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 .
164,129
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 .
164,130
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" , thi...
Get s the userMetaData
164,131
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 ( loc...
Computes the best - effort size of the cache entry s value . Returns - 1 if value could not be computed .
164,132
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...
Added for support of HttpSessionIdListeners
164,133
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 .
164,134
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 .
164,135
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 .
164,136
private void _idAdded ( String clientId ) { _ids . add ( _getIdFromClientId ( clientId ) ) ; _unvisitedClientIds . add ( clientId ) ; _addSubtreeClientId ( clientId ) ; }
an new id has been added .
164,137
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 .
164,138
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 .
164,139
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 ,...
subtree client ids
164,140
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
164,141
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 ( confi...
Create an ORB for a CORBABean server context .
164,142
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 .
164,143
private ORB createORB ( String [ ] args , Properties props ) { return ORB . init ( args , props ) ; }
Create an ORB instance using the configured argument and property bundles .
164,144
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 .
164,145
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 .
164,146
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 .
164,147
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
164,148
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
164,149
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 Boole...
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 .
164,150
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 .
164,151
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 ) ...
Sets the reference to a dynamic MBean .
164,152
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 .
164,153
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 .
164,154
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 .
164,155
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 ....
Copy the buffer parameters from the indirect to the backing direct buffer if necessary .
164,156
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
164,157
protected void prepareExpansion ( ) throws IOException { WsResource expansionResource = deployedAppServices . getLocationAdmin ( ) . resolveResource ( AppManagerConstants . EXPANDED_APPS_DIR ) ; expansionResource . create ( ) ; }
Application expansion ...
164,158
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 , "Creat...
Create deployment information for a java enterprise application .
164,159
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, #bott...
Creates the CSS content string to be used to format page .
164,160
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 .
164,161
protected void reConnect ( VirtualConnection inVC , IOException ioe ) { if ( getLink ( ) . isReconnectAllowed ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Attempting reconnect: " + getLink ( ) . getVirtualConnection ( ) ) ; } getTSC ( ) . getReadInterface ( ) ....
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 .
164,162
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" ) ; } getAppReadCal...
Call the error callback of the app above .
164,163
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 . position...
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 .
164,164
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...
Once we know we are reconnected to the target server reset the TCP buffers and start the async resend .
164,165
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 .
164,166
private VirtualConnection startEarlyRead ( InterChannelCallback cb , boolean forceQueue ) { getLink ( ) . disallowRewrites ( ) ; setAppReadCallback ( cb ) ; if ( headersParsed ( ) && ! getResponseImpl ( ) . isTemporaryStatusCode ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . d...
Common utility method to start the response read now regardless of the request message state .
164,167
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" ) ; } HttpRequestMessag...
Set the request message in this service context .
164,168
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 ) ; ...
Send the headers for the outgoing request synchronously .
164,169
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...
Send the headers for the outgoing request asynchronously .
164,170
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 ( ! h...
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 .
164,171
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 MessageSent...
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 .
164,172
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" ) ; ...
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...
164,173
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 M...
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...
164,174
private HttpInvalidMessageException checkRequestValidity ( ) { if ( shouldReadResponseImmediately ( ) ) { return null ; } long len = getRequest ( ) . getContentLength ( ) ; long num = getNumBytesWritten ( ) ; if ( HeaderStorage . NOTSET != len && num != len ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDe...
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 .
164,175
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 ( ) . getIn...
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 .
164,176
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 pars...
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 .
164,177
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...
Utility method to check whether the upcoming read for the response body is either valid at this point or even necessary .
164,178
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 .
164,179
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 .
164,180
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
164,181
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 .
164,182
@ 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
164,183
void initResolve ( ) { featureNamesToResolve = new HashSet < > ( ) ; samplesToInstall = new ArrayList < > ( ) ; resolvedFeatures = new HashMap < > ( ) ; requestedFeatureNames = new HashSet < > ( ) ; featuresMissing = new ArrayList < > ( ) ; resourcesWrongProduct = new ArrayList < > ( ) ; requirementsFoundForOtherProduc...
Initialize all the fields used for a resolution
164,184
List < List < RepositoryResource > > createInstallLists ( ) { List < List < RepositoryResource > > installLists = new ArrayList < > ( ) ; for ( SampleResource sample : samplesToInstall ) { installLists . add ( createInstallList ( sample ) ) ; } for ( String featureName : requestedFeatureNames ) { List < RepositoryResou...
Create the install lists for the resources which we were asked to resolve
164,185
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 ) ) ; retur...
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 .
164,186
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 .
164,187
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 ( ) ...
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 .
164,188
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 .
164,189
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 , R...
This method is used by garbage collector to get the cache key for the corresponding EvictionTableEntry
164,190
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 ; HashtableEntry e = findEntry ( key , RET...
Removes the mapping for this key and deletes the object from disk .
164,191
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
164,192
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 ( ) ; try { for ( int i = index , j = 0 ; i < t...
Generic routine to walk the hash table and pass each entry to the action interface .
164,193
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 .
164,194
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 Hasht...
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 .
164,195
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 . table...
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 .
164,196
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
164,197
private void doRehash ( int new_table_size ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { iterationLock . p ( ) ; long new_table = 0 ; header . setRehashFlag ( 1 ) ; new_table = filemgr . allocateAndClear ( new_table_size * DWORDSIZE ) ; header . initNew...
Double the size of the hash table -
164,198
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 .
164,199
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 .