idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
160,800
public SIBusMessage receiveNoWait ( final SITransaction tran ) throws SISessionDroppedException , SIConnectionDroppedException , SISessionUnavailableException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SIResourceException , SIErrorException , SIIncorrectCallException { final String methodName = "receiveNoWait" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , tran ) ; } checkValid ( ) ; final SIBusMessage message = _delegate . receiveNoWait ( _parentConnection . mapTransaction ( tran ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , message ) ; } return message ; }
Receives a message . Checks that the session is valid . Maps the transaction parameter before delegating .
220
21
160,801
public void start ( boolean deliverImmediately ) throws SIConnectionDroppedException , SISessionUnavailableException , SIConnectionUnavailableException , SIConnectionLostException , SIResourceException , SIErrorException , SIErrorException { final String methodName = "start" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , Boolean . valueOf ( deliverImmediately ) ) ; } checkValid ( ) ; _delegate . start ( deliverImmediately ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
Starts message delivery . Checks that the session is valid then delegates .
171
14
160,802
public void stop ( ) throws SISessionDroppedException , SIConnectionDroppedException , SISessionUnavailableException , SIConnectionUnavailableException , SIConnectionLostException , SIResourceException , SIErrorException { final String methodName = "stop" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } checkValid ( ) ; _delegate . stop ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
Stops message delivery . Checks that the session is valid then delegates .
157
14
160,803
@ Override public void unlockAll ( boolean incrementUnlockCount ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIIncorrectCallException { throw new SibRaNotSupportedException ( NLS . getString ( "ASYNCHRONOUS_METHOD_CWSIV0250" ) ) ; }
Unlocking of messages is not supported .
101
8
160,804
public void setConnectionObjectID ( int i ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setConnectionObjectID" , "" + i ) ; connectionObjectID = i ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setConnectionObjectID" ) ; }
Sets the Connection ID referring to the SIMPConnection Object on the server .
100
16
160,805
public ProxyQueueConversationGroup getProxyQueueConversationGroup ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getProxyQueueConversationGroup" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getProxyQueueConversationGroup" , proxyGroup ) ; return proxyGroup ; }
Gets the proxy queue group associated with this conversation .
109
11
160,806
public CatConnectionListenerGroup getCatConnectionListeners ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getCatConnectionListeners" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getCatConnectionListeners" , catConnectionGroup ) ; return catConnectionGroup ; }
Gets the connection listener group associated with thisconversation
103
12
160,807
public SICoreConnection getSICoreConnection ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSICoreConnection" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSICoreConnection" , siCoreConnection ) ; return siCoreConnection ; }
Returns the SICoreConnection in use with this conversation
103
11
160,808
public final boolean unlink ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "unlink" , _positionString ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "cursor count = " + _cursorCount ) ; boolean unlinked = false ; LinkedList parent = _parent ; if ( null != parent ) { synchronized ( parent ) { if ( LinkState . LINKED == _state ) { _state = LinkState . LOGICALLY_UNLINKED ; _tryUnlink ( ) ; unlinked = true ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "unlink while " + _state ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "unlink" , new Object [ ] { Boolean . valueOf ( unlinked ) , _positionString ( ) } ) ; return unlinked ; }
Request that the receiver be unlinked from the list . If the receiver is linked it will be marked as logically unlinked . Note that this will perform a logical unlink which may result in a physical unlink
270
42
160,809
private boolean isRequestForbidden ( StringBuffer path ) { boolean requestIsForbidden = false ; String matchString = path . toString ( ) ; //PM82876 Start // The fileName or dirName can have .. , check and fail for ".." in path only which can allow to serve from different location. if ( WCCustomProperties . ALLOW_DOTS_IN_NAME ) { if ( matchString . indexOf ( ".." ) > - 1 ) { if ( ( matchString . indexOf ( "/../" ) > - 1 ) || ( matchString . indexOf ( "\\..\\" ) > - 1 ) || matchString . startsWith ( "../" ) || matchString . endsWith ( "/.." ) || matchString . startsWith ( "..\\" ) || matchString . endsWith ( "\\.." ) ) { requestIsForbidden = true ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "isRequestForbidden" , "bad path :" + matchString ) ; } } if ( ( ! requestIsForbidden && ( matchString . endsWith ( "\\" ) || matchString . endsWith ( "." ) || matchString . endsWith ( "/" ) ) ) ) { requestIsForbidden = true ; } } else { //PM82876 End /** * Do not allow ".." to appear in a path as it allows one to serve files from anywhere within * the file system. * Also check to see if the path or URI ends with '/', '\', or '.' . * PQ44346 - Allow files on DFS to be served. */ if ( ( matchString . lastIndexOf ( ".." ) != - 1 && ( ! matchString . startsWith ( "/..." ) ) ) || matchString . endsWith ( "\\" ) // PK23475 use matchString instead of RequestURI because RequestURI is not decoded // || req.getRequestURI().endsWith(".") || matchString . endsWith ( "." ) // PK22928 // || req.getRequestURI().endsWith("/")){ || matchString . endsWith ( "/" ) ) //PK22928 { requestIsForbidden = true ; } } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "isRequestForbidden" , "returning :" + requestIsForbidden + ", matchstring :" + matchString ) ; return requestIsForbidden ; }
returns true if request is forbidden because it contains .. etc .
600
13
160,810
private boolean isDirectoryTraverse ( StringBuffer path ) { boolean directoryTraverse = false ; String matchString = path . toString ( ) ; //PM82876 Start if ( WCCustomProperties . ALLOW_DOTS_IN_NAME ) { // The fileName can have .. , check for the failing conditions only. if ( matchString . indexOf ( ".." ) > - 1 ) { if ( ( matchString . indexOf ( "/../" ) > - 1 ) || ( matchString . indexOf ( "\\..\\" ) > - 1 ) || matchString . startsWith ( "../" ) || matchString . endsWith ( "/.." ) || matchString . startsWith ( "..\\" ) || matchString . endsWith ( "\\.." ) ) { directoryTraverse = true ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "isDirectoryTraverse" , "bad path :" + matchString ) ; } } } else { //PM82876 End /** * Do not allow ".." to appear in a path as it allows one to serve files from anywhere within * the file system. * Also check to see if the path or URI ends with '/', '\', or '.' . * PQ44346 - Allow files on DFS to be served. */ if ( ( matchString . lastIndexOf ( ".." ) != - 1 ) && ( ! matchString . startsWith ( "/..." ) ) ) { directoryTraverse = true ; } } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "isDirectoryTraverse" , "returning" + directoryTraverse + " , matchstring :" + matchString ) ; return directoryTraverse ; }
542155 Add isDirectoryTraverse method - reduced version of isRequestForbidden
445
17
160,811
public ServiceRegistration < FileMonitor > monitorFiles ( Collection < String > paths , long monitorInterval ) { BundleContext bundleContext = actionable . getBundleContext ( ) ; final Hashtable < String , Object > fileMonitorProps = new Hashtable < String , Object > ( ) ; fileMonitorProps . put ( FileMonitor . MONITOR_FILES , paths ) ; fileMonitorProps . put ( FileMonitor . MONITOR_INTERVAL , monitorInterval ) ; return bundleContext . registerService ( FileMonitor . class , this , fileMonitorProps ) ; }
Registers this file monitor to start monitoring the specified files at the specified interval .
124
16
160,812
public ServiceRegistration < FileMonitor > monitorFiles ( String ID , Collection < String > paths , long pollingRate , String trigger ) { BundleContext bundleContext = actionable . getBundleContext ( ) ; final Hashtable < String , Object > fileMonitorProps = new Hashtable < String , Object > ( ) ; fileMonitorProps . put ( FileMonitor . MONITOR_FILES , paths ) ; //Adding INTERNAL parameter MONITOR_IDENTIFICATION_NAME to identify this monitor. fileMonitorProps . put ( com . ibm . ws . kernel . filemonitor . FileMonitor . MONITOR_IDENTIFICATION_NAME , com . ibm . ws . kernel . filemonitor . FileMonitor . SECURITY_MONITOR_IDENTIFICATION_VALUE ) ; //Adding parameter MONITOR_IDENTIFICATION_CONFIG_ID to identify this monitor by the ID. fileMonitorProps . put ( com . ibm . ws . kernel . filemonitor . FileMonitor . MONITOR_KEYSTORE_CONFIG_ID , ID ) ; if ( ! ( trigger . equalsIgnoreCase ( "disabled" ) ) ) { if ( trigger . equals ( "mbean" ) ) { fileMonitorProps . put ( FileMonitor . MONITOR_TYPE , FileMonitor . MONITOR_TYPE_EXTERNAL ) ; } else { fileMonitorProps . put ( FileMonitor . MONITOR_TYPE , FileMonitor . MONITOR_TYPE_TIMED ) ; fileMonitorProps . put ( FileMonitor . MONITOR_INTERVAL , pollingRate ) ; } } // Don't attempt to register the file monitor if the server is stopping if ( FrameworkState . isStopping ( ) ) return null ; return bundleContext . registerService ( FileMonitor . class , this , fileMonitorProps ) ; }
Registers this file monitor to start monitoring the specified files either by mbean notification or polling rate .
398
20
160,813
private Boolean isActionNeeded ( Collection < File > createdFiles , Collection < File > modifiedFiles ) { boolean actionNeeded = false ; for ( File createdFile : createdFiles ) { if ( currentlyDeletedFiles . contains ( createdFile ) ) { currentlyDeletedFiles . remove ( createdFile ) ; actionNeeded = true ; } } if ( modifiedFiles . isEmpty ( ) == false ) { actionNeeded = true ; } return actionNeeded ; }
Action is needed if a file is modified or if it is recreated after it was deleted .
98
19
160,814
public QueuedMessage [ ] getQueuedMessages ( java . lang . Integer fromIndexInteger , java . lang . Integer toIndexInteger , java . lang . Integer totalMessagesPerpageInteger ) throws Exception { int fromIndex = fromIndexInteger . intValue ( ) ; int toIndex = toIndexInteger . intValue ( ) ; int totalMessagesPerpage = totalMessagesPerpageInteger . intValue ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getQueuedMessages fromIndex=" + fromIndex + " toIndex= " + toIndex + " totalMsgs= " + totalMessagesPerpage ) ; List list = new ArrayList ( ) ; Iterator iter = _c . getQueuedMessageIterator ( fromIndex , toIndex , totalMessagesPerpage ) ; //673411 while ( iter != null && iter . hasNext ( ) ) { SIMPQueuedMessageControllable o = ( SIMPQueuedMessageControllable ) iter . next ( ) ; list . add ( o ) ; } List resultList = new ArrayList ( ) ; iter = list . iterator ( ) ; int i = 0 ; while ( iter . hasNext ( ) ) { Object o = iter . next ( ) ; QueuedMessage qm = SIBMBeanResultFactory . createSIBQueuedMessage ( ( SIMPQueuedMessageControllable ) o ) ; resultList . add ( qm ) ; } QueuedMessage [ ] retValue = ( QueuedMessage [ ] ) resultList . toArray ( new QueuedMessage [ 0 ] ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getQueuedMessagesfromIndex=" + fromIndex + " toIndex= " + toIndex + " totalMsgs= " + totalMessagesPerpage , retValue ) ; return retValue ; }
673411 - start
431
5
160,815
private void initializeCacheData ( int cacheSize ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && ( tc . isEntryEnabled ( ) || tcOOM . isEntryEnabled ( ) ) ) Tr . entry ( tc . isEntryEnabled ( ) ? tc : tcOOM , "initializeCacheData : " + ivCache . getName ( ) + " preferred size = " + ivPreferredMaxSize ) ; ivPreferredMaxSize = cacheSize ; // Define an internal upper limit to the cache size. This is similar // to the 'hard' limit, but would never be enforced; it is merely // used to determine a point at which the eviction strategy should // dynamically tune itself to become more aggressive. d112258 ivUpperLimit = ( long ) ( ivPreferredMaxSize * 1.1 ) ; // 10% over cache size // Give the cache a little breathing room (or buffer) below the // soft limit. By reducing to this far below the soft limit, it // is less likely that the next sweep will have to do anything. ivSoftLimitBuffer = ivPreferredMaxSize / 100 ; // 1% of the Cache Size if ( ivSoftLimitBuffer > 50 ) // Don't let this get too big. ivSoftLimitBuffer = 50 ; if ( isTraceOn && ( tc . isEntryEnabled ( ) || tcOOM . isEntryEnabled ( ) ) ) Tr . exit ( tc . isEntryEnabled ( ) ? tc : tcOOM , "initializeCacheData : " + ivCache . getName ( ) + " preferred size = " + ivPreferredMaxSize + " limit = " + ivUpperLimit + ", buffer = " + ivSoftLimitBuffer ) ; }
Initialize various optimization values used by the eviction strategy that depend on the cache size .
377
17
160,816
private void initializeSweepInterval ( long sweepInterval ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && ( tc . isEntryEnabled ( ) || tcOOM . isEntryEnabled ( ) ) ) Tr . entry ( tc . isEntryEnabled ( ) ? tc : tcOOM , "initializeSweepInterval : " + ivCache . getName ( ) + " preferred size = " + ivPreferredMaxSize + ", sweep = " + sweepInterval ) ; ivSweepInterval = sweepInterval ; // Adjust the discard threshold according to the sweepInterval. // The discard threshold is a value between 2 and 20. d112258 if ( ( ivSweepInterval * ivDiscardThreshold ) > MAX_THRESHOLD_MULTIPLIER ) { ivDiscardThreshold = ( MAX_THRESHOLD_MULTIPLIER / ivSweepInterval ) ; if ( ivDiscardThreshold < 2 ) ivDiscardThreshold = 2 ; } // Determine the upper and lower bounds for the discard threshold for // dynamic tuning of the eviction strategy. The max threshold will allow // objects to age for up to 1 minute (MAX_THRESHOLD_MULTIPLIER), and // the min threshold requires that objects age for at least 9 seconds // (MIN_THRESHOLD_MULTIPLIER). d112258 ivMaxDiscardThreshold = ivDiscardThreshold ; ivMinDiscardThreshold = ( MIN_THRESHOLD_MULTIPLIER / ivSweepInterval ) ; if ( ivMinDiscardThreshold < 2 ) ivMinDiscardThreshold = 2 ; if ( isTraceOn && ( tc . isEntryEnabled ( ) || tcOOM . isEntryEnabled ( ) ) ) Tr . exit ( tc . isEntryEnabled ( ) ? tc : tcOOM , "initializeSweepInterval : " + ivCache . getName ( ) + " preferred size = " + ivPreferredMaxSize + ", sweep = " + ivSweepInterval + ", threshold = " + ivDiscardThreshold + ", buffer = " + ivSoftLimitBuffer ) ; }
Initialize all of the intervals that are derived from the configurable sweep interval . Can be called at any time during runtime .
481
25
160,817
private boolean isTraceEnabled ( boolean debug ) // d581579 { if ( debug ? tc . isDebugEnabled ( ) : tc . isEntryEnabled ( ) ) { return true ; } if ( ivCache . numSweeps % NUM_SWEEPS_PER_OOMTRACE == 1 && ( debug ? tcOOM . isDebugEnabled ( ) : tcOOM . isEntryEnabled ( ) ) ) { return true ; } return false ; }
Returns true if trace should be printed .
98
8
160,818
protected NetworkConnection getNetworkConnectionInstance ( VirtualConnection vc ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getNetworkConnectionInstance" , vc ) ; NetworkConnection retConn = null ; if ( vc != null ) { // Default to the connection that we were created from retConn = conn ; if ( vc != ( ( CFWNetworkConnection ) conn ) . getVirtualConnection ( ) ) { // The connection is different - nothing else to do but create a new instance retConn = new CFWNetworkConnection ( vc ) ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getNetworkConnectionInstance" , retConn ) ; return retConn ; }
This method tries to avoid creating a new instance of a CFWNetworkConnection object by seeing if the specified virtual connection is the one that we are wrapping in the CFWNetworkConnection instance that created this context . If it is we simply return that . Otherwise we must create a new instance .
163
58
160,819
private void setChoices ( BigInteger multiChoice , JSchema schema ) { JSType topType = ( JSType ) schema . getJMFType ( ) ; if ( topType instanceof JSVariant ) setChoices ( multiChoice , schema , ( JSVariant ) topType ) ; else if ( topType instanceof JSTuple ) setChoices ( multiChoice , topType . getMultiChoiceCount ( ) , schema , ( ( JSTuple ) topType ) . getDominatedVariants ( ) ) ; else // If topType is JSRepeated, JSDynamic, JSEnum, or JSPrimitive there can be no unboxed // variants at top level. return ; }
multichoice code .
153
5
160,820
private void setChoices ( BigInteger multiChoice , JSchema schema , JSVariant var ) { for ( int i = 0 ; i < var . getCaseCount ( ) ; i ++ ) { BigInteger count = ( ( JSType ) var . getCase ( i ) ) . getMultiChoiceCount ( ) ; if ( multiChoice . compareTo ( count ) >= 0 ) multiChoice = multiChoice . subtract ( count ) ; else { // We now have the case of our particular Variant in i. We set that in // choiceCodes and then recursively visit the Variants dominated by ours. choiceCodes [ var . getIndex ( ) ] = i ; JSVariant [ ] subVars = var . getDominatedVariants ( i ) ; setChoices ( multiChoice , count , schema , subVars ) ; return ; } } // We should never get here throw new RuntimeException ( "Bad multiChoice code" ) ; }
Set the choices implied by the multiChoice code or contribution to a single JSVariant
203
17
160,821
private void setChoices ( BigInteger multiChoice , BigInteger radix , JSchema schema , JSVariant [ ] vars ) { for ( int j = 0 ; j < vars . length ; j ++ ) { radix = radix . divide ( vars [ j ] . getMultiChoiceCount ( ) ) ; BigInteger contrib = multiChoice . divide ( radix ) ; multiChoice = multiChoice . remainder ( radix ) ; setChoices ( contrib , schema , vars [ j ] ) ; } }
JSVariant whose choices are being set .
114
9
160,822
private static BigInteger getMultiChoice ( int [ ] choices , JSchema schema , JSVariant var ) throws JMFUninitializedAccessException { int choice = choices [ var . getIndex ( ) ] ; if ( choice == - 1 ) throw new JMFUninitializedAccessException ( schema . getPathName ( var ) ) ; BigInteger ans = BigInteger . ZERO ; // First, add the contribution of the cases less than the present one. for ( int i = 0 ; i < choice ; i ++ ) ans = ans . ( ( ( JSType ) var . getCase ( i ) ) . getMultiChoiceCount ( ) ) ; // Now compute the contribution of the actual case. Get the subvariants dominated by // this variant's present case. JSVariant [ ] subVars = var . getDominatedVariants ( choice ) ; if ( subVars == null ) // There are none: we already have the answer return ans ; return ans . add ( getMultiChoice ( choices , schema , subVars ) ) ; }
Compute the multiChoice code or contribution for an individual variant
222
12
160,823
private static BigInteger getMultiChoice ( int [ ] choices , JSchema schema , JSVariant [ ] vars ) throws JMFUninitializedAccessException { // Mixed-radix-encode the contribution from all the subvariants BigInteger base = BigInteger . ZERO ; for ( int i = 0 ; i < vars . length ; i ++ ) base = base . multiply ( vars [ i ] . getMultiChoiceCount ( ) ) . ( getMultiChoice ( choices , schema , vars [ i ] ) ) ; return base ; }
being calculate .
118
3
160,824
protected String getStyle ( FacesContext facesContext , UIComponent link ) { if ( link instanceof HtmlCommandLink ) { return ( ( HtmlCommandLink ) link ) . getStyle ( ) ; } return ( String ) link . getAttributes ( ) . get ( HTML . STYLE_ATTR ) ; }
Can be overwritten by derived classes to overrule the style to be used .
69
16
160,825
protected String getStyleClass ( FacesContext facesContext , UIComponent link ) { if ( link instanceof HtmlCommandLink ) { return ( ( HtmlCommandLink ) link ) . getStyleClass ( ) ; } return ( String ) link . getAttributes ( ) . get ( HTML . STYLE_CLASS_ATTR ) ; }
Can be overwritten by derived classes to overrule the style class to be used .
73
17
160,826
protected void completeConnectionPreface ( ) throws Http2Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "completeConnectionPreface entry: about to send preface SETTINGS frame" ) ; } FrameSettings settings ; // send out a settings frame with any HTTP2 settings that the user may have changed if ( Constants . SPEC_INITIAL_WINDOW_SIZE != this . streamReadWindowSize ) { settings = new FrameSettings ( 0 , - 1 , - 1 , this . muxLink . config . getH2MaxConcurrentStreams ( ) , ( int ) this . streamReadWindowSize , this . muxLink . config . getH2MaxFrameSize ( ) , - 1 , false ) ; } else { settings = new FrameSettings ( 0 , - 1 , - 1 , this . muxLink . config . getH2MaxConcurrentStreams ( ) , - 1 , this . muxLink . config . getH2MaxFrameSize ( ) , - 1 , false ) ; } this . frameType = FrameTypes . SETTINGS ; this . processNextFrame ( settings , Direction . WRITING_OUT ) ; if ( Constants . SPEC_INITIAL_WINDOW_SIZE != muxLink . maxReadWindowSize ) { // the user has changed the max connection read window, so we'll update that now FrameWindowUpdate wup = new FrameWindowUpdate ( 0 , ( int ) muxLink . maxReadWindowSize , false ) ; this . processNextFrame ( wup , Direction . WRITING_OUT ) ; } }
Complete the connection preface . At this point we should have received the client connection preface string . Now we need to make sure that the client sent a settings frame along with the preface update our settings and send an empty settings frame in response to the client preface .
356
55
160,827
private void readWriteTransitionState ( Constants . Direction direction ) throws Http2Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "readWriteTransitionState: entry: frame type: " + currentFrame . getFrameType ( ) + " state: " + state ) ; } if ( currentFrame . getFrameType ( ) == FrameTypes . GOAWAY || currentFrame . getFrameType ( ) == FrameTypes . RST_STREAM ) { writeFrameSync ( ) ; rstStreamSent = true ; this . updateStreamState ( StreamState . CLOSED ) ; if ( currentFrame . getFrameType ( ) == FrameTypes . GOAWAY ) { muxLink . closeConnectionLink ( null ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "readWriteTransitionState: return: state: " + state ) ; } return ; } switch ( state ) { case IDLE : processIdle ( direction ) ; break ; case RESERVED_LOCAL : processReservedLocal ( direction ) ; break ; case RESERVED_REMOTE : processReservedRemote ( direction ) ; break ; case OPEN : processOpen ( direction ) ; break ; case HALF_CLOSED_REMOTE : processHalfClosedRemote ( direction ) ; break ; case HALF_CLOSED_LOCAL : processHalfClosedLocal ( direction ) ; break ; case CLOSED : processClosed ( direction ) ; break ; default : break ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "readWriteTransitionState: exit: state: " + state ) ; } }
Transitions the stream state give the previous state and current frame . Handles writes and error processing as needed .
395
22
160,828
private void updateStreamState ( StreamState state ) { this . state = state ; if ( StreamState . CLOSED . equals ( state ) ) { setCloseTime ( System . currentTimeMillis ( ) ) ; muxLink . closeStream ( this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "current stream state for stream " + this . myID + " : " + this . state ) ; } }
Update the stream state and provide logging if enabled
108
9
160,829
private void processSETTINGSFrame ( ) throws FlowControlException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processSETTINGSFrame entry:\n" + currentFrame . toString ( ) ) ; } // check if this is the first non-ACK settings frame received; if so, update connection init state if ( ! connection_preface_settings_rcvd && ! ( ( FrameSettings ) currentFrame ) . flagAckSet ( ) ) { connection_preface_settings_rcvd = true ; } if ( ( ( FrameSettings ) currentFrame ) . flagAckSet ( ) ) { // if this is the first ACK frame, update connection init state if ( ! connection_preface_settings_ack_rcvd ) { connection_preface_settings_ack_rcvd = true ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "received a new settings frame: updating connection settings and sending out SETTINGS ACK" ) ; } // if the INITIAL_WINDOW_SIZE has changed, need to change it for this streams, and all the other streams on this connection if ( ( ( FrameSettings ) currentFrame ) . getInitialWindowSize ( ) != - 1 ) { int newSize = ( ( FrameSettings ) currentFrame ) . getInitialWindowSize ( ) ; muxLink . changeInitialWindowSizeAllStreams ( newSize ) ; } // update the SETTINGS for this connection muxLink . getRemoteConnectionSettings ( ) . updateSettings ( ( FrameSettings ) currentFrame ) ; muxLink . getVirtualConnection ( ) . getStateMap ( ) . put ( "h2_frame_size" , muxLink . getRemoteConnectionSettings ( ) . getMaxFrameSize ( ) ) ; // immediately send out ACK (an empty SETTINGS frame with the ACK flag set) currentFrame = new FrameSettings ( 0 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , false ) ; currentFrame . setAckFlag ( ) ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processSETTINGSFrame: stream: " + myID + " frame type: " + currentFrame . getFrameType ( ) . toString ( ) + " direction: " + Direction . WRITING_OUT + " H2InboundLink hc: " + muxLink . hashCode ( ) ) ; } writeFrameSync ( ) ; } catch ( FlowControlException e ) { // FlowControlException cannot occur for FrameTypes.SETTINGS, so do nothing here but debug if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "writeSync caught (logically unexpected) FlowControlException: " + e ) ; } } } // check to see if the current connection should be marked as initialized; if so, notify stream 1 to stop waiting if ( connection_preface_settings_rcvd && connection_preface_settings_ack_rcvd ) { if ( muxLink . checkInitAndOpen ( ) ) { muxLink . initLock . countDown ( ) ; } } }
Helper method to process a SETTINGS frame received from the client . Since the protocol utilizes SETTINGS frames for initialization some special logic is needed .
731
30
160,830
private void updateStreamReadWindow ( ) throws Http2Exception { if ( currentFrame instanceof FrameData ) { long frameSize = currentFrame . getPayloadLength ( ) ; streamReadWindowSize -= frameSize ; // decrement stream read window muxLink . connectionReadWindowSize -= frameSize ; // decrement connection read window // if the stream or connection windows become too small, update the windows // TODO: decide how often we should update the read window via WINDOW_UPDATE if ( streamReadWindowSize < ( muxLink . maxReadWindowSize / 2 ) || muxLink . connectionReadWindowSize < ( muxLink . maxReadWindowSize / 2 ) ) { int windowChange = ( int ) ( muxLink . maxReadWindowSize - this . streamReadWindowSize ) ; Frame savedFrame = currentFrame ; // save off the current frame if ( ! this . isStreamClosed ( ) ) { currentFrame = new FrameWindowUpdate ( myID , windowChange , false ) ; writeFrameSync ( ) ; currentFrame = savedFrame ; } long windowSizeIncrement = muxLink . getRemoteConnectionSettings ( ) . getMaxFrameSize ( ) ; FrameWindowUpdate wuf = new FrameWindowUpdate ( 0 , ( int ) windowSizeIncrement , false ) ; this . muxLink . getStream ( 0 ) . processNextFrame ( wuf , Direction . WRITING_OUT ) ; } } }
If this stream is receiving a DATA frame the local read window needs to be updated . If the read window drops below a threshold a WINDOW_UPDATE frame will be sent for both the connection and stream to update the windows .
306
46
160,831
protected void updateInitialWindowsUpdateSize ( int newSize ) throws FlowControlException { // this method should only be called by the thread that came in on processNewFrame. // newSize should be treated as an unsigned 32-bit int if ( myID == 0 ) { // the control stream doesn't care about initial window size updates return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "updateInitialWindowsUpdateSize entry: stream {0} newSize: {1}" , myID , newSize ) ; } long diff = newSize - streamWindowUpdateWriteInitialSize ; streamWindowUpdateWriteInitialSize = newSize ; streamWindowUpdateWriteLimit += diff ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "streamWindowUpdateWriteInitialSize updated to: " + streamWindowUpdateWriteInitialSize ) ; Tr . debug ( tc , "streamWindowUpdateWriteLimit updated to: " + streamWindowUpdateWriteLimit ) ; } // if any data frames were waiting for a window update, write them out now flushDataWaitingForWindowUpdate ( ) ; }
Updates the initial window size for this stream . If any data frames are waiting for an increased window size write them out if the new window size allows it .
257
32
160,832
private void processIdle ( Constants . Direction direction ) throws Http2Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processIdle entry: stream " + myID ) ; } // Can only receive HEADERS or PRIORITY frame in Idle state if ( direction == Constants . Direction . READ_IN ) { if ( frameType == FrameTypes . HEADERS ) { // check to see if too many client streams are currently open for this stream's h2 connection muxLink . incrementActiveClientStreams ( ) ; if ( muxLink . getActiveClientStreams ( ) > muxLink . getLocalConnectionSettings ( ) . getMaxConcurrentStreams ( ) ) { RefusedStreamException rse = new RefusedStreamException ( "too many client-initiated streams are currently active; rejecting this stream" ) ; rse . setConnectionError ( false ) ; throw rse ; } processHeadersPriority ( ) ; getHeadersFromFrame ( ) ; if ( currentFrame . flagEndHeadersSet ( ) ) { processCompleteHeaders ( false ) ; setHeadersComplete ( ) ; } else { muxLink . setContinuationExpected ( true ) ; } if ( currentFrame . flagEndStreamSet ( ) ) { endStream = true ; updateStreamState ( StreamState . HALF_CLOSED_REMOTE ) ; if ( currentFrame . flagEndHeadersSet ( ) ) { setReadyForRead ( ) ; } } else { updateStreamState ( StreamState . OPEN ) ; } } } else { // send out a HEADER frame and update the stream state to OPEN if ( frameType == FrameTypes . HEADERS ) { updateStreamState ( StreamState . OPEN ) ; } writeFrameSync ( ) ; } }
Perform operations to transition into IDLE state
395
9
160,833
private boolean isWindowLimitExceeded ( FrameData dataFrame ) { if ( streamWindowUpdateWriteLimit - dataFrame . getPayloadLength ( ) < 0 || muxLink . getWorkQ ( ) . getConnectionWriteLimit ( ) - dataFrame . getPayloadLength ( ) < 0 ) { // would exceed window update limit String s = "Cannot write Data Frame because it would exceed the stream window update limit." + "streamWindowUpdateWriteLimit: " + streamWindowUpdateWriteLimit + "\nstreamWindowUpdateWriteInitialSize: " + streamWindowUpdateWriteInitialSize + "\nconnection window size: " + muxLink . getWorkQ ( ) . getConnectionWriteLimit ( ) + "\nframe size: " + dataFrame . getPayloadLength ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , s ) ; } return true ; } return false ; }
Check to see if a writing out a frame will cause the stream or connection window to go exceeded
206
19
160,834
public void sendRequestToWc ( FramePPHeaders frame ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "H2StreamProcessor.sendRequestToWc()" ) ; } if ( null == frame ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "H2StreamProcessor.sendRequestToWc(): Frame is null" ) ; } } else { // Make the headers frame look like it just came in WsByteBuffer buf = frame . buildFrameForWrite ( ) ; TCPReadRequestContext readi = h2HttpInboundLinkWrap . getConnectionContext ( ) . getReadInterface ( ) ; readi . setBuffer ( buf ) ; // Call the synchronized method to handle the frame try { processNextFrame ( frame , Constants . Direction . READ_IN ) ; } catch ( Http2Exception he ) { // ProcessNextFrame() sends a reset/goaway if an error occurs, nothing left but to clean up if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "H2StreamProcessor.sendRequestToWc(): ProcessNextFrame() error, Exception: " + he ) ; } // Free the buffer buf . release ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "H2StreamProcessor.sendRequestToWc()" ) ; } }
Send an artificially created H2 request from a push_promise up to the WebContainer
354
18
160,835
private void setHeadersComplete ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "completed headers have been received stream " + myID ) ; } headersCompleted = true ; muxLink . setContinuationExpected ( false ) ; }
Call when all header block fragments for a header block have been received
71
13
160,836
private void getHeadersFromFrame ( ) { byte [ ] hbf = null ; if ( currentFrame . getFrameType ( ) == FrameTypes . HEADERS || currentFrame . getFrameType ( ) == FrameTypes . PUSHPROMISEHEADERS ) { hbf = ( ( FrameHeaders ) currentFrame ) . getHeaderBlockFragment ( ) ; } else if ( currentFrame . getFrameType ( ) == FrameTypes . CONTINUATION ) { hbf = ( ( FrameContinuation ) currentFrame ) . getHeaderBlockFragment ( ) ; } if ( hbf != null ) { if ( headerBlock == null ) { headerBlock = new ArrayList < byte [ ] > ( ) ; } headerBlock . add ( hbf ) ; } }
Appends the header block fragment in the current header frame to this stream s incomplete header block
162
18
160,837
private void getBodyFromFrame ( ) { if ( dataPayload == null ) { dataPayload = new ArrayList < byte [ ] > ( ) ; } if ( currentFrame . getFrameType ( ) == FrameTypes . DATA ) { dataPayload . add ( ( ( FrameData ) currentFrame ) . getData ( ) ) ; } }
Grab the data from the current frame
74
7
160,838
private void processCompleteData ( ) throws ProtocolException { WsByteBufferPoolManager bufManager = HttpDispatcher . getBufferManager ( ) ; WsByteBuffer buf = bufManager . allocate ( getByteCount ( dataPayload ) ) ; for ( byte [ ] bytes : dataPayload ) { buf . put ( bytes ) ; } buf . flip ( ) ; if ( expectedContentLength != - 1 && buf . limit ( ) != expectedContentLength ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processCompleteData release buffer and throw ProtocolException" ) ; } buf . release ( ) ; ProtocolException pe = new ProtocolException ( "content-length header did not match the expected amount of data received" ) ; pe . setConnectionError ( false ) ; // stream error throw pe ; } moveDataIntoReadBufferArray ( buf ) ; }
Put the data payload for this stream into the read buffer that will be passed to the webcontainer . This should only be called when this stream has received an end of stream flag .
200
36
160,839
private void setReadyForRead ( ) throws ProtocolException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setReadyForRead entry: stream id:" + myID ) ; } muxLink . updateHighestStreamId ( myID ) ; if ( headersCompleted ) { ExecutorService executorService = CHFWBundle . getExecutorService ( ) ; Http2Ready readyThread = new Http2Ready ( h2HttpInboundLinkWrap ) ; executorService . execute ( readyThread ) ; } }
Tell the HTTP inbound link that we have data ready for it to read
130
15
160,840
private void moveDataIntoReadBufferArray ( WsByteBuffer newReadBuffer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "moveDataIntoReadBufferArray entry: stream " + myID + " buffer: " + newReadBuffer ) ; } // move the data that is to be sent up the channel into the currentReadReady byte array, and update the currentReadSize if ( newReadBuffer != null ) { int size = newReadBuffer . remaining ( ) ; // limit - pos if ( size > 0 ) { streamReadReady . add ( newReadBuffer ) ; streamReadSize += size ; this . readLatch . countDown ( ) ; } } }
Add a buffer to the list of buffers that will be sent to the WebContainer when a read is requested
162
21
160,841
@ SuppressWarnings ( "unchecked" ) public VirtualConnection read ( long numBytes , WsByteBuffer [ ] requestBuffers ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "read entry: stream " + myID + " request: " + requestBuffers + " num bytes requested: " + numBytes ) ; } long streamByteCount = streamReadSize ; // number of bytes available on this stream long requestByteCount = bytesRemaining ( requestBuffers ) ; // total capacity of the caller byte array int reqArrayIndex = 0 ; // keep track of where we are in the caller's array // if at least numBytes are ready to be processed as part of the HTTP Request/Response, then load it up if ( numBytes > streamReadSize || requestBuffers == null ) { if ( this . headersCompleted ) { return h2HttpInboundLinkWrap . getVirtualConnection ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "read exit: stream " + myID + " more bytes requested than available for read: " + numBytes + " > " + streamReadSize ) ; } return null ; } } if ( streamByteCount < requestByteCount ) { // the byte count requested exceeds the caller array capacity actualReadCount = streamByteCount ; } else { actualReadCount = requestByteCount ; } // copy bytes from this stream into the caller arrays for ( int bytesRead = 0 ; bytesRead < actualReadCount ; bytesRead ++ ) { // find the first buffer from the caller that has remaining capacity while ( ( requestBuffers [ reqArrayIndex ] . position ( ) == requestBuffers [ reqArrayIndex ] . limit ( ) ) ) { reqArrayIndex ++ ; } // find the next stream buffer that has data while ( ! streamReadReady . isEmpty ( ) && ! streamReadReady . get ( 0 ) . hasRemaining ( ) ) { streamReadReady . get ( 0 ) . release ( ) ; streamReadReady . remove ( 0 ) ; } requestBuffers [ reqArrayIndex ] . put ( streamReadReady . get ( 0 ) . get ( ) ) ; } // put stream array back in shape streamReadSize = 0 ; readLatch = new CountDownLatch ( 1 ) ; for ( WsByteBuffer buffer : ( ( ArrayList < WsByteBuffer > ) streamReadReady . clone ( ) ) ) { streamReadReady . clear ( ) ; if ( buffer . hasRemaining ( ) ) { moveDataIntoReadBufferArray ( buffer . slice ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "read exit: " + streamId ( ) ) ; } // return the vc since this was a successful read return h2HttpInboundLinkWrap . getVirtualConnection ( ) ; }
Read the HTTP header and data bytes for this stream
650
10
160,842
public boolean isStreamClosed ( ) { if ( this . myID == 0 && ! endStream ) { return false ; } if ( state == StreamState . CLOSED ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isStreamClosed stream closed; " + streamId ( ) ) ; } return true ; } boolean rc = muxLink . checkIfGoAwaySendingOrClosing ( ) ; if ( rc == true ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isStreamClosed stream closed via muxLink check; " + streamId ( ) ) ; } } return rc ; }
Check if the current stream should be closed
169
8
160,843
private int getByteCount ( ArrayList < byte [ ] > listOfByteArrays ) { int count = 0 ; for ( byte [ ] byteArray : listOfByteArrays ) { if ( byteArray != null ) { count += byteArray . length ; } } return count ; }
Get the number of bytes in this list of byte arrays
61
11
160,844
public static String generateIncUuid ( Object caller ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "generateIncUuid" , "Caller=" + caller ) ; java . util . Date time = new java . util . Date ( ) ; int hash = caller . hashCode ( ) ; long millis = time . getTime ( ) ; byte [ ] data = new byte [ ] { ( byte ) ( hash >> 24 ) , ( byte ) ( hash >> 16 ) , ( byte ) ( hash >> 8 ) , ( byte ) ( hash ) , ( byte ) ( millis >> 24 ) , ( byte ) ( millis >> 16 ) , ( byte ) ( millis >> 8 ) , ( byte ) ( millis ) } ; String digits = "0123456789ABCDEF" ; StringBuffer retval = new StringBuffer ( data . length * 2 ) ; for ( int i = 0 ; i < data . length ; i ++ ) { retval . append ( digits . charAt ( ( data [ i ] >> 4 ) & 0xf ) ) ; retval . append ( digits . charAt ( data [ i ] & 0xf ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "generateIncUuid" , "return=" + retval ) ; return retval . toString ( ) ; }
The UUID for this incarnation of ME is generated using the hashcode of this object and the least significant four bytes of the current time in milliseconds .
323
30
160,845
public static String getMEName ( Object o ) { String meName ; if ( ! threadLocalStack . isEmpty ( ) ) { meName = threadLocalStack . peek ( ) ; } else { meName = DEFAULT_ME_NAME ; } String str = "" ; if ( o != null ) { str = "/" + Integer . toHexString ( System . identityHashCode ( o ) ) ; } // Defect 91793 to avoid SIBMessage in Systemout.log starting with [:] return "" ; }
Get Jetstream ME name to be printed in trace message
112
11
160,846
void setSICoreConnection ( final SICoreConnection connection ) { if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "setSICoreConnection" , connection ) ; } _coreConnection = connection ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "setSICoreConnection" ) ; //412795 } }
Sets the connection that was created as a result of this request .
93
14
160,847
@ Override @ Trivial public ZipFile open ( ) throws IOException { String methodName = "open" ; synchronized ( zipFileLock ) { if ( zipFile == null ) { debug ( methodName , "Opening" ) ; if ( zipFileReaper == null ) { zipFile = ZipFileUtils . openZipFile ( file ) ; // throws IOException } else { zipFile = zipFileReaper . open ( path ) ; } } openCount ++ ; debug ( methodName , "Opened" ) ; return zipFile ; } }
Open the zip file . Create and assign the zip file if this is the first open . Increase the open count by one .
118
25
160,848
@ Override @ Trivial public InputStream getInputStream ( ZipFile useZipFile , ZipEntry zipEntry ) throws IOException { String methodName = "getInputStream" ; String entryName = zipEntry . getName ( ) ; if ( zipEntry . isDirectory ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debug ( methodName , "Entry [ " + entryName + " ] [ null ] (Not using cache: Directory entry)" ) ; } return null ; } long entrySize = zipEntry . getSize ( ) ; if ( entrySize == 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debug ( methodName , "Entry [ " + entryName + " ] [ empty stream ] (Not using cache: Empty entry)" ) ; } return EMPTY_STREAM ; } boolean doNotCache ; String doNotCacheReason ; if ( zipEntries == null ) { // No entry cache. doNotCache = true ; doNotCacheReason = "Do not cache: Entry cache disabled" ; } else if ( entrySize > ZipCachingProperties . ZIP_CACHE_ENTRY_LIMIT ) { // Too big for the cache doNotCache = true ; doNotCacheReason = "Do not cache: Too big" ; } else if ( entryName . equals ( "META-INF/MANIFEST.MF" ) ) { doNotCache = false ; doNotCacheReason = "Cache META-INF/MANIFEST.MF" ; } else if ( entryName . endsWith ( ".class" ) ) { doNotCache = false ; doNotCacheReason = "Cache .class resources" ; } else { doNotCache = true ; doNotCacheReason = "Do not cache: Not manifest or class resource" ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debug ( methodName , "Entry [ " + entryName + " ] [ non-null ] [ " + doNotCacheReason + " ]" ) ; } if ( doNotCache ) { return useZipFile . getInputStream ( zipEntry ) ; // throws IOException } // The addition of ":::" *seems* to allow for non-unique cache keys. Duplicate // keys *are not* possible because the CRC and last-modified values are numeric. // Duplicate keys would be possible of the CRC or last-modified values, when // converted to strings, could contain ":::" character sequences. String entryCacheKey = entryName + ":::" + Long . toString ( zipEntry . getCrc ( ) ) + ":::" + Long . toString ( getLastModified ( ) ) ; // Note that only the individual gets and puts are protected. // // That means that simultaneous get misses are possible, which // will result in double reads and double puts. // // That is unfortunate, but is harmless. // // The simultaneous puts are allowed because they should be very // rare. // // They are allowed because blocking entry gets while waiting for // reads could create large delays. byte [ ] entryBytes ; synchronized ( zipEntriesLock ) { entryBytes = zipEntries . get ( entryCacheKey ) ; } if ( entryBytes == null ) { InputStream inputStream = useZipFile . getInputStream ( zipEntry ) ; // throws IOException try { entryBytes = read ( inputStream , ( int ) entrySize , entryName ) ; // throws IOException } finally { inputStream . close ( ) ; // throws IOException } synchronized ( zipEntriesLock ) { zipEntries . put ( entryCacheKey , entryBytes ) ; } } return new ByteArrayInputStream ( entryBytes ) ; }
Answer an input stream for an entry of a zip file . When the entry is a class entry which has 8K or fewer bytes read all of the entry bytes immediately and cache the bytes in this handle . Subsequent input stream requests which locate cached bytes will answer a stream on those bytes .
814
58
160,849
@ Trivial private static byte [ ] read ( InputStream inputStream , int expectedRead , String name ) throws IOException { byte [ ] bytes = new byte [ expectedRead ] ; int remainingRead = expectedRead ; int totalRead = 0 ; while ( remainingRead > 0 ) { int nextRead = inputStream . read ( bytes , totalRead , remainingRead ) ; // throws IOException if ( nextRead <= 0 ) { // 'nextRead == 0' should only ever happen if 'remainingRead == 0', which ought // never be the case here. Treat a '0' return value as an error. // // 'nextRead == -1' means the end of input was reached. throw new IOException ( "Read only [ " + Integer . valueOf ( totalRead ) + " ]" + " of expected [ " + Integer . valueOf ( expectedRead ) + " ] bytes" + " from [ " + name + " ]" ) ; } else { remainingRead -= nextRead ; totalRead += nextRead ; } } return bytes ; }
Read an exact count of bytes from an input stream .
223
11
160,850
private String findVersion ( ) { WlpInformation wlp = _asset . getWlpInformation ( ) ; if ( wlp == null ) { return null ; } Collection < AppliesToFilterInfo > filterInfo = wlp . getAppliesToFilterInfo ( ) ; if ( filterInfo == null ) { return null ; } for ( AppliesToFilterInfo filter : filterInfo ) { if ( filter . getMinVersion ( ) != null ) { return filter . getMinVersion ( ) . getValue ( ) ; } } return null ; }
Uses the filter information to return the first version number
117
11
160,851
private void addVersionDisplayString ( ) { WlpInformation wlp = _asset . getWlpInformation ( ) ; JavaSEVersionRequirements reqs = wlp . getJavaSEVersionRequirements ( ) ; if ( reqs == null ) { return ; } String minVersion = reqs . getMinVersion ( ) ; // Null means no requirements specified which is fine if ( minVersion == null ) { return ; } String minJava11 = "Java SE 11" ; String minJava8 = "Java SE 8, Java SE 11" ; String minJava7 = "Java SE 7, Java SE 8, Java SE 11" ; String minJava6 = "Java SE 6, Java SE 7, Java SE 8, Java SE 11" ; // TODO: Temporary special case for jdbc-4.3 (the first feature to require Java >8) // Once all builds are upgrade to Java 11+, we can remove this workaround if ( "jdbc-4.3" . equals ( wlp . getLowerCaseShortName ( ) ) ) { reqs . setVersionDisplayString ( minJava11 ) ; return ; } // The min version should have been validated when the ESA was constructed // so checking for the version string should be safe if ( minVersion . equals ( "1.6.0" ) ) { reqs . setVersionDisplayString ( minJava6 ) ; return ; } if ( minVersion . equals ( "1.7.0" ) ) { reqs . setVersionDisplayString ( minJava7 ) ; return ; } if ( minVersion . equals ( "1.8.0" ) ) { reqs . setVersionDisplayString ( minJava8 ) ; return ; } if ( minVersion . startsWith ( "9." ) || minVersion . startsWith ( "10." ) || minVersion . startsWith ( "11." ) ) { // If a feature requires a min of Java 9/10/11, state Java 11 is required because // Liberty does not officially support Java 9 or 10 reqs . setVersionDisplayString ( minJava11 ) ; return ; } // The min version string has been generated/validated incorrectly // Can't recover from this, it is a bug in EsaUploader throw new AssertionError ( "Unrecognized java version: " + minVersion ) ; }
This generates the string that should be displayed on the website to indicate the supported Java versions . The requirements come from the bundle manifests . The mapping between the two is non - obvious as it is the intersection between the Java EE requirement and the versions of Java that Liberty supports .
493
54
160,852
private void removeRequireFeatureWithToleratesIfExists ( String feature ) { Collection < RequireFeatureWithTolerates > rfwt = _asset . getWlpInformation ( ) . getRequireFeatureWithTolerates ( ) ; if ( rfwt != null ) { for ( RequireFeatureWithTolerates toCheck : rfwt ) { if ( toCheck . getFeature ( ) . equals ( feature ) ) { rfwt . remove ( toCheck ) ; return ; } } } }
Looks in the underlying asset to see if there is a requireFeatureWithTolerates entry for the supplied feature and if there is removes it .
112
29
160,853
private void copyRequireFeatureToRequireFeatureWithTolerates ( ) { Collection < RequireFeatureWithTolerates > rfwt = _asset . getWlpInformation ( ) . getRequireFeatureWithTolerates ( ) ; if ( rfwt != null ) { // Both fields (with and without tolerates) should exist, as // rfwt should not be created unless the other field is created first. // No need to copy, as the two fields should always be in sync return ; } Collection < String > requireFeature = _asset . getWlpInformation ( ) . getRequireFeature ( ) ; if ( requireFeature == null ) { // Neither field exists, no need to copy return ; } // We have the requireFeature field but not rfwt, so copy info into // the new field (rfwt). Collection < RequireFeatureWithTolerates > newOne = new HashSet < RequireFeatureWithTolerates > ( ) ; for ( String feature : requireFeature ) { RequireFeatureWithTolerates newFeature = new RequireFeatureWithTolerates ( ) ; newFeature . setFeature ( feature ) ; newFeature . setTolerates ( Collections . < String > emptyList ( ) ) ; newOne . add ( newFeature ) ; } _asset . getWlpInformation ( ) . setRequireFeatureWithTolerates ( newOne ) ; }
requireFeature was the old field in the asset which didn t contain tolerates information . The new field is requireFeatureWithTolerates and for the moment both fields are being maintained as older assets in the repository will only have the older field . When older assets are being written to the data from the older field needs to be copied to the new field to ensure both are consistent . The write will then write to both fields
301
84
160,854
public static boolean isClassVetoed ( Class < ? > type ) { if ( type . isAnnotationPresent ( Vetoed . class ) ) { return true ; } return isPackageVetoed ( type . getPackage ( ) ) ; }
Return true if the class is vetoed or the package is vetoed
53
12
160,855
private Map < String , String > populateCommonAuthzHeaderParams ( ) { Map < String , String > parameters = new HashMap < String , String > ( ) ; parameters . put ( TwitterConstants . PARAM_OAUTH_CONSUMER_KEY , consumerKey ) ; parameters . put ( TwitterConstants . PARAM_OAUTH_NONCE , Utils . generateNonce ( ) ) ; parameters . put ( TwitterConstants . PARAM_OAUTH_SIGNATURE_METHOD , DEFAULT_SIGNATURE_ALGORITHM ) ; parameters . put ( TwitterConstants . PARAM_OAUTH_TIMESTAMP , Utils . getCurrentTimestamp ( ) ) ; parameters . put ( TwitterConstants . PARAM_OAUTH_VERSION , DEFAULT_OAUTH_VERSION ) ; return parameters ; }
Creates a map of parameters and values that are common to all requests that require an Authorization header .
180
20
160,856
private String signAndCreateAuthzHeader ( String endpointUrl , Map < String , String > parameters ) { String signature = computeSignature ( requestMethod , endpointUrl , parameters ) ; parameters . put ( TwitterConstants . PARAM_OAUTH_SIGNATURE , signature ) ; String authzHeaderString = createAuthorizationHeaderString ( parameters ) ; return authzHeaderString ; }
Generates the Authorization header with all the requisite content for the specified endpoint request by computing the signature adding it to the parameters and generating the Authorization header string .
80
31
160,857
public Map < String , Object > populateJsonResponse ( String responseBody ) throws JoseException { if ( responseBody == null || responseBody . isEmpty ( ) ) { return null ; } return JsonUtil . parseJson ( responseBody ) ; }
Populates a Map from the response body . This method expects the responseBody value to be in JSON format .
55
22
160,858
@ FFDCIgnore ( SocialLoginException . class ) @ Sensitive public Map < String , Object > executeRequest ( SocialLoginConfig config , String requestMethod , String authzHeaderString , String url , String endpointType , String verifierValue ) { if ( endpointType == null ) { endpointType = TwitterConstants . TWITTER_ENDPOINT_REQUEST_TOKEN ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "A Twitter endpoint path was not found; defaulting to using " + endpointType + " as the Twitter endpoint path." ) ; } } try { SocialUtil . validateEndpointWithQuery ( url ) ; } catch ( SocialLoginException e ) { return createErrorResponse ( e ) ; } StringBuilder uri = new StringBuilder ( url ) ; if ( endpointType . equals ( TwitterConstants . TWITTER_ENDPOINT_VERIFY_CREDENTIALS ) ) { // Include the include_email and skip_status parameters for these endpoint requests uri . append ( "?" ) . append ( TwitterConstants . PARAM_INCLUDE_EMAIL ) . append ( "=" ) . append ( TwitterConstants . INCLUDE_EMAIL ) . append ( "&" ) . append ( TwitterConstants . PARAM_SKIP_STATUS ) . append ( "=" ) . append ( TwitterConstants . SKIP_STATUS ) ; } try { Map < String , Object > result = getEndpointResponse ( config , uri . toString ( ) , requestMethod , authzHeaderString , endpointType , verifierValue ) ; String responseContent = httpUtil . extractTokensFromResponse ( result ) ; return evaluateRequestResponse ( responseContent , endpointType ) ; } catch ( SocialLoginException e ) { return createErrorResponse ( "TWITTER_EXCEPTION_EXECUTING_REQUEST" , new Object [ ] { url , e . getLocalizedMessage ( ) } ) ; } }
Sends a request to the specified Twitter endpoint and returns a Map object containing the evaluated response .
433
19
160,859
@ FFDCIgnore ( IllegalStateException . class ) private void updateMonitorService ( ) { if ( ! coveringPaths . isEmpty ( ) ) { if ( service == null ) { try { // If we are shutting down, we want to generate the exception quickly. BundleContext bundleContext = getContainerFactoryHolder ( ) . getBundleContext ( ) ; // throws 'IllegalStateException' setServiceProperties ( ) ; service = bundleContext . registerService ( FileMonitor . class , this , serviceProperties ) ; // See comments on 'loadZipEntries' for why the entries must be loaded now. loadZipEntries ( ) ; } catch ( IllegalStateException e ) { // Ignore; the framework is shutting down. } } else { // Do nothing: There is already a service registration. } } else { if ( service != null ) { try { service . unregister ( ) ; } catch ( IllegalStateException e ) { // Ignore; framework is shutting down. } service = null ; } else { // Do nothing: There is already no service registration. } } }
Update the monitor service according to whether any listeners are registered . That is if any covering paths are present .
230
21
160,860
private void updateEnclosingMonitor ( ) { if ( ! coveringPaths . isEmpty ( ) ) { if ( ! listenerRegistered ) { // This container is not yet registered to the enclosing container. // Register this container. ArtifactContainer enclosingRootContainer = entryInEnclosingContainer . getRoot ( ) ; // The path to register is the path of the enclosing entry. ArtifactNotification enclosingNotification = new DefaultArtifactNotification ( enclosingRootContainer , Collections . singleton ( entryInEnclosingContainer . getPath ( ) ) ) ; ArtifactNotifier enclosingRootNotifier = enclosingRootContainer . getArtifactNotifier ( ) ; // The enclosing container generally will accept the registration // request. Just in case it doesn't, set the registration flag // based on the registration result. listenerRegistered = enclosingRootNotifier . registerForNotifications ( enclosingNotification , this ) ; // The result is that any change to the enclosing container reaches // this notifier through 'notifyEntryChange'. // See comments on 'loadZipEntries' for why the entries must be loaded now. loadZipEntries ( ) ; } else { // Do nothing: The enclosing entry was already registered // to the enclosing notifier. } } else { if ( listenerRegistered ) { // There are no listener registrations active on this container. // Remove the registration of this listener. // // This listener should be registered exactly once to the enclosing // container: Removing all registrations of this listener should remove // that one registration, with no addition, unwanted registration changes. ArtifactContainer enclosingRootContainer = entryInEnclosingContainer . getRoot ( ) ; ArtifactNotifier enclosingNotifier = enclosingRootContainer . getArtifactNotifier ( ) ; enclosingNotifier . removeListener ( this ) ; } else { // Do nothing: The enclosing monitor already did not have a registration // for this container. } } }
Update the enclosing monitor according to whether any listeners are registered . That is if any covering paths are present .
410
22
160,861
private boolean registerListener ( String newPath , ArtifactListenerSelector newListener ) { boolean updatedCoveringPaths = addCoveringPath ( newPath ) ; Collection < ArtifactListenerSelector > listenersForPath = listeners . get ( newPath ) ; if ( listenersForPath == null ) { // Each listeners collection is expected to be small. listenersForPath = new LinkedList < ArtifactListenerSelector > ( ) ; listeners . put ( newPath , listenersForPath ) ; } listenersForPath . add ( newListener ) ; return ( updatedCoveringPaths ) ; }
Register a listener to a specified path .
121
8
160,862
private boolean addCoveringPath ( String newPath ) { int newLen = newPath . length ( ) ; Iterator < String > useCoveringPaths = coveringPaths . iterator ( ) ; boolean isCovered = false ; boolean isCovering = false ; while ( ! isCovered && useCoveringPaths . hasNext ( ) ) { String coveringPath = useCoveringPaths . next ( ) ; int coveringLen = coveringPath . length ( ) ; if ( coveringLen < newLen ) { if ( isCovering ) { continue ; // Can't be covered. } else { if ( newPath . regionMatches ( 0 , coveringPath , 0 , coveringLen ) ) { if ( newPath . charAt ( coveringLen ) == ' ' ) { isCovered = true ; // Covered: "covering/child" vs "covering" break ; // No need to continue: Can't be any additional relationships to find. } else { continue ; // Dissimilar: "coveringX" vs "covering" } } else { continue ; // Dissimilar: "coverXngX" vs "covering" } } } else if ( coveringLen == newLen ) { if ( isCovering ) { continue ; // Can't be covered } else { if ( newPath . regionMatches ( 0 , coveringPath , 0 , coveringLen ) ) { isCovered = true ; // Covered: "covering" vs "covering" break ; // No need to continue: Can't be any additional relationships to find. } else { continue ; // "covering" vs "coverXng" } } } else { // coveringLen > newLen if ( newPath . regionMatches ( 0 , coveringPath , 0 , newLen ) ) { if ( coveringPath . charAt ( newLen ) == ' ' ) { isCovering = true ; useCoveringPaths . remove ( ) ; // Covering: "covering" vs "covering/child" continue ; // Look for other independent children: "covering/child1" and "covering/child2" } else { continue ; // Dissimilar: "covering" vs "coveringX" } } else { continue ; // Dissimilar: "covering" vs "coverXngX" } } } if ( ! isCovered ) { coveringPaths . add ( newPath ) ; } return ! isCovered ; }
Add a path to the covering paths collection .
517
9
160,863
@ Trivial private String validateNotification ( Collection < ? > added , Collection < ? > removed , Collection < ? > updated ) { boolean isAddition = ! added . isEmpty ( ) ; boolean isRemoval = ! removed . isEmpty ( ) ; boolean isUpdate = ! updated . isEmpty ( ) ; if ( ! isAddition && ! isRemoval && ! isUpdate ) { // Should never occur: // Completely null changes are detected and cause an early return // before reaching the validation method. return "null" ; } else if ( isAddition ) { return "Addition of [ " + added . toString ( ) + " ]" ; } else if ( isUpdate && isRemoval ) { return "Update of [ " + updated . toString ( ) + " ]" + " with removal of [ " + removed . toString ( ) + " ]" ; } else { return null ; } }
Validate change data which is expected to be collections of files or collections of entry paths .
197
18
160,864
private void notifyAllListeners ( boolean isUpdate , String filter ) { // Can't reuse the registered paths collection across the loop // because the listener notification can do processing in a new // thread. Reusing the registered paths could cause a collision // between the listener thread with this notification processing // thread. // TODO: Should the notification step be separated from the listener detection step? // That might create large data structures, but would prevent the listeners // from being locked during a possibly extensive steps of the listeners handling // their notifications. // TODO: See the comment, below. The notification step has been separated from the // listener collection step. List < QueuedNotification > notifications = null ; synchronized ( listenersLock ) { for ( Map . Entry < String , Collection < ArtifactListenerSelector > > listenersEntry : listeners . entrySet ( ) ) { List < String > a_registeredPaths = new ArrayList < String > ( ) ; collectRegisteredPaths ( listenersEntry . getKey ( ) , a_registeredPaths ) ; if ( a_registeredPaths . isEmpty ( ) ) { continue ; } ArtifactNotification registeredPaths = new DefaultArtifactNotification ( rootContainer , a_registeredPaths ) ; for ( ArtifactListenerSelector listener : listenersEntry . getValue ( ) ) { if ( notifications == null ) { notifications = new ArrayList < QueuedNotification > ( listenersEntry . getValue ( ) . size ( ) ) ; } QueuedNotification notification = new QueuedNotification ( isUpdate , registeredPaths , listener , filter ) ; notifications . add ( notification ) ; // parm1: additions, parm2: removals, parm3: updates // if ( isUpdate ) { // listener.notifyEntryChange(emptyNotification, emptyNotification, registeredPaths); // } else { // listener.notifyEntryChange(emptyNotification, registeredPaths, emptyNotification); // } } } } if ( notifications != null ) { for ( QueuedNotification notification : notifications ) { notification . fire ( ) ; } } }
A notification which was either an update to the entire zip or was the removal of the entire zip file was received . For each listener that is registered collect the paths for that listener and forward the notification .
438
40
160,865
public AuthenticationService getAuthenticationService ( SecurityService securityService ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "getAuthenticationService" , securityService ) ; } if ( _authenticationService == null ) { if ( securityService != null ) _authenticationService = securityService . getAuthenticationService ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "getAuthenticationService" , _authenticationService ) ; } return _authenticationService ; }
Get Authentication Service from the Liberty Security component It will get the AuthenticationService only if the SecurityService is activated
148
21
160,866
protected Subject login ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "login" ) ; } Subject subject = null ; try { /* * Only if we have the AuthenticationService running, we can do * Authentication. If it is not present we cannot do any * authentication and hence we have return null, which means * authentication failed */ if ( _authenticationService != null ) { subject = _authenticationService . authenticate ( MESSAGING_JASS_ENTRY_NAME , _authenticationData , _partialSubject ) ; } } catch ( AuthenticationException ae ) { // No FFDC Required. We will throw exception if the subject is Null later if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "EXCEPTION_OCCURED_DURING_AUTHENTICATION_MSE1001" ) ; SibTr . exception ( tc , ae ) ; } } finally { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "login" ) ; } } return subject ; }
The method to authenticate a User
281
7
160,867
private void rejectHandshake ( Conversation conversation , int requestNumber , String rejectedField ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "rejectHandshake" , new Object [ ] { conversation , requestNumber , rejectedField } ) ; SIConnectionLostException exception = new SIConnectionLostException ( nls . getFormattedMessage ( "INVALID_PROP_SICO8012" , null , null ) ) ; FFDCFilter . processException ( exception , CLASS_NAME + ".rejectHandshake" , CommsConstants . COMMONSERVERRECEIVELISTENER_HSREJCT_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Invalid handshake type received - rejecting field:" , rejectedField ) ; StaticCATHelper . sendExceptionToClient ( exception , CommsConstants . COMMONSERVERRECEIVELISTENER_HSREJCT_01 , conversation , requestNumber ) ; // At this point we really don't want anything more to do with this client - so close him closeConnection ( conversation ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "rejectHandshake" ) ; }
This method is used to inform the client that we are rejecting their handshake . Typically this will never happen unless a third party client is written or an internal error occurs . However we should check for an inproperly formatted handshake and inform the client if such an error occurs .
318
55
160,868
void register ( CloudantService svc , ConcurrentMap < ClientKey , Object > clients ) { registrations . put ( svc , clients ) ; }
Lazily registers a CloudantService to have its client cache purged of entries related to a stopped application .
32
23
160,869
@ FFDCIgnore ( NoSuchMethodException . class ) private void setRRSTransactional ( ) { try { ivRRSTransactional = ( Boolean ) activationSpec . getClass ( ) . getMethod ( "getRRSTransactional" ) . invoke ( activationSpec ) ; } catch ( NoSuchMethodException x ) { ivRRSTransactional = false ; } catch ( Exception x ) { ivRRSTransactional = x == null ; // always false - avoid a FindBugs warning by using the value of x in some trivial way } }
If an RA wants to enable RRS Transactions it should return true for the method getRRSTransactional .
122
23
160,870
@ Override public void setJCAVersion ( int majorJCAVer , int minorJCAVer ) { majorJCAVersion = majorJCAVer ; minorJCAVersion = minorJCAVer ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "MessageEndpointFactoryImpl.setJCAVersionJCA: Version " + majorJCAVersion + "." + minorJCAVersion + " is set" ) ; } }
Indicates what version of JCA specification the RA using this MessageEndpointFactory requires compliance with .
109
20
160,871
private void setup ( BeanMetaData bmd ) { if ( ! ivSetup ) { int slotSize = bmd . container . getEJBRuntime ( ) . getMetaDataSlotSize ( MethodMetaData . class ) ; for ( int i = 0 ; i < capacity ; ++ i ) { EJBMethodInfoImpl methodInfo = bmd . createEJBMethodInfoImpl ( slotSize ) ; methodInfo . initializeInstanceData ( null , null , null , null , null , false ) ; elements [ i ] = methodInfo ; } ivSetup = true ; } }
Construct capacity sized stack
120
4
160,872
public final void done ( EJBMethodInfoImpl mi ) { //d151861 if ( orig || ( mi == null ) || ( topOfStack == 0 ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "In orig mode returning:" + " orig: " + orig + " top: " + topOfStack + " mi: " + mi ) ; orig = true ; elements = null ; //d166651 } //d151861 else { -- topOfStack ; if ( topOfStack < capacity ) { //d156621 if ( mi != ( elements [ topOfStack ] ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "EJBMethodInfoStack::done called with wrong " + "TopOfStack value: " + mi + "!=" + ( elements [ topOfStack ] ) ) ; orig = true ; elements = null ; //d166651 } else elements [ topOfStack ] . initializeInstanceData ( null , null , null , // 199625 null , null , false ) ; //d162441 //d156621 } } }
Indicate that the caller is finished with the instance that was last obtained .
268
15
160,873
final public EJBMethodInfoImpl get ( String methodSignature , String methodNameOnly , EJSWrapperBase wrapper , MethodInterface methodInterface , // d164221 TransactionAttribute txAttr ) // 199625 { EJBMethodInfoImpl retVal = null ; BeanMetaData bmd = wrapper . bmd ; setup ( bmd ) ; // delay initting array so we can get slot count //d151861 if ( ( topOfStack < 0 ) || orig ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "EJBMethodInfoStack::get called with neg TopOfStack " + "or in orig mode:" + topOfStack + " orig: " + orig ) ; orig = true ; elements = null ; //d166651 retVal = bmd . createEJBMethodInfoImpl ( bmd . container . getEJBRuntime ( ) . getMetaDataSlotSize ( MethodMetaData . class ) ) ; } //d151861 else { if ( topOfStack < elements . length ) { retVal = elements [ topOfStack ++ ] ; } else { ++ topOfStack ; retVal = bmd . createEJBMethodInfoImpl ( bmd . container . getEJBRuntime ( ) . getMetaDataSlotSize ( MethodMetaData . class ) ) ; } } retVal . initializeInstanceData ( null , methodNameOnly , bmd , methodInterface , txAttr , false ) ; return retVal ; }
Get an instance of EJBMethodInfoImpl . Either return EJBMethod off the stack or new up a new instance after stack capacity is exhausted returns EJBMethodInfoImpl
326
35
160,874
Class < ? > loadClass ( String name ) throws ClassNotFoundException { // First, try to find the class by name. ServiceReference < DeserializationClassProvider > provider = classProviders . getReference ( name ) ; if ( provider != null ) { return loadClass ( provider , name ) ; } // Next, try to find the class by package. int index = name . lastIndexOf ( ' ' ) ; if ( index != - 1 ) { String pkg = name . substring ( 0 , index ) ; provider = packageProviders . getReference ( pkg ) ; if ( provider != null ) { return loadClass ( provider , name ) ; } } return null ; }
Attempts to resolve a class from registered class providers .
146
10
160,875
private void serializeRealObject ( ) throws ObjectFailedToSerializeException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "serializeRealObject" ) ; if ( hasRealObject ) { // If the realObject isn't null, we need to serialize it & set it into the message if ( realObject != null ) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( baos ) ; // Write the real object into a byte array oos . writeObject ( realObject ) ; // Store the bytes in the payload getPayload ( ) . setField ( JmsObjectBodyAccess . BODY_DATA_VALUE , baos . toByteArray ( ) ) ; // Set the flag, create a SoftReference to the Object & null out the strong reference // so the object can be GCd if necessary hasSerializedRealObject = true ; softRefToRealObject = new SoftReference < Serializable > ( realObject ) ; realObject = null ; } catch ( IOException ioe ) { FFDCFilter . processException ( ioe , "com.ibm.ws.sib.mfp.impl.JsJmsObjectMessageImpl.serializeRealObject" , "296" ) ; // Wrapper the exception, giving the object's class name, and throw. String objectClassName = realObject . getClass ( ) . getName ( ) ; throw new ObjectFailedToSerializeException ( ioe , objectClassName ) ; } } // If the realObject is null, we just set the field in the message & can now claim to have serialized it. else { // Real object is null getPayload ( ) . setField ( JmsObjectBodyAccess . BODY_DATA_VALUE , null ) ; // We have not actually serialized anything, but the object data is in the payload hasSerializedRealObject = true ; } } // Any length calculation will need to be redone as the message now 'owns' the payload value clearCachedLengths ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "serializeRealObject" ) ; }
Private method to serialize the real object into the payload .
502
12
160,876
private Serializable deserializeToRealObject ( ) throws IOException , ClassNotFoundException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deserializeToRealObject" ) ; Serializable obj = null ; ObjectInputStream ois = null ; byte [ ] bytes = getDataFromPayload ( ) ; if ( bytes != null ) { try { ByteArrayInputStream bais = new ByteArrayInputStream ( bytes ) ; // Get the classloader, which may be the standard classloader or may be an application // classloader provided by WebSphere ClassLoader cl = AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { @ Override public ClassLoader run ( ) { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } } ) ; ois = new DeserializationObjectInputStream ( bais , cl ) ; // Deserialize the object and set the local variables appropriately obj = ( Serializable ) ois . readObject ( ) ; hasRealObject = true ; hasSerializedRealObject = true ; softRefToRealObject = new SoftReference < Serializable > ( obj ) ; } catch ( IOException ioe ) { FFDCFilter . processException ( ioe , "com.ibm.ws.sib.mfp.impl.JsJmsObjectMessageImpl.deserializeToRealObject" , "340" ) ; throw ioe ; } catch ( ClassNotFoundException cnfe ) { FFDCFilter . processException ( cnfe , "com.ibm.ws.sib.mfp.impl.JsJmsObjectMessageImpl.deserializeToRealObject" , "345" ) ; throw cnfe ; } finally { try { if ( ois != null ) { ois . close ( ) ; } } catch ( IOException ex ) { // No FFDC code needed if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Exception closing the ObjectInputStream" , ex ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deserializeToRealObject" , ( obj == null ? "null" : obj . getClass ( ) ) ) ; return obj ; }
Private method to deserialize the real object from the payload .
529
13
160,877
public SICoreConnection getConnection ( ) throws SISessionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIProducerSession . tc . isEntryEnabled ( ) ) { SibTr . entry ( CoreSPIProducerSession . tc , "getConnection" , this ) ; SibTr . exit ( CoreSPIProducerSession . tc , "getConnection" , _conn ) ; } checkNotClosed ( ) ; return _conn ; }
Returns this sessions connection
106
4
160,878
void disableDiscriminatorAccessCheckAtSend ( String discriminatorAtCreate ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "disableDiscriminatorAccessCheckAtSend" ) ; _checkDiscriminatorAccessAtSend = false ; this . _discriminatorAtCreate = discriminatorAtCreate ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "disableDiscriminatorAccessCheckAtSend" ) ; }
Disable discriminator access checks at send time
125
8
160,879
public void addEntry ( TimerWorkItem addItem , long curTime ) { // this routine assumes the slot is not full this . mostRecentlyAccessedTime = curTime ; this . lastEntryIndex ++ ; this . entries [ lastEntryIndex ] = addItem ; }
Add a timer item .
57
5
160,880
@ Generated ( value = "com.ibm.jtc.jax.tools.xjc.Driver" , date = "2014-06-11T05:49:00-04:00" , comments = "JAXB RI v2.2.3-11/28/2011 06:21 AM(foreman)-" ) public List < Flow > getFlows ( ) { if ( flows == null ) { flows = new ArrayList < Flow > ( ) ; } return this . flows ; }
Gets the value of the flows property .
111
9
160,881
public JMFMessage decode ( JSchema schema , byte [ ] contents , int offset , int length ) throws JMFMessageCorruptionException { return new JSMessageImpl ( schema , contents , offset , length , true ) ; }
Implementation of decode
49
4
160,882
protected String read ( SocketChannel sc ) throws IOException { sc . read ( buffer ) ; buffer . flip ( ) ; decoder . decode ( buffer , charBuffer , true ) ; charBuffer . flip ( ) ; String result = charBuffer . toString ( ) ; // Clear out buffers buffer . clear ( ) ; charBuffer . clear ( ) ; decoder . reset ( ) ; return result ; }
Reads a command or command response from a socket channel .
84
12
160,883
protected void write ( SocketChannel sc , String s ) throws IOException { sc . write ( encoder . encode ( CharBuffer . wrap ( s ) ) ) ; }
Writes a command or command response to a socket channel .
35
12
160,884
@ Test public void MPJwtBadMPConfigAsEnvVars_GoodMpJwtConfigSpecifiedInServerXml ( ) throws Exception { resourceServer . reconfigureServerUsingExpandedConfiguration ( _testName , "rs_server_AltConfigNotInApp_goodServerXmlConfig.xml" ) ; standardTestFlow ( resourceServer , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_APP , MpJwtFatConstants . MPJWT_APP_CLASS_NO_MP_CONFIG_IN_APP ) ; }
The server will be started with all mp - config properties set to bad values in environment variables . The server . xml has a valid mp_jwt config specified . The config settings should come from server . xml . The test should run successfully .
150
49
160,885
@ Test public void MPJwtBadMPConfigAsEnvVars_MpJwtConfigNotSpecifiedInServerXml ( ) throws Exception { standardTestFlow ( resourceServer , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_APP , MpJwtFatConstants . MPJWT_APP_CLASS_NO_MP_CONFIG_IN_APP , setBadIssuerExpectations ( resourceServer ) ) ; }
The server will be started with all mp - config properties set to bad values in environment variables . The server . xml has NO mp_jwt config specified . The config settings should come from the env vars . The test should fail
126
47
160,886
private boolean doRead ( int amountToRead ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "doRead, Current buffer, " + _buffer + ", reading from the TCP Channel, readLine : " + _isReadLine ) ; } try { if ( _tcpChannelCallback != null && ! _isReadLine ) { //async read logic return immediateRead ( amountToRead ) ; } else { return syncRead ( amountToRead ) ; } } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "doRead, we encountered an exception during the read : " + e ) ; } if ( _error != null ) { return false ; } _error = e ; throw e ; } }
This method will call the synchronous or asynchronous method depending on how everything is set up
195
17
160,887
private boolean syncRead ( int amountToRead ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "syncRead, Executing a synchronous read" ) ; } // Allocate the buffer and set it on the TCP Channel setAndAllocateBuffer ( amountToRead ) ; try { long bytesRead = _tcpContext . getReadInterface ( ) . read ( 1 , WCCustomProperties31 . UPGRADE_READ_TIMEOUT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "syncRead, Completed the read, " + bytesRead ) ; } if ( bytesRead > 0 ) { //Get the buffer from the TCP Channel after we have told them to read. _buffer = _tcpContext . getReadInterface ( ) . getBuffer ( ) ; //We don't need to check for null first as we know we will always get the buffer we just set configurePostReadBuffer ( ) ; // record the new amount of data read from the channel _totalBytesRead += _buffer . remaining ( ) ; return true ; } return false ; } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "syncRead, We encountered an exception during the read : " + e ) ; } _error = e ; throw e ; } }
Issues a synchronous read to the TCP Channel .
327
11
160,888
private boolean immediateRead ( int amountToRead ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "immediateRead, Executing a read" ) ; } if ( amountToRead > 1 ) { //Allocate a new temp buffer, then set the position to 0 and limit to the amount we want to read //Copy in the current this.buffer as it should only have one byte in it WsByteBuffer tempBuffer = allocateBuffer ( amountToRead ) ; tempBuffer . position ( 0 ) ; tempBuffer . limit ( amountToRead ) ; tempBuffer . put ( _buffer ) ; tempBuffer . position ( 1 ) ; _buffer . release ( ) ; _buffer = tempBuffer ; tempBuffer = null ; _tcpContext . getReadInterface ( ) . setBuffer ( _buffer ) ; long bytesRead = 0 ; try { bytesRead = _tcpContext . getReadInterface ( ) . read ( 0 , WCCustomProperties31 . UPGRADE_READ_TIMEOUT ) ; } catch ( IOException readException ) { //If we encounter an exception here we need to return the 1 byte that we already have. //Returned true immediately and the next read will catch the exception and propagate it properly if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "immediateRead, The read encountered an exception. " + readException ) ; Tr . debug ( tc , "immediateRead, Return with our one byte" ) ; } configurePostReadBuffer ( ) ; return true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "immediateRead, Complete, " + bytesRead ) ; } //Get the buffer from the TCP Channel after we have told them to read. _buffer = _tcpContext . getReadInterface ( ) . getBuffer ( ) ; //We don't need to check for null first as we know we will always get the buffer we just set configurePostReadBuffer ( ) ; // record the new amount of data read from the channel _totalBytesRead += _buffer . remaining ( ) ; } //We will return true here in all circumstances because we always have 1 byte read from the isReady call or the initial read of the connection return true ; }
This method will execute an immediate read The immediate read will issue a read to the TCP Channel and immediately return with whatever can fit in the buffers This will only ever be called after we had read the 1 byte from the isReady or initialRead methods . As such we will allocate a buffer and add in the 1 byte . This method should always return at least 1 byte even if the read fails since we have already read that byte
514
85
160,889
public int read ( ) throws IOException { validate ( ) ; int rc = - 1 ; if ( doRead ( 1 ) ) { rc = _buffer . get ( ) & 0x000000FF ; } _buffer . release ( ) ; _buffer = null ; return rc ; }
Read the first available byte
59
5
160,890
public int read ( byte [ ] output , int offset , int length ) throws IOException { int size = - 1 ; validate ( ) ; if ( 0 == length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "read(byte[],int,int), Target length was 0" ) ; } return length ; } if ( doRead ( length ) ) { size = _buffer . limit ( ) - _buffer . position ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "(byte[],int,int) Filling byte array, size --> " + size ) ; } _buffer . get ( output , offset , size ) ; } _buffer . release ( ) ; _buffer = null ; return size ; }
Read into the provided byte array with the length and offset provided
189
12
160,891
private void setAndAllocateBuffer ( int sizeToAllocate ) { if ( _buffer == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setAndAllocateBuffer, Buffer is null, size to allocate is : " + sizeToAllocate ) ; } _buffer = allocateBuffer ( sizeToAllocate ) ; } configurePreReadBuffer ( sizeToAllocate ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setAndAllocateBuffer, Setting the buffer : " + _buffer ) ; } _tcpContext . getReadInterface ( ) . setBuffer ( _buffer ) ; }
Allocate the buffer size we need and then pre - configure the buffer to prepare it to be read into Once it has been prepared set the buffer to the TCP Channel
165
33
160,892
private void validate ( ) throws IOException { if ( null != _error ) { throw _error ; } if ( ! _isReadLine && ! _isReady ) { //If there is no data available then isReady will have returned false and this throw an IllegalStateException if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isErrorEnabled ( ) ) Tr . error ( tc , "read.failed.isReady.false" ) ; throw new IllegalStateException ( Tr . formatMessage ( tc , "read.failed.isReady.false" ) ) ; } }
This checks if we have already had an exception thrown . If so it just rethrows that exception This check is done before any reads are done
124
29
160,893
public void setupReadListener ( ReadListener readListenerl , SRTUpgradeInputStream31 srtUpgradeStream ) { if ( readListenerl == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isErrorEnabled ( ) ) Tr . error ( tc , "readlistener.is.null" ) ; throw new NullPointerException ( Tr . formatMessage ( tc , "readlistener.is.null" ) ) ; } if ( _rl != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isErrorEnabled ( ) ) Tr . error ( tc , "readlistener.already.started" ) ; throw new IllegalStateException ( Tr . formatMessage ( tc , "readlistener.already.started" ) ) ; } //Save off the current Thread data by creating the ThreadContextManager. Then pass it into the callback ThreadContextManager tcm = new ThreadContextManager ( ) ; _tcpChannelCallback = new UpgradeReadCallback ( readListenerl , this , tcm , srtUpgradeStream ) ; _rl = readListenerl ; _isReady = false ; _upConn . getVirtualConnection ( ) . getStateMap ( ) . put ( TransportConstants . UPGRADED_LISTENER , "true" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setupReadListener, Starting the initial read" ) ; } initialRead ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setupReadListener, ReadListener set : " + _rl ) ; } }
Sets the ReadListener provided by the application to this stream Once the ReadListener is set we will kick off the initial read
372
25
160,894
public void initialRead ( ) { _isInitialRead = true ; if ( _buffer != null ) { _buffer . release ( ) ; _buffer = null ; } setAndAllocateBuffer ( 1 ) ; configurePreReadBuffer ( 1 ) ; //This if the first read of the ReadListener, which means force the read to go async //We won't get an actual response from this read as it will always come back on another thread _tcpContext . getReadInterface ( ) . setBuffer ( _buffer ) ; _tcpContext . getReadInterface ( ) . read ( 1 , _tcpChannelCallback , true , WCCustomProperties31 . UPGRADE_READ_TIMEOUT ) ; }
This method triggers the initial read on the connection or the read for after the ReadListener . onDataAvailable has run The read done in this method is a forced async read meaning it will always return on another thread The provided callback will be called when the read is completed and that callback will invoke the ReadListener logic .
151
63
160,895
public void configurePostInitialReadBuffer ( ) { _isInitialRead = false ; _isFirstRead = false ; _buffer = _tcpContext . getReadInterface ( ) . getBuffer ( ) ; configurePostReadBuffer ( ) ; }
Called after the initial read is completed . This will set the first read flag to false get the buffer from the TCP Channel and post configure the buffer . Without this method we would lose the first byte we are reading
51
43
160,896
public Boolean close ( ) { _isClosing = true ; boolean closeResult = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "close, Initial read outstanding : " + _isInitialRead ) ; } if ( _isInitialRead ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "close, Cancelling any outstanding read" ) ; } _tcpContext . getReadInterface ( ) . read ( 1 , _tcpChannelCallback , false , TCPReadRequestContext . IMMED_TIMEOUT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "close, Call to cancel complete" ) ; } //This seems strange, but what happens during the timeout it will be set to false. //If it's false we don't want to do the wait since it's been called in line. //If it's true we will want to wait until the timeout has been processed if ( _isInitialRead ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "close, Timeout has been called, waiting for it to complete" ) ; } closeResult = true ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "close, No read outstanding, no reason to call cancel" ) ; } closeResult = false ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "close, No read outstanding, no reason to call cancel" ) ; } closeResult = false ; } if ( _rl != null ) { if ( ! this . isAlldataReadCalled ( ) ) { try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "close, We are now closed, calling the ReadListener onAllDataRead" ) ; } this . setAlldataReadCalled ( true ) ; _rl . onAllDataRead ( ) ; } catch ( IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "close, Encountered an exception while calling onAllDAtaRead : " + ioe ) ; } } } } return closeResult ; }
Close the connection down by immediately timing out any existing read
570
11
160,897
public synchronized int getDurableSubscriptions ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getDurableSubscriptions" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getDurableSubscriptions" , new Integer ( durableSubscriptions ) ) ; return durableSubscriptions ; }
Get number of durable subscriptions .
84
6
160,898
public synchronized int getNonDurableSubscriptions ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getNonDurableSubscriptions" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getNonDurableSubscriptions" , new Integer ( nonDurableSubscriptions ) ) ; return nonDurableSubscriptions ; }
Get number of non - durable subscriptions .
91
8
160,899
public synchronized int getTotalSubscriptions ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getTotalSubscriptions" ) ; int totalSubscriptions = durableSubscriptions + nonDurableSubscriptions ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getTotalSubscriptions" , new Integer ( totalSubscriptions ) ) ; return totalSubscriptions ; }
Get total number of subscriptions .
99
6