idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
25,100
public Object saveView ( FacesContext facesContext ) { UIViewRoot uiViewRoot = facesContext . getViewRoot ( ) ; if ( uiViewRoot . isTransient ( ) ) { return null ; } Object serializedView = null ; ResponseStateManager responseStateManager = facesContext . getRenderKit ( ) . getResponseStateManager ( ) ; String viewId =...
Wrap the original method and redirect to VDL StateManagementStrategy when necessary
25,101
public static Serializable serialize ( Serializable serializable ) throws IOException { if ( serializable == null ) { return null ; } if ( serializable instanceof KeyHelper ) { return serializable ; } ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; ObjectOutputStream objectOutputStream = n...
serialize the primary key corresponding to a Handle to an entity bean for Rel . 3 . 5 4 . 0 . This method is called from the writeObject
25,102
public static Serializable deserialize ( Serializable kh ) throws IOException , ClassNotFoundException { if ( kh == null ) { return null ; } if ( ! ( kh instanceof KeyHelper ) ) { return kh ; } KeyHelper ivKh = ( KeyHelper ) kh ; ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream ( ivKh . vBytes ) ; O...
deserialize the Object reference corresponding to a primary key for a Handle to Rel . 3 . 5 4 . 0 Entity Bean . This method is called from the readResolve
25,103
public Object readResolve ( ) throws ObjectStreamException { Object obj = null ; try { obj = deserialize ( this ) ; } catch ( Throwable t ) { throw new InvalidObjectException ( "com.ibm.ws.ejb.portable.KeyHelper can not be deserialized" ) ; } return obj ; }
readResolve is the standard overide if you want to substitute during a readObject call during serialization in our case we call the deserialize method to deserialize the contained byte array into the original Key object
25,104
private int skipWhiteSpace ( byte [ ] data , int start ) { int index = start ; while ( index < data . length && ( ' ' == data [ index ] || '\t' == data [ index ] ) ) { index ++ ; } return index ; }
Skip whitespace found in the input data starting at the given index . It will return an index value that points to the first non - space byte found or end of data if it ran out .
25,105
protected HttpRequestMessageImpl getRequestImpl ( ) { if ( null == getMyRequest ( ) ) { setMyRequest ( getObjectFactory ( ) . getRequest ( this ) ) ; getMyRequest ( ) . setHeaderChangeLimit ( getHttpConfig ( ) . getHeaderChangeLimit ( ) ) ; } setStartTime ( ) ; return getMyRequest ( ) ; }
Get access to the request message impl for internal use .
25,106
public void setResponse ( HttpResponseMessage msg ) throws IllegalResponseObjectException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "setResponse: " + msg ) ; } if ( null == msg ) { throw new IllegalResponseObjectException ( "Illegal null message" ) ; } HttpResponse...
Set the response object in the service context for usage .
25,107
public void sendResponseHeaders ( ) throws IOException , MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "sendResponseHeaders(sync)" ) ; } if ( ! headersParsed ( ) ) { IOException ioe = new IOException ( "Request not read yet" ) ; FFDCFilter . proces...
Send the headers for the outgoing response synchronously .
25,108
protected HttpInvalidMessageException checkResponseValidity ( ) { if ( ! MethodValues . HEAD . equals ( getRequest ( ) . getMethodValue ( ) ) ) { long len = getResponse ( ) . getContentLength ( ) ; long num = getNumBytesWritten ( ) ; if ( HeaderStorage . NOTSET != len && num != len ) { if ( TraceComponent . isAnyTracin...
Once the response message has been fully written perform any last checks for correctness . This will return null if the response was valid otherwise it will return the HttpInvalidMessageException that should be handed off to the application channel above .
25,109
protected void logFinalResponse ( long numBytesWritten ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { HttpChannelConfig c = getHttpConfig ( ) ; Tr . debug ( tc , "logFinal" , c , c . getAccessLog ( ) , c . getAccessLog ( ) . isStarted ( ) , numBytesWritten ) ; } if ( ! getHttpConfig ( ...
Method to consolidate the access logging message into one spot . This pulls all the pieces together for the appropriate line to save .
25,110
public void finishRawResponseMessage ( WsByteBuffer [ ] body ) throws IOException , MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "finishRawResponseMessage(sync)" ) ; } setRawBody ( true ) ; finishResponseMessage ( body ) ; if ( TraceComponent . is...
Finish sending the response message with the optional input body buffers . These can be null if there is no more actual body data to send . This method will avoid any body modification such as compression or chunked encoding and simply send the buffers as - is . If the headers have not been sent yet then they will be p...
25,111
public void sendError ( HttpError error ) throws MessageSentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Called sendError with: " + error ) ; } if ( ! headersParsed ( ) ) { IOException ioe = new IOException ( "Request not read yet" ) ; FFDCFilter . processE...
Sends an error code and page back to the client asynchronously and closes the connection .
25,112
protected void finishSendError ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "finishSendError: " + getVC ( ) ) ; } HttpError error = ( HttpError ) getVC ( ) . getStateMap ( ) . get ( HTTP_ERROR_IDENTIFIER ) ; WsByteBuffer [ ] body = ( WsByteBuffer [ ] ) getVC ( ) ....
Finish the send error path by closing the connection with the exception from the HttpError . This is used by the callbacks .
25,113
protected void finishSendError ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "finishSendError(exception): " + getVC ( ) ) ; } WsByteBuffer [ ] body = ( WsByteBuffer [ ] ) getVC ( ) . getStateMap ( ) . remove ( EPS_KEY ) ; if ( null != body ) { for ( int...
Finish the send error path by closing the connection with the exception from the HttpError .
25,114
public void purgeBodyBuffers ( boolean callClose ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Discarding body buffers..." ) ; } super . clearStorage ( ) ; super . clearTempStorage ( ) ; if ( callClose ) { this . myLink . close ( getVC ( ) , null ) ; } }
If we are purging the incoming request body during a close sequence then this method should be called once the entire body is successfully read . This will discard those body buffers and then restart the close process now that we re ready to read the next inbound request .
25,115
public void initialise ( String name , int minSize , int maxSize ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "initialise" , new Object [ ] { name , minSize , maxSize } ) ; wasThreadPool = new com . ibm . ws . util . ThreadPool ( name , minSize , maxSize ) ;...
Creates the underlying WAS thread pool .
25,116
public ArrayList < Frame > prepareHeaders ( byte [ ] marshalledHeaders , boolean complete ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareHeaders entry: stream: marked as complete: " + complete ) ; } int maxFrameSize = muxLink . getRemoteConnectionSettings ( ) ...
Create Header frames corresponding to a byte array of http headers
25,117
public ArrayList < Frame > prepareBody ( WsByteBuffer [ ] wsbb , int length , boolean isFinalWrite ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareBody entry : final write: " + isFinalWrite ) ; } ArrayList < Frame > dataFrames = new ArrayList < Frame > ( ) ; Fr...
Create Data frames to contain the http body payload The buffers passed in must not exceed the http2 max frame size
25,118
protected boolean isSwappableData ( Object obj ) { if ( obj != null && ( obj instanceof Serializable || obj instanceof Externalizable ) ) { return true ; } return false ; }
Check if attribute is swappable as defined by J2EE
25,119
public void initialize ( MessageStoreImpl ms , XidManager xidManager , Configuration configuration ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "initialize" , new Object [ ] { "MS=" + ms , "XidManager=" + xidManager , "Config=" + configuration } ) ; _ms = ms...
Initialises the PersistentMessageStore
25,120
public void stop ( int mode ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stop" , "Mode=" + mode ) ; _available = false ; _shutdownRequested = true ; if ( _starting ) { synchronized ( this ) { _starting = false ; notify ( ) ; } } if ( _spillDispatcher != nul...
Stops the Persistent Message Store .
25,121
public void notification ( int event , Object [ ] args ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "notification" , new Object [ ] { event , args } ) ; switch ( event ) { case ObjectManagerEventCallback . objectManagerStopped : if ( _omgrStarted ) { objectM...
by the ObjectManager when anything interesting occurs .
25,122
private void objectManagerStopped ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "objectManagerStopped" ) ; _available = false ; if ( ! _shutdownRequested ) { _ms . reportLocalError ( ) ; SibTr . error ( tc , "FILE_STORE_STOP_UNEXPECTED_SIMS1590" ) ; } else ...
as we can not function once we have lost the ObjectManager .
25,123
private String createDirectoryPath ( String path ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createDirectoryPath" , "Path=" + path ) ; StringBuilder directoryPath = new StringBuilder ( "" ) ; if ( ( path != null ) && ( path . length ( ) > 0 ) ) { if ( path...
Checks to see if the supplied path exists and if not creates the directory structure required to store the file store files .
25,124
public boolean mayBeNumeric ( ) { if ( type == UNKNOWN ) type = NUMERIC ; return type == NUMERIC || ( type >= INT && type <= DOUBLE ) ; }
Returns true if the type is consistent with a numeric context false otherwise . Sets the type to NUMERIC if it is UNKNOWN .
25,125
public void unintern ( InternTable table ) { refCount -- ; if ( refCount < 0 ) throw new IllegalStateException ( ) ; if ( refCount == 0 ) { Object res = table . remove ( this ) ; if ( res == null ) throw new IllegalStateException ( ) ; } }
Removes this Selector from an InternTable
25,126
public static Selector decode ( ObjectInput buf ) throws IOException { if ( buf . readByte ( ) != VERSION ) throw new IOException ( ) ; try { return decodeSubtree ( buf ) ; } catch ( Exception e ) { FFDC . processException ( cclass , "com.ibm.ws.sib.matchspace.selector.impl.Selector.decode" , e , "1:191:1.19" ) ; throw...
The decode method turns an ObjectInput into a Selector tree .
25,127
public static String createDirectoryPath ( String source ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createDirectoryPath" , source ) ; String directoryPath = null ; if ( source != null ) { directoryPath = "" ; final StringTokenizer tokenizer = new StringTokenizer ( source , "\\/" ) ; while ( tokenizer . hasMo...
Replaces forward and backward slashes in the source string with File . separator characters .
25,128
protected void performColdStart ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "performColdStart" ) ; coldStartLogFileName = logFileName ; coldStartTime = System . currentTimeMillis ( ) ; switch ( logFileType ) { case ( ObjectMa...
Cold start the ObjectManager .
25,129
private final void performRecovery ( LogInput logInput ) throws ObjectManagerException { final String methodName = "performRecovery" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { logInput } ) ; checkpointEndSeen = false ; try { for...
Recover the state of the objectManager from the Log . Re apply changes to object stores that were lost .
25,130
protected void saveClonedState ( Transaction transaction ) throws ObjectManagerException { final String methodName = "saveClonedState" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , transaction ) ; java . util . Iterator objectStoreIterator = object...
Create or update a copy of the ObjectManagerState in each ObjectStore . The caller must be synchronised on objectStores .
25,131
protected final void waitForCheckpoint ( boolean persistent ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "waitForCheckpoint" ) ; checkpointHelper . waitForCheckpoint ( persistent ) ; if ( Tracing . isAnyTracingEnabled ( ) && tra...
Blocking request for a checkpoint returns once a checkpoint has been completed .
25,132
protected final void requestCheckpoint ( boolean persistent ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "requestCheckpoint" , new Object [ ] { new Boolean ( persistent ) } ) ; if ( checkpointHelper != null ) checkpointHelper . ...
Non blocking request for a checkpoint returns immediately . If multiple requests are made this may result in fewer checkpoints than requests .
25,133
public void notifyBeforeEvaluation ( String expression ) { for ( EvaluationListener listener : listeners ) { try { listener . beforeEvaluation ( this , expression ) ; } catch ( Throwable t ) { Util . handleThrowable ( t ) ; } } }
Notify interested listeners that an expression will be evaluated .
25,134
public void notifyAfterEvaluation ( String expression ) { for ( EvaluationListener listener : listeners ) { try { listener . afterEvaluation ( this , expression ) ; } catch ( Throwable t ) { Util . handleThrowable ( t ) ; } } }
Notify interested listeners that an expression has been evaluated .
25,135
public void notifyPropertyResolved ( Object base , Object property ) { for ( EvaluationListener listener : listeners ) { try { listener . propertyResolved ( this , base , property ) ; } catch ( Throwable t ) { Util . handleThrowable ( t ) ; } } }
Notify interested listeners that a property has been resolved .
25,136
public boolean isLambdaArgument ( String name ) { for ( Map < String , Object > arguments : lambdaArguments ) { if ( arguments . containsKey ( name ) ) { return true ; } } return false ; }
Determine if the specified name is recognised as the name of a lambda argument .
25,137
public Object getLambdaArgument ( String name ) { for ( Map < String , Object > arguments : lambdaArguments ) { Object result = arguments . get ( name ) ; if ( result != null ) { return result ; } } return null ; }
Obtain the value of the lambda argument with the given name .
25,138
public Object convertToType ( Object obj , Class < ? > type ) { boolean originalResolved = isPropertyResolved ( ) ; setPropertyResolved ( false ) ; try { ELResolver resolver = getELResolver ( ) ; if ( resolver != null ) { Object result = resolver . convertToType ( this , obj , type ) ; if ( isPropertyResolved ( ) ) { r...
Coerce the supplied object to the requested type .
25,139
public static Class < ? > tryLoad ( String className ) { try { return Class . forName ( className , false , JSFContainer . class . getClassLoader ( ) ) ; } catch ( ClassNotFoundException notFound ) { return null ; } }
Try to load the given class . If the class is not found null is returned .
25,140
private boolean processUninstalledInstallerBundle ( String installerBundleLocation ) { Set < String > bundleLocationsToUninstall = bundleOrigins . remove ( installerBundleLocation ) ; if ( bundleLocationsToUninstall != null ) { debug ( "Installer bundle at location {0} had installees that need to be uninstalled" , inst...
Determines if the uninstalled bundle location was an installer bundle and calls for the removal of any installees associated with it if it was .
25,141
private Set < String > uninstallInstalleeBundles ( Set < String > installeeBundleLocationsToUninstall ) { Set < String > unsuccessfulUninstallLocations = new HashSet < String > ( ) ; for ( String installeeBundleLocation : installeeBundleLocationsToUninstall ) { Bundle installeeBundleToUninstall = ctx . getBundle ( inst...
Iterates a set of installee bundles attempting to uninstall them .
25,142
final private void updateWaterMark ( ) { if ( initWaterMark ) { if ( current < lowWaterMark ) lowWaterMark = current ; if ( current > highWaterMark ) highWaterMark = current ; } else { lowWaterMark = highWaterMark = current ; initWaterMark = true ; } }
Internal final method for perfOptimization
25,143
final public void incrementWithoutSync ( long curTime , long val ) { if ( enabled ) { lastSampleTime = updateIntegral ( curTime ) ; current += val ; updateWaterMark ( ) ; } else { current += val ; } }
the caller of this method should be in synchronization block
25,144
final public void decrementWithSyncFlag ( long curTime , long val ) { if ( enabled ) { lastSampleTime = updateIntegral ( curTime ) ; if ( sync ) { synchronized ( this ) { current -= val ; } } else { current -= val ; if ( current < 0 ) current = 0 ; } updateWaterMark ( ) ; } else { current -= val ; } }
synchronize ONLY if synchronized update flag is enabled
25,145
public int getType ( int pathLength ) { if ( type == TYPE_INVALID || dataPath == null || pathLength >= dataPath . length ) return TYPE_INVALID ; if ( pathLength == 1 ) return TYPE_MODULE ; else return TYPE_COLLECTION ; }
This method should be rewritten if we allow arbitrary module structure
25,146
public boolean isSamePath ( DataDescriptor other ) { if ( other == null ) return false ; if ( type == TYPE_INVALID || other . getType ( ) == TYPE_INVALID ) return false ; if ( type != other . getType ( ) ) return false ; if ( dataPath == null || other . getPath ( ) == null ) return false ; String [ ] otherPath = other ...
Returns true if this descriptor has same path same type same moduleName instanceName and dataId as the other DataDescriptor .
25,147
public boolean isDescendant ( DataDescriptor other ) { if ( other == null ) return false ; if ( type == TYPE_INVALID || other . getType ( ) == TYPE_INVALID ) return false ; String [ ] otherPath = other . getPath ( ) ; if ( otherPath . length >= dataPath . length ) return false ; for ( int i = 0 ; i < otherPath . length...
Returns true if this descriptor is descendant of other descriptor
25,148
public DataDescriptor parentDescriptor ( ) { if ( type == TYPE_INVALID ) { return null ; } else if ( dataIds != null ) { return new DataDescriptor ( dataPath ) ; } else { if ( dataPath . length == 1 ) return null ; String [ ] myPath = new String [ dataPath . length - 1 ] ; System . arraycopy ( dataPath , 0 , myPath , 0...
Returns the parentDescriptor
25,149
public Object createConnectionFactory ( final ConnectionManager connectionManager ) { if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "createConnectionFactory" , connectionManager ) ; } final Object connectionFactory = new SibRaConnectionFactory ( this , connectionManager ) ; if ( TRACE . isEntryEnab...
Creates a core SPI connection factory that will use the given connection manager to create connections .
25,150
protected void put ( byte [ ] bytes ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "put" , new Object [ ] { RLSUtils . toHexString ( bytes , RLSUtils . MAX_DISPLAY_BYTES ) , this } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing at position " + _buffer . position ( ) ) ; _buffer . put ( bytes ) ; if...
Setter method used to write bytes . length bytes from the buffer into the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by bytes . length .
25,151
protected void putInt ( int data ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "putInt" , new Object [ ] { this , new Integer ( data ) } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing at position " + _buffer . position ( ) ) ; _buffer . putInt ( data ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( ...
Setter method used to write an integer to the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by the size of an integer .
25,152
protected void putLong ( long data ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "putLong" , new Object [ ] { this , new Long ( data ) } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing at position " + _buffer . position ( ) ) ; _buffer . putLong ( data ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit (...
Setter method used to write a long to the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by the size of a long .
25,153
protected void putShort ( short data ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "putShort" , new Object [ ] { this , new Short ( data ) } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing at position " + _buffer . position ( ) ) ; _buffer . putShort ( data ) ; if ( tc . isEntryEnabled ( ) ) Tr . e...
Setter method used to write a short to the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by the size of a short .
25,154
protected void putBoolean ( boolean data ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "putBoolean" , new Object [ ] { this , new Boolean ( data ) } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing at position " + _buffer . position ( ) ) ; _buffer . put ( data ? TRUE : FALSE ) ; if ( tc . isEntryEn...
Setter method used to write a boolean to the mapped byte buffer at the current byte cursor position . The byte cursor is advanced by the size of a boolean .
25,155
protected void close ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "close" , this ) ; _buffer . putLong ( _sequenceNumber ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "close" ) ; }
Close the WritableLogRecord . Creates the record tail sructure . On exit from this method the buffers byte cursor will be positioned on the very next byte after the log record . No further access to this instance is permitted after this call has been issued .
25,156
public void setTime ( Date minTime , Date maxTime ) throws IllegalArgumentException { if ( minTime != null && maxTime != null && minTime . after ( maxTime ) ) { throw new IllegalArgumentException ( "Value of the minTime parameter should specify time before the time specified by the value of the maxTime parameter" ) ; }...
sets the current value for the minimum and maximum time
25,157
public void setLevels ( Level minLevel , Level maxLevel ) throws IllegalArgumentException { if ( minLevel != null && maxLevel != null && minLevel . intValue ( ) > maxLevel . intValue ( ) ) { throw new IllegalArgumentException ( "Value of the minLevel parameter should specify level not larger than the value of the maxLe...
sets the current value for the minimum and maximum levels
25,158
public static Pattern compile ( String pattern ) throws IllegalArgumentException { if ( pattern == null ) { throw new IllegalArgumentException ( "Pattern can not be null" ) ; } if ( pattern . startsWith ( "/" ) && pattern . endsWith ( "/" ) && pattern . length ( ) > 1 ) { try { return Pattern . compile ( pattern . subs...
compiles pattern string into regular expression Pattern object .
25,159
public void setThreadIDs ( String [ ] threadIDs ) throws IllegalArgumentException { int [ ] threads = null ; if ( threadIDs != null ) { threads = new int [ threadIDs . length ] ; try { for ( int i = 0 ; i < threads . length ; i ++ ) { threads [ i ] = Integer . parseInt ( threadIDs [ i ] , 16 ) ; } } catch ( NumberForma...
sets string array each string representing the hex value of a thread to search on
25,160
final public void decRequests ( long execTime , String url ) { long lst = 0 ; if ( responseTime != null && execTime >= 0 ) { lst = System . currentTimeMillis ( ) ; responseTime . add ( lst , execTime ) ; } if ( currentRequests != null ) { if ( lst <= 0 ) lst = System . currentTimeMillis ( ) ; currentRequests . decremen...
use tmp var to avoid possible problem due to multithreads
25,161
public static Bundle getBundle ( BundleContext bundleContext , String resourceAdapter ) throws ConfigEvaluatorException { Bundle bundle = null ; if ( JMSResourceDefinitionConstants . RESOURCE_ADAPTER_WASJMS . equals ( resourceAdapter ) || JMSResourceDefinitionConstants . RESOURCE_ADAPTER_WMQJMS . equals ( resourceAdapt...
Get the bundle where the resource adapter s Metatype Information exists .
25,162
public void commsFailure ( SICoreConnection conn , SIConnectionLostException exception ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "commsFailure" , new Object [ ] { conn , exception } ) ; JMSException jmse = ( JMSException ) JmsErrorUtils . newThrowable ( J...
This method is called when a connection is closed due to a communications failure . Examine the SICommsException to determine the nature of the failure .
25,163
public void meTerminated ( SICoreConnection conn ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "meTerminated" , conn ) ; JMSException jmse = ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "ME_TERMINATED_CWSIA0344" , null , tc ) ; conne...
This method is called when a connection is closed because the Messaging Engine has terminated .
25,164
public static void shutDownSSLEngine ( SSLConnectionLink connLink , boolean isServer , boolean isConnected ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "shutDownSSLEngine: isServer: " + isServer + " isConnected: " + isConnected + " " + connLink ) ; } SSLEngine engin...
Shut down the engine for the given SSL connection link .
25,165
public static ByteBuffer [ ] getWrappedByteBuffers ( WsByteBuffer wsbuffers [ ] ) { ByteBuffer buffers [ ] = new ByteBuffer [ wsbuffers . length ] ; boolean foundNullBuffer = false ; int i = 0 ; for ( i = 0 ; i < wsbuffers . length ; i ++ ) { if ( wsbuffers [ i ] != null ) { buffers [ i ] = wsbuffers [ i ] . getWrapped...
Return the underlying ByteBuffer array associated with the input WsByteBuffer array .
25,166
public static void flipBuffers ( WsByteBuffer [ ] buffers , int totalSize ) { int size = 0 ; boolean overLimit = false ; for ( int i = 0 ; i < buffers . length && null != buffers [ i ] ; i ++ ) { if ( overLimit ) { buffers [ i ] . limit ( buffers [ i ] . position ( ) ) ; } else { buffers [ i ] . flip ( ) ; size += buff...
Flip the input list of buffers walking through the list until the flipped amount equals the input total size mark the rest of the buffers as empty .
25,167
public static void copyBuffer ( WsByteBuffer src , WsByteBuffer dst ) { copyBuffer ( src , dst , src . remaining ( ) ) ; }
Simlified method call for copyBuffer which sets length to copy at src . remaining .
25,168
public static void copyBuffer ( WsByteBuffer src , WsByteBuffer dst , int length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "copyBuffer: length=" + length + "\r\n\tsrc: " + getBufferTraceInfo ( src ) + "\r\n\tdst: " + getBufferTraceInfo ( dst ) ) ; } if ( ( dst . ...
Copy all the contents of the source buffer into the destination buffer . The contents copied from the source buffer will be from its position . The data will be copied into the destination buffer starting at its current position .
25,169
public static WsByteBuffer allocateByteBuffer ( int size , boolean allocateDirect ) { WsByteBuffer newBuffer = null ; if ( allocateDirect ) { newBuffer = ChannelFrameworkFactory . getBufferManager ( ) . allocateDirect ( size ) ; } else { newBuffer = ChannelFrameworkFactory . getBufferManager ( ) . allocate ( size ) ; }...
Allocate a ByteBuffer per the SSL config at least as big as the input size .
25,170
public static String getBufferTraceInfo ( WsByteBuffer buffers [ ] ) { if ( null == buffers ) { return "Null buffer array" ; } StringBuilder sb = new StringBuilder ( 32 + ( 64 * buffers . length ) ) ; for ( int i = 0 ; i < buffers . length ; i ++ ) { sb . append ( "\r\n\t Buffer [" ) ; sb . append ( i ) ; sb . append ...
This method is called for tracing in various places . It returns a string that represents all the buffers in the array including hashcode position limit and capacity .
25,171
public static String showBufferContents ( WsByteBuffer buffers [ ] ) { if ( null == buffers || 0 == buffers . length ) { return "null" ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < buffers . length ; i ++ ) { sb . append ( "Buffer [" ) ; sb . append ( i ) ; if ( null == buffers [ i ] ) { sb . app...
Return a String containing all the data in the buffers provided between their respective positions and limits .
25,172
public static WsByteBuffer [ ] allocateByteBuffers ( int requestedBufferSize , long totalDataSize , boolean allocateDirect , boolean enforceRequestedSize ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . entry ( tc , "allocateByteBuffers" ) ; } WsByteBuffer firstBuffer = allocateByte...
Allocate a buffer array large enough to contain totalDataSize bytes but with the limit of perBufferSize bytes per buffer .
25,173
public static boolean anyPositionsNonZero ( WsByteBuffer buffers [ ] ) { if ( buffers != null ) { for ( int i = 0 ; i < buffers . length ; i ++ ) { if ( ( buffers [ i ] != null ) && ( buffers [ i ] . position ( ) != 0 ) ) { return true ; } } } return false ; }
Search for any buffer in the array that has a position that isn t zero . If found return true otherwise false .
25,174
public static SSLEngine getOutboundSSLEngine ( SSLContext context , SSLLinkConfig config , String host , int port , SSLConnectionLink connLink ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getOutboundSSLEngine, host=" + host + ", port=" + port ) ; } SSLEngine engine...
Create an SSL engine with the input parameters . The host and port values allow the re - use of possible cached SSL session ids .
25,175
public static SSLEngine getSSLEngine ( SSLContext context , FlowType type , SSLLinkConfig config , SSLConnectionLink connLink ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getSSLEngine" ) ; } SSLEngine engine = context . createSSLEngine ( ) ; configureEngine ( engin...
Setup the SSL engine for the given context .
25,176
private static void configureEngine ( SSLEngine engine , FlowType type , SSLLinkConfig config , SSLConnectionLink connLink ) { engine . setEnabledCipherSuites ( config . getEnabledCipherSuites ( engine ) ) ; String protocol = config . getSSLProtocol ( ) ; if ( protocol != null ) { engine . setEnabledProtocols ( new Str...
Configure the new engine based on the input flow type and configuration .
25,177
public static int [ ] adjustBuffersForJSSE ( WsByteBuffer [ ] buffers , int maxBufferSize ) { int [ ] limitInfo = null ; int dataAmount = 0 ; for ( int i = 0 ; i < buffers . length && null != buffers [ i ] ; i ++ ) { dataAmount += buffers [ i ] . remaining ( ) ; if ( dataAmount > maxBufferSize ) { int savedLimit = buff...
The purpose of this method is to prepare the input buffers to be sent into a call to wrap or unwrap in the JSSE considering the limitations about how much data can be present in each buffer . This amount is determined by the amount of data between position and limit .
25,178
public static int adjustBufferForJSSE ( WsByteBuffer buffer , int maxBufferSize ) { int limit = - 1 ; if ( null != buffer ) { int size = buffer . remaining ( ) ; if ( maxBufferSize < size ) { limit = buffer . limit ( ) ; int overFlow = size - maxBufferSize ; buffer . limit ( limit - overFlow ) ; if ( TraceComponent . i...
The purpose of this method is to prepare the input buffer to be sent into a call to wrap or unwrap in the JSSE considering the limitations about how much data can be present in each buffer . This amount is determined by the amount of data between position and limit .
25,179
public static void resetBuffersAfterJSSE ( WsByteBuffer [ ] buffers , int [ ] limitInfo ) { if ( limitInfo == null ) { return ; } int bufferIndex = limitInfo [ 0 ] ; int bufferLimit = limitInfo [ 1 ] ; if ( buffers . length > bufferIndex ) { WsByteBuffer buffer = buffers [ bufferIndex ] ; if ( ( buffer != null ) && ( b...
This method is called after a call is made to adjustBuffersForJSSE followed by a call to wrap or unwrap in the JSSE . It restores the saved limit in the buffer that was modified . A few extra checks are done here to prevent any problems during odd code paths in the future .
25,180
public static void getBufferLimits ( WsByteBuffer [ ] buffers , int [ ] limits ) { if ( ( buffers != null ) && ( limits != null ) ) { for ( int i = 0 ; i < buffers . length && i < limits . length ; i ++ ) { if ( buffers [ i ] != null ) { limits [ i ] = buffers [ i ] . limit ( ) ; if ( TraceComponent . isAnyTracingEnabl...
Assign an array of limits associated with the passed in buffer array .
25,181
public static void setBufferLimits ( WsByteBuffer [ ] buffers , int [ ] limits ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "setBufferLimits" ) ; } if ( ( buffers != null ) && ( limits != null ) ) { int bufferCapacity = 0 ; int limit = 0 ; for ( int i = 0 ; i < buff...
Assign the limits of the passed in buffers to the specified values in the int array . The lengths of both arrays are expected to be similar . The limits are expected to be settable . IE the respective buffers should have capacity > = to the limit .
25,182
public static int lengthOf ( WsByteBuffer [ ] src , int startIndex ) { int length = 0 ; if ( null != src ) { for ( int i = startIndex ; i < src . length && null != src [ i ] ; i ++ ) { length += src [ i ] . remaining ( ) ; } } return length ; }
Find the amount of data in the source buffers starting at the input index .
25,183
public static WsByteBuffer [ ] compressBuffers ( WsByteBuffer [ ] src , boolean releaseEmpty ) { List < WsByteBuffer > output = new LinkedList < WsByteBuffer > ( ) ; boolean first = true ; int size = 0 ; for ( int i = 0 ; i < src . length ; i ++ ) { if ( null == src [ i ] ) { continue ; } if ( 0 < src [ i ] . remaining...
Take the source buffers and extract all non - null non - empty buffers into a new list . If the releaseEmpty flag is true then it will release the empty buffers .
25,184
public void visitCode ( ) { if ( injectedTraceAnnotationVisitor == null && classAdapter . isInjectedTraceAnnotationRequired ( ) ) { AnnotationVisitor av = visitAnnotation ( INJECTED_TRACE_TYPE . getDescriptor ( ) , true ) ; av . visitEnd ( ) ; } super . visitCode ( ) ; methodEntryLabel = new Label ( ) ; visitLabel ( me...
Begin processing a method . This is called when the instruction stream for a method is first encountered . Since this is the first callback we use this to add the byte codes required for entry tracing .
25,185
private void visitFrameAfterOnMethodEntry ( ) { if ( ! visitFramesAfterCallbacks ) return ; if ( isConstructor ( ) ) { List < Object > stackLocals = new ArrayList < Object > ( argTypes . length + 1 ) ; stackLocals . add ( classAdapter . getClassType ( ) . getInternalName ( ) ) ; for ( Type type : argTypes ) { switch ( ...
Inject a simple stack map frame and a PUSH NULL POP . This method assumes that the onMethodEntry modified code and returned immediately after visiting the target label of a trace guard .
25,186
private void visitFrameAfterMethodReturnCallback ( ) { if ( ! visitFramesAfterCallbacks ) return ; Type returnType = getReturnTypeForTrace ( ) ; if ( ! Type . VOID_TYPE . equals ( getReturnTypeForTrace ( ) ) && ! isConstructor ( ) ) { Object typeDescriptor = null ; switch ( returnType . getSort ( ) ) { case Type . BOOL...
Generate the stack frame that s needed after visiting the method exit trace guard target injected by tracing adapters .
25,187
public void visitTryCatchBlock ( Label start , Label end , Label handler , String type ) { if ( type != null ) { handlers . put ( handler , type ) ; } super . visitTryCatchBlock ( start , end , handler , type ) ; }
Visit a try catch block . We will use this to determine the exception handler labels for the try block .
25,188
public void visitLabel ( Label label ) { super . visitLabel ( label ) ; if ( waitingForSuper ) { if ( branchTargets . containsKey ( label ) ) { currentStack = branchTargets . get ( label ) ; } } else { pendingExceptionHandlerTypeName = handlers . get ( label ) ; } }
Visit a label . We will use this to determine when we ve reached an exception handler block .
25,189
public void visitFrame ( int type , int numLocals , Object [ ] locals , int stackSize , Object [ ] stack ) { if ( ! isVisitFrameRequired ( ) ) return ; super . visitFrame ( type , numLocals , locals , stackSize , stack ) ; }
Visit a stack map frame .
25,190
public void visitLocalVariable ( String name , String desc , String signature , Label start , Label end , int index ) { if ( index < firstNonParameterSlot ) { start = methodEntryLabel ; } super . visitLocalVariable ( name , desc , signature , start , end , index ) ; }
Visit a local variable . We will use this to change the start label for method parameters references .
25,191
protected void createTraceArrayForParameters ( ) { int localVarOffset = isStatic ? 0 : 1 ; int syntheticArgs = 0 ; if ( isConstructor ( ) && getClassAdapter ( ) . isInnerClass ( ) && argTypes . length > 1 ) { String className = getClassAdapter ( ) . getClassInternalName ( ) ; String ownerName = className . substring ( ...
Create an object array that contains references to the method parameters . Primitives will be boxed and parameters that have been annotated as sensitive will only have their class type traced . On exit the Object array will be on the top of the stack .
25,192
protected void boxLocalVar ( final Type type , final int slot , final boolean isSensitive ) { visitVarInsn ( type . getOpcode ( ILOAD ) , slot ) ; box ( type , isSensitive ) ; }
Generate the instruction sequence needed to box the local variable if required .
25,193
protected void visitGetTraceObjectField ( ) { visitFieldInsn ( GETSTATIC , classAdapter . getClassInternalName ( ) , classAdapter . getTraceObjectFieldName ( ) , classAdapter . getTraceObjectFieldType ( ) . getDescriptor ( ) ) ; }
Load the trace object field onto the top of the stack .
25,194
protected void visitSetTraceObjectField ( ) { visitFieldInsn ( PUTSTATIC , classAdapter . getClassInternalName ( ) , classAdapter . getTraceObjectFieldName ( ) , classAdapter . getTraceObjectFieldType ( ) . getDescriptor ( ) ) ; }
Set the trace object field from the reference on the top of the stack .
25,195
protected boolean isArgumentSensitive ( int index ) { if ( methodInfo != null ) { return methodInfo . isArgSensitive ( index ) ; } Set < Type > parameterAnnotations = observedParameterAnnotations . get ( index ) ; if ( parameterAnnotations != null ) { return parameterAnnotations . contains ( SENSITIVE_TYPE ) ; } return...
Determine if the introspection or trace configuration for this method indicates that the specified method parameter is sensitive .
25,196
protected boolean isMethodInstrumentedByThisAdapter ( ) { if ( injectedTraceAnnotationVisitor == null ) { return false ; } List < String > visitedMethodAdapters = injectedTraceAnnotationVisitor . getMethodAdapters ( ) ; return visitedMethodAdapters . contains ( getClass ( ) . getName ( ) ) ; }
Determine if the method being processed has already had trace points automatically injected by this method adapter .
25,197
@ Reference ( name = THREAD_CONTEXT_PROVIDER , service = ThreadContextProvider . class , cardinality = ReferenceCardinality . MULTIPLE , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY ) protected void setThreadContextProvider ( ServiceReference < ThreadContextProvider > ref ) { Strin...
Declarative Services method for adding a thread context provider .
25,198
protected void unsetThreadContextProvider ( ServiceReference < ThreadContextProvider > ref ) { String threadContextProviderName = ( String ) ref . getProperty ( COMPONENT_NAME ) ; if ( threadContextProviders . removeReference ( threadContextProviderName , ref ) && Boolean . TRUE . equals ( ref . getProperty ( ThreadCon...
Declarative Services method for removing a thread context provider .
25,199
public static boolean containsContentType ( String contentType , String [ ] allowedContentTypes ) { if ( allowedContentTypes == null ) { return false ; } for ( int i = 0 ; i < allowedContentTypes . length ; i ++ ) { if ( allowedContentTypes [ i ] . indexOf ( contentType ) != - 1 ) { return true ; } } return false ; }
Indicate if the passes content type match one of the options passed .