idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
24,400
@ FFDCIgnore ( IllegalArgumentException . class ) private String evaluateGroupNameAttribute ( boolean immediateOnly ) { try { return elHelper . processString ( "groupNameAttribute" , this . idStoreDefinition . groupNameAttribute ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "groupNameAttribute" , "cn" } ) ; } return "cn" ; } }
Evaluate and return the groupNameAttribute .
24,401
@ FFDCIgnore ( IllegalArgumentException . class ) private String evaluateGroupSearchBase ( boolean immediateOnly ) { try { return elHelper . processString ( "groupSearchBase" , this . idStoreDefinition . groupSearchBase ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "groupSearchBase" , "" } ) ; } return "" ; } }
Evaluate and return the groupSearchBase .
24,402
@ FFDCIgnore ( IllegalArgumentException . class ) private String evaluateGroupSearchFilter ( boolean immediateOnly ) { try { return elHelper . processString ( "groupSearchFilter" , this . idStoreDefinition . groupSearchFilter ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "There was an error resolving the '{1}' configuration object. Ensure any EL expressions are resolveable. The value will be defaulted to '{2}'" , new Object [ ] { "groupSearchFilter" , "" } ) ; } return "" ; } }
Evaluate and return the groupSearchFilter .
24,403
@ FFDCIgnore ( IllegalArgumentException . class ) private LdapSearchScope evaluateGroupSearchScope ( boolean immediateOnly ) { try { return elHelper . processLdapSearchScope ( "groupSearchScopeExpression" , this . idStoreDefinition . groupSearchScopeExpression ( ) , this . idStoreDefinition . groupSearchScope ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "groupSearchScope/groupSearchScopeExpression" , "LdapSearchScope.SUBTREE" } ) ; } return LdapSearchScope . SUBTREE ; } }
Evaluate and return the groupSearchScope .
24,404
@ FFDCIgnore ( IllegalArgumentException . class ) private Integer evaluateMaxResults ( boolean immediateOnly ) { try { return elHelper . processInt ( "maxResultsExpression" , this . idStoreDefinition . maxResultsExpression ( ) , this . idStoreDefinition . maxResults ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "maxResults/maxResultsExpression" , "1000" } ) ; } return 1000 ; } }
Evaluate and return the maxResults .
24,405
@ FFDCIgnore ( IllegalArgumentException . class ) private Integer evaluatePriority ( boolean immediateOnly ) { try { return elHelper . processInt ( "priorityExpression" , this . idStoreDefinition . priorityExpression ( ) , this . idStoreDefinition . priority ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "priority/priorityExpression" , "80" } ) ; } return 80 ; } }
Evaluate and return the priority .
24,406
@ FFDCIgnore ( IllegalArgumentException . class ) private Integer evaluateReadTimeout ( boolean immediateOnly ) { try { return elHelper . processInt ( "readTimeoutExpression" , this . idStoreDefinition . readTimeoutExpression ( ) , this . idStoreDefinition . readTimeout ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "readTimeout/readTimeoutExpression" , "0" } ) ; } return 0 ; } }
Evaluate and return the readTimeout .
24,407
@ FFDCIgnore ( IllegalArgumentException . class ) private String evaluateUrl ( boolean immediateOnly ) { try { return elHelper . processString ( "url" , this . idStoreDefinition . url ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "url" , "" } ) ; } return "" ; } }
Evaluate and return the url .
24,408
@ FFDCIgnore ( IllegalArgumentException . class ) private Set < ValidationType > evaluateUseFor ( boolean immediateOnly ) { try { return elHelper . processUseFor ( this . idStoreDefinition . useForExpression ( ) , this . idStoreDefinition . useFor ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { Set < ValidationType > values = new HashSet < ValidationType > ( ) ; values . add ( ValidationType . PROVIDE_GROUPS ) ; values . add ( ValidationType . VALIDATE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "useFor/useForExpression" , values } ) ; } return values ; } }
Evaluate and return the useFor .
24,409
public static StackInfo getStack ( ) { StackInfo result = MDC . get ( ) ; return result == null ? new StackInfo ( ) : result ; }
Returns current stack information . It is called by log handler to get thread specific information which is either passed for the record in a request or obtained from the thread directly .
24,410
public static int getThreadID ( ) { StackInfo result = MDC . get ( ) ; return result == null ? HpelHelper . getIntThreadId ( ) : result . threadId ; }
Returns thread id from the current stack . It is called by log handler to get thread id which is either passed for the record in a request or obtained from the thread directly .
24,411
public static Map < String , String > getExtensions ( ) { StackInfo result = MDC . get ( ) ; if ( result == null ) { return StackInfo . collectExtensions ( ) ; } else { return result . extensions ; } }
Returns context extensions from the current stack . It is called by log handler to get extensions which are either passed for the record in a request or obtained from the thread directly .
24,412
public void setPubSubInputHandler ( PubSubInputHandler pubSubInputHandler ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setPubSubInputHandler" , pubSubInputHandler ) ; this . pubSubInputHandler = pubSubInputHandler ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setPubSubInputHandler" ) ; }
Method setPubSubInputHandler .
24,413
public String getResourceName ( ) { String nameString = null ; nameString = mcWrapper . gConfigProps . getXpathId ( ) ; return nameString ; }
The most meaningful string to return is the xpath unique identifier
24,414
private static Constructor getConstructor ( ) { if ( _tc . isEntryEnabled ( ) ) SibTr . entry ( _tc , "getConstructor" ) ; if ( _constructor == null ) { try { Class clazz = Class . forName ( "com.ibm.ws.sib.exitpoint.systemcontext.SystemContextImpl" ) ; _constructor = clazz . getConstructor ( new Class [ ] { JsApiMessage . class } ) ; } catch ( Exception e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ws.sib.exitpoint.systemcontext.SystemContextFactory.getConstructor" , "66" ) ; NoSuchMethodError newE = new NoSuchMethodError ( ) ; newE . initCause ( e ) ; if ( _tc . isEntryEnabled ( ) ) SibTr . exit ( _tc , "getConstructor" , newE ) ; throw newE ; } } if ( _tc . isEntryEnabled ( ) ) SibTr . exit ( _tc , "getConstructor" , _constructor ) ; return _constructor ; }
This method creates and returns the constructor of the SystemContextImpl .
24,415
public void invalidateByTemplate ( String template , boolean waitOnInvalidation , DCache cache ) { synchronized ( this ) { BatchUpdateList bul = getUpdateList ( cache ) ; bul . invalidateByTemplateEvents . put ( template , new InvalidateByTemplateEvent ( template , CachePerf . LOCAL ) ) ; } if ( waitOnInvalidation ) { wakeUp ( 0 , 0 ) ; } }
This invalidates all cache entries in all caches whose template is specified .
24,416
public void cacheCommand_Clear ( boolean waitOnInvalidation , DCache cache ) { String template = cache . getCacheName ( ) ; synchronized ( this ) { BatchUpdateList bul = getUpdateList ( cache ) ; bul . invalidateByIdEvents . clear ( ) ; bul . invalidateByTemplateEvents . clear ( ) ; bul . pushCacheEntryEvents . clear ( ) ; bul . pushECFEvents . clear ( ) ; InvalidateByTemplateEvent invalidateByTemplateEvent = new InvalidateByTemplateEvent ( template , CachePerf . LOCAL ) ; invalidateByTemplateEvent . setCacheCommand_Clear ( ) ; bul . invalidateByTemplateEvents . put ( template , invalidateByTemplateEvent ) ; } if ( waitOnInvalidation ) { wakeUp ( 0 , 0 ) ; } }
This will send a CLEAR command to all caches .
24,417
public void invalidateById ( Object id , boolean waitOnInvalidation , DCache cache ) { invalidateById ( id , CachePerf . DIRECT , waitOnInvalidation , cache , Cache . CHECK_PREINVALIDATION_LISTENER ) ; }
This invalidates all cache entries in all caches whose cache id or data id is specified . Assumes this is the result of a direct invalidation .
24,418
public synchronized void pushExternalCacheFragment ( ExternalInvalidation externalCacheFragment , DCache cache ) { BatchUpdateList bul = getUpdateList ( cache ) ; bul . pushECFEvents . add ( externalCacheFragment ) ; }
This allows an external cache fragment to be added to the BatchUpdateDaemon .
24,419
public synchronized AbstractMessage getMEMEMessage ( ) throws Exception { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMEMEMessage" ) ; int messageLength = getInt ( ) ; boolean isControlMessage = get ( ) == CommsConstants . MEME_CONTROLMESSAGE ; AbstractMessage message = null ; if ( tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "Message Length" , messageLength ) ; SibTr . debug ( tc , "Control Message" , "" + isControlMessage ) ; } if ( isControlMessage ) { ControlMessageFactory fac = ControlMessageFactory . getInstance ( ) ; if ( receivedBuffer . hasArray ( ) ) { message = fac . createInboundControlMessage ( receivedBuffer . array ( ) , receivedBuffer . position ( ) + receivedBuffer . arrayOffset ( ) , messageLength ) ; } else { byte [ ] messageArray = get ( messageLength ) ; message = fac . createInboundControlMessage ( messageArray , 0 , messageLength ) ; } } else { JsMessageFactory fac = JsMessageFactory . getInstance ( ) ; if ( receivedBuffer . hasArray ( ) ) { message = fac . createInboundJsMessage ( receivedBuffer . array ( ) , receivedBuffer . position ( ) + receivedBuffer . arrayOffset ( ) , messageLength ) ; } else { byte [ ] messageArray = get ( messageLength ) ; message = fac . createInboundJsMessage ( messageArray , 0 , messageLength ) ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMEMEMessage" , message ) ; return message ; }
This method will retrieve an ME - ME message from the buffer . A JsMessage or ControlMessage may be returned from this method .
24,420
public synchronized int putMEMEMessageWithoutEncode ( AbstractMessage memeMessage , List < DataSlice > messageParts ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putMEMEMessageWithoutEncode" , new Object [ ] { memeMessage , messageParts } ) ; int messageLength = 0 ; for ( int x = 0 ; x < messageParts . size ( ) ; x ++ ) { messageLength += messageParts . get ( x ) . getLength ( ) ; } if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Message is " + messageLength + "byte(s) in length" ) ; putInt ( messageLength ) ; if ( memeMessage . isControlMessage ( ) ) put ( CommsConstants . MEME_CONTROLMESSAGE ) ; else put ( CommsConstants . MEME_JSMESSAGE ) ; for ( int x = 0 ; x < messageParts . size ( ) ; x ++ ) { DataSlice messPart = messageParts . get ( x ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "DataSlice[" + x + "]: " + "Array: " + messPart . getBytes ( ) + ", " + "Offset: " + messPart . getOffset ( ) + ", " + "Length: " + messPart . getLength ( ) ) ; wrap ( messPart . getBytes ( ) , messPart . getOffset ( ) , messPart . getLength ( ) ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putMEMEMessageWithoutEncode" , messageLength ) ; return messageLength ; }
This method puts a message into the buffer using the already encoded messageParts parameter . This is for the case where the encoding has already been performed . The memeMessage parameter is used to ensure the correct message type is worked out .
24,421
String lookupPid ( ConfigID referenceId ) { ExtendedConfiguration config = caSupport . lookupConfiguration ( referenceId ) ; String pid = ( config == null ) ? null : config . getPid ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "lookupPid(): Lookup of " + referenceId + " reference resolved to " + pid ) ; } return pid ; }
Find a configuration PID from a configuration ID .
24,422
String getPid ( ConfigID configId ) throws ConfigNotFoundException { ExtendedConfiguration config = getConfiguration ( configId ) ; String pid = config . getPid ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getPid(): Lookup of " + configId + " configuration id resolved to " + pid ) ; } return pid ; }
Find or create a PID for a configuration ID .
24,423
private void overrideDatabaseTerminationToken ( Map < Object , Object > props ) { String overrideTermToken = null ; String platformClassName = _dbMgr . getDatabasePlatformClassName ( _pui ) ; if ( platformClassName != null ) { overrideTermToken = platformTerminationToken . get ( platformClassName ) ; } if ( overrideTermToken != null ) { String existing = ( String ) props . get ( PersistenceUnitProperties . TARGET_DATABASE_PROPERTIES ) ; if ( existing != null ) { existing = existing + "," ; } else { existing = "" ; } existing = ( existing + "StoredProcedureTerminationToken=" + overrideTermToken ) ; props . put ( PersistenceUnitProperties . TARGET_DATABASE_PROPERTIES , existing ) ; } }
Helper method that will override the termination token if the database detected is in our platformTerminationToken list .
24,424
private String generateDigest ( String algorithmName , X509Certificate cert ) { try { MessageDigest md = MessageDigest . getInstance ( algorithmName ) ; md . update ( cert . getEncoded ( ) ) ; byte data [ ] = md . digest ( ) ; StringBuilder buffer = new StringBuilder ( 3 * data . length ) ; int i = 0 ; buffer . append ( HEX_CHARS [ ( data [ i ] >> 4 ) & 0xF ] ) ; buffer . append ( HEX_CHARS [ ( data [ i ] % 16 ) & 0xF ] ) ; for ( ++ i ; i < data . length ; i ++ ) { buffer . append ( ':' ) ; buffer . append ( HEX_CHARS [ ( data [ i ] >> 4 ) & 0xF ] ) ; buffer . append ( HEX_CHARS [ ( data [ i ] % 16 ) & 0xF ] ) ; } return buffer . toString ( ) ; } catch ( NoClassDefFoundError e ) { return getMessage ( "sslTrust.genDigestError" , algorithmName , e . getMessage ( ) ) ; } catch ( Exception e ) { return getMessage ( "sslTrust.genDigestError" , algorithmName , e . getMessage ( ) ) ; } }
This method is used to create a SHA - 1 or MD5 digest on an X509Certificate as the fingerprint .
24,425
public int prepareOperation ( ) throws XAException , XAResourceNotAvailableException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "prepareOperation" , new Object [ ] { this } ) ; final int retVal = getXAResource ( ) . prepare ( _xid ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "prepareOperation" , retVal ) ; return retVal ; }
It s gonna be called asynchronously
24,426
public void writeDefaultConfiguration ( ManifestFileProcessor mfp ) { try { try { buildDefaultConfigurationList ( mfp ) ; startDefaultConfigurationSection ( ) ; for ( Entry < FeatureResource , Set < String > > entry : bundleNameToFeaturesMap . entrySet ( ) ) { FeatureResource bundle = entry . getKey ( ) ; BundleWrapper bw = new BundleWrapper ( mfp , bundle ) ; for ( DefaultElement element : bw . getDefaultElements ( ) ) { indenter . indent ( 1 ) ; writer . writeStartElement ( DEFAULT_INSTANCE ) ; writer . writeAttribute ( PROVIDING_FEATURES , getFeatureString ( entry . getValue ( ) ) ) ; if ( element . requiresExisting ( ) ) writer . writeAttribute ( XMLConfigParser . REQUIRE_EXISTING , "true" ) ; if ( element . addIfMissing ( ) ) writer . writeAttribute ( XMLConfigParser . REQUIRE_DOES_NOT_EXIST , "true" ) ; element . writeElement ( 2 ) ; indenter . indent ( 1 ) ; writer . writeEndElement ( ) ; } } endDefaultConfigurationSection ( ) ; } catch ( XMLStreamException e ) { throw new IOException ( "Error generating feature list" , e ) ; } catch ( BundleException e ) { throw new IOException ( "Error generating feature list" , e ) ; } } catch ( IOException ex ) { options . setReturnCode ( ReturnCode . RUNTIME_EXCEPTION ) ; throw new RuntimeException ( ex ) ; } }
Builds a representation of default configuration and writes it out to the feature list file
24,427
private String getFeatureString ( Set < String > featureNames ) { StringBuilder featureBuilder = new StringBuilder ( ) ; if ( featureNames != null ) { Iterator < String > iter = featureNames . iterator ( ) ; while ( iter . hasNext ( ) ) { featureBuilder . append ( iter . next ( ) ) ; if ( iter . hasNext ( ) ) featureBuilder . append ( ',' ) ; } } return featureBuilder . toString ( ) ; }
Build a comma separated string based on the set of feature names .
24,428
private void buildDefaultConfigurationList ( ManifestFileProcessor mfp ) { for ( Map . Entry < String , ProvisioningFeatureDefinition > entry : features . entrySet ( ) ) { ProvisioningFeatureDefinition feature = entry . getValue ( ) ; Collection < FeatureResource > featureResources = feature . getConstituents ( SubsystemContentType . BUNDLE_TYPE ) ; for ( FeatureResource featureResource : featureResources ) { Set < String > featureSet = bundleNameToFeaturesMap . get ( featureResource ) ; if ( featureSet == null ) { featureSet = new HashSet < String > ( ) ; bundleNameToFeaturesMap . put ( featureResource , featureSet ) ; } featureSet . add ( feature . getSymbolicName ( ) ) ; } } }
Build a map of bundles to the features that enable them .
24,429
public byte [ ] toBytes ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "toBytes" ) ; final byte [ ] result = new byte [ 16 ] ; final int t1 = ( int ) ( _timestamp >> 32 & 0xFFFFFFFFL ) ; final int t2 = ( int ) ( _timestamp & 0xFFFFFFFFL ) ; Util . setBytesFromInt ( result , 0 , 4 , t1 ) ; Util . setBytesFromInt ( result , 4 , 4 , t2 ) ; Util . setBytesFromInt ( result , 8 , 4 , _epochNumber ) ; Util . setBytesFromInt ( result , 12 , 4 , _sequenceNumber ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "toBytes" , Util . toHexString ( result ) ) ; return result ; }
Build a native TxPrimaryKey suitable for recreating with the mainline constructor .
24,430
public final static ProducerType getProducerType ( Byte aValue ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Value = " + aValue ) ; return set [ aValue . intValue ( ) ] ; }
Returns the corresponding ProducerType for a given Byte . This method should NOT be called by any code outside the MFP component . It is only public so that it can be accessed by sub - packages .
24,431
public static H2HeaderField decodeHeader ( WsByteBuffer buffer , H2HeaderTable table ) throws CompressionException { return decodeHeader ( buffer , table , true , false , null ) ; }
Decode header bytes without validating against connection settings
24,432
private static String decodeFragment ( WsByteBuffer buffer ) throws CompressionException { String decodedResult = null ; try { byte currentByte = buffer . get ( ) ; buffer . position ( buffer . position ( ) - 1 ) ; boolean huffman = ( HpackUtils . getBit ( currentByte , 7 ) == 1 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Decoding using huffman encoding: " + huffman ) ; } int fragmentLength = IntegerRepresentation . decode ( buffer , ByteFormatType . HUFFMAN ) ; byte [ ] bytes = new byte [ fragmentLength ] ; buffer . get ( bytes ) ; if ( huffman && bytes . length > 0 ) { HuffmanDecoder decoder = new HuffmanDecoder ( ) ; bytes = decoder . convertHuffmanToAscii ( bytes ) ; } decodedResult = new String ( bytes , Charset . forName ( HpackConstants . HPACK_CHAR_SET ) ) ; } catch ( Exception e ) { throw new CompressionException ( "Received an invalid header block fragment" ) ; } return decodedResult ; }
Decode a Fragment of the Header . Fragment in this case refers to the bytes that represent the integer length and octets length of either the Name or Value of a Header . For instance in the case of the Name the fragment is
24,433
private static void checkIsValidH2Header ( H2HeaderField header , boolean isTrailerField ) throws CompressionException { if ( ! header . getName ( ) . startsWith ( ":" ) ) { String headerName = header . getName ( ) ; String headerValue = header . getValue ( ) ; for ( String name : HpackConstants . connectionSpecificHeaderList ) { if ( name . equalsIgnoreCase ( headerName ) ) { throw new CompressionException ( "Invalid Connection header received: " + header . toString ( ) ) ; } } if ( "Connection" . equalsIgnoreCase ( headerName ) && ! "TE" . equalsIgnoreCase ( headerValue ) ) { throw new CompressionException ( "Invalid Connection header received: " + header . toString ( ) ) ; } if ( "TE" . equalsIgnoreCase ( headerName ) && ! "trailers" . equalsIgnoreCase ( headerValue ) ) { throw new CompressionException ( "Invalid header: TE header must have value \"trailers\": " + header . toString ( ) ) ; } } else { if ( isTrailerField ) { throw new CompressionException ( "Psuedo-headers are not allowed in trailers: " + header . toString ( ) ) ; } } }
Validate a H2HeaderField object
24,434
public static int getContentLengthValue ( H2HeaderField header ) { if ( "content-length" . equalsIgnoreCase ( header . getName ( ) ) ) { return Integer . parseInt ( header . getValue ( ) ) ; } return - 1 ; }
Get the content length value from a header if one exists
24,435
protected synchronized void createListOfEntries ( Container container ) { listOfEntries = new ArrayList < String > ( ) ; for ( Entry entry : container ) { String entryName = entry . getName ( ) ; try { Container dirContainer = entry . adapt ( Container . class ) ; if ( dirContainer != null && entry . getSize ( ) == 0 ) { if ( ! "META-INF" . equalsIgnoreCase ( entry . getName ( ) ) ) { addToList ( listOfEntries , dirContainer , "/" + entryName ) ; } } else { if ( isJspFile ( entryName , extList ) && entry . getSize ( ) >= this . _minLength ) { listOfEntries . add ( "/" + entryName ) ; } } } catch ( UnableToAdaptException e ) { } } if ( listOfEntries != null ) { listOfEntriesIterator = listOfEntries . iterator ( ) ; } }
only called by single thread before others are spawned but going to synchronize to fix findbugs
24,436
protected synchronized File getJsp ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASS_NAME , "getJsp" , "enter" ) ; } File [ ] children ; try { if ( _counter % _notify == 0 ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . INFO ) ) { logger . logp ( Level . INFO , CLASS_NAME , "getJsp" , "PrepareJspHelper in group [" + appName + "]: " + _counter + " jsp files have been processed." ) ; } } if ( ! _files . isEmpty ( ) ) { _counter ++ ; if ( _counter >= _startAt ) shouldClassload = true ; return ( File ) _files . pop ( ) ; } if ( _parents . isEmpty ( ) ) { return null ; } List extList = PrepareJspHelper . buildJspFileExtensionList ( Constants . STANDARD_JSP_EXTENSIONS , _jspExtProcessor . getPatternList ( ) ) ; String resourcePath = null ; while ( _files . isEmpty ( ) && ! _parents . isEmpty ( ) ) { children = ( ( File ) _parents . pop ( ) ) . listFiles ( ) ; if ( children != null ) { for ( int i = 0 ; i < children . length ; i ++ ) { resourcePath = children [ i ] . getName ( ) . replace ( '\\' , '/' ) ; if ( resourcePath . startsWith ( "/META-INF" ) == false ) { if ( children [ i ] . isDirectory ( ) ) { _parents . push ( children [ i ] ) ; } else if ( children [ i ] . isFile ( ) && isJspFile ( children [ i ] . getName ( ) , extList ) ) { _files . push ( children [ i ] ) ; } } } } } if ( ! _files . isEmpty ( ) ) { _counter ++ ; if ( _counter >= _startAt ) shouldClassload = true ; return ( File ) _files . pop ( ) ; } else { return null ; } } catch ( Exception ex ) { logger . logp ( Level . WARNING , CLASS_NAME , "getJsp" , "Pretouch ERROR: Unexpected exception retrieving jsp names" , ex ) ; return null ; } finally { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASS_NAME , "getJsp" , "exit" ) ; } } }
near the beginning
24,437
public void setRequestNumber ( int requestNumber ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setRequestNumber" , requestNumber ) ; this . requestNumber = requestNumber ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setRequestNumber" ) ; }
Set the request number .
24,438
public synchronized void setComplete ( boolean completed ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setComplete" , completed ) ; this . completed = completed ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setComplete" ) ; }
Sets whether we have set a response or not .
24,439
public void setCATTimer ( Alarm alarm ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setCATTimer" , alarm ) ; this . alarm = alarm ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setCATTimer" ) ; }
Sets the Alarm that is running with asynch session .
24,440
public void stopSession ( ) throws SIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stopSession" ) ; mainConsumer . getConsumerSession ( ) . stop ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "stopSession" ) ; }
Stops the main consumer session so that we can be sure that no more messages will be delivered .
24,441
public void setTransaction ( int tran ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setTransaction" , tran ) ; this . transaction = tran ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setTransaction" ) ; }
This method will set the transaction that the current receive should be performed with .
24,442
private void sendEntireMessage ( JsMessage jsMessage , List < DataSlice > messageSlices ) throws UnsupportedEncodingException , MessageCopyFailedException , IncorrectMessageTypeException , MessageEncodeFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendEntireMessage" , new Object [ ] { jsMessage , messageSlices } ) ; int msgLen = 0 ; try { CommsServerByteBuffer buffer = poolManager . allocate ( ) ; ConversationState convState = ( ConversationState ) conversation . getAttachment ( ) ; buffer . putShort ( convState . getConnectionObjectId ( ) ) ; if ( ! mainConsumer . getUsingConnectionReceive ( ) ) { buffer . putShort ( mainConsumer . getConsumerSessionId ( ) ) ; } if ( messageSlices == null ) { msgLen = buffer . putMessage ( jsMessage , convState . getCommsConnection ( ) , conversation ) ; } else { msgLen = buffer . putMessgeWithoutEncode ( messageSlices ) ; } int seg = JFapChannelConstants . SEG_RECEIVE_SESS_MSG_R ; if ( mainConsumer . getUsingConnectionReceive ( ) ) { seg = JFapChannelConstants . SEG_RECEIVE_CONN_MSG_R ; } int jfapPriority = JFapChannelConstants . getJFAPPriority ( jsMessage . getPriority ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending with JFAP priority of " + jfapPriority ) ; conversation . send ( buffer , seg , requestNumber , jfapPriority , false , ThrottlingPolicy . BLOCK_THREAD , null ) ; mainConsumer . messagesSent ++ ; } catch ( SIException e ) { if ( ! ( ( ConversationState ) mainConsumer . getConversation ( ) . getAttachment ( ) ) . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".sendEntireMessage" , CommsConstants . CATSYNCASYNCHREADER_SEND_MSG_01 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2015" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendEntireMessage" ) ; }
Sends the message in one transmission back down to our peer . If the messageSlices parameter is not null then the message has already been encoded and does not need to be done again . This may be in the case where the message was destined to be sent in chunks but is so small that it does not seem worth it .
24,443
protected void sendNoMessageToClient ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendNoMessageToClient" ) ; setCurrentlyDoingReceiveWithWait ( false ) ; setComplete ( true ) ; CommsServerByteBuffer buffer = poolManager . allocate ( ) ; int msgLen = - 1 ; ConversationState convState = ( ConversationState ) conversation . getAttachment ( ) ; buffer . putShort ( convState . getConnectionObjectId ( ) ) ; if ( ! mainConsumer . getUsingConnectionReceive ( ) ) buffer . putShort ( mainConsumer . getConsumerSessionId ( ) ) ; buffer . putLong ( msgLen ) ; int seg = JFapChannelConstants . SEG_RECEIVE_SESS_MSG_R ; if ( mainConsumer . getUsingConnectionReceive ( ) ) { seg = JFapChannelConstants . SEG_RECEIVE_CONN_MSG_R ; } try { conversation . send ( buffer , seg , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException c ) { FFDCFilter . processException ( c , CLASS_NAME + ".sendNoMessageToClient" , CommsConstants . CATSYNCASYNCHREADER_SEND_NO_MSG_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , c . getMessage ( ) , c ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2015" , c ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendNoMessageToClient" ) ; }
This method will send a message to the client informing it that no message was received .
24,444
protected void sendErrorToClient ( Throwable e , String probeId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendErrorToClient" , new Object [ ] { e , probeId } ) ; setComplete ( true ) ; setCurrentlyDoingReceiveWithWait ( false ) ; StaticCATHelper . sendExceptionToClient ( e , probeId , conversation , requestNumber ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendErrorToClient" ) ; }
This method sends an exception to the client and marks the reader that a response has been sent to the client .
24,445
private void deliverAsynchExceptionToClient ( Throwable throwable , String probeId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deliverAsynchExceptionToClient" , throwable ) ; if ( ! isComplete ( ) ) { if ( alarm != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Cancelling the alarm: " + alarm . toString ( ) ) ; alarm . cancel ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Alarm cancelled" ) ; } if ( ! isComplete ( ) ) { try { final MPConsumerSession mpSession = ( MPConsumerSession ) mainConsumer . getConsumerSession ( ) ; mpSession . getConnection ( ) . removeConnectionListener ( this ) ; } catch ( SIException s ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , s . getMessage ( ) , s ) ; } sendErrorToClient ( throwable , probeId ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deliverAsynchExceptionToClient" ) ; }
Common routine used by all the connection listener methods that deliver an exception to the client .
24,446
public boolean hasMETerminated ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "hasMETerminated" ) ; final boolean hasMETerminated = ( ( ConversationState ) mainConsumer . getConversation ( ) . getAttachment ( ) ) . hasMETerminated ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "hasMETerminated" , hasMETerminated ) ; return hasMETerminated ; }
Returns the value of hasMETerminated from the ConversationState object associated with this object .
24,447
public Collection < ProvisioningFeatureDefinition > isUninstallable ( UninstallAsset uninstallAsset , Collection < ProvisioningFeatureDefinition > installedFeatureDefinitions , Collection < String > uninstallInstallFeatures , boolean isChecking ) { Collection < ProvisioningFeatureDefinition > requiredByTheseFeatures = requiresThisFeature ( uninstallAsset . getProvisioningFeatureDefinition ( ) . getSymbolicName ( ) , installedFeatureDefinitions , uninstallInstallFeatures , isChecking ) ; Collection < ProvisioningFeatureDefinition > temp = new ArrayList < ProvisioningFeatureDefinition > ( ) ; while ( requiredByTheseFeatures . size ( ) > temp . size ( ) ) { temp . addAll ( requiredByTheseFeatures ) ; for ( ProvisioningFeatureDefinition p : temp ) { InstallLogUtils . getInstallLogger ( ) . log ( Level . FINEST , "The uninstalling feature : " + uninstallAsset . getProvisioningFeatureDefinition ( ) . getSymbolicName ( ) + " is required by " + p . getSymbolicName ( ) ) ; InstallLogUtils . getInstallLogger ( ) . log ( Level . FINEST , "Determine additional dependency for feature : " + p . getSymbolicName ( ) ) ; Collection < ProvisioningFeatureDefinition > required = requiresThisFeature ( p . getSymbolicName ( ) , installedFeatureDefinitions , uninstallInstallFeatures , isChecking ) ; if ( ! ! ! required . isEmpty ( ) ) { for ( ProvisioningFeatureDefinition pp : required ) { if ( ! ! ! requiredByTheseFeatures . contains ( pp ) ) { InstallLogUtils . getInstallLogger ( ) . log ( Level . FINEST , "Found additional dependent feature : " + pp . getSymbolicName ( ) ) ; requiredByTheseFeatures . add ( pp ) ; } } } } } return requiredByTheseFeatures ; }
Verfiy whether the feature is uninstallable and there is no other installed features still require this feature .
24,448
public List < UninstallAsset > determineOrder ( List < UninstallAsset > list ) { Map < String , Integer > visited = new HashMap < String , Integer > ( ) ; Map < String , UninstallAsset > assetsMap = new HashMap < String , UninstallAsset > ( ) ; for ( UninstallAsset ua : list ) { assetsMap . put ( ua . getProvisioningFeatureDefinition ( ) . getSymbolicName ( ) , ua ) ; } AtomicInteger order = new AtomicInteger ( list . size ( ) ) ; for ( UninstallAsset ua : list ) { if ( ! ! ! visited . containsKey ( ua . getProvisioningFeatureDefinition ( ) . getSymbolicName ( ) ) ) { DFS ( ua , visited , assetsMap , order ) ; } } Collections . sort ( list , new FeatureDependencyComparator ( visited ) ) ; return list ; }
Determine the order of the features according to their dependency Use DFS approach to solve the Topological Sort problem . visited map will be used to store the order of the asset the DFS will search for all the assets without required features and work its way backward to find the order .
24,449
protected final void homeEnabled ( ) { if ( ! enabled ) { String msgTxt = "The referenced version of the " + j2eeName . getComponent ( ) + " bean in the " + j2eeName . getApplication ( ) + " application has been stopped and may no longer be used. " + "If the " + j2eeName . getApplication ( ) + " application has been started again, a new reference for " + "the new image of the " + j2eeName . getComponent ( ) + " bean must be obtained. Local references to a bean or home " + "are no longer valid once the application has been stopped." ; if ( beanMetaData . ivModuleVersion < BeanMetaData . J2EE_EJB_VERSION_3_0 ) { throw new HomeDisabledException ( msgTxt ) ; } throw new EJBStoppedException ( msgTxt ) ; } else if ( ! ivApplicationStarted ) { ivApplicationStarted = beanMetaData . _moduleMetaData . getEJBApplicationMetaData ( ) . checkIfEJBWorkAllowed ( beanMetaData . _moduleMetaData ) ; } }
Throw a runtime exception if this home is not open for business .
24,450
private void preLoadBeanPool ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . debug ( tc , "preLoadBeanPool: " + j2eeName ) ; synchronized ( beanPool ) { Object oldClassLoader = ThreadContextAccessor . UNCHANGED ; try { ivCMDAccessor . beginContext ( beanMetaData ) ; oldClassLoader = EJBThreadData . svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( beanMetaData . ivContextClassLoader ) ; for ( int i = ivNumberBeansCreated ; i < beanMetaData . ivInitialPoolSize ; i ++ ) { BeanO beanO = beanOFactory . create ( container , this , false ) ; beanPool . put ( beanO ) ; if ( beanMetaData . ivMaxCreation > 0 ) { ++ ivNumberBeansCreated ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Pre-load BeanPool(" + ivNumberBeansCreated + "/" + beanMetaData . ivMaxCreation + ")" ) ; } } } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".preLoadBeanPool" , "561" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Pre-load of BeanPool failed: exception ignored: " + ex ) ; if ( ex instanceof InvocationTargetException ) { ex = ex . getCause ( ) ; } Tr . warning ( tc , "IGNORING_UNEXPECTED_EXCEPTION_CNTR0033E" , ex ) ; } finally { EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( oldClassLoader ) ; ivCMDAccessor . endContext ( ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "preLoadBeanPool" ) ; }
Pre - load the BeanPool if the BeanPool min value has been configured as a hard limit . Any exceptions encountered will be ignored and the pool just not pre - loaded . Currently only supported for Stateless Session beans .
24,451
public synchronized void destroy ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Destroying home " , new Object [ ] { this , j2eeName } ) ; if ( ! enabled ) { return ; } if ( ivSingletonBeanO != null ) { try { ivSingletonBeanO . destroy ( ) ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".destroy" , "809" , this ) ; } } if ( beanPool != null ) { beanPool . destroy ( ) ; } enabled = false ; if ( pmiBean != null ) { container . pmiFactory . removePmiModule ( pmiBean ) ; } }
Disable this home instance and free all resources associated with it .
24,452
public final HomeWrapperSet getWrapperSet ( ) throws CSIException , RemoteException { EJSWrapperCommon w = getWrapper ( ) ; Remote remote = beanMetaData . homeRemoteImplClass == null ? null : w . getRemoteWrapper ( ) ; Object local = beanMetaData . homeLocalImplClass == null ? null : w . getLocalObject ( ) ; return new HomeBindingInfo ( remote , local ) ; }
Gets the set of wrappers for binding this home to naming .
24,453
public BeanO createBeanO ( EJBThreadData threadData , ContainerTx tx , BeanId id ) throws RemoteException { homeEnabled ( ) ; BeanO result = createBeanO ( threadData , tx , true , null ) ; result . setId ( id ) ; return result ; }
Added ContainerTx d168509 ; added EJBThreadData d630940
24,454
public Object createBusinessObject ( String businessInterfaceName , boolean useSupporting ) throws CreateException , RemoteException , ClassNotFoundException , EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createBusinessObject: " + businessInterfaceName ) ; int localIndex = beanMetaData . getLocalBusinessInterfaceIndex ( businessInterfaceName ) ; if ( localIndex != - 1 ) { return createLocalBusinessObject ( localIndex , null ) ; } int remoteIndex = beanMetaData . getRemoteBusinessInterfaceIndex ( businessInterfaceName ) ; if ( remoteIndex != - 1 ) { container . getEJBRuntime ( ) . checkRemoteSupported ( this , businessInterfaceName ) ; return createRemoteBusinessObject ( remoteIndex , null ) ; } if ( useSupporting ) { Class < ? > target = beanMetaData . classLoader . loadClass ( businessInterfaceName ) ; localIndex = beanMetaData . getAssignableLocalBusinessInterfaceIndex ( target ) ; remoteIndex = beanMetaData . getAssignableRemoteBusinessInterfaceIndex ( target ) ; if ( localIndex != - 1 ) { if ( remoteIndex != - 1 ) { Tr . error ( tc , "AMBIGUOUS_REFERENCE_TO_DUPLICATE_INTERFACE_CNTR0155E" , new Object [ ] { beanMetaData . enterpriseBeanName , beanMetaData . _moduleMetaData . ivName , businessInterfaceName } ) ; EJBConfigurationException ejbex = new EJBConfigurationException ( "Another component has an ambiguous reference to interface: " + businessInterfaceName + " which has both local and remote implementions on bean: " + j2eeName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "createBusinessObject : " + ejbex ) ; throw ejbex ; } return createLocalBusinessObject ( localIndex , null ) ; } if ( remoteIndex == - 1 ) { Tr . error ( tc , "ATTEMPT_TO_REFERENCE_MISSING_INTERFACE_CNTR0154E" , new Object [ ] { beanMetaData . enterpriseBeanName , beanMetaData . _moduleMetaData . ivName , businessInterfaceName } ) ; EJBConfigurationException ejbex = new EJBConfigurationException ( "Another component is attempting to reference local interface: " + businessInterfaceName + " which is not implemented by bean: " + j2eeName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "createBusinessObject : " + ejbex ) ; throw ejbex ; } container . getEJBRuntime ( ) . checkRemoteSupported ( this , businessInterfaceName ) ; return createRemoteBusinessObject ( remoteIndex , null ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "createBusinessObject : IllegalStateException : " + "Requested business interface not found : " + businessInterfaceName ) ; throw new IllegalStateException ( "Requested business interface not found : " + businessInterfaceName ) ; } }
d366807 . 4
24,455
public Object createRemoteBusinessObject ( int interfaceIndex , ManagedObjectContext context ) throws RemoteException , CreateException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createRemoteBusinessObject: " + interfaceIndex ) ; Object result ; EJSWrapperCommon commonWrapper = createBusinessObjectWrappers ( context ) ; result = commonWrapper . getRemoteBusinessObject ( interfaceIndex ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createRemoteBusinessObject returning: " + Util . identity ( result ) ) ; return result ; }
Method to create a remote business reference object . Once the index of the interface is found it is then passed through the EJSWrapperCommon for the rest of the logic .
24,456
public final Handle createHandle ( BeanId id ) throws RemoteException { EJSWrapper wrapper = null ; homeEnabled ( ) ; wrapper = getWrapper ( id ) . getRemoteWrapper ( ) ; if ( ! statelessSessionHome && ! statefulSessionHome ) { if ( cvUsePortableClass ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "createHandle():Creating portable HandleImpl" ) ; return new HandleImpl ( ( EJBObject ) PortableRemoteObject . toStub ( wrapper ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "createHandle():Creating non-portable EntityHandle" ) ; Properties pFake = null ; return new EntityHandle ( id , beanMetaData , pFake ) ; } } else { Object wrapperRef = container . getEJBRuntime ( ) . getRemoteReference ( wrapper ) ; EJBObject object = ( EJBObject ) PortableRemoteObject . narrow ( wrapperRef , EJBObject . class ) ; return container . sessionHandleFactory . create ( object ) ; } }
Create a Handle for the given BeanId
24,457
public EJSWrapperCommon activateBean ( BeanId beanId , ContainerTx currentTx ) throws CSIException , RemoteException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "activateBean (" + beanId + ")" , currentTx ) ; homeEnabled ( ) ; EJSWrapperCommon result = null ; try { if ( currentTx . ivFlushRequired ) { IllegalStateException isex = new IllegalStateException ( "Persistence Manager failed to perform synchronization " + "of Entity beans prior to find<METHOD>" ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "activateBean" , isex ) ; throw isex ; } beanId = wrapperManager . beanIdCache . find ( beanId ) ; container . activator . activateBean ( EJSContainer . getThreadData ( ) , currentTx , beanId ) ; result = wrapperManager . getWrapper ( beanId ) ; } catch ( NoSuchObjectException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".activateBean" , "998" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "activateBean : NoSuchObjectException" , ex ) ; result = getWrapper ( beanId ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "activateBean" , result ) ; return result ; }
d146034 . 6
24,458
public void discard ( Object o ) { BeanO beanO = ( BeanO ) o ; beanO . destroy ( ) ; }
This method is called when beans are deallocated from the pool .
24,459
protected final Object WASInternal_copyPrimaryKey ( Object obj ) { if ( ! noPrimaryKeyMutation && ! statefulSessionHome ) { Object copy = null ; Object oldCL = EJBThreadData . svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( beanMetaData . classLoader ) ; try { copy = container . ivObjectCopier . copy ( ( Serializable ) obj ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".WASInternal_copyPrimaryKey" , "4016" , this ) ; ContainerEJBException ex = new ContainerEJBException ( "WASInternal_copyPrimaryKey failed attempting to process PrimaryKey" , t ) ; Tr . error ( tc , "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E" , new Object [ ] { t , ex . toString ( ) } ) ; throw ex ; } finally { EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( oldCL ) ; } return copy ; } return obj ; }
This method is used to make a copy of the Primary Key object .
24,460
public boolean getUserInfo ( ProviderAuthenticationResult oidcResult , SSLSocketFactory sslSocketFactory , String accessToken , String subjectFromIdToken ) { if ( ! willRetrieveUserInfo ( ) || accessToken == null ) { return false ; } String userInfoStr = getUserInfoFromURL ( clientConfig , sslSocketFactory , accessToken ) ; if ( userInfoStr == null ) { return false ; } if ( ! isUserInfoValid ( userInfoStr , subjectFromIdToken ) ) { return false ; } updateAuthenticationResultPropertiesWithUserInfo ( oidcResult , userInfoStr ) ; return true ; }
get userinfo from provider s UserInfo Endpoint if configured and active . If successful update properties in the ProviderAuthenticationResult
24,461
protected boolean isUserInfoValid ( String userInfoStr , String subClaim ) { String userInfoSubClaim = getUserInfoSubClaim ( userInfoStr ) ; if ( userInfoSubClaim == null || subClaim == null || userInfoSubClaim . compareTo ( subClaim ) != 0 ) { Tr . error ( tc , "USERINFO_INVALID" , new Object [ ] { userInfoStr , subClaim } ) ; return false ; } return true ; }
per oidc - connect - core - 1 . 0 sec 5 . 3 . 2 sub claim of userinfo response must match sub claim in id token .
24,462
protected String getUserInfoFromURL ( ConvergedClientConfig config , SSLSocketFactory sslsf , String accessToken ) { String url = config . getUserInfoEndpointUrl ( ) ; boolean hostnameVerification = config . isHostNameVerificationEnabled ( ) ; if ( ! url . toLowerCase ( ) . startsWith ( "https:" ) && config . isHttpsRequired ( ) ) { Tr . error ( tc , "OIDC_CLIENT_URL_PROTOCOL_NOT_HTTPS" , new Object [ ] { url } ) ; return null ; } OidcClientUtil oidccu = new OidcClientUtil ( ) ; int statusCode = 0 ; String responseStr = null ; try { boolean useSysProps = config . getUseSystemPropertiesForHttpClientConnections ( ) ; Map < String , Object > resultMap = oidccu . getUserinfo ( url , accessToken , sslsf , hostnameVerification , useSysProps ) ; if ( resultMap == null ) { throw new Exception ( "result map from getUserinfo is null" ) ; } HttpResponse response = ( HttpResponse ) resultMap . get ( ClientConstants . RESPONSEMAP_CODE ) ; if ( response == null ) { throw new Exception ( "HttpResponse from getUserinfo is null" ) ; } statusCode = response . getStatusLine ( ) . getStatusCode ( ) ; responseStr = EntityUtils . toString ( response . getEntity ( ) , "UTF-8" ) ; } catch ( Exception ex ) { } if ( statusCode != 200 ) { Tr . error ( tc , "USERINFO_RETREIVE_FAILED" , new Object [ ] { url , Integer . toString ( statusCode ) , responseStr } ) ; return null ; } return responseStr ; }
Obtain userInfo from an OIDC provider
24,463
public static WsLocationAdminImpl createLocations ( final BundleContext ctx ) { if ( instance . get ( ) == null ) { SymbolRegistry . getRegistry ( ) . clear ( ) ; Callable < WsLocationAdminImpl > initializer = new Callable < WsLocationAdminImpl > ( ) { public WsLocationAdminImpl call ( ) throws Exception { return new WsLocationAdminImpl ( new BundleContextMap ( ctx ) ) ; } } ; instance = StaticValue . mutateStaticValue ( instance , initializer ) ; } return instance . get ( ) ; }
Construct the WsLocationAdminService singleton based on a set of initial properties provided by the bundle context when running in an osgi framework .
24,464
public static String processMessageDigestForData ( MessageDigest messageDigest , byte [ ] data ) { String output = "" ; if ( messageDigest != null ) { messageDigest . update ( data ) ; byte [ ] digest = messageDigest . digest ( ) ; output = Base64Coder . encode ( digest ) ; } return output ; }
Calculate the digest specified by byte array of data
24,465
public String createTokenString ( String builderConfigId ) { try { return createTokenString ( builderConfigId , WSSubject . getRunAsSubject ( ) , null , null ) ; } catch ( Exception e ) { return null ; } }
create an MP - JWT token using the builder API . Assumes the user is already authenticated .
24,466
public String getUserName ( Subject subject ) { try { WSCredential wsCred = getWSCredential ( subject ) ; if ( wsCred == null ) { wsCred = getPrivateWSCredential ( subject ) ; } return wsCred != null ? wsCred . getSecurityName ( ) : null ; } catch ( Exception e ) { return null ; } }
get the username from the WSSubject
24,467
public Selector getSelector ( String selector ) { Selector ans ; try { ans = QueryExpr ( ) ; if ( ! ans . mayBeBoolean ( ) ) ans . setType ( Selector . INVALID ) ; } catch ( ParseException e ) { Object obj = null ; ans = new LiteralImpl ( obj ) ; ans . setType ( Selector . INVALID ) ; } return ans ; }
Return the Selector tree associated with a primed parser .
24,468
final public Selector Expression ( ) throws ParseException { Selector left , right = null ; int op = - 1 ; left = Term ( ) ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case 7 : case 8 : op = PlusMinus ( ) ; right = Expression ( ) ; break ; default : jj_la1 [ 5 ] = jj_gen ; ; } if ( right == null ) { if ( true ) return left ; } else { if ( true ) return new OperatorImpl ( op , left , right ) ; } throw new Error ( "Missing return statement in function" ) ; }
| Term PlusMinus Expression
24,469
final public Selector Term ( ) throws ParseException { Selector left , right = null ; int op = - 1 ; left = Primary ( false ) ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case 9 : case 10 : op = TimesDiv ( ) ; right = Term ( ) ; break ; default : jj_la1 [ 7 ] = jj_gen ; ; } if ( right == null ) { if ( true ) return left ; } else { if ( true ) return new OperatorImpl ( op , left , right ) ; } throw new Error ( "Missing return statement in function" ) ; }
| Primary TimesDiv Term
24,470
public void defineFunction ( String prefix , String function , Method method ) throws java . lang . NoSuchMethodException { if ( prefix == null || function == null || method == null ) { throw new NullPointerException ( Util . message ( context , "elProcessor.defineFunctionNullParams" ) ) ; } int modifiers = method . getModifiers ( ) ; if ( ! Modifier . isStatic ( modifiers ) || ! Modifier . isPublic ( modifiers ) ) { throw new NoSuchMethodException ( Util . message ( context , "elProcessor.defineFunctionInvalidMethod" , method . getName ( ) , method . getDeclaringClass ( ) . getName ( ) ) ) ; } manager . mapFunction ( prefix , function , method ) ; }
Map a method to a function name .
24,471
public Builder create ( ) throws InvalidBuilderException { if ( ! active ) { String err = Tr . formatMessage ( tc , "JWT_BUILDER_NOT_ACTIVE" , new Object [ ] { "defaultJWT" } ) ; throw new InvalidBuilderException ( err ) ; } return create ( "defaultJWT" ) ; }
Create a builder with default configuration
24,472
public synchronized Builder create ( String builderConfigId ) throws InvalidBuilderException { if ( builderConfigId == null || builderConfigId . isEmpty ( ) ) { String err = Tr . formatMessage ( tc , "JWT_BUILDER_INVALID" , new Object [ ] { builderConfigId } ) ; throw new InvalidBuilderException ( err ) ; } if ( ! active ) { String err = Tr . formatMessage ( tc , "JWT_BUILDER_NOT_ACTIVE" , new Object [ ] { builderConfigId } ) ; throw new InvalidBuilderException ( err ) ; } return new BuilderImpl ( builderConfigId ) ; }
Create a builder with specified builder
24,473
public void restore ( HttpServletRequest req , HttpServletResponse res , boolean anyMethod ) { if ( ! ( req instanceof IExtendedRequest ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "It is not an IExtendedRequest object" ) ; } return ; } if ( ! anyMethod && ! req . getMethod ( ) . equalsIgnoreCase ( "GET" ) ) { return ; } String reqURL = req . getRequestURI ( ) ; IExtendedRequest extRequest = ( IExtendedRequest ) req ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , " method : " + req . getMethod ( ) + " URL:" + reqURL ) ; } String postParamSaveMethod = webAppSecurityConfig . getPostParamSaveMethod ( ) ; if ( postParamSaveMethod . equalsIgnoreCase ( WebAppSecurityConfig . POST_PARAM_SAVE_TO_COOKIE ) ) { restoreFromCookie ( extRequest , res , reqURL ) ; } else if ( postParamSaveMethod . equalsIgnoreCase ( WebAppSecurityConfig . POST_PARAM_SAVE_TO_SESSION ) ) { restoreFromSession ( extRequest , req , reqURL ) ; } }
Restore POST parameters from session or cookie .
24,474
private void restoreFromSession ( IExtendedRequest extRequest , HttpServletRequest req , String reqURL ) { HttpSession postparamsession = req . getSession ( false ) ; if ( postparamsession == null ) { return ; } String previousReq = ( String ) postparamsession . getAttribute ( INITIAL_URL ) ; if ( previousReq != null && previousReq . equals ( reqURL ) ) { try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found the session, restoring POST parameters." ) ; } extRequest . setMethod ( "POST" ) ; Map paramValues = ( Map ) postparamsession . getAttribute ( PARAM_VALUES ) ; if ( paramValues != null && ! paramValues . isEmpty ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Restoring POST paramameters for URL : " + reqURL ) ; } extRequest . setInputStreamData ( ( HashMap ) paramValues ) ; } } catch ( IOException exc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "IOException restoring POST parameters onto a cookie: " , new Object [ ] { exc } ) ; } } } else if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Parameters NOT restored. Original URL : " + previousReq + " req. URL : " + reqURL ) ; } postparamsession . setAttribute ( INITIAL_URL , null ) ; postparamsession . setAttribute ( PARAM_NAMES , null ) ; postparamsession . setAttribute ( PARAM_VALUES , null ) ; }
Restore the POST parameters from session
24,475
@ SuppressWarnings ( "rawtypes" ) private void restoreFromCookie ( IExtendedRequest extRequest , HttpServletResponse res , String reqURL ) { byte [ ] cookieValueBytes = extRequest . getCookieValueAsBytes ( POSTPARAM_COOKIE ) ; if ( cookieValueBytes == null || cookieValueBytes . length <= 2 ) { return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found the cookie, restoring POST parameters: " + new String ( cookieValueBytes ) ) ; } try { HashMap restoredParams = deserializePostParam ( extRequest , cookieValueBytes , reqURL ) ; extRequest . setInputStreamData ( restoredParams ) ; extRequest . setMethod ( "POST" ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception restoring POST parameters from the cookie: " , new Object [ ] { e } ) ; } } Cookie paramCookie = new Cookie ( POSTPARAM_COOKIE , "" ) ; paramCookie . setPath ( reqURL ) ; paramCookie . setMaxAge ( 0 ) ; if ( webAppSecurityConfig . getHttpOnlyCookies ( ) ) { paramCookie . setHttpOnly ( true ) ; } if ( webAppSecurityConfig . getSSORequiresSSL ( ) ) { paramCookie . setSecure ( true ) ; } res . addCookie ( paramCookie ) ; }
Restore POST parameter from cookie
24,476
private HashMap deserializePostParam ( IExtendedRequest req , byte [ ] cookieValueBytes , String reqURL ) throws IOException , UnsupportedEncodingException , IllegalStateException { HashMap output = null ; List < byte [ ] > data = splitBytes ( cookieValueBytes , ( byte ) '.' ) ; int total = data . size ( ) ; if ( total > OFFSET_DATA ) { String url = new String ( Base64Coder . base64Decode ( data . get ( OFFSET_REQURL ) ) , "UTF-8" ) ; if ( url != null && url . equals ( reqURL ) ) { byte [ ] [ ] bytes = new byte [ total - OFFSET_DATA ] [ ] ; for ( int i = 0 ; i < ( total - OFFSET_DATA ) ; i ++ ) { bytes [ i ] = Base64Coder . base64Decode ( data . get ( OFFSET_DATA + i ) ) ; } output = req . deserializeInputStreamData ( bytes ) ; } else { throw new IllegalStateException ( "The url in the post param cookie does not match the requested url" ) ; } } else { throw new IllegalStateException ( "The data of the post param cookie is too short. The data might be truncated." ) ; } return output ; }
deserialize Post parameters . The code doesn t expect that the req cookieValueBytes or reqURL is null .
24,477
private List < byte [ ] > splitBytes ( byte [ ] array , byte delimiter ) { List < byte [ ] > byteArrays = new ArrayList < byte [ ] > ( ) ; int begin = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { while ( i < array . length && array [ i ] != delimiter ) { i ++ ; } byteArrays . add ( Arrays . copyOfRange ( array , begin , i ) ) ; begin = i + 1 ; } return byteArrays ; }
split the byte array with the specified delimiter . the expectation here is tha the byte array is a byte representation of cookie value which was base64 encoded data .
24,478
public void incrementRefCount ( ) { synchronized ( this . cf ) { this . refCount ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Increased refcount; " + this ) ; } } }
Increment the reference to the users of the outbound chain . This is called by the framework when a request is made for an existing VCF .
24,479
public void destroyInternal ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "destroyInternal; " + this ) ; } try { this . cf . stopChainInternal ( getChain ( ) , 0 ) ; this . cf . destroyChainInternal ( getChain ( ) ) ; } catch ( ChannelException e ) { } catch ( ChainException e ) { } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "destroyInternal" ) ; } }
This method is only ever called from the framework s clear method which is only called when the framework is being destroyed or when automated tests are clearing out the frameworks config .
24,480
private static String generateTempServerName ( ) { String serverName = TEMP_SERVER_NAME ; while ( InstallUtils . serverExists ( serverName ) ) { int randomNumber = random . nextInt ( ) ; while ( randomNumber == Integer . MIN_VALUE ) { randomNumber = random . nextInt ( ) ; } serverName = TEMP_SERVER_NAME + "_" + Integer . toString ( Math . abs ( randomNumber ) ) ; } return serverName ; }
Generates a server name that does not already exist in the Liberty s servers directory .
24,481
public void visit ( String name , Object value ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "visit [ {0} ] Name [ {1} ] Value [ 2 ]" , getHashText ( ) , name , value ) ) ; } if ( value instanceof Type ) { Type valueAsType = ( Type ) value ; value = valueAsType . getClassName ( ) ; } AnnotationValueImpl newAnnotationValue = new AnnotationValueImpl ( value ) ; storeAnnotationValue ( name , newAnnotationValue ) ; }
annotation value choosing how to type the retrieved value .
24,482
public void visitEnum ( String targetMethodName , String enumerationTypeDescription , String enumerationLiteral ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "visitEnum [ {0} ] Name [ {1} ] Description [ {2} ] Value [ {3} ]" , getHashText ( ) , targetMethodName , enumerationTypeDescription , enumerationLiteral ) ) ; } Type enumerationType = Type . getType ( enumerationTypeDescription ) ; String enumerationClassName = enumerationType . getClassName ( ) ; AnnotationValueImpl newAnnotationValue = new AnnotationValueImpl ( enumerationClassName , enumerationLiteral ) ; storeAnnotationValue ( targetMethodName , newAnnotationValue ) ; }
Visit an enumeration value of an annotation occurrence .
24,483
public AnnotationVisitor visitAnnotation ( String targetMethodName , String annotationClassDescription ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "visitAnnotation [ {0} ] Annotation Class [ {1} ] Description [ 2 ]" , getHashText ( ) , targetMethodName , annotationClassDescription ) ) ; } Type annotationType = Type . getType ( annotationClassDescription ) ; String annotationClassName = annotationType . getClassName ( ) ; AnnotationInfoImpl newAnnotationInfo = new AnnotationInfoImpl ( annotationClassName , infoStore ) ; AnnotationValueImpl newAnnotationValue = new AnnotationValueImpl ( newAnnotationInfo ) ; storeAnnotationValue ( targetMethodName , newAnnotationValue ) ; return new InfoVisitor_Annotation . AnnotationInfoVisitor ( newAnnotationInfo ) ; }
Visit an annotation child value .
24,484
public AnnotationVisitor visitArray ( String name ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Name [ {1} ]" , getHashText ( ) , name ) ) ; } final AnnotationValueImpl arrayValue = new AnnotationValueImpl ( ) ; storeAnnotationValue ( name , arrayValue ) ; return new InfoVisitor_Annotation ( infoStore ) { protected void storeAnnotationValue ( String name , AnnotationValueImpl newAnnotationValue ) { arrayValue . addArrayValue ( newAnnotationValue ) ; } } ; }
object which will receive the array element values .
24,485
public final IndirectionCache register ( int storageStrategy ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "register" , "StorageStrategy=" + storageStrategy ) ; IndirectionCache cache = null ; if ( AbstractItem . STORE_NEVER == storageStrategy ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Using UnstoredItemManager" ) ; cache = _unstoredItemManager ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Using StoredItemManager" ) ; cache = _storedItemManager ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "register" , cache ) ; return cache ; }
This method is used to provide an Item with the correct storage manager to use throughout its lifetime dependant on its storage strategy .
24,486
public WsByteBuffer wrap ( com . ibm . wsspi . bytebuffer . WsByteBuffer realBuffer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "wrap" , realBuffer ) ; RichByteBufferImpl returnBuffer = null ; if ( realBuffer != null ) { returnBuffer = getFromPool ( ) ; returnBuffer . reset ( realBuffer , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "wrap" , returnBuffer ) ; return returnBuffer ; }
Wraps an already existing WsByteBuffer in the wrapper .
24,487
RichByteBufferImpl getFromPool ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getFromPool" ) ; RichByteBufferImpl buffer = ( RichByteBufferImpl ) byteBufferWrapperPool . remove ( ) ; if ( buffer == null ) { buffer = new RichByteBufferImpl ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getFromPool" , buffer ) ; return buffer ; }
Actual creates the proxy which will handle the calls to the real WsByteBuffer .
24,488
public InjectionBinding < A > createInjectionBinding ( A annotation , Class < ? > instanceClass , Member member ) throws InjectionException { return new InjectionSimpleBinding < A > ( annotation , ivNameSpaceConfig ) ; }
Returns an annotation - specific InjectionSimpleBinding associated with the specified input annotation . The default implementation returns a new InjectionSimpleBinding .
24,489
protected synchronized void unsetHandler ( ServiceReference < Handler > handlerRef ) { jaxwsInFlowClientSideGlobalHandlers . removeReference ( handlerRef ) ; jaxwsOutFlowClientSideGlobalHandlers . removeReference ( handlerRef ) ; jaxwsInFlowServerSideGlobalHandlers . removeReference ( handlerRef ) ; jaxwsOutFlowServerSideGlobalHandlers . removeReference ( handlerRef ) ; jaxrsInFlowClientSideGlobalHandlers . removeReference ( handlerRef ) ; jaxrsOutFlowClientSideGlobalHandlers . removeReference ( handlerRef ) ; jaxrsInFlowServerSideGlobalHandlers . removeReference ( handlerRef ) ; jaxrsOutFlowServerSideGlobalHandlers . removeReference ( handlerRef ) ; String importPackage = handlerRef . getBundle ( ) . getHeaders ( "" ) . get ( "Import-package" ) ; String dynamicImportPackage = handlerRef . getBundle ( ) . getHeaders ( "" ) . get ( "DynamicImport-Package" ) ; if ( ( importPackage != null && importPackage . contains ( "javax.xml.ws.handler.soap" ) ) || ( dynamicImportPackage != null && dynamicImportPackage . contains ( "javax.xml.ws.handler.soap" ) ) ) { saajCount . getAndDecrement ( ) ; } clearAllList ( ) ; Iterator < Handler > registeredHandlers = jaxwsInFlowServerSideGlobalHandlers . getServices ( ) ; while ( registeredHandlers . hasNext ( ) ) { jaxwsInFlowServerSideGlobalHandlers1 . add ( registeredHandlers . next ( ) ) ; } registeredHandlers = jaxwsOutFlowServerSideGlobalHandlers . getServices ( ) ; while ( registeredHandlers . hasNext ( ) ) { jaxwsOutFlowServerSideGlobalHandlers1 . add ( 0 , registeredHandlers . next ( ) ) ; } registeredHandlers = jaxwsInFlowClientSideGlobalHandlers . getServices ( ) ; while ( registeredHandlers . hasNext ( ) ) { jaxwsInFlowClientSideGlobalHandlers1 . add ( registeredHandlers . next ( ) ) ; } registeredHandlers = jaxwsOutFlowClientSideGlobalHandlers . getServices ( ) ; while ( registeredHandlers . hasNext ( ) ) { jaxwsOutFlowClientSideGlobalHandlers1 . add ( 0 , registeredHandlers . next ( ) ) ; } registeredHandlers = jaxrsOutFlowServerSideGlobalHandlers . getServices ( ) ; while ( registeredHandlers . hasNext ( ) ) { jaxrsOutFlowServerSideGlobalHandlers1 . add ( 0 , registeredHandlers . next ( ) ) ; } registeredHandlers = jaxrsInFlowServerSideGlobalHandlers . getServices ( ) ; while ( registeredHandlers . hasNext ( ) ) { jaxrsInFlowServerSideGlobalHandlers1 . add ( registeredHandlers . next ( ) ) ; } registeredHandlers = jaxrsOutFlowClientSideGlobalHandlers . getServices ( ) ; while ( registeredHandlers . hasNext ( ) ) { jaxrsOutFlowClientSideGlobalHandlers1 . add ( 0 , registeredHandlers . next ( ) ) ; } registeredHandlers = jaxrsInFlowClientSideGlobalHandlers . getServices ( ) ; while ( registeredHandlers . hasNext ( ) ) { jaxrsInFlowClientSideGlobalHandlers1 . add ( registeredHandlers . next ( ) ) ; } }
Create a monitor holder for the given FileMonitor . The type of holder we create will depend
24,490
public static DERUniversalString getInstance ( Object obj ) { if ( obj == null || obj instanceof DERUniversalString ) { return ( DERUniversalString ) obj ; } if ( obj instanceof ASN1OctetString ) { return new DERUniversalString ( ( ( ASN1OctetString ) obj ) . getOctets ( ) ) ; } throw new IllegalArgumentException ( "illegal object in getInstance: " + obj . getClass ( ) . getName ( ) ) ; }
return a Universal String from the passed in object .
24,491
public void onRetry ( Throwable t ) { try { this . retries ++ ; debugRelativeTime ( "onRetry: " + this . retries ) ; metricRecorder . incrementRetriesCount ( ) ; if ( timeout != null ) { timeout . restart ( ) ; attemptStartTime = System . nanoTime ( ) ; } onAttemptComplete ( t ) ; } catch ( RuntimeException e ) { throw e ; } }
Called when we have determined that this execution is going to be retried
24,492
private void onAttemptComplete ( Throwable t ) { try { if ( circuitBreaker != null ) { if ( t instanceof CircuitBreakerOpenException ) { metricRecorder . incrementCircuitBreakerCallsCircuitOpenCount ( ) ; } else if ( circuitBreaker . isFailure ( null , t ) ) { metricRecorder . incrementCircuitBreakerCallsFailureCount ( ) ; } else { metricRecorder . incrementCircuitBreakerCallsSuccessCount ( ) ; } } if ( t instanceof TimeoutException ) { metricRecorder . incrementTimeoutTrueCount ( ) ; } else { metricRecorder . incrementTimeoutFalseCount ( ) ; } } catch ( RuntimeException e ) { throw e ; } }
Called at the end of each retry attempt
24,493
public void setNested ( ) { if ( timeout != null && ( retry . getMaxRetries ( ) != 0 || fallbackPolicy != null ) ) { timeout . runSyncOnNewThread ( Thread . currentThread ( ) ) ; } int retriesRemaining = this . retry . getMaxRetries ( ) - this . retries ; if ( this . retry . getMaxDuration ( ) != null ) { long maxDuration = this . retry . getMaxDuration ( ) . toNanos ( ) ; long now = System . nanoTime ( ) ; long elapsed = now - this . startTime ; long delay = this . retry . getDelay ( ) . toNanos ( ) ; maxDuration = maxDuration - elapsed ; if ( maxDuration <= delay ) { maxDuration = delay + 1 ; retriesRemaining = 0 ; } this . retry . withMaxDuration ( maxDuration , TimeUnit . NANOSECONDS ) ; } this . retry . withMaxRetries ( retriesRemaining ) ; }
As an asynchronous execution moves from the outer part to the nested inner part update the context s policies
24,494
@ SuppressWarnings ( "unchecked" ) public static final Enum < ? > coerceToEnum ( final ELContext ctx , final Object obj , @ SuppressWarnings ( "rawtypes" ) Class type ) { if ( ctx != null ) { boolean originalIsPropertyResolved = ctx . isPropertyResolved ( ) ; try { Object result = ctx . getELResolver ( ) . convertToType ( ctx , obj , type ) ; if ( ctx . isPropertyResolved ( ) ) { return ( Enum < ? > ) result ; } } finally { ctx . setPropertyResolved ( originalIsPropertyResolved ) ; } } if ( obj == null || "" . equals ( obj ) ) { return null ; } if ( type . isAssignableFrom ( obj . getClass ( ) ) ) { return ( Enum < ? > ) obj ; } if ( ! ( obj instanceof String ) ) { throw new ELException ( MessageFactory . get ( "error.convert" , obj , obj . getClass ( ) , type ) ) ; } Enum < ? > result ; try { result = Enum . valueOf ( type , ( String ) obj ) ; } catch ( IllegalArgumentException iae ) { throw new ELException ( MessageFactory . get ( "error.convert" , obj , obj . getClass ( ) , type ) ) ; } return result ; }
but I couldn t find it
24,495
public static final String coerceToString ( final ELContext ctx , final Object obj ) { if ( ctx != null ) { boolean originalIsPropertyResolved = ctx . isPropertyResolved ( ) ; try { Object result = ctx . getELResolver ( ) . convertToType ( ctx , obj , String . class ) ; if ( ctx . isPropertyResolved ( ) ) { return ( String ) result ; } } finally { ctx . setPropertyResolved ( originalIsPropertyResolved ) ; } } if ( obj == null ) { return "" ; } else if ( obj instanceof String ) { return ( String ) obj ; } else if ( obj instanceof Enum < ? > ) { return ( ( Enum < ? > ) obj ) . name ( ) ; } else { return obj . toString ( ) ; } }
Coerce an object to a string .
24,496
public static < T > void initSingletonEJBCDIProvider ( AbstractResourceInfo resource , Message message , T resourceObject ) { if ( ( ! ( resource instanceof ProviderInfo ) ) || ( resource instanceof ApplicationInfo ) || resource . getConstructorProxies ( ) != null ) { return ; } ProviderInfo < T > pi = ( ProviderInfo < T > ) resource ; if ( pi . isInit ( ) ) { return ; } synchronized ( pi ) { if ( pi . isInit ( ) ) { return ; } Class clz = pi . getProvider ( ) . getClass ( ) ; Bus bus = resource . getBus ( ) ; if ( bus != null ) { List < JaxRsFactoryBeanCustomizer > beanCustomizers = ( List < JaxRsFactoryBeanCustomizer > ) bus . getProperty ( JaxRsConstants . ENDPOINT_LIST_BEANCUSTOMIZER ) ; Map < String , Object > beanCustomizerContexts = ( Map < String , Object > ) bus . getProperty ( JaxRsConstants . ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ ) ; if ( beanCustomizers != null && ! beanCustomizers . isEmpty ( ) && beanCustomizerContexts != null ) { Object newProviderInstance = null ; for ( JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers ) { if ( beanCustomizer . isCustomizableBean ( clz , beanCustomizerContexts . get ( Integer . toString ( beanCustomizer . hashCode ( ) ) ) ) ) { newProviderInstance = beanCustomizer . onSingletonProviderInit ( pi . getProvider ( ) , beanCustomizerContexts . get ( Integer . toString ( beanCustomizer . hashCode ( ) ) ) , message ) ; if ( newProviderInstance != null ) { pi . setProvider ( newProviderInstance ) ; pi . setIsInit ( true ) ; return ; } } } } pi . setIsInit ( true ) ; Method postConstructMethod = ResourceUtils . findPostConstructMethod ( clz ) ; InjectionUtils . invokeLifeCycleMethod ( pi . getProvider ( ) , postConstructMethod ) ; } } }
RuntimeContextTLS can init the EJB or CDI provider
24,497
public final BeanO create ( EJSContainer c , EJSHome h , boolean reactivate ) throws RemoteException , InvocationTargetException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "create: " + h ) ; BeanO beanO = newInstance ( c , h ) ; boolean success = false ; try { beanO . initialize ( reactivate ) ; success = true ; } finally { if ( ! success ) { beanO . discard ( ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "create: " + beanO + ", success=" + success ) ; } return beanO ; }
Changed EnterpriseBean to Object . d366807 . 1
24,498
public MethodInfo getMethodInfo ( ELContext context ) throws PropertyNotFoundException , MethodNotFoundException , ELException { Node n = this . getNode ( ) ; EvaluationContext ctx = new EvaluationContext ( context , this . fnMapper , this . varMapper ) ; ctx . notifyBeforeEvaluation ( getExpressionString ( ) ) ; MethodInfo result = n . getMethodInfo ( ctx , this . paramTypes ) ; ctx . notifyAfterEvaluation ( getExpressionString ( ) ) ; return result ; }
Evaluates the expression relative to the provided context and returns information about the actual referenced method .
24,499
public Object invoke ( ELContext context , Object [ ] params ) throws PropertyNotFoundException , MethodNotFoundException , ELException { EvaluationContext ctx = new EvaluationContext ( context , this . fnMapper , this . varMapper ) ; ctx . notifyBeforeEvaluation ( getExpressionString ( ) ) ; Object result = this . getNode ( ) . invoke ( ctx , this . paramTypes , params ) ; ctx . notifyAfterEvaluation ( getExpressionString ( ) ) ; return result ; }
Evaluates the expression relative to the provided context invokes the method that was found using the supplied parameters and returns the result of the method invocation .