idx
int64 0
165k
| question
stringlengths 73
4.15k
| target
stringlengths 5
918
| len_question
int64 21
890
| len_target
int64 3
255
|
|---|---|---|---|---|
160,300
|
private void closeConfig ( Config config ) { if ( config instanceof WebSphereConfig ) { try { ( ( WebSphereConfig ) config ) . close ( ) ; } catch ( IOException e ) { throw new ConfigException ( Tr . formatMessage ( tc , "could.not.close.CWMCG0004E" , e ) ) ; } } }
|
Close a given config if it s a WebSphereConfig
| 76
| 11
|
160,301
|
@ Override public SICoreConnection getSICoreConnection ( ) throws IllegalStateException { if ( connectionClosed ) { throw new IllegalStateException ( NLS . getFormattedMessage ( ( "ILLEGAL_STATE_CWSJR1086" ) , new Object [ ] { "getSICoreConnection" } , null ) ) ; } return _coreConnection ; }
|
Returns the core connection created for and associated with this connection .
| 82
| 12
|
160,302
|
@ Override synchronized public void close ( ) throws SIConnectionLostException , SIIncorrectCallException , SIResourceException , SIErrorException , SIConnectionDroppedException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "close" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "We have " + _sessions . size ( ) + " left open - closing them" ) ; } // Close all the sessions created from this connection. for ( final Iterator iterator = _sessions . iterator ( ) ; iterator . hasNext ( ) ; ) { final Object object = iterator . next ( ) ; if ( object instanceof JmsJcaSessionImpl ) { final JmsJcaSessionImpl session = ( JmsJcaSessionImpl ) object ; session . close ( false ) ; } iterator . remove ( ) ; } if ( _coreConnection != null ) { _coreConnection . close ( ) ; } connectionClosed = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "close" ) ; } }
|
Closes this connection its associated core connection and any sessions created from it .
| 303
| 15
|
160,303
|
private static boolean isRunningInWAS ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , "isRunningInWAS" ) ; } if ( inWAS == null ) { inWAS = Boolean . TRUE ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , "isRunningInWAS" , inWAS ) ; } return inWAS . booleanValue ( ) ; }
|
Returns true if running in WAS . The check is to see if com . ibm . tx . jta . Transaction . TransactionManagerFactory is on the classpath .
| 128
| 34
|
160,304
|
private static final Object getCurrentUOWCoord ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , "getCurrentUOWCoord" ) ; } Object currentUOW = null ; if ( isRunningInWAS ( ) ) { currentUOW = EmbeddableTransactionManagerFactory . getUOWCurrent ( ) . getUOWCoord ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , "getCurrentUOWCoord" , currentUOW ) ; } return currentUOW ; }
|
This method uses reflection to try and obtain the current UOW if we are not inside WAS null is returned .
| 154
| 22
|
160,305
|
private PostCreateAction listenForLibraryChanges ( final String libid ) { return new PostCreateAction ( ) { @ Override public void invoke ( AppClassLoader acl ) { listenForLibraryChanges ( libid , acl ) ; } } ; }
|
create an action that will create a listener when invoked
| 53
| 10
|
160,306
|
private void listenForLibraryChanges ( String libid , AppClassLoader acl ) { // ensure this loader is removed from the canonical store when the library is updated new WeakLibraryListener ( libid , acl . getKey ( ) . getId ( ) , acl , bundleContext ) { @ Override protected void update ( ) { Object cl = get ( ) ; if ( cl instanceof AppClassLoader && aclStore != null ) aclStore . remove ( ( AppClassLoader ) cl ) ; deregister ( ) ; } } ; }
|
create a listener to remove a loader from the canonical store on library update
| 115
| 14
|
160,307
|
private String getTopic ( BundleEvent bundleEvent ) { StringBuilder topic = new StringBuilder ( BUNDLE_EVENT_TOPIC_PREFIX ) ; switch ( bundleEvent . getType ( ) ) { case BundleEvent . INSTALLED : topic . append ( "INSTALLED" ) ; break ; case BundleEvent . STARTED : topic . append ( "STARTED" ) ; break ; case BundleEvent . STOPPED : topic . append ( "STOPPED" ) ; break ; case BundleEvent . UPDATED : topic . append ( "UPDATED" ) ; break ; case BundleEvent . UNINSTALLED : topic . append ( "UNINSTALLED" ) ; break ; case BundleEvent . RESOLVED : topic . append ( "RESOLVED" ) ; break ; case BundleEvent . UNRESOLVED : topic . append ( "UNRESOLVED" ) ; break ; default : return null ; } return topic . toString ( ) ; }
|
Determine the appropriate topic to use for the Bundle Event .
| 214
| 13
|
160,308
|
public PmiDataInfo [ ] submoduleMembers ( String submoduleName , int level ) { if ( submoduleName == null ) return listLevelData ( level ) ; ArrayList returnData = new ArrayList ( ) ; // special case for category boolean inCategory = false ; if ( submoduleName . startsWith ( "ejb." ) ) inCategory = true ; Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo info = ( PmiDataInfo ) allData . next ( ) ; if ( inCategory ) { // submoduleName is actually the category name for entity/session/mdb if ( info . getCategory ( ) . equals ( "all" ) || isInCategory ( submoduleName , info . getCategory ( ) ) ) returnData . add ( info ) ; } else if ( info . getSubmoduleName ( ) != null && info . getSubmoduleName ( ) . equals ( submoduleName ) && info . getLevel ( ) <= level ) { returnData . add ( info ) ; } } PmiDataInfo [ ] ret = new PmiDataInfo [ returnData . size ( ) ] ; for ( int i = 0 ; i < ret . length ; i ++ ) ret [ i ] = ( PmiDataInfo ) returnData . get ( i ) ; return ret ; }
|
Returns an array of PmiDataInfo for the given submoduleName and level .
| 299
| 17
|
160,309
|
public PmiDataInfo [ ] listLevelData ( int level ) { ArrayList levelData = new ArrayList ( ) ; Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo dataInfo = ( PmiDataInfo ) allData . next ( ) ; if ( dataInfo . getLevel ( ) <= level ) { levelData . add ( dataInfo ) ; } } // get the array PmiDataInfo [ ] ret = new PmiDataInfo [ levelData . size ( ) ] ; for ( int i = 0 ; i < ret . length ; i ++ ) ret [ i ] = ( PmiDataInfo ) levelData . get ( i ) ; return ret ; }
|
Returns the statistic with level equal to or lower than level
| 162
| 11
|
160,310
|
public PmiDataInfo [ ] listMyLevelData ( int level ) { ArrayList levelData = new ArrayList ( ) ; Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo dataInfo = ( PmiDataInfo ) allData . next ( ) ; if ( dataInfo . getLevel ( ) == level ) { levelData . add ( dataInfo ) ; } } return ( PmiDataInfo [ ] ) levelData . toArray ( ) ; }
|
Returns the statistic with level equal to level
| 116
| 8
|
160,311
|
public int [ ] listStatisticsWithDependents ( ) { if ( dependList == null ) { ArrayList list = new ArrayList ( ) ; Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo dataInfo = ( PmiDataInfo ) allData . next ( ) ; if ( dataInfo . getDependency ( ) != null ) { list . add ( new Integer ( dataInfo . getId ( ) ) ) ; } } dependList = new int [ list . size ( ) ] ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { dependList [ i ] = ( ( Integer ) list . get ( i ) ) . intValue ( ) ; } } return dependList ; }
|
Returns String representation of this object
| 174
| 6
|
160,312
|
private void scheduleEvictionTask ( long timeoutInMilliSeconds ) { EvictionTask evictionTask = new EvictionTask ( ) ; // Before creating new Timers, which create new Threads, we // must ensure that we are not using any application classloader // as the current thread's context classloader. Otherwise, it // is possible that the new Timer thread would hold on to the // app classloader indefinitely, thereby leaking it and all // classes that it loaded, long after the app has been stopped. SwapTCCLAction swapTCCL = new SwapTCCLAction ( ) ; AccessController . doPrivileged ( swapTCCL ) ; try { timer = new Timer ( true ) ; long period = timeoutInMilliSeconds / 3 ; long delay = period ; timer . schedule ( evictionTask , delay , period ) ; } finally { AccessController . doPrivileged ( swapTCCL ) ; } }
|
Creates a timer and schedules the eviction task based on the timeout in milliseconds
| 197
| 15
|
160,313
|
public synchronized Object update ( String key , Object value ) { // evict until size < maxSize while ( isEvictionRequired ( ) && entryLimit > 0 && entryLimit < Integer . MAX_VALUE ) { evictStaleEntries ( ) ; } CacheEntry oldEntry = null ; CacheEntry curEntry = new CacheEntry ( value ) ; if ( primaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) primaryTable . put ( key , curEntry ) ; } else if ( secondaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) secondaryTable . put ( key , curEntry ) ; } else if ( tertiaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) tertiaryTable . put ( key , curEntry ) ; } else { oldEntry = ( CacheEntry ) primaryTable . put ( key , curEntry ) ; } return oldEntry != null ? oldEntry . value : null ; }
|
Update the value into the Cache using the specified key but do not change the table level of the cache . If the key is not in any table add it to the primaryTable
| 203
| 35
|
160,314
|
public synchronized void clearAllEntries ( ) { tertiaryTable . putAll ( primaryTable ) ; tertiaryTable . putAll ( secondaryTable ) ; primaryTable . clear ( ) ; secondaryTable . clear ( ) ; evictStaleEntries ( ) ; }
|
Purge all entries from the Cache . Semantically this should behave the same as the expiration of all entries from the cache .
| 55
| 25
|
160,315
|
public static WebSphereBeanDeploymentArchive createBDA ( WebSphereCDIDeployment deployment , ExtensionArchive extensionArchive , CDIRuntime cdiRuntime ) throws CDIException { Set < String > additionalClasses = extensionArchive . getExtraClasses ( ) ; Set < String > additionalAnnotations = extensionArchive . getExtraBeanDefiningAnnotations ( ) ; boolean extensionCanSeeApplicationBDAs = extensionArchive . applicationBDAsVisible ( ) ; boolean extClassesOnlyBDA = extensionArchive . isExtClassesOnly ( ) ; String archiveID = deployment . getDeploymentID ( ) + "#" + extensionArchive . getName ( ) + ".additionalClasses" ; //this isn't really part of any EE module so we just use the archiveID which should be unique EEModuleDescriptor eeModuleDescriptor = new WebSphereEEModuleDescriptor ( archiveID , extensionArchive . getType ( ) ) ; WebSphereBeanDeploymentArchive bda = createBDA ( deployment , archiveID , extensionArchive , cdiRuntime , additionalClasses , additionalAnnotations , extensionCanSeeApplicationBDAs , extClassesOnlyBDA , eeModuleDescriptor ) ; return bda ; }
|
only for extensions
| 279
| 3
|
160,316
|
public void setWrapperCacheSize ( int cacheSize ) { wrapperCache . setCachePreferredMaxSize ( cacheSize ) ; int updatedCacheSize = getBeanIdCacheSize ( cacheSize ) ; beanIdCache . setSize ( updatedCacheSize ) ; }
|
Call to update the BeanIdCache cache size .
| 56
| 10
|
160,317
|
private int getBeanIdCacheSize ( int cacheSize ) { int beanIdCacheSize = cacheSize ; if ( beanIdCacheSize < ( Integer . MAX_VALUE / 2 ) ) beanIdCacheSize = beanIdCacheSize * 2 ; else beanIdCacheSize = Integer . MAX_VALUE ; return beanIdCacheSize ; }
|
Calculate the size to be used for the BeanIdCache .
| 71
| 14
|
160,318
|
public boolean unregister ( BeanId beanId , boolean dropRef ) // f111627 throws CSIException { boolean removed = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregister" , new Object [ ] { beanId , new Boolean ( dropRef ) } ) ; // d181569 ByteArray wrapperKey = beanId . getByteArray ( ) ; // d181569 try { EJSWrapperCommon wrapperCommon = ( EJSWrapperCommon ) // f111627 wrapperCache . removeAndDiscard ( wrapperKey , dropRef ) ; if ( wrapperCommon != null ) { // f111627 removed = true ; } } catch ( IllegalOperationException ex ) { // Object is pinned and cannot be removed from the cache // Swallow the exception for now, and let the Eviction thread // take care of the object later FFDCFilter . processException ( ex , CLASS_NAME + ".unregister" , "351" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { // d144064 Tr . event ( tc , "unregister ignoring IllegalOperationException for object " + beanId ) ; // d181569 Tr . event ( tc , "Exception: " + ex ) ; } } catch ( DiscardException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".unregister" , "358" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) // d144064 Tr . event ( tc , "Unable to discard element" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "unregister" ) ; return removed ; }
|
d181569 - changed signature of method .
| 405
| 10
|
160,319
|
public void unregisterHome ( J2EEName homeName , EJSHome homeObj ) throws CSIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregisterHome" ) ; J2EEName cacheHomeName ; int numEnumerated = 0 , numRemoved = 0 ; // d103404.2 Enumeration < ? > enumerate = wrapperCache . enumerateElements ( ) ; while ( enumerate . hasMoreElements ( ) ) { // need to get the beanid from either the remote or local wrapper, // whichever is available, the beanid must be the same for both wrappers EJSWrapperCommon wCommon = ( EJSWrapperCommon ) // f111627 ( ( CacheElement ) enumerate . nextElement ( ) ) . getObject ( ) ; // f111627 BeanId cacheMemberBeanId = wCommon . getBeanId ( ) ; // d181569 cacheHomeName = cacheMemberBeanId . getJ2EEName ( ) ; numEnumerated ++ ; // If the cache has homeObj as it's home or is itself the home, // remove it. If the wrapper has been removed since it was found // (above), then the call to unregister() will just return false. // Note that the enumeration can handle elements being removed // from the cache while enumerating. d103404.2 if ( cacheHomeName . equals ( homeName ) || cacheMemberBeanId . equals ( homeObj . getId ( ) ) ) { unregister ( cacheMemberBeanId , true ) ; // d181217 d181569 numRemoved ++ ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { // d103404.1 d103404.2 Tr . debug ( tc , "Unregistered " + numRemoved + " wrappers (total = " + numEnumerated + ")" ) ; } // Now remove any cached BeanIds for this home. d152323 beanIdCache . removeAll ( homeObj ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "unregisterHome" ) ; }
|
unregisterHome removes from cache homeObj and all Objects that have homeObj as it s home . It also unregisters these objects from from the orb object adapter .
| 499
| 34
|
160,320
|
@ Override public void discardObject ( EJBCache wrapperCache , Object key , Object ele ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "discardObject" , new Object [ ] { key , ele } ) ; EJSWrapperCommon wrapperCommon = ( EJSWrapperCommon ) ele ; wrapperCommon . disconnect ( ) ; // @MD20022C, F58064 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "discardObject" ) ; }
|
Unregister a wrapper instance when it is castout of the wrapper cache .
| 137
| 15
|
160,321
|
@ Override public Object faultOnKey ( EJBCache cache , Object key ) throws FaultException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "faultOnKey" , key ) ; ByteArray wrapperKey = ( ByteArray ) key ; EJSWrapperCommon result = null ; // f111627 // Check if the beanId is already set on this key in which case // we can avoid the deserialize BeanId beanId = wrapperKey . getBeanId ( ) ; try { if ( beanId == null ) { beanId = BeanId . getBeanId ( wrapperKey , container ) ; // d140003.12 } result = container . createWrapper ( beanId ) ; } catch ( InvalidBeanIdException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".faultOnKey" , "533" , this ) ; // If the nested exception is an EJBNotFoundException, then report // that the app is not started/installed, rather than just the // generic 'Malformed object key'. d356676.1 Throwable cause = ex . getCause ( ) ; if ( cause instanceof EJBNotFoundException ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Application Not Started" , ex ) ; throw new FaultException ( ( EJBNotFoundException ) cause , "Application not started or not installed" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Malformed object key" , ex ) ; throw new FaultException ( ex , "Malformed object key" ) ; } catch ( Exception ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".faultOnKey" , "548" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Malformed object key" , ex ) ; throw new FaultException ( ex , "Malformed object key" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "faultOnKey" ) ; return result ; }
|
Invoked by the Cache FaultStrategy when an object was not found and needs to be inserted . We create a new wrapper instance to be inserted into the cache . The cache package holds the lock on a bucket when this method is invoked .
| 513
| 48
|
160,322
|
public boolean isValid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Checking validity of token " + this . getClass ( ) . getName ( ) ) ; if ( token != null ) { // return if this token is still valid long currentTime = System . currentTimeMillis ( ) ; long expiration = getExpiration ( ) ; long timeleft = expiration - currentTime ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Time left for token: " + timeleft ) ; if ( timeleft > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "token is valid." ) ; return true ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "token is invalid." ) ; return false ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "token is null, returning invalid." ) ; return false ; } }
|
Validates the token including expiration signature etc .
| 271
| 9
|
160,323
|
public String getPrincipal ( ) { String [ ] accessIDArray = getAttributes ( "u" ) ; if ( accessIDArray != null && accessIDArray . length > 0 ) return accessIDArray [ 0 ] ; else return null ; }
|
Gets the principal that this Token belongs to . If this is an authorization token this principal string must match the authentication token principal string or the message will be rejected .
| 52
| 33
|
160,324
|
public String getUniqueID ( ) { // return null so that this token does not change the uniqueness, // all static attributes from the default tokens. String [ ] cacheKeyArray = getAttributes ( AttributeNameConstants . WSCREDENTIAL_CACHE_KEY ) ; if ( cacheKeyArray != null && cacheKeyArray [ 0 ] != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Found cache key in Authz token: " + cacheKeyArray [ 0 ] ) ; return cacheKeyArray [ 0 ] ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "No unique cache key found in token." ) ; return null ; }
|
Returns a unique identifier of the token based upon information the provider considers makes this a unique token . This will be used for caching purposes and may be used in combination with other token unique IDs that are part of the same Subject .
| 174
| 45
|
160,325
|
public String [ ] getAttributes ( String key ) { if ( token != null ) return token . getAttributes ( key ) ; else return null ; }
|
Gets the attribute value based on the named value .
| 31
| 11
|
160,326
|
@ Override public long getMaximumTimeInStore ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMaximumTimeInStore" ) ; long maxTime = getMessageItem ( ) . getMaximumTimeInStore ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMaximumTimeInStore" , new Long ( maxTime ) ) ; return maxTime ; }
|
Return the maximum time this reference should spend in a ReferenceStream .
| 119
| 13
|
160,327
|
private void resetEvents ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resetEvents" ) ; // Reset all callbacks PRE_COMMIT_ADD = null ; PRE_COMMIT_REMOVE = null ; POST_COMMIT_ADD_1 = null ; POST_COMMIT_ADD_2 = null ; POST_COMMIT_REMOVE_1 = null ; POST_COMMIT_REMOVE_2 = null ; POST_COMMIT_REMOVE_3 = null ; POST_COMMIT_REMOVE_4 = null ; POST_ROLLBACK_ADD_1 = null ; POST_ROLLBACK_ADD_2 = null ; POST_ROLLBACK_REMOVE_1 = null ; POST_ROLLBACK_REMOVE_2 = null ; POST_ROLLBACK_REMOVE_3 = null ; POST_ROLLBACK_REMOVE_4 = null ; UNLOCKED_1 = null ; UNLOCKED_2 = null ; UNLOCKED_3 = null ; PRE_UNLOCKED_1 = null ; PRE_UNLOCKED_2 = null ; REFERENCES_DROPPED_TO_ZERO = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resetEvents" ) ; }
|
Reset all callbacks to null .
| 318
| 8
|
160,328
|
@ Override public SIBUuid12 getProducerConnectionUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getProducerConnectionUuid" ) ; SibTr . exit ( tc , "getProducerConnectionUuid" ) ; } return getMessageItem ( ) . getProducerConnectionUuid ( ) ; }
|
Returns the producerConnectionUuid .
| 94
| 7
|
160,329
|
private MessageItem getMessageItem ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMessageItem" ) ; MessageItem msg = null ; try { msg = ( MessageItem ) getReferredItem ( ) ; } catch ( MessageStoreException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.items.MessageItemReference.getMessageItem" , "1:857:1.147" , this ) ; SibTr . exception ( tc , e ) ; // TODO : For now we throw a runtime here but we need to look at the stack to see // what this means. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMessageItem" , e ) ; throw new SIErrorException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMessageItem" , msg ) ; return msg ; }
|
Returns the referenced message item
| 256
| 5
|
160,330
|
public static void setTextInfoTranslationEnabled ( boolean textInfoTranslationEnabled , Locale locale ) { com . ibm . ws . pmi . stat . StatsImpl . setEnableNLS ( textInfoTranslationEnabled , locale ) ; }
|
This method allows translation of the textual information . By default translation is enabled using the default Locale .
| 50
| 20
|
160,331
|
private final static void ELCheckType ( final Object obj , final Class < ? > type ) throws ELException { if ( String . class . equals ( type ) ) { ELSupport . coerceToString ( obj ) ; } if ( ELArithmetic . isNumberType ( type ) ) { ELSupport . coerceToNumber ( obj , type ) ; } if ( Character . class . equals ( type ) || Character . TYPE == type ) { ELSupport . coerceToCharacter ( obj ) ; } if ( Boolean . class . equals ( type ) || Boolean . TYPE == type ) { ELSupport . coerceToBoolean ( obj ) ; } if ( type . isEnum ( ) ) { ELSupport . coerceToEnum ( obj , type ) ; } }
|
method used to replace ELSupport . checkType
| 166
| 9
|
160,332
|
public static String getProductVersion ( RepositoryResource installResource ) { String resourceVersion = null ; try { Collection < ProductDefinition > pdList = new ArrayList < ProductDefinition > ( ) ; for ( ProductInfo pi : ProductInfo . getAllProductInfo ( ) . values ( ) ) { pdList . add ( new ProductInfoProductDefinition ( pi ) ) ; } resourceVersion = installResource . getAppliesToVersions ( pdList ) ; } catch ( Exception e ) { logger . log ( Level . FINEST , e . getMessage ( ) , e ) ; } if ( resourceVersion == null ) resourceVersion = InstallConstants . NOVERSION ; return resourceVersion ; }
|
Gets the version of the resource using the getAppliesToVersions function .
| 145
| 16
|
160,333
|
public static boolean isPublicAsset ( ResourceType resourceType , RepositoryResource installResource ) { if ( resourceType . equals ( ResourceType . FEATURE ) || resourceType . equals ( ResourceType . ADDON ) ) { EsaResource esar = ( ( EsaResource ) installResource ) ; if ( esar . getVisibility ( ) . equals ( Visibility . PUBLIC ) || esar . getVisibility ( ) . equals ( Visibility . INSTALL ) ) { return true ; } } else if ( resourceType . equals ( ResourceType . PRODUCTSAMPLE ) || resourceType . equals ( ResourceType . OPENSOURCE ) ) { return true ; } return false ; }
|
Checks if Feature or Addon has visibility public or install OR checks if the resource is a Product sample or open source to see if it is a public asset .
| 143
| 33
|
160,334
|
public static Map < String , Collection < String > > writeResourcesToDiskRepo ( Map < String , Collection < String > > downloaded , File toDir , Map < String , List < List < RepositoryResource > > > installResources , String productVersion , EventManager eventManager , boolean defaultRepo ) throws InstallException { int progress = 10 ; int interval1 = installResources . size ( ) == 0 ? 90 : 90 / installResources . size ( ) ; for ( List < List < RepositoryResource > > targetList : installResources . values ( ) ) { for ( List < RepositoryResource > mrList : targetList ) { int interval2 = mrList . size ( ) == 0 ? interval1 : interval1 / mrList . size ( ) ; for ( RepositoryResource installResource : mrList ) { try { writeResourcesToDiskRepo ( downloaded , toDir , installResource , eventManager , progress += interval2 ) ; } catch ( InstallException e ) { throw e ; } catch ( Exception e ) { throw ExceptionUtils . createFailedToDownload ( installResource , e , toDir ) ; } } } } return downloaded ; }
|
The function writes the resources to the downloaded disk repo
| 248
| 10
|
160,335
|
@ Reference ( cardinality = ReferenceCardinality . MULTIPLE ) protected void setJaasLoginModuleConfig ( JAASLoginModuleConfig lmc , Map < String , Object > props ) { String pid = ( String ) props . get ( KEY_SERVICE_PID ) ; loginModuleMap . put ( pid , lmc ) ; }
|
SINCE THIS IS A STATIC REFERENCE DS provides enough synchronization so that we don t need to synchronize on the map .
| 74
| 28
|
160,336
|
public void init ( HttpInboundServiceContext context ) { this . message = context . getRequest ( ) ; if ( this . useEE7Streams ) { this . body = new HttpInputStreamEE7 ( context ) ; } else { this . body = new HttpInputStreamImpl ( context ) ; } }
|
Initialize with a new connection .
| 69
| 7
|
160,337
|
public static Metadata < Extension > loadExtension ( String extensionClass , ClassLoader classloader ) { Class < ? extends Extension > serviceClass = loadClass ( Extension . class , extensionClass , classloader ) ; if ( serviceClass == null ) { return null ; } Extension serviceInstance = prepareInstance ( serviceClass ) ; if ( serviceInstance == null ) { return null ; } return new MetadataImpl < Extension > ( serviceInstance , extensionClass ) ; }
|
Create the extension and return a metadata for the extension
| 96
| 10
|
160,338
|
public static < S > Class < ? extends S > loadClass ( Class < S > expectedType , String serviceClassName , ClassLoader classloader ) { Class < ? > clazz = null ; Class < ? extends S > serviceClass = null ; try { clazz = classloader . loadClass ( serviceClassName ) ; serviceClass = clazz . asSubclass ( expectedType ) ; } catch ( ResourceLoadingException e ) { //noop if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "loadClass()" , e ) ; } } catch ( ClassCastException e ) { //noop if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "loadClass()" , e ) ; } } catch ( ClassNotFoundException e ) { //noop if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "loadClass()" , e ) ; } } return serviceClass ; }
|
load the class and then casts to the specified sub class
| 239
| 11
|
160,339
|
public static < S > S prepareInstance ( Class < ? extends S > serviceClass ) { try { final Constructor < ? extends S > constructor = serviceClass . getDeclaredConstructor ( ) ; AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { constructor . setAccessible ( true ) ; return null ; } } ) ; return constructor . newInstance ( ) ; } catch ( LinkageError e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): Could not instantiate service class " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( InvocationTargetException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( InstantiationException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( IllegalAccessException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( SecurityException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( NoSuchMethodException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } }
|
Creates an object of the service class
| 545
| 8
|
160,340
|
private static boolean isVisible ( ClassLoader loaderA , ClassLoader loaderB ) { if ( loaderB == loaderA || loaderB . getParent ( ) == loaderA ) { return true ; } return false ; }
|
return true if loaderA is visible to loaderB
| 46
| 10
|
160,341
|
public static ClassLoader getAndSetLoader ( ClassLoader newCL ) { ThreadContextAccessor tca = ThreadContextAccessor . getThreadContextAccessor ( ) ; //This could be a ClassLoader or the special type UNCHANGED. Object maybeOldCL = tca . pushContextClassLoaderForUnprivileged ( newCL ) ; if ( maybeOldCL instanceof ClassLoader ) { return ( ClassLoader ) maybeOldCL ; } else { return newCL ; } }
|
This method sets the thread context classloader and returns whatever was the TCCL before it was updated .
| 101
| 21
|
160,342
|
public static boolean isWeldProxy ( Object obj ) { Class < ? > clazz = obj . getClass ( ) ; boolean result = isWeldProxy ( clazz ) ; return result ; }
|
Return whether the object is a weld proxy
| 42
| 8
|
160,343
|
@ Override public < T > void aroundInject ( final InjectionContext < T > injectionContext ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Annotations: " + injectionContext . getAnnotatedType ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Perform EE injection." ) ; } injectJavaEEResources ( injectionContext ) ; // perform Weld injection AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { injectionContext . proceed ( ) ; return null ; } } ) ; }
|
Perform Injection . For EE
| 163
| 7
|
160,344
|
@ Override public void readSet ( int requestNumber , SIMessageHandle [ ] msgHandles ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readSet" , new Object [ ] { requestNumber , msgHandles } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Request to read " + msgHandles . length + " message(s)" ) ; final ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; try { SIBusMessage [ ] messages = bifSession . readSet ( msgHandles ) ; // Add the number of items first CommsServerByteBuffer buff = poolManager . allocate ( ) ; buff . putInt ( messages . length ) ; for ( int x = 0 ; x < messages . length ; x ++ ) { buff . putMessage ( ( JsMessage ) messages [ x ] , convState . getCommsConnection ( ) , getConversation ( ) ) ; } try { getConversation ( ) . send ( buff , JFapChannelConstants . SEG_READ_SET_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".readSet" , CommsConstants . CATBIFCONSUMER_READSET_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2033" , e ) ; } } catch ( Exception e ) { //No FFDC code needed //Only FFDC if we haven't received a meTerminated event OR if this Exception isn't a SIException. if ( ! ( e instanceof SIException ) || ! convState . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".readSet" , CommsConstants . CATBIFCONSUMER_READSET_02 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATBIFCONSUMER_READSET_02 , getConversation ( ) , requestNumber ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readSet" ) ; }
|
This method will return a set of messages currently locked by the messaging engine .
| 646
| 15
|
160,345
|
@ Override public void readAndDeleteSet ( int requestNumber , SIMessageHandle [ ] msgHandles , int tran ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readAndDeleteSet" , new Object [ ] { requestNumber , msgHandles , tran } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Request to read / delete " + msgHandles . length + " message(s)" ) ; final ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; try { SITransaction siTran = null ; if ( tran != CommsConstants . NO_TRANSACTION ) { siTran = ( ( ServerLinkLevelState ) getConversation ( ) . getLinkLevelAttachment ( ) ) . getTransactionTable ( ) . get ( tran ) ; } SIBusMessage [ ] messages ; if ( siTran != IdToTransactionTable . INVALID_TRANSACTION ) { messages = bifSession . readAndDeleteSet ( msgHandles , siTran ) ; } else { messages = new SIBusMessage [ 0 ] ; } // Add the number of items first CommsServerByteBuffer buff = poolManager . allocate ( ) ; buff . putInt ( messages . length ) ; for ( int x = 0 ; x < messages . length ; x ++ ) { buff . putMessage ( ( JsMessage ) messages [ x ] , convState . getCommsConnection ( ) , getConversation ( ) ) ; } try { getConversation ( ) . send ( buff , JFapChannelConstants . SEG_READ_AND_DELETE_SET_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".readAndDeleteSet" , CommsConstants . CATBIFCONSUMER_READANDDELTESET_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2033" , e ) ; } } catch ( Exception e ) { //No FFDC code needed //Only FFDC if we haven't received a meTerminated event OR if this Exception isn't a SIException. if ( ! ( e instanceof SIException ) || ! convState . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".readAndDeleteSet" , CommsConstants . CATBIFCONSUMER_READANDDELTESET_02 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATBIFCONSUMER_READANDDELTESET_02 , getConversation ( ) , requestNumber ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readAndDeleteSet" ) ; }
|
This method will return and delete a set of messages currently locked by the messaging engine .
| 796
| 17
|
160,346
|
public String getCodeSource ( ProtectionDomain pd ) { CodeSource cs = pd . getCodeSource ( ) ; String csStr = null ; if ( cs == null ) { csStr = "null code source" ; } else { URL url = cs . getLocation ( ) ; if ( url == null ) { csStr = "null code URL" ; } else { csStr = url . toString ( ) ; } } return csStr ; }
|
Find the code source based on the protection domain
| 96
| 9
|
160,347
|
public String permissionToString ( java . security . CodeSource cs , ClassLoader classloaderClass , PermissionCollection col ) { StringBuffer buf = new StringBuffer ( "ClassLoader: " ) ; if ( classloaderClass == null ) { buf . append ( "Primordial Classloader" ) ; } else { buf . append ( classloaderClass . getClass ( ) . getName ( ) ) ; } buf . append ( lineSep ) ; buf . append ( " Permissions granted to CodeSource " ) . append ( cs ) . append ( lineSep ) ; if ( col != null ) { Enumeration < Permission > e = col . elements ( ) ; buf . append ( " {" ) . append ( lineSep ) ; while ( e . hasMoreElements ( ) ) { Permission p = e . nextElement ( ) ; buf . append ( " " ) . append ( p . toString ( ) ) . append ( ";" ) . append ( lineSep ) ; } buf . append ( " }" ) ; } else { buf . append ( " {" ) . append ( lineSep ) . append ( " }" ) ; } return buf . toString ( ) ; }
|
Print out permissions granted to a CodeSource .
| 251
| 9
|
160,348
|
boolean isOffendingClass ( Class < ? > [ ] classes , int j , ProtectionDomain pd2 , Permission inPerm ) { // Return true if ... return ( ! classes [ j ] . getName ( ) . startsWith ( "java" ) ) && // as long as not // starting with // java ( classes [ j ] . getName ( ) . indexOf ( "com.ibm.ws.kernel.launch.internal.NoRethrowSecurityManager" ) == - 1 ) && // not // our // SecurityManager ( classes [ j ] . getName ( ) . indexOf ( "ClassLoader" ) == - 1 ) && // not a // class // loader // not the end of stack and next is not a class loader ( ( j == classes . length - 1 ) ? true : ( classes [ j + 1 ] . getName ( ) . indexOf ( "ClassLoader" ) == - 1 ) ) && // lacks the required permissions ! pd2 . implies ( inPerm ) ; }
|
isOffendingClass determines the offending class from the classes defined in the stack .
| 218
| 16
|
160,349
|
protected void cleanup ( ) { final String methodName = "cleanup" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } super . cleanup ( ) ; if ( _successfulMessages . size ( ) > 0 ) { try { deleteMessages ( getMessageHandles ( _successfulMessages ) , null ) ; } catch ( final ResourceException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , FFDC_PROBE_1 , this ) ; if ( TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } } finally { _successfulMessages . clear ( ) ; } } if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
|
Invoked after all messages in the batch have been delivered . Deletes any successful messages .
| 194
| 18
|
160,350
|
public String getContextName ( ) { ExternalContext ctx = _MyFacesExternalContextHelper . firstInstance . get ( ) ; if ( ctx == null ) { throw new UnsupportedOperationException ( ) ; } return ctx . getContextName ( ) ; }
|
Returns the name of the underlying context
| 57
| 7
|
160,351
|
@ Override public boolean addTransformer ( final ClassFileTransformer cft ) { transformers . add ( cft ) ; // Also recursively register with parent(s), until a non-AppClassLoader or GlobalSharedLibrary loader is encountered. if ( parent instanceof AppClassLoader ) { if ( Util . isGlobalSharedLibraryLoader ( ( ( AppClassLoader ) parent ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addTransformer - skipping parent loader because it is a GlobalSharedLibrary" ) ; } } else { return ( ( AppClassLoader ) parent ) . addTransformer ( cft ) ; } } return true ; }
|
Spring method to register the given ClassFileTransformer on this ClassLoader
| 162
| 14
|
160,352
|
@ Override public Bundle getBundle ( ) { return parent instanceof GatewayClassLoader ? ( ( GatewayClassLoader ) parent ) . getBundle ( ) : parent instanceof LibertyLoader ? ( ( LibertyLoader ) parent ) . getBundle ( ) : null ; }
|
Returns the Bundle of the Top Level class loader
| 57
| 9
|
160,353
|
@ FFDCIgnore ( value = { IllegalArgumentException . class } ) private void definePackage ( ByteResourceInformation byteResourceInformation , String packageName ) { // If the package is in a JAR then we can load the JAR manifest to see what package definitions it's got Manifest manifest = byteResourceInformation . getManifest ( ) ; try { // The URLClassLoader.definePackage() will NPE with a null manifest so use the other definePackage if we don't have a manifest if ( manifest == null ) { definePackage ( packageName , null , null , null , null , null , null , null ) ; } else { definePackage ( packageName , manifest , byteResourceInformation . getResourceUrl ( ) ) ; } } catch ( IllegalArgumentException e ) { // Ignore, this happens if the package is already defined but it is hard to guard against this in a thread safe way. See: // http://bugs.sun.com/view_bug.do?bug_id=4841786 } }
|
This method will define the package using the byteResourceInformation for a class to get the URL for this package to try to load a manifest . If a manifest can t be loaded from the URL it will create the package with no package versioning or sealing information .
| 215
| 52
|
160,354
|
@ FFDCIgnore ( ClassNotFoundException . class ) private Class < ? > findClassCommonLibraryClassLoaders ( String name ) throws ClassNotFoundException { for ( LibertyLoader cl : delegateLoaders ) { try { return cl . findClass ( name ) ; } catch ( ClassNotFoundException e ) { // Ignore. Will throw at the end if class is not found. } } // If we reached here, then the class was not loaded. throw new ClassNotFoundException ( name ) ; }
|
Search for the class using the common library classloaders .
| 107
| 12
|
160,355
|
private URL findResourceCommonLibraryClassLoaders ( String name ) { for ( LibertyLoader cl : delegateLoaders ) { URL url = cl . findResource ( name ) ; if ( url != null ) { return url ; } } // If we reached here, then the resource was not found. return null ; }
|
Search for the resource using the common library classloaders .
| 65
| 12
|
160,356
|
private CompositeEnumeration < URL > findResourcesCommonLibraryClassLoaders ( String name , CompositeEnumeration < URL > enumerations ) throws IOException { for ( LibertyLoader cl : delegateLoaders ) { enumerations . add ( cl . findResources ( name ) ) ; } return enumerations ; }
|
Search for the resources using the common library classloaders .
| 64
| 12
|
160,357
|
private void copyLibraryElementsToClasspath ( Library library ) { Collection < File > files = library . getFiles ( ) ; addToClassPath ( library . getContainers ( ) ) ; if ( files != null && ! ! ! files . isEmpty ( ) ) { for ( File file : files ) { nativeLibraryFiles . add ( file ) ; } } for ( Fileset fileset : library . getFilesets ( ) ) { for ( File file : fileset . getFileset ( ) ) { nativeLibraryFiles . add ( file ) ; } } }
|
Takes the Files and Folders from the Library and adds them to the various classloader classpaths
| 120
| 21
|
160,358
|
private static boolean checkLib ( final File f , String basename ) { boolean fExists = System . getSecurityManager ( ) == null ? f . exists ( ) : AccessController . doPrivileged ( new PrivilegedAction < Boolean > ( ) { @ Override public Boolean run ( ) { return f . exists ( ) ; } } ) ; return fExists && ( f . getName ( ) . equals ( basename ) || ( isWindows ( basename ) && f . getName ( ) . equalsIgnoreCase ( basename ) ) ) ; }
|
Check if the given file s name matches the given library basename .
| 119
| 14
|
160,359
|
public static void removeCompositeComponentForResolver ( FacesContext facesContext ) { List < UIComponent > list = ( List < UIComponent > ) facesContext . getAttributes ( ) . get ( CURRENT_COMPOSITE_COMPONENT_KEY ) ; if ( list != null ) { list . remove ( list . size ( ) - 1 ) ; } }
|
Removes the composite component from the attribute map of the FacesContext .
| 83
| 14
|
160,360
|
public void processHttpChainWork ( boolean enableEndpoint , boolean isPause ) { if ( enableEndpoint ) { // enable the endpoint if it is currently disabled // it's ok if the endpoint is stopped, the config update will occur @ next start endpointState . compareAndSet ( DISABLED , ENABLED ) ; if ( httpPort >= 0 ) { httpChain . enable ( ) ; } if ( httpsPort >= 0 && sslFactoryProvider . getService ( ) != null ) { httpSecureChain . enable ( ) ; } if ( ! isPause ) { // Use an update action so they pick up the new settings performAction ( updateAction ) ; } else { updateAction . run ( ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "endpoint disabled: " + ( String ) endpointConfig . get ( "id" ) ) ; } // The endpoint has been disabled-- stop it now endpointState . set ( DISABLED ) ; if ( ! isPause ) { performAction ( stopAction ) ; } else { stopAction . run ( ) ; } } }
|
Process HTTP chain work .
| 252
| 5
|
160,361
|
@ FFDCIgnore ( Exception . class ) final void shutdownFramework ( ) { Tr . audit ( tc , "httpChain.error.shutdown" , name ) ; try { Bundle bundle = bundleContext . getBundle ( Constants . SYSTEM_BUNDLE_LOCATION ) ; if ( bundle != null ) bundle . stop ( ) ; } catch ( Exception e ) { // do not FFDC this. // exceptions during bundle stop occur if framework is already stopping or stopped } }
|
When an error occurs during startup and the config variable fail . on . error . enabled is true then this method is used to stop the root bundle thus bringing down the OSGi framework .
| 104
| 37
|
160,362
|
@ Trivial @ Reference ( name = "sslOptions" , service = ChannelConfiguration . class , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY , cardinality = ReferenceCardinality . OPTIONAL ) protected void setSslOptions ( ServiceReference < ChannelConfiguration > service ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "set ssl options " + service . getProperty ( "id" ) , this ) ; } this . sslOptions . setReference ( service ) ; if ( endpointConfig != null ) { performAction ( updateAction ) ; } }
|
The specific sslOptions is selected by a filter set through metatype that matches a specific user - configured option set or falls back to a default .
| 150
| 31
|
160,363
|
@ Trivial @ Reference ( name = "remoteIp" , service = ChannelConfiguration . class , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY , cardinality = ReferenceCardinality . MANDATORY ) protected void setRemoteIp ( ChannelConfiguration config ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "set remote ip " + config . getProperty ( "id" ) , this ) ; } this . remoteIpConfig = config ; if ( remoteIpConfig != null ) { performAction ( updateAction ) ; } }
|
The specific remoteIpOptions is selected by a filter set through metatype that matches a specific user - configured option set or falls back to a default .
| 146
| 32
|
160,364
|
@ Reference ( name = "executorService" , service = ExecutorService . class , policy = ReferencePolicy . DYNAMIC ) protected void setExecutorService ( ServiceReference < ExecutorService > executorService ) { this . executorService . setReference ( executorService ) ; }
|
DS method for setting the required dynamic executor service reference .
| 63
| 12
|
160,365
|
@ Trivial private void performAction ( Runnable action , boolean addToQueue ) { ExecutorService exec = executorService . getService ( ) ; if ( exec == null ) { // If we can't find the executor service, we have to run it in place. action . run ( ) ; } else { // If we can find the executor service, we'll add the action to the queue. // If the actionFuture is null (no pending actions) and the configFuture is null (no // pending configuration updates), we'll submit the actionsRunner to the executor // service to drain the queue // // configFuture is used to avoid bouncing the endpoint multiple times because of a // single configuration update. // // actionFuture is only set to a non-null value by kicking off the executor service here. // actionsRunner syncs on actionQueue, so we can't add any new actions while we are // draining the queue. When the queue is empty, actionFuture is explicitly set to null. // // Long story short, it prevents us from kicking off multiple executors which could run in // random order. if ( addToQueue ) { synchronized ( actionQueue ) { actionQueue . add ( action ) ; if ( ( actionFuture == null ) && ( configFuture == null ) ) { actionFuture = exec . submit ( actionsRunner ) ; } } } else { // Schedule immediately exec . submit ( action ) ; } } }
|
Schedule an activity to run off the SCR action thread if the ExecutorService is available
| 301
| 19
|
160,366
|
synchronized void reset ( double value , int updated ) { ewma = value ; ewmaStddev = value * SINGLE_VALUE_STDDEV ; ewmaVariance = ewmaStddev * ewmaStddev ; consecutiveOutliers = 0 ; lastUpdate = updated ; }
|
Reset the distribution by throwing away all history and adding a single data point .
| 70
| 16
|
160,367
|
synchronized void addDataPoint ( double value , int updated ) { // 8/10/2012: Force the standard deviation to 1/3 of the first data point // 8/11:2012: Force it to 1/6th of the first data point (more accurate) if ( ewmaVariance == Double . NEGATIVE_INFINITY ) { reset ( value , updated ) ; return ; } double delta = value - ewma ; double increment = ALPHA * delta ; ewma += increment ; ewmaVariance = ( 1 - ALPHA ) * ( ewmaVariance + delta * increment ) ; ewmaStddev = Math . sqrt ( ewmaVariance ) ; lastUpdate = updated ; }
|
Add a throughput observation to the distribution setting lastUpdate
| 160
| 10
|
160,368
|
static void handleThrowable ( Throwable t ) { if ( t instanceof ThreadDeath ) { throw ( ThreadDeath ) t ; } if ( t instanceof VirtualMachineError ) { throw ( VirtualMachineError ) t ; } // All other instances of Throwable will be silently swallowed }
|
Checks whether the supplied Throwable is one that needs to be rethrown and swallows all others .
| 59
| 22
|
160,369
|
protected boolean isEvictionRequired ( ) { boolean evictionRequired = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { int size = primaryTable . size ( ) + secondaryTable . size ( ) + tertiaryTable . size ( ) ; Tr . debug ( tc , "The current cache size is " + size + "( " + primaryTable . size ( ) + ", " + secondaryTable . size ( ) + ", " + tertiaryTable . size ( ) + ")" ) ; } if ( entryLimit != 0 && entryLimit != Integer . MAX_VALUE ) { int size = primaryTable . size ( ) + secondaryTable . size ( ) + tertiaryTable . size ( ) ; // If the cache size is greater than its limit, time to purge... if ( size > entryLimit ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "The cache size is " + size + "( " + primaryTable . size ( ) + ", " + secondaryTable . size ( ) + ", " + tertiaryTable . size ( ) + ") which is greater than the cache limit of " + entryLimit + "." ) ; evictionRequired = true ; } } return evictionRequired ; }
|
Determine if the cache is " ; full" ; and entries need to be evicted .
| 277
| 24
|
160,370
|
private boolean isDelegatedFacesServlet ( String className ) { if ( className == null ) { // The class name can be null if this is e.g., a JSP mapped to // a servlet. return false ; } try { Class < ? > clazz = Class . forName ( className ) ; return DELEGATED_FACES_SERVLET_CLASS . isAssignableFrom ( clazz ) ; } catch ( ClassNotFoundException cnfe ) { return false ; } }
|
Checks if the class represented by className implements DelegatedFacesServlet .
| 113
| 18
|
160,371
|
public static synchronized void unregisterModule ( PmiModule instance ) { if ( disabled ) return ; if ( instance == null ) // || instance.getPath().length<=1) return; return ; // check if the path has null in it. if a module is unregistered twice // the path will have null String [ ] path = instance . getPath ( ) ; if ( path == null || path . length == 0 ) return ; for ( int k = 0 ; k < path . length ; k ++ ) { if ( path [ k ] == null ) return ; } if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregisterModule: " + instance . getModuleID ( ) + ", " + instance . getName ( ) ) ; // unregister itself String [ ] parentPath = new String [ path . length - 1 ] ; System . arraycopy ( path , 0 , parentPath , 0 , parentPath . length ) ; // locate parent ModuleItem parent = moduleRoot . find ( parentPath , 0 ) ; if ( parent != null ) { // remove "instance" from parent parent . remove ( parent . find ( path [ path . length - 1 ] ) ) ; // do not remove the empty parent group in custom pmi // in custom PMI groups/instances are explicitly created and // should be remove explicitly // in pre-custom groups are create IMPLICITYLY when needed if ( instance . isCustomModule ( ) ) return ; // check if parent is empty if ( parent . children == null || parent . children . size ( ) == 0 ) { if ( parent . getInstance ( ) != null ) { String [ ] mypath = parent . getInstance ( ) . getPath ( ) ; // TODO: ask Wenjian about this? // exclude WEBAPP_MODULE because it is created explicitly and // should be removed explictly by calling PmiFactory.removePmiModule if ( ! ( mypath . length == 2 && ( mypath [ 0 ] . equals ( WEBSERVICES_MODULE ) ) ) ) { // recursive call?: unregisterModule (parent.getInstance()); parent . getInstance ( ) . unregister ( ) ; } } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "unregisterModule" ) ; }
|
remove module - never remove TYPE_MODULE .
| 492
| 10
|
160,372
|
protected static ModuleAggregate getModuleAggregate ( String moduleID ) { ModuleAggregate aggregate = ( ModuleAggregate ) moduleAggregates . get ( moduleID ) ; if ( aggregate != null ) return aggregate ; // need to create it - synchronized synchronized ( moduleAggregates ) { aggregate = ( ModuleAggregate ) moduleAggregates . get ( moduleID ) ; if ( aggregate != null ) return aggregate ; PmiModuleConfig config = getConfig ( moduleID ) ; if ( config == null ) return null ; aggregate = new ModuleAggregate ( moduleID ) ; moduleAggregates . put ( moduleID , aggregate ) ; return aggregate ; } }
|
create it if not there - synchronized
| 138
| 7
|
160,373
|
public static ModuleItem findModuleItem ( String [ ] path ) { if ( disabled ) return null ; if ( path == null || path [ 0 ] . equals ( APPSERVER_MODULE ) ) { return moduleRoot ; } return moduleRoot . find ( path , 0 ) ; }
|
find a ModuleItem
| 61
| 4
|
160,374
|
public static StatLevelSpec [ ] getInstrumentationLevel ( StatDescriptor sd , boolean recursive ) { if ( disabled ) return null ; ModuleItem item = findModuleItem ( sd . getPath ( ) ) ; if ( item == null ) { // wrong moduleName return null ; } else { if ( ! recursive ) { StatLevelSpec [ ] pld = new StatLevelSpec [ 1 ] ; PmiModule instance = item . getInstance ( ) ; if ( instance != null ) { pld [ 0 ] = new StatLevelSpec ( sd . getPath ( ) , instance . getEnabled ( ) ) ; return pld ; } else { return null ; } } else { ArrayList res = item . getStatLevelSpec ( recursive ) ; StatLevelSpec [ ] pld = new StatLevelSpec [ res . size ( ) ] ; for ( int i = 0 ; i < pld . length ; i ++ ) pld [ i ] = ( StatLevelSpec ) res . get ( i ) ; return pld ; } } }
|
6 . 0 API
| 220
| 4
|
160,375
|
public static int getInstrumentationLevel ( String [ ] path ) { if ( disabled ) return LEVEL_UNDEFINED ; DataDescriptor dd = new DataDescriptor ( path ) ; ModuleItem item = findModuleItem ( dd ) ; if ( item == null ) { // wrong moduleName return LEVEL_UNDEFINED ; } else { return item . getInstance ( ) . getInstrumentationLevel ( ) ; } }
|
get instrumenation level based on the path during runtime
| 93
| 11
|
160,376
|
public static String getInstrumentationLevelString ( ) { if ( disabled ) return null ; Map modules = moduleRoot . children ; if ( modules == null ) { return "" ; } else { PerfLevelDescriptor [ ] plds = new PerfLevelDescriptor [ modules . size ( ) ] ; Iterator values = modules . values ( ) . iterator ( ) ; int i = 0 ; while ( values . hasNext ( ) ) { PmiModule instance = ( ( ModuleItem ) values . next ( ) ) . getInstance ( ) ; plds [ i ++ ] = new PerfLevelDescriptor ( instance . getPath ( ) , instance . getInstrumentationLevel ( ) , instance . getModuleID ( ) ) ; } return PmiUtil . getStringFromPerfLevelSpecs ( plds ) ; } }
|
return the top level modules s PerfLevelDescriptor in String
| 183
| 14
|
160,377
|
public JwtBuilder audience ( List < String > newaudiences ) throws InvalidClaimException { // this.AUDIENCE // if (newaudiences != null && !newaudiences.isEmpty()) { // // ArrayList<String> audiences = new ArrayList<String>(); // for (String aud : newaudiences) { // if (aud != null && !aud.trim().isEmpty() // && !audiences.contains(aud)) { // audiences.add(aud); // } // } // if (audiences.isEmpty()) { // String err = Tr.formatMessage(tc, // "JWT_INVALID_CLAIM_VALUE_ERR", new Object[] { // Claims.AUDIENCE, newaudiences }); // throw new InvalidClaimException(err); // } // // this.audiences = new ArrayList<String>(audiences); // claims.put(Claims.AUDIENCE, audiences); // } else { // String err = Tr.formatMessage(tc, "JWT_INVALID_CLAIM_VALUE_ERR", // new Object[] { Claims.AUDIENCE, newaudiences }); // throw new InvalidClaimException(err); // } builder = builder . audience ( newaudiences ) ; return this ; }
|
Sets audience claim . This claim in the JWT identifies the recipients that the token is intended for .
| 269
| 21
|
160,378
|
public JwtBuilder signWith ( String algorithm , Key key ) throws KeyException { builder = builder . signWith ( algorithm , key ) ; return this ; }
|
Signing key and algorithm information .
| 33
| 7
|
160,379
|
public JwtBuilder claim ( String name , Object value ) throws InvalidClaimException { // if (isValidClaim(name, value)) { // if (name.equals(Claims.AUDIENCE)) { // if (value instanceof ArrayList) { // this.audience((ArrayList) value); // } else if (value instanceof String) { // String[] auds = ((String) value).split(" "); // ArrayList<String> audList = new ArrayList<String>(); // for (String aud : auds) { // if (!aud.isEmpty()) { // audList.add(aud.trim()); // } // } // if (!audList.isEmpty()) { // this.audience(audList); // } // } else { // String msg = Tr.formatMessage(tc, // "JWT_INVALID_CLAIM_VALUE_TYPE", // new Object[] { Claims.AUDIENCE }); // throw new InvalidClaimException(msg); // } // } else if (name.equals(Claims.EXPIRATION)) { // if (value instanceof Long) { // this.expirationTime((Long) value); // } else if (value instanceof Integer) { // this.expirationTime(((Integer) value).longValue()); // } else { // String msg = Tr.formatMessage(tc, // "JWT_INVALID_CLAIM_VALUE_TYPE", // new Object[] { Claims.EXPIRATION }); // throw new InvalidClaimException(msg); // } // } else if (name.equals(Claims.ISSUED_AT)) { // if (value instanceof Long) { // this.issueTime((Long) value); // } else if (value instanceof Integer) { // this.expirationTime(((Integer) value).longValue()); // } else { // String msg = Tr.formatMessage(tc, // "JWT_INVALID_CLAIM_VALUE_TYPE", // new Object[] { Claims.ISSUED_AT }); // throw new InvalidClaimException(msg); // } // } else if (name.equals(Claims.NOT_BEFORE)) { // if (value instanceof Long) { // this.notBefore((Long) value); // } else if (value instanceof Integer) { // this.expirationTime(((Integer) value).longValue()); // } else { // String msg = Tr.formatMessage(tc, // "JWT_INVALID_CLAIM_VALUE_TYPE", // new Object[] { Claims.NOT_BEFORE }); // throw new InvalidClaimException(msg); // } // } else if (name.equals(Claims.ISSUER) || name.equals(Claims.SUBJECT)) { // if (value instanceof String) { // if (name.equals(Claims.ISSUER)) { // this.issuer((String) value); // } else { // this.subject((String) value); // } // } else { // String msg = Tr.formatMessage(tc, "JWT_INVALID_CLAIM_VALUE_TYPE", new Object[] { name }); // throw new InvalidClaimException(msg); // } // } else { // claims.put(name, value); // } // } builder = builder . claim ( name , value ) ; return this ; }
|
Sets the specified claim .
| 724
| 6
|
160,380
|
public JwtBuilder claim ( Map < String , Object > map ) throws InvalidClaimException { // if (map == null) { // String err = Tr.formatMessage(tc, "JWT_INVALID_CLAIMS_ERR");// "JWT_INVALID_CLAIMS_ERR"; // throw new InvalidClaimException(err); // } builder = builder . claim ( map ) ; return this ; //return copyClaimsMap(map); // claims.putAll(map); // return this; }
|
Sets the specified claims .
| 112
| 6
|
160,381
|
public JwtBuilder claimFrom ( String jsonOrJwt , String claim ) throws InvalidClaimException , InvalidTokenException { // if (JwtUtils.isNullEmpty(claim)) { // String err = Tr.formatMessage(tc, "JWT_INVALID_CLAIM_ERR", // new Object[] { claim }); // throw new InvalidClaimException(err); // } // if (isValidToken(jsonOrJwt)) { // String decoded = jsonOrJwt; // if (JwtUtils.isBase64Encoded(jsonOrJwt)) { // decoded = JwtUtils.decodeFromBase64String(jsonOrJwt); // } // boolean isJson = JwtUtils.isJson(decoded); // // if (!isJson) { // String jwtPayload = JwtUtils.getPayload(jsonOrJwt); // decoded = JwtUtils.decodeFromBase64String(jwtPayload); // } // // // } else { // // // either decoded payload from jwt or encoded/decoded json string // // if (JwtUtils.isBase64Encoded(jsonOrJwt)) { // // decoded = JwtUtils.decodeFromBase64String(jsonOrJwt); // // } // // } // // if (decoded != null) { // Object claimValue = null; // try { // if ((claimValue = JwtUtils.claimFromJsonObject(decoded, // claim)) != null) { // claims.put(claim, claimValue); // } // } catch (IOException e) { // String err = Tr.formatMessage(tc, "JWT_INVALID_TOKEN_ERR"); // throw new InvalidTokenException(err); // } // } // } builder = builder . claimFrom ( jsonOrJwt , claim ) ; return this ; }
|
Retrieves the specified claim from the given json or jwt string .
| 418
| 15
|
160,382
|
protected Dispatchable getThreadContext ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getThreadContext" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getThreadContext" ) ; return null ; }
|
Not needed for receive listener data invocations
| 89
| 8
|
160,383
|
protected synchronized void invoke ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "invoke" ) ; try { // Pass details to implementor's conversation receive listener. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBuffer ( this , tc , data , 16 , "data passed to dataReceived method" ) ; listener . dataReceived ( data , segmentType , requestNumber , priority , allocatedFromPool , partOfExchange , conversation ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.sib.jfapchannel.impl.rldispatcher.ReceiveListenerDataReceivedInvocation" , JFapChannelConstants . RLDATARECEIVEDINVOKE_INVOKE_01 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "exception thrown by dataReceived" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , t ) ; // User has thrown an exception from data received method. Probably // the best way to deal with this is to invalidate their connection. // That'll learn 'em. connection . invalidate ( true , t , "exception thrown by dataReceived - " + t . getLocalizedMessage ( ) ) ; // D224570 } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "invoke" ) ; }
|
Invokes the dataReceived method . If the callback throws an exception than the connection associated with it is invalidated .
| 397
| 24
|
160,384
|
protected synchronized void reset ( Connection connection , ReceiveListener listener , WsByteBuffer data , int size , int segmentType , int requestNumber , int priority , boolean allocatedFromPool , boolean partOfExchange , Conversation conversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reset" , new Object [ ] { connection , listener , data , "" + size , "" + segmentType , "" + requestNumber , "" + priority , "" + allocatedFromPool , "" + partOfExchange , conversation } ) ; this . connection = connection ; this . listener = listener ; this . data = data ; this . size = size ; this . segmentType = segmentType ; this . requestNumber = requestNumber ; this . priority = priority ; this . allocatedFromPool = allocatedFromPool ; this . partOfExchange = partOfExchange ; this . conversation = conversation ; setDispatchable ( null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "reset" ) ; }
|
Resets the state of this invocation object - used by the pooling code .
| 247
| 16
|
160,385
|
protected synchronized void repool ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "repool" ) ; // begin F181705.5 connection = null ; listener = null ; data = null ; conversation = null ; // end F181705.5 owningPool . add ( this ) ; setDispatchable ( null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "repool" ) ; }
|
Returns this object to its associated object pool .
| 130
| 9
|
160,386
|
public static void setCookieForRequestParameter ( HttpServletRequest request , HttpServletResponse response , String id , String state , boolean isHttpsRequest , ConvergedClientConfig clientCfg ) { //OidcClientConfigImpl clientCfg = activatedOidcClientImpl.getOidcClientConfig(request, id); Map < String , String [ ] > map = request . getParameterMap ( ) ; // at least it gets state parameter JsonObject jsonObject = new JsonObject ( ) ; Set < Map . Entry < String , String [ ] > > entries = map . entrySet ( ) ; for ( Map . Entry < String , String [ ] > entry : entries ) { String key = entry . getKey ( ) ; if ( Constants . ACCESS_TOKEN . equals ( key ) || Constants . ID_TOKEN . equals ( key ) ) { continue ; } String [ ] strs = entry . getValue ( ) ; if ( strs != null && strs . length > 0 ) { jsonObject . addProperty ( key , strs [ 0 ] ) ; } } String requestParameters = jsonObject . toString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "requestParameters:" + requestParameters ) ; } String encodedReqParams = null ; try { encodedReqParams = Base64Coder . toString ( Base64Coder . base64Encode ( requestParameters . getBytes ( ClientConstants . CHARSET ) ) ) ; } catch ( UnsupportedEncodingException e ) { //This should not happen, we are using UTF-8 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "get unexpected exception" , e ) ; } } String encodedHash = null ; if ( encodedReqParams != null ) { encodedHash = calculateOidcCodeCookieValue ( encodedReqParams , clientCfg ) ; } Cookie c = OidcClientUtil . createCookie ( ClientConstants . WAS_OIDC_CODE , encodedHash , request ) ; if ( clientCfg . isHttpsRequired ( ) && isHttpsRequest ) { c . setSecure ( true ) ; } response . addCookie ( c ) ; }
|
set the code cookie during authentication
| 518
| 6
|
160,387
|
public static MultivaluedMap < String , String > getStructuredParams ( String query , String sep , boolean decode , boolean decodePlus ) { MultivaluedMap < String , String > map = new MetadataMap <> ( new LinkedHashMap < String , List < String > > ( ) ) ; getStructuredParams ( map , query , sep , decode , decodePlus ) ; return map ; }
|
Retrieve map of query parameters from the passed in message
| 88
| 11
|
160,388
|
public static List < MediaType > intersectMimeTypes ( List < MediaType > requiredMediaTypes , List < MediaType > userMediaTypes , boolean addRequiredParamsIfPossible ) { return intersectMimeTypes ( requiredMediaTypes , userMediaTypes , addRequiredParamsIfPossible , false ) ; }
|
intersect two mime types
| 66
| 6
|
160,389
|
protected void addNameToApplicationMap ( String name ) { String appName = getApplicationName ( ) ; // If it is a base metric, the name will be null if ( appName == null ) return ; ConcurrentLinkedQueue < String > list = applicationMap . get ( appName ) ; if ( list == null ) { ConcurrentLinkedQueue < String > newList = new ConcurrentLinkedQueue < String > ( ) ; list = applicationMap . putIfAbsent ( appName , newList ) ; if ( list == null ) list = newList ; } list . add ( name ) ; }
|
Adds the metric name to an application map . This map is not a complete list of metrics owned by an application produced metrics are managed in the MetricsExtension
| 130
| 32
|
160,390
|
@ Override public SortedSet < String > getNames ( ) { return Collections . unmodifiableSortedSet ( new TreeSet < String > ( metrics . keySet ( ) ) ) ; }
|
Returns a set of the names of all the metrics in the registry .
| 42
| 14
|
160,391
|
@ Override public SortedMap < String , Counter > getCounters ( MetricFilter filter ) { return getMetrics ( Counter . class , filter ) ; }
|
Returns a map of all the counters in the registry and their names which match the given filter .
| 35
| 19
|
160,392
|
@ Override public SortedMap < String , Histogram > getHistograms ( MetricFilter filter ) { return getMetrics ( Histogram . class , filter ) ; }
|
Returns a map of all the histograms in the registry and their names which match the given filter .
| 37
| 20
|
160,393
|
@ Override public SortedMap < String , Meter > getMeters ( MetricFilter filter ) { return getMetrics ( Meter . class , filter ) ; }
|
Returns a map of all the meters in the registry and their names which match the given filter .
| 35
| 19
|
160,394
|
@ Override public SortedMap < String , Timer > getTimers ( MetricFilter filter ) { return getMetrics ( Timer . class , filter ) ; }
|
Returns a map of all the timers in the registry and their names which match the given filter .
| 37
| 19
|
160,395
|
public synchronized int addElement ( E theElement ) { if ( theElement == null ) { return - 1 ; } if ( elementCount == currentCapacity ) { // try to expand the table to handle the new value, if that fails // then it will throw an illegalstate exception expandTable ( ) ; } int theIndex = occupiedSlots . nextClearBit ( 0 ) ; if ( theIndex < 0 || theIndex > currentCapacity - 1 ) { throw new IllegalStateException ( "No space available for element" ) ; } theElementArray [ theIndex ] = theElement ; elementCount ++ ; occupiedSlots . set ( theIndex ) ; return theIndex ; }
|
Add an element to the LookupTable . Returns the index value which can be used to look up the element in the LookupTable .
| 142
| 28
|
160,396
|
public synchronized Object removeElement ( int theIndex ) { if ( theIndex < 0 || theIndex > currentCapacity - 1 ) { throw new IllegalArgumentException ( "Index is out of range." ) ; } Object theElement = theElementArray [ theIndex ] ; if ( theElement != null ) { theElementArray [ theIndex ] = null ; elementCount -- ; occupiedSlots . clear ( theIndex ) ; } return theElement ; }
|
Remove the object from the LookupTable which is referenced by the supplied Index value .
| 95
| 17
|
160,397
|
public int findElement ( Object element ) { for ( int i = 0 ; i < currentCapacity ; i ++ ) { if ( element == theElementArray [ i ] ) { return i ; } } return - 1 ; }
|
Finds a supplied object in the LookupTable and returns its index .
| 48
| 15
|
160,398
|
@ SuppressWarnings ( "unchecked" ) private void expandTable ( ) { int newCapacity = currentCapacity + increment ; if ( newCapacity < currentCapacity ) { throw new IllegalStateException ( "Attempt to expand LookupTable beyond maximum capacity" ) ; } E [ ] theNewArray = ( E [ ] ) new Object [ newCapacity ] ; System . arraycopy ( this . theElementArray , 0 , theNewArray , 0 , currentCapacity ) ; theElementArray = theNewArray ; currentCapacity = newCapacity ; }
|
Expands the lookup table to accommodate more elements . Does this by adding the expansion increment to the current capacity .
| 122
| 22
|
160,399
|
public void initialize ( Map < String , Object > configProps ) throws WIMException { reposId = ( String ) configProps . get ( KEY_ID ) ; reposRealm = ( String ) configProps . get ( REALM ) ; if ( String . valueOf ( configProps . get ( ConfigConstants . CONFIG_PROP_SUPPORT_CHANGE_LOG ) ) . equalsIgnoreCase ( ConfigConstants . CONFIG_SUPPORT_CHANGE_LOG_NATIVE ) ) { //Construct a change handler depending on the type of LDAP repository changeHandler = ChangeHandlerFactory . getChangeHandler ( iLdapConn ) ; } iLdapConfigMgr = new LdapConfigManager ( ) ; iLdapConfigMgr . initialize ( configProps ) ; iLdapConn = new LdapConnection ( iLdapConfigMgr ) ; iLdapConn . initialize ( configProps ) ; isActiveDirectory = iLdapConfigMgr . isActiveDirectory ( ) ; }
|
Function that is invoked when the LdapAdapter is initialized . It extracts the repository configuration details and sets itself up with the required properties .
| 228
| 28
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.